shenyijian
2024-08-30 44d30cbd79df473dbdf6d28decde2bbc931c0821
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sg/mapper/SgProgressReportMapper.xml
@@ -25,6 +25,13 @@
        <if test="dto.reportPerson != null ">
            and report.report_user = #{dto.reportPerson}
        </if>
        <if test="dto.startTime != null and dto.startTime !='' ">
            and report.report_time &gt;= #{dto.startTime}
        </if>
        <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">
@@ -53,6 +60,7 @@
        <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">
@@ -90,28 +98,35 @@
            and de.device_name like CONCAT(CONCAT('%', #{dto.deviceName}), '%')
        </if>
        <if test="dto.userId != null and dto.userId != ''">
            and userR.user_id = #{dto.userId}
            and userR.user_id = #{dto.userId} and userR.approval_order != 0
        </if>
        <if test="dto.approvalStatus != null and dto.approvalStatus != 3">
        <if test="dto.approvalStatus != null and dto.approvalStatus ==0">
            and userR.approval_status = 0
            and userR.approval_status = 0 and report.audit_person = #{dto.auditPerson} and (report."STATUS" = 0 or report."STATUS" = 1)
        </if>
        <if test="dto.approvalStatus != null and dto.approvalStatus ==1">
           and userR.approval_status != 0
           and userR.approval_status = 1
        </if>
            AND userR.approval_order != 0
        <if test="dto.approvalStatus != null and dto.approvalStatus ==2">
            AND userR.approval_status = 2
        </if>
        <choose >
        <if test="dto.startTime != null and dto.startTime !='' ">
            and report.report_time &gt;= #{dto.startTime}
        </if>
        <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)
            </when>
            <when test="dto.approvalStatus != null and dto.approvalStatus == 1">
               and report."STATUS" != 0
               and report."STATUS" != 1
            </when>
            <when test="dto.approvalStatus != null and dto.approvalStatus == 3">
                and report.report_user = #{dto.userId}
            </when>
        </choose>
        </choose>-->
    </select>
    <select id="countList" resultType="java.lang.Long">
        select count(1) from  ywxt.SG_PROGRESS_REPORT report
@@ -136,7 +151,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
@@ -178,4 +194,8 @@
    <select id="selectProframId" resultType="java.lang.Long">
        select program_id from ywxt.sg_device where id = #{deviceId}
    </select>
    <select id="selectProcessUserByProjectId" resultType="cn.gistack.sm.sg.DO.SgReportUserDO">
        select  u.* from ywxt.sg_report_user u left join  ywxt.sg_progresss_report r on u.report_id = r.id
        where 1=1 and r.profram_id = #{programId}
    </select>
</mapper>