From 8e65eb751d8e3c18d9d2134df084d349e55f1985 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 15 Aug 2022 11:42:28 +0800
Subject: [PATCH] 首页执行农事操作要使用农资时,农资库存表会进行相应的变化
---
src/main/java/org/springblade/modules/soldr/mapper/SoldrMapper.xml | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/src/main/java/org/springblade/modules/soldr/mapper/SoldrMapper.xml b/src/main/java/org/springblade/modules/soldr/mapper/SoldrMapper.xml
index 23166d9..58af5da 100644
--- a/src/main/java/org/springblade/modules/soldr/mapper/SoldrMapper.xml
+++ b/src/main/java/org/springblade/modules/soldr/mapper/SoldrMapper.xml
@@ -37,7 +37,8 @@
a.dict_value AS stype,
d.dict_value AS dic1,
c.dict_value AS dic2,
- stf.agricultural_name as agrname
+ stf.agricultural_name as agrname,
+ st.dept_id
FROM sys_soldr st
LEFT JOIN sys_stockfactory stf ON stf.id = st.stock_id1
LEFT JOIN (SELECT dict_key, dict_value
@@ -61,6 +62,9 @@
</if>
<if test="soldr.stockId1!=null and soldr.stockId1 != ''">
and st.stock_id1 = #{soldr.stockId1}
+ </if>
+ <if test="soldr.deptId != null and soldr.deptId !=''">
+ AND st.dept_id = #{soldr.deptId}
</if>
</select>
@@ -103,6 +107,9 @@
WHERE CODE = 'stockType' AND is_deleted = 0) a ON
a.dict_key = stf.type
WHERE st.is_deleted = 0
+ <if test="farmId != null and farmId !=''">
+ AND st.dept_id = #{farmId}
+ </if>
</select>
<!--查询是否存在已出库农资-->
@@ -111,5 +118,14 @@
FROM `sys_soldr`
WHERE sid = #{sid}
</select>
+<!-- 根据stockId、specs1、specs_val1、specs_val2、sid-->
+ <select id="getByServalParam" resultType="org.springblade.modules.soldr.entity.Soldr">
+ SELECT * FROM sys_soldr WHERE
+ stock_id1 = #{stockId1} and specs1=#{specs1} and specs_val1=#{specsVal1} and specs_val2=#{specsVal2} and sid=#{sid} and type=#{type} and is_deleted=0
+ </select>
+
+ <update id="cancelDel">
+ UPDATE sys_soldr SET is_deleted = 0 WHERE id = #{id}
+ </update>
</mapper>
--
Gitblit v1.9.3