|
@@ -184,8 +184,11 @@
|
|
|
FROM employee e LEFT JOIN sys_user su ON e.user_id_ = su.id_
|
|
|
<where>
|
|
|
su.user_type_ = 'SYSTEM'
|
|
|
- <if test="organId != null">
|
|
|
- AND FIND_IN_SET(su.organ_id_,#{organId})
|
|
|
+ <if test="organIds != null">
|
|
|
+ AND
|
|
|
+ <foreach collection="organIds" item="item" open="(" close=")" separator=" OR ">
|
|
|
+ FIND_IN_SET(#{item},e.organ_id_list_)
|
|
|
+ </foreach>
|
|
|
</if>
|
|
|
<if test="search != null">
|
|
|
AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
|
|
@@ -198,19 +201,20 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="queryEmployByOrganIdCount" resultType="int">
|
|
|
- SELECT COUNT(ue.user_id_)
|
|
|
- FROM (SELECT e.user_id_,su.real_name_,su.gender_,su.phone_,su.user_type_,e.job_nature_,su.lock_flag_,
|
|
|
- e.entry_date_,e.demission_date_,e.organ_id_list_,e.create_time_
|
|
|
+ SELECT COUNT(DISTINCT e.user_id_)
|
|
|
FROM employee e LEFT JOIN sys_user su ON e.user_id_ = su.id_
|
|
|
<where>
|
|
|
- <if test="organId != null">
|
|
|
- FIND_IN_SET(su.organ_id_,#{organId})
|
|
|
- </if>
|
|
|
- </where>) ue
|
|
|
- WHERE ue.user_type_ LIKE '%SYSTEM%'
|
|
|
- <if test="search != null">
|
|
|
- AND (ue.real_name_ LIKE CONCAT('%',#{search},'%') OR ue.phone_ LIKE CONCAT('%',#{search},'%'))
|
|
|
- </if>
|
|
|
+ su.user_type_ = 'SYSTEM'
|
|
|
+ <if test="organIds != null">
|
|
|
+ AND
|
|
|
+ <foreach collection="organIds" item="item" open="(" close=")" separator=" OR ">
|
|
|
+ FIND_IN_SET(#{item},e.organ_id_list_)
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="search != null">
|
|
|
+ AND (su.real_name_ LIKE CONCAT('%',#{search},'%') OR su.phone_ LIKE CONCAT('%',#{search},'%'))
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
</select>
|
|
|
<select id="queryUserRole" resultType="java.lang.Integer">
|
|
|
SELECT sur.role_id_ FROM sys_user_role sur WHERE sur.user_id_ = #{userId}
|