zhangk
2024-06-24 feb39b032f50cf5c3770a821652c132a15bcfef1
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
@@ -30,11 +30,18 @@
        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",
        report.audit_person,
        report.report_time,
        report.create_time,
        report.gx_progress,
        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 +50,31 @@
        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.projectName != null and dto.projectName != ''">
            and report.PROGRAM_NAME like CONCAT(CONCAT('%',#{dto.projectName}),'%')
        </if>
        <if test="dto.deviceName != null and dto.deviceName != ''">
            and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%')
        </if>
        <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}
@@ -110,7 +131,7 @@
            and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%')
        </if>
        <if test="dto.reportPerson != null">
            and report.reportPerson = #{dto.reportPerson}
            and report.report_user = #{dto.reportPerson}
        </if>
    </select>
    <select id="getUserByIds" resultType="java.util.Map">