update
This commit is contained in:
@@ -468,7 +468,6 @@
|
||||
jobnumber=values(jobnumber)
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="batchUpdateDiffUserDiffRegionIds">
|
||||
update enterprise_user_${eid}
|
||||
set user_region_ids =
|
||||
@@ -480,4 +479,195 @@
|
||||
#{item.userId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="fuzzyUsersByDepartment" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
u.user_id as userId,
|
||||
u.name as name,
|
||||
u.roles as roles,
|
||||
u.jobnumber as jobnumber,
|
||||
u.remark as remark,
|
||||
u.mobile as mobile,
|
||||
u.email as email,
|
||||
u.org_email as orgEmail,
|
||||
u.avatar as avatar,
|
||||
u.user_status as userStatus,
|
||||
u.unionid as unionid
|
||||
from enterprise_user_${eid} u
|
||||
left join enterprise_user_role_${eid} ul on u.user_id=ul.user_id
|
||||
left join sys_role_${eid} r on ul.role_id=r.id
|
||||
<where>
|
||||
u.active = true and u.user_id != 'a100000001'
|
||||
<if test="deptId !=null and deptId !=''">
|
||||
and u.departments like concat('%/',#{deptId},'/%')
|
||||
</if>
|
||||
<if test="userName !=null and userName !=''">
|
||||
and u.name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="jobNumber !=null and jobNumber !=''">
|
||||
and u.jobnumber = #{jobNumber}
|
||||
</if>
|
||||
<if test="roleId !=null ">
|
||||
and r.id=#{roleId}
|
||||
</if>
|
||||
<if test="userStatus !=null ">
|
||||
and u.user_status=#{userStatus}
|
||||
</if>
|
||||
<if test="regionId !=null and regionId !=''">
|
||||
and user_region_ids like concat('%/',#{regionId},'/%')
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
and u.user_id in
|
||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY u.user_id
|
||||
<if test="orderBy != null and orderBy != '' ">
|
||||
order by u.${orderBy} ${orderRule}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="fuzzyUsersByNotRole" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
user_id as userId,
|
||||
name as name,
|
||||
jobnumber as jobnumber,
|
||||
remark as remark,
|
||||
mobile as mobile,
|
||||
email as email,
|
||||
org_email as orgEmail,
|
||||
avatar as avatar,
|
||||
roles as roles,
|
||||
departments as departments,
|
||||
user_status as userStatus,
|
||||
unionid
|
||||
from enterprise_user_${eid}
|
||||
<where>
|
||||
active = true and user_id != 'a100000001'
|
||||
<if test="deptId !=null and deptId !=''">
|
||||
and departments like concat('%/',#{deptId},'/%')
|
||||
</if>
|
||||
<if test="userName !=null and userName !=''">
|
||||
and name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="jobNumber !=null and jobNumber !=''">
|
||||
and jobnumber = #{jobNumber}
|
||||
</if>
|
||||
<if test="userStatus !=null">
|
||||
and user_status = #{userStatus}
|
||||
</if>
|
||||
<if test="regionId !=null and regionId !=''">
|
||||
and user_region_ids like concat('%/',#{regionId},'/%')
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
and user_id in
|
||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
</where>
|
||||
ORDER BY user_id
|
||||
<if test="orderBy != null and orderBy != '' ">
|
||||
, ${orderBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectUsersByUserIds" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
id,
|
||||
user_id as userId,
|
||||
`name` as name,
|
||||
avatar,
|
||||
active,
|
||||
mobile,
|
||||
jobnumber,
|
||||
`language`,
|
||||
user_status as userStatus,
|
||||
subordinate_range as subordinateRange
|
||||
from enterprise_user_${eid}
|
||||
<where>
|
||||
user_id != 'a100000001'
|
||||
and
|
||||
<if test="userIds.size()>0 and userIds!=null">or
|
||||
user_id in
|
||||
<foreach
|
||||
collection="userIds" item="userId" separator="," open="(" close=")">
|
||||
#{userId, jdbcType=VARCHAR}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="listUserByGroupId" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
u.user_id as userId,
|
||||
u.name as name,
|
||||
u.roles as roles,
|
||||
u.jobnumber as jobnumber,
|
||||
u.mobile as mobile,
|
||||
u.email as email,
|
||||
u.org_email as orgEmail,
|
||||
u.avatar as avatar,
|
||||
u.departments as departments,
|
||||
u.user_status as userStatus,
|
||||
u.unionid as unionid
|
||||
from enterprise_user_${eid} u
|
||||
left join enterprise_user_group_mapping_${eid} ug on u.user_id=ug.user_id
|
||||
<where>
|
||||
ug.group_id = #{groupId} and u.active = true and u.user_id != 'a100000001'
|
||||
<if test="userName !=null and userName !=''">
|
||||
and u.name like concat('%',#{userName},'%')
|
||||
</if>
|
||||
<if test="userIdList != null and userIdList.size > 0">
|
||||
and u.user_id in
|
||||
<foreach collection="userIdList" item="userId" separator="," open="(" close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY u.user_id
|
||||
</select>
|
||||
|
||||
<select id="listByRegionIdList" resultType="com.cool.store.entity.EnterpriseUserDO">
|
||||
select
|
||||
id as id,
|
||||
user_id as userId,
|
||||
`name` as name,
|
||||
tel as tel,
|
||||
work_place as workPlace,
|
||||
remark as remark,
|
||||
mobile as mobile,
|
||||
email as email,
|
||||
org_email as orgEmail,
|
||||
active as active,
|
||||
order_in_depts as orderInDepts,
|
||||
is_admin as isAdmin,
|
||||
is_boss as isBoss,
|
||||
dingId as dingId,
|
||||
unionid as unionid,
|
||||
is_leader_in_depts as isLeaderInDepts,
|
||||
is_hide as isHide,
|
||||
`position` as position,
|
||||
avatar as avatar,
|
||||
jobnumber as jobnumber,
|
||||
extattr as extattr,
|
||||
is_enterprise as isEnterprise,
|
||||
roles as roles,
|
||||
monitored_departments as monitoredDepartments,
|
||||
departments as departments,
|
||||
is_leader as isLeader,
|
||||
face_url as faceUrl,
|
||||
create_time as createTime,
|
||||
`language` as language
|
||||
from enterprise_user_${eid} where user_id != 'a100000001'
|
||||
<foreach collection="regionIdList" item="regionId" separator=" or " open="and (" close=" )">
|
||||
user_region_ids like concat('%/', #{regionId}, '/%')
|
||||
</foreach>
|
||||
order by id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user