From 528d0da19f5fc3f5c78af3c99a1f2cfa914a27dd Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 01 二月 2024 17:00:08 +0800
Subject: [PATCH] #
---
zy-asrs-common/src/main/resources/mapper/wms/LocDetlMapper.xml | 102 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 100 insertions(+), 2 deletions(-)
diff --git a/zy-asrs-common/src/main/resources/mapper/wms/LocDetlMapper.xml b/zy-asrs-common/src/main/resources/mapper/wms/LocDetlMapper.xml
index a137f77..c8584e7 100644
--- a/zy-asrs-common/src/main/resources/mapper/wms/LocDetlMapper.xml
+++ b/zy-asrs-common/src/main/resources/mapper/wms/LocDetlMapper.xml
@@ -2,6 +2,17 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.asrs.common.wms.mapper.LocDetlMapper">
+ <sql id="batchSeq">
+ <choose>
+ <when test="batch != null and batch != ''">
+ and batch = #{batch}
+ </when>
+ <otherwise>
+ and (batch IS NULL OR batch = '')
+ </otherwise>
+ </choose>
+ </sql>
+
<sql id="stockOutCondition">
<if test="map.loc_no!=null and map.loc_no!='' ">
and a.loc_no like '%' + #{map.loc_no} + '%'
@@ -34,14 +45,101 @@
select
a.matnr
, sum(a.anfme) as anfme
- from asr_loc_detl a
+ from wms_loc_detl a
where 1=1
<include refid="stockOutCondition"></include>
group by a.matnr
</select>
<select id="sum" resultType="java.lang.Integer">
- SELECT SUM(anfme) FROM asr_loc_detl
+ SELECT SUM(anfme) FROM wms_loc_detl
+ </select>
+
+ <select id="queryStock" resultType="com.zy.asrs.common.wms.entity.LocDetl">
+ select
+ a.*
+ from wms_loc_detl a
+ left join common_loc_mast b on a.loc_no = b.loc_no and a.host_id = b.host_id
+ where 1=1
+ and a.matnr = #{matnr}
+ <if test="batch!=null and batch!=''">
+ and a.batch = #{batch}
+ </if>
+ and b.host_id = #{hostId}
+ and b.loc_sts = 'F'
+ order by b.row1
+ </select>
+
+ <select id="selectItem" resultType="com.zy.asrs.common.wms.entity.LocDetl">
+ select top 1 *
+ from wms_loc_detl
+ where 1=1
+ and loc_no = #{locNo}
+ and matnr = #{matnr}
+ and host_id = #{hostId}
+ <include refid="batchSeq"></include>
+ </select>
+
+ <delete id="deleteItem">
+ delete from wms_loc_detl
+ where 1=1
+ and loc_no = #{locNo}
+ and matnr = #{matnr}
+ and host_id = #{hostId}
+ <include refid="batchSeq"></include>
+ </delete>
+
+ <update id="updateAnfme">
+ update wms_loc_detl
+ set anfme = #{anfme}
+ , modi_time = getdate()
+ where 1=1
+ and loc_no = #{locNo}
+ and matnr = #{matnr}
+ and host_id = #{hostId}
+ <include refid="batchSeq"></include>
+ </update>
+
+ <select id="getStockOutPage" resultType="com.zy.asrs.common.wms.entity.LocDetl">
+ select
+ a.*
+ from wms_loc_detl a
+ left join common_loc_mast b on a.loc_no = b.loc_no and a.host_id = b.host_id
+ where 1=1
+ and b.loc_sts = 'F'
+ and b.host_id = #{map.hostId}
+ <include refid="stockOutCondition"></include>
+ </select>
+
+ <select id="getReportStockDto" resultType="com.zy.asrs.common.domain.dto.ReportStockDto">
+ select matnr,batch,sum(anfme) anfme from wms_loc_detl
+ where host_id = #{hostId}
+ group by matnr,batch
+ </select>
+
+ <select id="selectSameDetl" resultType="java.lang.String">
+ SELECT
+ ld.loc_no
+ FROM wms_loc_detl ld
+ LEFT JOIN common_loc_mast lm ON ld.loc_no = lm.loc_no and ld.host_id = lm.host_id
+ LEFT JOIN (
+ select
+ loc_no,
+ count(1) as count
+ from wms_loc_detl
+ where 1=1
+ and host_id = #{hostId}
+ group by loc_no
+ ) dual on dual.loc_no = lm.loc_no
+ WHERE 1 = 1
+ AND ld.matnr = #{matnr}
+ <if test="batch">
+ AND ld.batch = #{batch}
+ </if>
+ AND (lm.loc_sts = 'F')
+ AND dual.count = 1
+ AND lm.host_id = #{hostId}
+ ORDER BY lm.modi_time ASC
</select>
</mapper>
--
Gitblit v1.9.1