From a1caec6ae31fe58841eeb16a3a536c746191efee Mon Sep 17 00:00:00 2001 From: mengjiao <3338049200@qq,com> Date: Mon, 30 Dec 2024 20:41:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?wms=E7=99=BD=E8=83=9A=E5=8E=9F=E6=9D=90?= =?UTF-8?q?=E6=96=99=E5=BA=93=E5=AD=98=E6=9F=A5=E8=AF=A2=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9Camount=5Freal=E4=B8=BAnull=E5=B0=B1=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/wms/BpRawMaterialInMapper.xml | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml b/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml index c13df621e..41a0e2c1a 100644 --- a/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml +++ b/op-modules/op-wms/src/main/resources/mapper/wms/BpRawMaterialInMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -27,12 +27,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, factory_code, wa_code, wl_code, material_code, material_name, unit, supply_name, amnount_plan, amount_real, user_defined1, user_defined2, user_defined3, user_defined4, user_defined5, create_by, gmt_create, modified_by, gmt_modified from bp_raw_material_in + SELECT + id, + factory_code, + wa_code, + wl_code, + material_code, + material_name, + unit, + supply_name, + amnount_plan, + COALESCE(amount_real, 0) AS amount_real, -- 使用COALESCE函数处理NULL值 + user_defined1, + user_defined2, + user_defined3, + user_defined4, + user_defined5, + create_by, + gmt_create, + modified_by, + gmt_modified + FROM + bp_raw_material_in - - + @@ -57,22 +57,12 @@ mtsd.remark from mes_table_self mts left join mes_table_self_detial mtsd on mts.id = mtsd.belong_to - - - and CONVERT(date, mts.check_date) = dateadd(day, -1, CONVERT(date,#{checkDate})) - - - and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) - - and mts.line_code = #{lineCode} - and mts.del_flag = '0' - and mtsd.del_flag = '0' - and mts.report_name = #{reportName} - + where mts.id = #{id} + and mtsd.del_flag = '0' - + select dict_label as projectName , dict_code as projectCode ,dict_sort as tableLine from base_dict_data where dict_type = #{param} order by dict_sort asc @@ -88,24 +78,23 @@ order by dict_sort asc - select - mtsd.check_time_s + '-' + mtsd.check_time_e as timeArray + mtsd.check_time_s as checkTimeS, + mtsd.check_time_e as checkTimeE, + mtsd.check_time_s + '-' + mtsd.check_time_e as timeArray, + mtsd.table_line as tableLine from mes_table_self mts left join mes_table_self_detial mtsd on mts.id = mtsd.belong_to and mts.del_flag = '0' and mtsd.del_flag = '0' - - and CONVERT(date, mts.check_date) = dateadd(day, -1, CONVERT(date,#{checkDate})) - - - and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) - + and CONVERT(date, mts.check_date) = CONVERT(date,#{checkDate}) and mts.line_code = #{lineCode} and mts.report_name = #{reportName} + and mtsd.table_line is not null - group by mtsd.check_time_s,mtsd.check_time_e + group by mtsd.check_time_s , mtsd.check_time_e , mtsd.table_line order by mtsd.check_time_s @@ -125,29 +114,18 @@ + + + + + + update mes_table_self + + remark = #{remark}, + create_by = #{createBy}, + bz = #{bz}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where id = #{id} + + + + + + update mes_table_self_detial + + check_time_s = #{item.checkTimeS}, + check_time_e = #{item.checkTimeE}, + check_result = #{item.checkResult}, + update_by = #{item.updateBy}, + update_time = #{item.updateTime}, + + where id = #{item.id} + + + + + insert into mes_table_self_detial( + id, belong_to, + remark, bz, + create_by, create_time, + update_by, update_time, + factory_code, del_flag, + check_time_s, check_time_e, + check_result, info_code, + info_name, table_line + ) values + + ( + #{item.id}, #{item.belongTo}, + #{item.remark}, #{item.bz}, + #{item.createBy}, #{item.createTime}, + #{item.updateBy}, #{item.updateTime}, + #{item.factoryCode}, #{item.delFlag}, + #{item.checkTimeS}, #{item.checkTimeE}, + #{item.checkResult}, #{item.infoCode}, + #{item.infoName}, #{item.tableLine} + ) + + +