liyong
2025-02-22 1fb3203f439527ab59728319e425787534f7ba42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?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.ruoyi.process.mapper.QualitySuperviseDetailsMapper">
 
    <!-- 质量监督计划详情列表 -->
    <select id="pageQualitySuperviseDetail" resultType="com.ruoyi.process.dto.QualitySuperviseDetailsDto">
        select *
        from (select cd.*,
                     cr.is_according,
                     ca.is_correct,
                     cc.supervise_details_correct_id
              from cnas_quality_supervise_details cd
                       left join cnas_quality_supervise_details_record cr
                                 on cr.supervise_details_id = cd.supervise_details_id
                       left join cnas_quality_supervise_details_according ca
                                 on ca.supervise_details_id = cd.supervise_details_id
                       left join cnas_quality_supervise_details_correct cc
                                 on cc.supervise_details_id = cd.supervise_details_id
        where 1=1
        <choose>
            <when test="causeType != null and causeType == 1">
                and cd.supervise_reason not like '%动态%'
            </when>
            <when test="causeType != null and causeType == 2">
                and cd.supervise_reason like '%动态%'
            </when>
            <otherwise>
                and cd.supervise_reason not like '%动态%'
            </otherwise>
        </choose>
              order by STR_TO_DATE(CONCAT(cd.supervise_time, '.01'), '%Y.%m.%d')) a
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
</mapper>