chenlu
2025-10-30 174cc2a8aa52f00334e0e9a3a0ea91b2e3e7acd3
north-glass-erp/src/main/resources/mapper/pp/Report.xml
@@ -274,7 +274,8 @@
               rw.this_process,
               JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code,
               CONCAT(rw.process_id,'/',GROUP_CONCAT(distinct dd.technology_number SEPARATOR '')) as process_id,
               rw.creator
               rw.creator,
               rw.reporting_work_id
        from
            sd.`order` as o left join sd.order_detail as od on o.order_id=od.order_id
                             left join sd.order_glass_detail as ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number
@@ -285,7 +286,7 @@
          and date(rw.reporting_work_time) <= #{endDate}
          and rw.this_worn_quantity > 0
          and dd.available = 0
          and reviewed_state != 2
          and reviewed_state >-1
          and rw.this_process != dd.responsible_process
        and o.create_order>0
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
@@ -320,6 +321,12 @@
        </if>
        <if test="crossProcessBreakingDTO.creator != null and crossProcessBreakingDTO.creator != ''">
            and rw.creator regexp #{crossProcessBreakingDTO.creator}
        </if>
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
            and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{crossProcessBreakingDTO.code}
        </if>
        <if test="crossProcessBreakingDTO.reportingWorkId != null and crossProcessBreakingDTO.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{crossProcessBreakingDTO.reportingWorkId}
        </if>
        GROUP BY dd.id
        order by dd.id desc
@@ -343,7 +350,8 @@
        rw.this_process,
        JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code,
        CONCAT(rw.process_id,'/',GROUP_CONCAT(distinct dd.technology_number SEPARATOR '')) as process_id,
        rw.creator
        rw.creator,
        rw.reporting_work_id
        from
        sd.`order` as o left join sd.order_detail as od on o.order_id=od.order_id
        left join sd.order_glass_detail as ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number
@@ -354,7 +362,7 @@
        and date(rw.reporting_work_time) &lt;= #{endDate}
        and rw.this_worn_quantity > 0
        and dd.available = 0
        and reviewed_state != 2
        and reviewed_state >-1
        and rw.this_process = dd.responsible_process
        and o.create_order>0
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
@@ -390,6 +398,12 @@
        <if test="crossProcessBreakingDTO.creator != null and crossProcessBreakingDTO.creator != ''">
            and rw.creator regexp #{crossProcessBreakingDTO.creator}
        </if>
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
            and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{crossProcessBreakingDTO.code}
        </if>
        <if test="crossProcessBreakingDTO.reportingWorkId != null and crossProcessBreakingDTO.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{crossProcessBreakingDTO.reportingWorkId}
        </if>
        GROUP BY dd.id
        order by dd.id desc
        limit #{offset},#{pageSize}
@@ -406,11 +420,12 @@
                 left join sd.order_glass_detail as ogd
                           on ogd.order_id = o.order_id and ogd.order_number = dd.order_number
                               and ogd.technology_number and dd.technology_number
        left join sd.order_detail as od on o.order_id = od.order_id and od.order_number=ogd.order_number
        where date(rw.reporting_work_time) >= #{startDate}
          and date(rw.reporting_work_time) &lt;= #{endDate}
          and rw.this_worn_quantity > 0
          and dd.available = 0
          and reviewed_state != 2
          and rw.reviewed_state>=0
          and rw.this_process != dd.responsible_process
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
            and JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) regexp #{crossProcessBreakingDTO.code}
@@ -442,6 +457,12 @@
        <if test="crossProcessBreakingDTO.responsiblePersonnel != null and crossProcessBreakingDTO.responsiblePersonnel != ''">
            and dd.responsible_personnel regexp #{crossProcessBreakingDTO.responsiblePersonnel}
        </if>
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
            and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{crossProcessBreakingDTO.code}
        </if>
        <if test="crossProcessBreakingDTO.reportingWorkId != null and crossProcessBreakingDTO.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{crossProcessBreakingDTO.reportingWorkId}
        </if>
        order by dd.id desc
    </select>
@@ -456,6 +477,7 @@
        left join sd.order_glass_detail as ogd
        on ogd.order_id = o.order_id and ogd.order_number = dd.order_number
        and ogd.technology_number and dd.technology_number
        left join sd.order_detail as od on o.order_id = od.order_id and od.order_number=ogd.order_number
        where date(rw.reporting_work_time) >= #{startDate}
        and date(rw.reporting_work_time) &lt;= #{endDate}
        and rw.this_worn_quantity > 0
@@ -491,6 +513,9 @@
        </if>
        <if test="crossProcessBreakingDTO.responsiblePersonnel != null and crossProcessBreakingDTO.responsiblePersonnel != ''">
            and dd.responsible_personnel regexp #{crossProcessBreakingDTO.responsiblePersonnel}
        </if>
        <if test="crossProcessBreakingDTO.code != null and crossProcessBreakingDTO.code != ''">
            and ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') regexp #{crossProcessBreakingDTO.code}
        </if>
        order by dd.id desc
    </select>
@@ -748,7 +773,8 @@
        ogd.child_height,
        ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber,
        rw.this_process,
        rw.creator
        rw.creator,
        rw.reporting_work_id
        FROM
        sd.ORDER AS o
        LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id
@@ -804,6 +830,9 @@
        <if test="damageReportDTO.creator != null and damageReportDTO.creator != ''">
            and rw.creator regexp #{damageReportDTO.creator}
        </if>
        <if test="damageReportDTO.reportingWorkId != null and damageReportDTO.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{damageReportDTO.reportingWorkId}
        </if>
        GROUP BY
        dd.id
        limit #{offset},#{pageSize};
@@ -823,7 +852,7 @@
        WHERE
        rw.reporting_work_time >= #{selectTime1}
        AND rw.reporting_work_time &lt;  #{selectTime2}
        AND dd.available = 0
        AND dd.available = 0 and rw.reviewed_state>=0
        <if test="damageReportDTO.orderId != null and damageReportDTO.orderId != ''">
            and o.order_id regexp #{damageReportDTO.orderId}
        </if>
@@ -1197,7 +1226,8 @@
               rw.this_process,
               JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code,
               CONCAT(rw.process_id,'/',GROUP_CONCAT(distinct dd.technology_number SEPARATOR '')) as process_id,
               rw.creator
               rw.creator,
               rw.reporting_work_id
        from damage_details as dd
                 left join reporting_work as rw
                           on rw.reporting_work_id = dd.reporting_work_id
@@ -1233,7 +1263,8 @@
               rw.this_process,
               JSON_UNQUOTE( JSON_EXTRACT( od.other_columns, '$.S01' )) AS code,
               CONCAT(rw.process_id,'/',GROUP_CONCAT(distinct dd.technology_number SEPARATOR '')) as process_id,
               rw.creator
               rw.creator,
               rw.reporting_work_id
        from damage_details as dd
                 left join reporting_work as rw
                           on rw.reporting_work_id = dd.reporting_work_id
@@ -1274,7 +1305,8 @@
               ogd.child_height,
               ifnull(JSON_UNQUOTE(JSON_EXTRACT(od.other_columns, '$.S01')),'') AS glassNumber,
               rw.this_process,
               rw.creator
               rw.creator,
               rw.reporting_work_id
        FROM sd.ORDER AS o
                 LEFT JOIN sd.order_glass_detail AS ogd ON ogd.order_id = o.order_id
                 LEFT JOIN reporting_work AS rw ON rw.order_id = o.order_id
@@ -1676,6 +1708,9 @@
        <if test="teamOutputDTO.deviceName != null and teamOutputDTO.deviceName != ''">
            AND rw.device_name REGEXP #{teamOutputDTO.deviceName}
        </if>
        <if test="teamOutputDTO.batch != null and teamOutputDTO.batch != ''">
            AND o.batch REGEXP #{teamOutputDTO.batch}
        </if>
        <choose>
            <when test="laminating == ''">
@@ -1823,7 +1858,9 @@
        <if test="teamOutputDTO.edgingType != null and teamOutputDTO.edgingType != ''">
            and od.edging_type regexp #{teamOutputDTO.edgingType}
        </if>
        <if test="teamOutputDTO.batch != null and teamOutputDTO.batch != ''">
            AND o.batch REGEXP #{teamOutputDTO.batch}
        </if>
        <choose>
            <when test="laminating == ''">
                GROUP BY
@@ -2505,7 +2542,9 @@
        <if test="teamOutputDTO.deviceName != null and teamOutputDTO.deviceName != ''">
            AND rw.device_name REGEXP #{teamOutputDTO.deviceName}
        </if>
        <if test="teamOutputDTO.batch != null and teamOutputDTO.batch != ''">
            AND o.batch REGEXP #{teamOutputDTO.batch}
        </if>
        <choose>
            <when test="laminating == ''">
                GROUP BY