From 4098ea2b95d6da283ac62f2ebb30ce37fe0d6d3f Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 05 七月 2024 10:12:31 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override
---
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml | 157 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 157 insertions(+), 0 deletions(-)
diff --git a/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml b/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
new file mode 100644
index 0000000..1fb8366
--- /dev/null
+++ b/north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -0,0 +1,157 @@
+<?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.example.erp.mapper.pp.PatchLogMapper">
+
+
+
+ <!--鑾峰彇琛ョ墖鏁版嵁-->
+ <select id="SelectReplenish" >
+ select
+ r.id,
+ r.review_status,
+ r.reporting_work_id,
+ r.patch_id,
+ r.process_id,
+ r.order_id,
+ r.order_sort,
+ o.project,
+ o.batch,
+ od.building_number,
+ od.product_name,
+ r.technology_number,
+ ogd.glass_address,
+ r.patch_num,
+ od.width,
+ od.height,
+ od.shape,
+ r.patch_type,
+ r.patch_reason,
+ r.responsible_team,
+ r.responsible_personnel,
+ r.responsible_equipment,
+ r.patch_area,
+ r.quality_inspector,
+ r.patch_processes,
+ r.reviewer,
+ date(r.create_time) as create_time,
+ date(r.update_time) as update_time
+ from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number
+ left join sd.`order` o on r.order_id = o.order_id
+ left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
+ on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
+ <where>
+ date(r.create_time)>=#{startDate} and date(r.create_time) <= #{endDate}
+ </where>
+ order by r.review_status,r.id desc
+ limit #{offset},#{pageSize};
+ </select>
+
+ <select id="SelectReplenishPageTotal" >
+ select CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
+ count(zu.id) as 'total'
+ from (select r.id as id
+ from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number
+ left join sd.`order` o on r.order_id = o.order_id
+ left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
+ on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
+ <where>
+ date(r.create_time)>=#{startDate} and date(r.create_time) <= #{endDate}
+ </where>
+ ) as zu
+ limit #{offset},#{pageSize};
+ </select>
+
+
+
+
+ <select id="getMaximum" >
+ select count(*) from pp.patch_log where date(create_time)=CURDATE()
+ </select>
+
+
+ <insert id="insertReplenish" useGeneratedKeys="true" >
+ insert into pp.patch_log(patch_id,reporting_work_id,process_id,order_id, order_sort, technology_number, responsible_team,
+ responsible_personnel, patch_type, patch_reason, patch_processes, patch_num,
+ patch_area,responsible_equipment,quality_inspector, reviewer, review_status, create_time)
+ values (
+ #{oddNumber}, #{patchLog.reportingWorkId},#{patchLog.processId},#{patchLog.orderId},#{patchLog.orderSort},#{patchLog.technologyNumber},
+ #{patchLog.responsibleTeam},#{patchLog.responsiblePersonnel},#{patchLog.patchType},#{patchLog.patchReason},
+ #{patchLog.patchProcesses},#{patchLog.patchNum},#{patchLog.patchArea},#{patchLog.responsibleEquipment},#{patchLog.qualityInspector},"",0,now()
+ )
+ </insert>
+
+ <update id="updateReplenish" >
+ update pp.patch_log set reviewer=#{userName},review_status=1,update_time=now() where id=#{patchLog.id}
+ </update>
+
+
+ <update id="updateOrderProcessDetail" >
+ update sd.order_process_detail
+ set reporting_work_num=reporting_work_num - #{patchLog.patchNum}
+ where order_id = #{patchLog.orderId}
+ and process_id = #{patchLog.processId}
+ and order_number = #{patchLog.orderSort}
+ and technology_number = #{patchLog.technologyNumber}
+ and id <![CDATA[<]]> (select a.opdid
+ from (select id as opdid
+ from sd.order_process_detail opd
+ where opd.order_id = #{patchLog.orderId}
+ and opd.process_id = #{patchLog.processId}
+ and opd.order_number = #{patchLog.orderSort}
+ and opd.technology_number = #{patchLog.technologyNumber}
+ and process = #{reportingWork.thisProcess}) as a)
+ </update>
+
+ <update id="updateDamageDetails" >
+ update pp.damage_details set quantity=quantity+#{patchLog.patchNum},patch_status=1 where id=#{patchLog.reviewer}
+ </update>
+
+
+ <select id="getSelectReplenish">
+ select date(rw.reporting_work_time) as reportingWorkTime,
+ o.order_id as orderId,
+ dd.reporting_work_id as reportingWorkId,
+ rw.production_id as productionId,
+ rw.process_id as processId,
+ o.project,
+ o.batch,
+ dd.id as reviewer,
+ od.building_number as buildingNumber,
+ dd.order_number as orderSort,
+ od.product_name as productName,
+ dd.technology_number as technologyNumber,
+ ogd.glass_address as glassAddress,
+ dd.breakage_quantity-dd.quantity as patchNum,
+ od.width,
+ od.height,
+ od.shape,
+ dd.responsible_process as responsibleProcess,
+ rw.this_process as patchProcesses,
+ dd.breakage_quantity-dd.quantity as breakageQuantity,
+ dd.return_process as patchProcesses,
+ dd.breakage_reason as patchReason,
+ dd.breakage_type as patchType,
+ dd.responsible_personnel as responsiblePersonnel,
+ dd.responsible_equipment as responsibleEquipment,
+ dd.responsible_team as responsibleTeam,
+ ROUND((dd.breakage_quantity-dd.quantity) * od.width * od.height / 1000000, 2) as patchArea,
+ rw.quality_inspector as qualityInspector
+ from pp.damage_details dd
+ left join pp.reporting_work_detail rwd on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number=rwd.order_number and dd.technology_number=rwd.technology_number
+ left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id
+
+ left join sd.`order` o on rw.order_id = o.order_id
+ left join sd.order_detail od on rw.order_id = od.order_id and dd.order_number = od.order_number
+ left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
+ on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
+
+ where dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.quality_ins_status!=1)) and rw.reviewed_state!=-1
+ order by dd.id desc
+ </select>
+
+
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0