|
|
@@ -394,6 +394,9 @@
|
|
|
and (t.name like concat('%', #{searchValue}, '%')
|
|
|
or t.room like concat('%', #{searchValue}, '%'))
|
|
|
</if>
|
|
|
+ <if test="loginUserId != null ">
|
|
|
+ (t.`admin_id` = #{loginUserId} or find_in_set(#{loginUserId},t.`safe_user_id`))
|
|
|
+ </if>
|
|
|
<if test="name != null and name != ''">and t.name like concat('%', #{name}, '%')</if>
|
|
|
<if test="adminName != null and adminName != ''">and su.nick_name like concat('%', #{adminName}, '%')</if>
|
|
|
|
|
|
@@ -419,6 +422,96 @@
|
|
|
order by t.diy_order desc , t.create_time desc
|
|
|
</select>
|
|
|
|
|
|
+ <select id="selectLabAppSubjectVOList" parameterType="com.zd.laboratory.domain.LabSubject"
|
|
|
+ resultMap="LabSubjectResultVO">
|
|
|
+ select t.id,
|
|
|
+ t.name,
|
|
|
+ bfl.floor_id,
|
|
|
+ t.room,
|
|
|
+ t.dept_id,
|
|
|
+ IFNULL(su.user_id, -1) admin_id,
|
|
|
+ t.is_del,
|
|
|
+ t.create_time,
|
|
|
+ t.user_id,
|
|
|
+ t.create_by,
|
|
|
+ t.update_time,
|
|
|
+ t.update_by,
|
|
|
+ t.sub_dept,
|
|
|
+ bfl.id layout_id,
|
|
|
+ t.build_id,
|
|
|
+ t.remark,
|
|
|
+ t.level,
|
|
|
+ t.diy_order,
|
|
|
+ cf.classified_name levelName,
|
|
|
+ cf.classified_color fiedColor,
|
|
|
+ t.type_id,
|
|
|
+ (SELECT ct.type_name FROM lab_safe_classtype ct WHERE ct.id = t.`type_id`) typeName,
|
|
|
+ t.mold_id,
|
|
|
+ (select lm.mold_name from lab_mold lm where t.mold_id = lm.id) as moldName,
|
|
|
+ t.check_out,
|
|
|
+ t.check_in,
|
|
|
+ t.safe_user_id,
|
|
|
+ t.safe_signs,
|
|
|
+ t.hazard_category,
|
|
|
+ t.risk_measure,
|
|
|
+ t.outfire,
|
|
|
+ t.qr_code,
|
|
|
+ su.nick_name as admin_name,
|
|
|
+ su.phonenumber as adminPhone,
|
|
|
+ sd.dept_name as dept_name,
|
|
|
+ t.skipped,
|
|
|
+ t.check_count,
|
|
|
+ t.sign_time,
|
|
|
+ t.inspect_check_in,
|
|
|
+ t.inspect_skipped,
|
|
|
+ t.inspect_check_count,
|
|
|
+ t.inspect_sign_time,
|
|
|
+ t.hardware_type,
|
|
|
+ (select i.id from xxp_card_info i where i.subJect_id=t.id LIMIT 1) xxpCardInfoId,
|
|
|
+ CONCAT(su.nick_name, '@', su.phonenumber) AS adminNameAndPhone,
|
|
|
+
|
|
|
+ (select b.name from lab_build_floor b where b.id = t.build_id) buildName,
|
|
|
+ (select b.name from lab_build_floor b where b.id = t.floor_id) floorName,
|
|
|
+ (SELECT l.room_num FROM lab_build_floor_layout l WHERE l.sub_id = t.id) roomName
|
|
|
+
|
|
|
+ from lab_subject t
|
|
|
+ left join sys_user su on su.user_id = t.admin_id AND su.`del_flag` = 0
|
|
|
+ left join sys_dept sd on sd.dept_id = t.dept_id
|
|
|
+ left join lab_safe_classified cf on cf.id = t.level
|
|
|
+ LEFT JOIN lab_build_floor_layout bfl ON t.`id` = bfl.`sub_id`
|
|
|
+ <where>
|
|
|
+ <if test="searchValue != null ">
|
|
|
+ and (t.name like concat('%', #{searchValue}, '%')
|
|
|
+ or t.room like concat('%', #{searchValue}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="loginUserId != null ">
|
|
|
+ (t.`admin_id` = #{loginUserId} or find_in_set(#{loginUserId},t.`safe_user_id`))
|
|
|
+ </if>
|
|
|
+ <if test="name != null and name != ''">and t.name like concat('%', #{name}, '%')</if>
|
|
|
+ <if test="adminName != null and adminName != ''">and su.nick_name like concat('%', #{adminName}, '%')</if>
|
|
|
+
|
|
|
+ <if test="buildId != null ">and t.build_id = #{buildId}</if>
|
|
|
+ <if test="deptId != null ">and t.dept_id = #{deptId}</if>
|
|
|
+ <if test="id != null ">and t.id = #{id}</if>
|
|
|
+ <if test="subIds != null and subIds != ''">and find_in_set(t.id, #{subIds})</if>
|
|
|
+
|
|
|
+ <if test="adminId != null ">and t.admin_id = #{adminId}</if>
|
|
|
+ <if test="level != null ">and t.level = #{level}</if>
|
|
|
+ <if test="typeId != null ">and t.type_id = #{typeId}</if>
|
|
|
+ <if test="subDept != null and subDept != ''">and t.sub_dept = #{subDept}</if>
|
|
|
+ <if test="ids!=null and ids.size()>0">
|
|
|
+ and t.id in
|
|
|
+ <foreach item="id" collection="ids" open="(" separator="," close=")">
|
|
|
+ #{id}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <!-- 数据范围过滤 -->
|
|
|
+ ${params.dataScope}
|
|
|
+ </where>
|
|
|
+ order by t.diy_order desc , t.create_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="selectLabSubjectVOListByPc" parameterType="com.zd.laboratory.domain.LabSubject"
|
|
|
resultType="com.zd.laboratory.domain.vo.LabSubjectVO">
|
|
|
select t.id,
|