<?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.CheckHiddenPushMapper">
    <select id="getWaitPushHidden" resultType="pd">
        SELECT
            CONCAT( "http://10.100.106.2:8991/file/", i.FILEPATH ) HIDDEN_PICTURE,
-- 发现人,确认人
            u1.NAME CREATOR_STR,
            d1.DEPARTMENT_ID CREATOR_DEPARTMENT_ID,
            d1.PARENT_ID CREATOR_PARENT_ID,
            d1.`NAME` CREATOR_DEPT,
-- 整改人
            u3.NAME RECTIFICATIONOR_STR,
            d3.DEPARTMENT_ID RECTIFICATIONOR_DEPARTMENT_ID,
            d3.PARENT_ID RECTIFICATIONOR_PARENT_ID,
            d3.`NAME` RECTIFICATIONOR_DEPT,
-- 验收人
            u2.NAME CHECKOR_STR,
            d2.DEPARTMENT_ID CHECKOR_DEPARTMENT_ID,
            d2.PARENT_ID CHECKOR_PARENT_ID,
            d2.`NAME` CHECKOR_DEPT,
            h.*
        FROM
            `bus_hidden` h
                LEFT JOIN bus_imgfiles i ON i.FOREIGN_KEY = HIDDEN_ID
                LEFT JOIN sys_user u1 ON h.CREATOR = u1.USER_ID
                LEFT JOIN sys_user u2 ON h.CHECKOR = u2.USER_ID
                LEFT JOIN sys_user u3 ON h.RECTIFICATIONOR = u3.USER_ID
                LEFT JOIN oa_department d1 ON d1.DEPARTMENT_ID = u1.DEPARTMENT_ID
                LEFT JOIN oa_department d2 ON d2.DEPARTMENT_ID = u2.DEPARTMENT_ID
                LEFT JOIN oa_department d3 ON d3.DEPARTMENT_ID = u3.DEPARTMENT_ID
                AND i.TYPE = 3
        WHERE
            h.SOURCE = 8
          AND HIDDEN_ID NOT IN (
            SELECT
                HIDDEN_ID
            FROM
                ry_check_hidden_push)
    </select>
</mapper>
