gonglilong
2024-09-14 17dc74a722d4b9e441c0db65ff6ed67df8df5a09
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
@@ -31,6 +31,7 @@
        <if test="dto.endTime != null and dto.endTime !='' ">
            and report.report_time &lt;= #{dto.endTime}
        </if>
        order by report_time desc
    </select>
    <select id="queryPageListAll" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO">
@@ -38,9 +39,11 @@
        report.*,
        de.device_name,
        de.device_type,
        dict."DICT_VALUE" as typeName
        dict."DICT_VALUE" as typeName, si.control_unit,si.self_unit,dria."county_cd"
        FROM
        ywxt.SG_PROGRESS_REPORT report
        LEFT JOIN ywxt.SG_PROJECT_INFO si ON report.profram_id = si.id
        LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = si.sk_id
        LEFT JOIN ywxt.sg_device de ON report.gx_device_id = de.id
        left join YWXT."BLADE_DICT_BIZ" as dict  on de.device_type=dict.DICT_KEY  and dict.CODE='SG_DEVICE_TYPE'
        where 1=1 and report."STATUS" != 4
@@ -59,10 +62,12 @@
        <if test="dto.endTime != null and dto.endTime != ''">
            and report.create_time &lt;= #{dto.endTime}
        </if>
        order by report.report_time desc
    </select>
    <select id="queryById" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO">
        select * from  SG_PROGRESS_REPORT report where id = #{id}
        select report.*,si.control_unit,si.self_unit,dria."county_cd" from  SG_PROGRESS_REPORT report  LEFT JOIN ywxt.SG_PROJECT_INFO si ON report.profram_id = si.id
                                                  LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = si.sk_id where report.id = #{id}
    </select>
    <select id="queryList" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO">
        SELECT distinct
@@ -79,15 +84,27 @@
        DBMS_LOB.SUBSTR(report.video_urls) videoUrls,
        de.device_name,
        de.device_type,
       <!-- userR.approval_status, -->
        dict."DICT_VALUE" as typeName
        userR.approval_status,
        dict."DICT_VALUE" as typeName,
        si.control_unit,si.self_unit,dria."county_cd"
        FROM
        ywxt.SG_PROGRESS_REPORT report
        LEFT JOIN ywxt.SG_PROJECT_INFO si ON report.profram_id = si.id
        LEFT JOIN SJZT_DW."dim_res_info_a" dria ON dria."res_cd" = si.sk_id
        LEFT JOIN ywxt.sg_device de ON report.gx_device_id = de.id
        left join YWXT."BLADE_DICT_BIZ" as dict  on de.device_type=dict.DICT_KEY  and dict.CODE='SG_DEVICE_TYPE'
        LEFT JOIN ywxt.sg_report_user userR ON report.id = userR.report_id
        WHERE
        1 = 1 and report."STATUS" != 4
        <if test="dto.userUnit != null and dto.userUnit != ''">
            and  si.CONTROL_UNIT=#{dto.userUnit}
        </if>
        <if test="dto.countryUnit != null and dto.countryUnit != ''">
            and dria."county_cd"=#{dto.userUnit}
        </if>
        <if test="dto.roleUnit != null and dto.roleUnit != ''">
            and userR.role_id=#{dto.roleUnit}
        </if>
       <!-- AND userR.is_his = 0 -->
        <if test="dto.projectName != null and dto.projectName != ''">
            and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%')
@@ -99,7 +116,7 @@
            and userR.user_id = #{dto.userId} and userR.approval_order != 0
        </if>
        <if test="dto.approvalStatus != null and dto.approvalStatus ==0">
            and userR.approval_status = 0 and report.audit_person = #{dto.auditPerson} and (report."STATUS" = 0 or report."STATUS" = 1)
            and userR.approval_status = 0 and report.audit_person = #{dto.roleUnit} and (report."STATUS" = 0 or report."STATUS" = 1)
        </if>
        <if test="dto.approvalStatus != null and dto.approvalStatus ==1">
           and userR.approval_status = 1
@@ -113,6 +130,7 @@
        <if test="dto.endTime != null and dto.endTime !='' ">
            and report.report_time &lt;= #{dto.endTime}
        </if>
        order by report.report_time desc
        <!--<choose >
            <when test="dto.approvalStatus != null and dto.approvalStatus == 0">
                and report.audit_person = #{dto.userId} and (report."STATUS" = 0 or report."STATUS" = 1)
@@ -148,7 +166,8 @@
            step.gx_step_name AS stepName,
            step.gx_step_num AS stepNum,
            re.STATUS AS approvalStatus,
            re.report_time
            re.report_time,
            re.resubmit
        FROM
            ywxt.sg_gx_step step
                LEFT JOIN ywxt.sg_gx gx ON step.gx_info_id = gx.id