<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zcloud.modules.RyCheck.mapper.HiddenMapper">

    <select id="getAllUserList" resultType="pd">
        select h.*,
        u.HIDDENUSER_ID,u.USER_ID as u_user_id,u.TYPE,u.IS_MAIN,
        c.HIDDENCHECK_ID,c.DEPARTMENT_ID,c.USER_ID as c_user_id,c.STATUS,c.CHECK_TIME,c.CHECKDESCR as c_CHECKDESCR,
        u1.USERNAME AS fwxfzrTel,
        u1.`NAME` AS fwxfzr,
        u1.DEPARTMENT_ID AS fwwdw,
        d1.`NAME` AS fwwdwStr,
        u2.USERNAME AS fqfuserPhone,
        u2.`NAME` AS fqfuserStr,
        u2.DEPARTMENT_ID AS fqfuserDept,
        d2.`NAME` AS fqfuserDeptStr,
        u3.USERNAME AS fysPhone,
        u3.`NAME` AS fysUser,
        u3.DEPARTMENT_ID AS fysDept,
        d3.`NAME` AS fysDeptStr
        FROM bus_hidden h
        LEFT JOIN bus_hidden_user u on u.HIDDEN_ID = h.HIDDEN_ID
        LEFT JOIN bus_hiddencheck c on c.HIDDEN_ID = h.HIDDEN_ID
        left JOIN sys_user u1 on u1.USER_ID = h.RECTIFICATIONOR
        left JOIN oa_department d1 on d1.DEPARTMENT_ID = u1.DEPARTMENT_ID
        left JOIN sys_user u2 on u2.USER_ID = h.CREATOR
        left JOIN oa_department d2 on d2.DEPARTMENT_ID = u2.DEPARTMENT_ID
        left JOIN sys_user u3 on u3.USER_ID = h.CHECKOR
        left JOIN oa_department d3 on d3.DEPARTMENT_ID = u3.DEPARTMENT_ID
        WHERE 1 = 1
        and h.SOURCE = '8'
        and h.CORPINFO_ID = '8854edee3aa94be496cee676b6d4845a'
        <if test="HIDDEN_IDS != null and HIDDEN_IDS != ''">
            and
            h.HIDDEN_ID in
            <foreach item="item" index="index" collection="HIDDEN_IDS" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        GROUP BY h.HIDDEN_ID
    </select>
</mapper>
