From 684399b665ef8c25c43faff0fdc821a0b72b39ba Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 26 四月 2024 14:03:50 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override

---
 north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml |  262 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 254 insertions(+), 8 deletions(-)

diff --git a/north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml b/north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml
index 0a4e259..dcdc2fb 100644
--- a/north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml
+++ b/north-glass-erp/src/main/resources/mapper/pp/ReportingWorkDetail.xml
@@ -3,19 +3,265 @@
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.example.erp.mapper.pp.ReportingWorkDetailMapper">
+    <!--杩斿伐鏂板-->
     <resultMap id="reworkAdd" type="com.example.erp.entity.pp.ReportingWorkDetail">
+        <id column="id" property="id"/>
+        <result column="rework_team" property="reworkTeam"/>
+        <result column="breakage_quantity" property="breakageQuantity"/>
+        <result column="return_process" property="returnProcess"/>
+        <result column="breakage_reason" property="breakageReason"/>
+        <result column="responsible_equipment" property="responsibleEquipment"/>
+        <result column="responsible_team" property="responsibleTeam"/>
+        <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
+        <association property="reportingWork" javaType="com.example.erp.entity.pp.ReportingWork">
+            <result column="process_id" property="processId"/>
+        </association>
 
+        <association property="order" javaType="com.example.erp.entity.sd.Order">
+            <result column="order_id" property="orderId"/>
+            <result column="project" property="project"/>
+            <result column="batch" property="batch"/>
+        </association>
+
+        <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
+            <result column="shape" property="shape"/>
+
+        </association>
+
+        <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail">
+            <result column="glass_child" property="glassChild"/>
+            <result column="order_number" property="orderNumber"/>
+            <result column="technology_number" property="technologyNumber"/>
+            <result column="glass_address" property="glassAddress"/>
+            <result column="child_height" property="childHeight"/>
+
+        </association>
+
+        <!-- <result column="order_id" property="orderId"/>-->
+
+    </resultMap>
+
+    <!--杩斿伐绠$悊椤甸潰-->
+    <resultMap id="reworkManage" type="com.example.erp.entity.pp.ReportingWorkDetail">
+
+        <id column="id" property="id"/>
+        <result column="rework_team" property="reworkTeam"/>
+        <result column="breakage_number" property="breakageNumber"/>
+        <result column="return_process" property="returnProcess"/>
+        <result column="breakage_reason" property="breakageReason"/>
+        <result column="breakage_type" property="breakageType"/>
+        <result column="responsible_equipment" property="responsibleEquipment"/>
+        <result column="responsible_team" property="responsibleTeam"/>
+        <result column="rework_area" property="reworkArea"/>
+        <result column="order_number" property="orderNumber"/>
+        <result column="quality_inspector" property="qualityInspector"/>
+
+        <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
+        <association property="reportingWork" javaType="com.example.erp.entity.pp.ReportingWork">
+            <result column="process_id" property="processId"/>
+        </association>
+
+        <association property="order" javaType="com.example.erp.entity.sd.Order">
+            <result column="order_id" property="orderId"/>
+            <result column="project" property="project"/>
+            <result column="batch" property="batch"/>
+        </association>
+
+        <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail">
+            <result column="shape" property="shape"/>
+        </association>
+
+        <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail">
+            <result column="glass_child" property="glassChild"/>
+            <!--<result column="order_number" property="orderNumber"/>-->
+            <result column="technology_number" property="technologyNumber"/>
+            <result column="glass_address" property="glassAddress"/>
+            <result column="child_height" property="childHeight"/>
+            <result column="child_width" property="childWidth"/>
+
+        </association>
+        <association property="OrderProcessDetail" javaType="com.example.erp.entity.sd.OrderProcessDetail">
+            <result column="reporting_work_num" property="reportingWorkNum"/>
+        </association>
 
 
     </resultMap>
-    
-    
-    <!--鑾峰彇琛ョ墖鏁版嵁-->
-    <select id="getDetail">
-        select
-            *
-        from
-            reporting_work_detail
+
+    <!--鑾峰彇杩斿伐鏂板鏁版嵁-->
+    <select id="queryReworkAdd" resultMap="reworkAdd">
+        select * from v_rework
+        <where>
+            rework_team is null
+
+            <if test="order_id != null and order_id != ''">
+                and order_id = #{order_id}
+            </if>
+
+            <if test="process_id != null and process_id != ''">
+                and process_id = #{process_id}
+            </if>
+
+            <if test="project != null and project != ''">
+                and project = #{project}
+            </if>
+        </where>
+
+        order by id desc
+        limit #{pageNum},#{pageSize}
+        ;
     </select>
 
+
+    <!--杩斿伐绠$悊-->
+    <select id="reworkDataManage" resultMap="reworkManage">
+        select * from v_rework
+
+
+
+        order by id desc
+        limit #{pageNum},#{pageSize}
+        ;
+    </select>
+
+
+    <!--杩斿伐绠$悊-->
+    <select id="reworkDataManage2" resultMap="reworkManage">
+        select * from v_rework
+
+        <where>
+
+            /*create_time <![CDATA[>=]]> #{sDate} and create_time <![CDATA[<=]]> #{eDate}}*/
+            /*澶т簬绛変簬锛屽皬浜庣瓑浜�*/
+            create_time &gt;= #{sDate} and create_time &lt;= #{eDate}}
+
+            and rework_team is not null
+
+            <if test="order_id != null and order_id != ''">
+                and order_id = #{order_id}
+            </if>
+
+            <if test="process_id != null and process_id != ''">
+                and process_id = #{process_id}
+            </if>
+
+            <if test="project != null and project != ''">
+                and project = #{project}
+            </if>
+
+
+        </where>
+
+        order by id desc
+        limit #{pageNum},#{pageSize}
+        ;
+    </select>
+
+
+
+    <!--鏌ヨdetail鏄庣粏-->
+    <select id="reportingWorkId">
+        select * from reporting_work_detail
+        where reporting_work_id =  #{reportingWorkId}
+    </select>
+
+    <select id="selectInventory">
+        select reporting_work_num
+        FROM sd.order_process_detail as opd
+        where opd.process_id = #{processId}
+          and opd.order_number = #{orderNumber}
+          and opd.technology_number = #{technologyNumber}
+          and opd.process = '鍖呰'
+    </select>
+    <!--<where>
+
+            create_time <![CDATA[>=]]> #{startTime} and create_time <![CDATA[<=]]> #{endTime}}
+            &lt;!&ndash;杩斿伐缂栧彿&ndash;&gt;
+            <if test="rework_id!=null and rework != ''">
+                and rework_id = #{reworkId}
+            </if>
+            &lt;!&ndash;娴佺▼鍗″彿&ndash;&gt;
+            <if test="process_id != null and process_id != ''">
+                and process_id=#{processId}
+            </if>
+            &lt;!&ndash;杩斿伐绫诲瀷&ndash;&gt;
+            <if test="rework_Type != null and rework_Type!=''">
+                and rework_Type=#{rework_Type}
+            </if>
+            &lt;!&ndash;杩斿伐鍘熷洜&ndash;&gt;
+            <if test="rework_Reason != null and rework_Reason!=''">
+                and rework_Reason=#{rework_Reason}
+            </if>
+            &lt;!&ndash;杩斿伐宸ュ簭&ndash;&gt;
+            <if test="rework_Processes != null and rework_Processes!=''">
+                and rework_Processes=#{rework_Processes}
+            </if>
+            &lt;!&ndash;杩斿伐鏁伴噺&ndash;&gt;
+            <if test="rework_Num != null and rework_Num!=''">
+                and rework_Num=#{rework_Num}
+            </if>
+            &lt;!&ndash;杩斿伐鐝粍&ndash;&gt;
+            <if test="rework_Team != null and rework_Team!=''">
+                and rework_Team=#{rework_Team}
+            </if>
+            &lt;!&ndash;瀹℃牳浜�&ndash;&gt;
+            <if test="reviewer != null and reviewer!=''">
+                and reviewer=#{reviewer}
+            </if>
+            &lt;!&ndash;瀹℃牳鐘舵��&ndash;&gt;
+            <if test="review_Status != null and review_Status!=''">
+                and review_Status=#{review_Status}
+            </if>
+            &lt;!&ndash;杩斿伐闈㈢Н&ndash;&gt;
+            <if test="rework_Area != null and rework_Area!=''">
+                and rework_Area=#{rework_Area}
+            </if>
+
+        </where>-->
+
+    <!--鑾峰彇杩斿伐鏂板鏁版嵁-->
+    <!--<select id="getReworkAdd">
+        SELECT `b`.`id`                                                                                 AS `id`,
+               `b`.`rework_team`                                                                        AS `rework_team`,
+               `c`.`order_id`                                                                           AS `order_id`,
+               `a`.`process_id`                                                                         AS `process_id`,
+               `c`.`project`                                                                            AS `project`,
+               `c`.`batch`                                                                              AS `batch`,
+               `d`.`glass_child`                                                                        AS `glass_child`,
+               `d`.`order_number`                                                                       AS `order_Number`,
+               `d`.`technology_number`                                                                  AS `technology_number`,
+               `d`.`glass_address`                                                                      AS `glass_address`,
+               `b`.`breakage_number`                                                                    AS `breakage_number`,
+               `d`.`child_width`                                                                        AS `child_width`,
+               `d`.`child_height`                                                                       AS `child_height`,
+               `e`.`shape`                                                                              AS `shape`,
+               `b`.`return_process`                                                                     AS `return_process`,
+               `b`.`breakage_reason`                                                                    AS `breakage_reason`,
+               `b`.`responsible_equipment`                                                              AS `responsible_equipment`,
+               `b`.`responsible_team`                                                                   AS `responsible_team`,
+               round((((`d`.`child_width` * `d`.`child_height`) * `b`.`breakage_number`) / 1000000),
+                     2)                                                                                 AS `rework_area`,
+               `b`.`qualityIns_pector`                                                                  AS `qualityIns_pector`
+        FROM ((((
+            `reporting_work_detail` `b`
+                LEFT JOIN `reporting_work` `a` ON ((
+                `a`.`reporting_work_id` = `b`.`reporting_work_id`
+                )))
+            LEFT JOIN `sd`.`order` `c` ON ((
+            `a`.`order_id` = `c`.`order_id`
+            )))
+            LEFT JOIN `sd`.`order_detail` `e` ON (((
+                                                       `c`.`order_id` = `e`.`order_id`
+                                                       )
+            AND (`e`.`order_number` = `b`.`order_number`))))
+            LEFT JOIN `sd`.`order_glass_detail` `d` ON (((
+                                                             `d`.`order_id` = `c`.`order_id`
+                                                             )
+            AND (`b`.`order_number` = `d`.`order_number`)
+            AND (`b`.`technology_number` = `d`.`technology_number`))))
+        WHERE (
+                  `b`.`available` = 1)
+    </select>-->
+
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0