Commit 43ed5f7f by duanhq

资源匹配修改 by duanht 2019/3/5

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18141 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent d4bca4e4
......@@ -36,7 +36,7 @@ public interface SysOrganizationMapper {
List<SysOrganization> findOrgByParentId(@Param("id")Integer id);
List<SysOrganization> getAllGroup(@Param("id")Integer id,@Param("parentId")Integer parentId);
List<SysOrganization> getAllGroupByParentId(@Param("id")Integer id,@Param("parentId")Integer parentId);
SysOrganization selectDetailById(Integer id);
......
......@@ -492,7 +492,7 @@ public class SysUserServiceImpl implements SysUserService {
//非搜索模式(点击获取组织或服务商)
if (userQueryVo.getOrgId() != null) {
if (userQueryVo.getOrgId() == 0) {
sysOrganizationList = sysOrganizationMapper.getAllGroup(userQueryVo.getId(), userQueryVo.getOrgId());
sysOrganizationList = sysOrganizationMapper.getAllGroupByParentId(userQueryVo.getId(), userQueryVo.getOrgId());
} else {
//获取根目录下的服务商
sysUserList = getServiceListByGroupId(userQueryVo);
......@@ -501,7 +501,7 @@ public class SysUserServiceImpl implements SysUserService {
}
} else {
//搜索模式(获取符合条件的服务商组织以及下面的服务商,不符合的删除)
sysOrganizationList = sysOrganizationMapper.getAllGroup(userQueryVo.getId(), 0);
sysOrganizationList = sysOrganizationMapper.getAllGroupByParentId(userQueryVo.getId(), 0);
List<SysOrganization> removeOrg = new ArrayList<>();
for (SysOrganization sysOrganization : sysOrganizationList) {
userQueryVo.setOrgId(sysOrganization.getId());
......@@ -632,7 +632,7 @@ public class SysUserServiceImpl implements SysUserService {
public static void main(String[] args) {
System.out.println(new SysUserServiceImpl().encryptPassword("123456"));
System.out.println(new SysUserServiceImpl().encryptPassword("glsx8888"));
}
@Override
......
......@@ -266,29 +266,27 @@
`sort` ASC
</select>
<select id="getAllGroup" resultType="com.glsx.usercenter.pojo.menu.SysOrganization">
<select id="getAllGroupByParentId" resultType="com.glsx.usercenter.pojo.menu.SysOrganization">
SELECT
so.id id,
so.name name
so.id id,
so.name name
FROM
sys_user_org uo
LEFT JOIN sys_user u ON uo.org_id = u.org_id
LEFT JOIN sys_organization so ON uo.org_id = so.id
sys_organization so
WHERE
uo.user_id = #{id,jdbcType=TINYINT}
AND so.parent_id = #{parentId,jdbcType=TINYINT}
so.parent_id = #{parentId,jdbcType=TINYINT}
AND so.org_status = 1
</select>
<select id="selectDetailById" resultType="com.glsx.usercenter.pojo.menu.SysOrganization">
SELECT
sor.*,so.name parentName
FROM
sys_organization so
INNER JOIN sys_organization sor ON so.id = sor.parent_id
WHERE
sor.id = #{id}
<select id="selectDetailById" resultType="com.glsx.usercenter.pojo.menu.SysOrganization">
SELECT
sor.*,
so.name parentName
FROM
sys_organization so
INNER JOIN sys_organization sor ON so.id = sor.parent_id
WHERE
sor.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -900,6 +900,7 @@
<select id="getUserByIdAndName" resultType="com.glsx.usercenter.pojo.user.SysUser">
SELECT
DISTINCT
u.id id,
u.name name,
u.org_id orgId
......@@ -987,13 +988,15 @@
<select id="getMechanicByOrgId" parameterType="com.glsx.usercenter.pojo.vo.UserQueryVo"
resultType="com.glsx.usercenter.pojo.user.SysUser">
SELECT
DISTINCT
su.name name,
su.phone_number phoneNumber,
su.id
FROM sys_resource_matching srm LEFT JOIN sys_service_mechanic ssm ON srm.user_id = ssm.service_id
LEFT JOIN sys_user su ON ssm.mechanic_id = su.id
WHERE srm.merchant_id = #{id,jdbcType=INTEGER} AND srm.service_key = #{serviceKey,jdbcType=VARCHAR}
LEFT JOIN sys_user su ON ssm.mechanic_id = su.id LEFT JOIN sys_user_services sus ON su.id = sus.user_id
WHERE srm.merchant_id = #{id,jdbcType=INTEGER} AND sus.service_key = #{serviceKey,jdbcType=VARCHAR}
AND su.user_status = 'sys_user_status_normal'
AND su.user_type = 3
<if test="orgId != null">
AND su.org_id = #{orgId,jdbcType=INTEGER}
</if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!