|
|
@@ -1054,13 +1054,18 @@
|
|
|
GROUP BY w.user_id
|
|
|
union all
|
|
|
select a.user_id from lab_security_apply a
|
|
|
- where date_format(a.valid_end_time,'%Y-%m-%d') >= date_format(NOW(),'%Y-%m-%d')
|
|
|
- and audit_status=2
|
|
|
+ where audit_status=2
|
|
|
+ and date_format(a.valid_end_time,'%Y-%m-%d') >= date_format(NOW(),'%Y-%m-%d')
|
|
|
<if test="subjectIds!=null and subjectIds.size > 0">
|
|
|
and a.subject_id in
|
|
|
<foreach item="item" collection="subjectIds" open="(" separator="," close=")">
|
|
|
#{item}
|
|
|
</foreach>
|
|
|
+ <if test="dateList!=null and dateList.size > 0">
|
|
|
+ <foreach item="item" collection="dateList">
|
|
|
+ and date_format(a.valid_end_time,'%Y-%m-%d') >=date_format(#{item},'%Y-%m-%d')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
</if>
|
|
|
) t
|
|
|
LEFT JOIN sys_user u on t.user_id=u.user_id
|
|
|
@@ -1080,6 +1085,62 @@
|
|
|
<!-- 数据范围过滤 -->
|
|
|
${params.dataScope}
|
|
|
</select>
|
|
|
+
|
|
|
+ <!--值班人员列表,多个实验室时使用-->
|
|
|
+ <select id="selectUserDutyListMultiple" parameterType="com.zd.model.entity.SysUser" resultMap="SysUserResult">
|
|
|
+ select u.user_id, u.dept_id,d.dept_name, u.user_name, u.nick_name, u.avatar, u.phonenumber, u.sex,
|
|
|
+ u.status, u.del_flag,u.user_type, count
|
|
|
+ from
|
|
|
+ (
|
|
|
+ select w.user_id,j.subject_id,count(1) count from lab_whitelist w LEFT JOIN lab_white_join_sublist j on w.user_id = j.white_user_id
|
|
|
+ <if test="deptId != null and deptId != 0">
|
|
|
+ AND (w.dept_id = #{deptId} OR w.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
|
|
+ ancestors) ))
|
|
|
+ </if>
|
|
|
+ <if test="subjectIds!=null and subjectIds.size > 0">
|
|
|
+ where j.subject_id in
|
|
|
+ <foreach item="item" collection="subjectIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ GROUP BY w.user_id
|
|
|
+ union all
|
|
|
+ select a.user_id,a.subject_id,count(1) count from lab_security_apply a
|
|
|
+ where audit_status=2
|
|
|
+ and date_format(a.valid_end_time,'%Y-%m-%d') >= date_format(NOW(),'%Y-%m-%d')
|
|
|
+ <if test="dateList!=null and dateList.size > 0">
|
|
|
+ <foreach item="item" collection="dateList">
|
|
|
+ and date_format(a.valid_end_time,'%Y-%m-%d') >=date_format(#{item},'%Y-%m-%d')
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="subjectIds!=null and subjectIds.size > 0">
|
|
|
+ and a.subject_id in
|
|
|
+ <foreach item="item" collection="subjectIds" open="(" separator="," close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ GROUP BY a.user_id
|
|
|
+ ) t
|
|
|
+ LEFT JOIN sys_user u on t.user_id=u.user_id
|
|
|
+ LEFT JOIN sys_dept d on d.dept_id = u.dept_id
|
|
|
+ <where>
|
|
|
+ <if test="deptId != null and deptId != 0">
|
|
|
+ AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId},
|
|
|
+ ancestors) ))
|
|
|
+ </if>
|
|
|
+ <if test="nickName != null and nickName != ''">
|
|
|
+ AND u.nick_name like concat('%', #{nickName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="userType != null and userType != ''">
|
|
|
+ AND u.user_type = #{userType}
|
|
|
+ </if>
|
|
|
+ and count >= #{majorId}
|
|
|
+ </where>
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectUserByUserId" resultType="java.util.Map">
|
|
|
SELECT user_type userType,nick_name userName,user_id userId,avatar,dept_id deptId,(SELECT dept_name FROM sys_dept sd WHERE sd.dept_id=su.dept_id) deptName FROM `sys_user` su WHERE del_flag=0 AND user_id=#{userId}
|
|
|
</select>
|