|
|
@@ -330,39 +330,39 @@
|
|
|
<if test="username != null and username != ''">
|
|
|
user_name = #{username},
|
|
|
</if>
|
|
|
-<!-- <if test="nickname != null and nickname != ''">-->
|
|
|
-<!-- nick_name = #{nickname},-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="email != null ">-->
|
|
|
-<!-- email = #{email},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="nickname != null and nickname != ''">-->
|
|
|
+ <!-- nick_name = #{nickname},-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="email != null ">-->
|
|
|
+ <!-- email = #{email},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="phone != null ">
|
|
|
phone = #{phone},
|
|
|
</if>
|
|
|
<if test="gender != null and gender != ''">
|
|
|
gender = #{gender},
|
|
|
</if>
|
|
|
-<!-- <if test="avatar != null and avatar != ''">-->
|
|
|
-<!-- avatar = #{avatar},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="avatar != null and avatar != ''">-->
|
|
|
+ <!-- avatar = #{avatar},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="password != null and password != ''">
|
|
|
password = #{password},
|
|
|
</if>
|
|
|
-<!-- <if test="status != null and status != ''">-->
|
|
|
-<!-- status = #{status},-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="loginIp != null and loginIp != ''">-->
|
|
|
-<!-- login_ip = #{loginIp},-->
|
|
|
-<!-- </if>-->
|
|
|
-<!-- <if test="loginDate != null">-->
|
|
|
-<!-- login_date = #{loginDate},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="status != null and status != ''">-->
|
|
|
+ <!-- status = #{status},-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="loginIp != null and loginIp != ''">-->
|
|
|
+ <!-- login_ip = #{loginIp},-->
|
|
|
+ <!-- </if>-->
|
|
|
+ <!-- <if test="loginDate != null">-->
|
|
|
+ <!-- login_date = #{loginDate},-->
|
|
|
+ <!-- </if>-->
|
|
|
<if test="updateBy != null and updateBy != ''">
|
|
|
update_by = #{updateBy},
|
|
|
</if>
|
|
|
-<!-- <if test="remark != null">-->
|
|
|
-<!-- remark = #{remark},-->
|
|
|
-<!-- </if>-->
|
|
|
+ <!-- <if test="remark != null">-->
|
|
|
+ <!-- remark = #{remark},-->
|
|
|
+ <!-- </if>-->
|
|
|
update_time = sysdate()
|
|
|
</set>
|
|
|
where id = #{id}
|
|
|
@@ -452,14 +452,22 @@
|
|
|
FROM
|
|
|
sys_user u
|
|
|
LEFT JOIN sys_org o ON u.original_org_id = o.id
|
|
|
- LEFT JOIN ( SELECT user_id FROM sys_user_role uo LEFT JOIN sys_role ro ON uo.role_id = ro.id WHERE ro.role_name LIKE '%安全保卫管理人员' ) h ON h.user_id = u.id
|
|
|
+ LEFT JOIN ( SELECT user_id FROM sys_user_role uo LEFT JOIN sys_role ro ON uo.role_id = ro.id WHERE ro.role_name
|
|
|
+ LIKE '%安全保卫管理人员' ) h ON h.user_id = u.id
|
|
|
LEFT JOIN sys_user_role sro on u.id=sro.user_id
|
|
|
LEFT JOIN sys_role sr on sro.role_id=sr.id
|
|
|
where 1=1
|
|
|
and u.deleted =0
|
|
|
<choose>
|
|
|
<when test="info.checkSub">
|
|
|
- AND o.path like concat('%', #{info.orgPath}, '%')
|
|
|
+ AND (o.path like concat('%', #{info.orgPath}, '%')
|
|
|
+ <if test="info.parentOrgIds!=null and info.parentOrgIds.size()>0">
|
|
|
+ or o.id in
|
|
|
+ <foreach collection="info.parentOrgIds" separator="," open="(" close=")" item="orgId">
|
|
|
+ #{orgId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ )
|
|
|
</when>
|
|
|
<otherwise>
|
|
|
AND o.id = #{info.orgId}
|
|
|
@@ -497,16 +505,11 @@
|
|
|
ORDER BY t.org_id DESC
|
|
|
</select>
|
|
|
<select id="selectrolesByOrgId" resultType="com.xunmei.system.api.domain.SysRole">
|
|
|
- SELECT
|
|
|
- r.*
|
|
|
- FROM
|
|
|
- sys_role r
|
|
|
- LEFT JOIN sys_org o ON r.org_type = o.type
|
|
|
- WHERE
|
|
|
- 1 = 1
|
|
|
- AND o.id =#{orgId}
|
|
|
-
|
|
|
-
|
|
|
+ SELECT r.*
|
|
|
+ FROM sys_role r
|
|
|
+ LEFT JOIN sys_org o ON r.org_type = o.type
|
|
|
+ WHERE 1 = 1
|
|
|
+ AND o.id = #{orgId}
|
|
|
</select>
|
|
|
<select id="getList" resultMap="SysUserResult">
|
|
|
SELECT
|
|
|
@@ -550,7 +553,8 @@
|
|
|
FROM
|
|
|
sys_user u
|
|
|
LEFT JOIN sys_org o ON u.original_org_id = o.id
|
|
|
- LEFT JOIN ( SELECT user_id FROM sys_user_role uo LEFT JOIN sys_role ro ON uo.role_id = ro.id WHERE ro.role_name LIKE '%安全保卫管理人员' ) h ON h.user_id = u.id
|
|
|
+ LEFT JOIN ( SELECT user_id FROM sys_user_role uo LEFT JOIN sys_role ro ON uo.role_id = ro.id WHERE ro.role_name
|
|
|
+ LIKE '%安全保卫管理人员' ) h ON h.user_id = u.id
|
|
|
LEFT JOIN sys_user_role sro on u.id=sro.user_id
|
|
|
LEFT JOIN sys_role sr on sro.role_id=sr.id
|
|
|
where 1=1
|
|
|
@@ -581,11 +585,10 @@
|
|
|
AND date_format(u.create_time,'%y%m%d') <= date_format(#{info.params.endTime},'%y%m%d')
|
|
|
</if>
|
|
|
ORDER BY u.update_time DESC
|
|
|
-
|
|
|
</select>
|
|
|
<select id="selectAllUser" resultType="com.xunmei.system.api.domain.SysUser">
|
|
|
- select * from
|
|
|
- sys_user where deleted=0 and is_lock =0 and locked=0
|
|
|
+ select * from
|
|
|
+ sys_user where deleted=0 and is_lock =0 and locked=0
|
|
|
<if test="userName != null and userName != ''">
|
|
|
AND name like concat('%', #{userName}, '%')
|
|
|
</if>
|
|
|
@@ -598,22 +601,19 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
<select id="selectUserListByRoleAndOrg" resultType="com.xunmei.system.api.domain.SysUser">
|
|
|
- SELECT DISTINCT
|
|
|
- a.*
|
|
|
- FROM
|
|
|
- sys_user a
|
|
|
- LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
- LEFT JOIN sys_user_role c ON c.user_id = a.id
|
|
|
- LEFT JOIN sys_role d ON d.id = c.role_id
|
|
|
- WHERE
|
|
|
- a.deleted = 0
|
|
|
+ SELECT DISTINCT a.*
|
|
|
+ FROM sys_user a
|
|
|
+ LEFT JOIN sys_org b ON a.org_id = b.id
|
|
|
+ LEFT JOIN sys_user_role c ON c.user_id = a.id
|
|
|
+ LEFT JOIN sys_role d ON d.id = c.role_id
|
|
|
+ WHERE a.deleted = 0
|
|
|
AND d.del_flag = 0
|
|
|
AND b.id = #{sysRoleOrgDTO.orgId}
|
|
|
- AND d.id IN ( SELECT role_id FROM core_resumption_plan_to_role WHERE plan_id=#{sysRoleOrgDTO.planId})
|
|
|
+ AND d.id IN (SELECT role_id FROM core_resumption_plan_to_role WHERE plan_id = #{sysRoleOrgDTO.planId})
|
|
|
</select>
|
|
|
<select id="select" resultType="com.xunmei.system.util.UserExport">
|
|
|
SELECT
|
|
|
- # h.user_id AS is_manager,
|
|
|
+ # h.user_id AS is_manager,
|
|
|
GROUP_CONCAT(sr.role_name) role_names,
|
|
|
CONCAT(',',GROUP_CONCAT( sr.id ),',') as roleIds,
|
|
|
u.id,
|
|
|
@@ -655,7 +655,8 @@
|
|
|
FROM
|
|
|
sys_user u
|
|
|
LEFT JOIN sys_org o ON u.original_org_id = o.id
|
|
|
- LEFT JOIN ( SELECT user_id FROM sys_user_role uo LEFT JOIN sys_role ro ON uo.role_id = ro.id WHERE ro.role_name LIKE '%安全保卫管理人员' ) h ON h.user_id = u.id
|
|
|
+ LEFT JOIN ( SELECT user_id FROM sys_user_role uo LEFT JOIN sys_role ro ON uo.role_id = ro.id WHERE ro.role_name
|
|
|
+ LIKE '%安全保卫管理人员' ) h ON h.user_id = u.id
|
|
|
LEFT JOIN sys_user_role sro on u.id=sro.user_id
|
|
|
LEFT JOIN sys_role sr on sro.role_id=sr.id
|
|
|
where 1=1
|
|
|
@@ -695,13 +696,11 @@
|
|
|
AND date_format(u.create_time,'%y%m%d') <= date_format(#{info.params.endTime},'%y%m%d')
|
|
|
</if>
|
|
|
group by u.id
|
|
|
-
|
|
|
</select>
|
|
|
<select id="selectCountByNames" resultType="java.lang.String">
|
|
|
- select u.name from sys_user u where u.deleted=0 and u.name in
|
|
|
+ select u.name from sys_user u where u.deleted=0 and u.name in
|
|
|
<foreach collection="names" item="name" open="(" separator="," close=")">
|
|
|
#{name}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
-
|
|
|
</mapper>
|