shenyijian
2024-06-24 5097bf3234b98ada92b6608de0e656da3e272572
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
@@ -30,11 +30,14 @@
        select * from  SG_PROGRESS_REPORT report where id = #{id}
    </select>
    <select id="queryList" resultType="cn.gistack.sm.sg.VO.SgProgressReportVO">
        SELECT
        report.*,
        SELECT distinct
        report.id,
        report.program_name,
        report.gx_step_name,
        report."STATUS",
        de.device_name,
        de.device_type,
        userR.approval_status,
       <!-- userR.approval_status, -->
        dict."DICT_VALUE" as typeName
        FROM
        ywxt.SG_PROGRESS_REPORT report
@@ -43,17 +46,25 @@
        LEFT JOIN ywxt.sg_report_user userR ON report.id = userR.report_id
        WHERE
        1 = 1
        AND userR.is_his = 0
       <!-- AND userR.is_his = 0 -->
        <if test="dto.userId != null and dto.userId != ''">
            and userR.user_id = #{dto.userId}
        </if>
        <if test="dto.approvalStatus != null and dto.approvalStatus != 3">
            and userR.approval_status = #{dto.approvalStatus}
        <if test="dto.approvalStatus != null and dto.approvalStatus ==0">
            and userR.approval_status = 0
        </if>
        <if test="dto.approvalStatus != null and dto.approvalStatus ==1">
           and userR.approval_status != 0
        </if>
            AND userR.approval_order != 0
        </if>
        <choose >
            <when test="dto.approvalStatus != null and dto.approvalStatus == 0">
                and report.audit_person = #{dto.userId}
                and report.audit_person = #{dto.userId} and (report."STATUS" = 0 or report."STATUS" = 1)
            </when>
            <when test="dto.approvalStatus != null and dto.approvalStatus == 1">
               and report."STATUS" != 0
            </when>
            <when test="dto.approvalStatus != null and dto.approvalStatus == 3">
                and report.report_user = #{dto.userId}