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