From 539d9ffc477d28a23a923b41fdeabc8c37c99ce6 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 23 九月 2024 14:43:31 +0800
Subject: [PATCH] #
---
src/main/resources/mapper/NodeMapper.xml | 64 ++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/NodeMapper.xml b/src/main/resources/mapper/NodeMapper.xml
index b2dcada..e9acdee 100644
--- a/src/main/resources/mapper/NodeMapper.xml
+++ b/src/main/resources/mapper/NodeMapper.xml
@@ -29,9 +29,73 @@
<result column="lev1" property="lev1" />
</resultMap>
+ <sql id="nodeCondition">
+ <if test="host_id != null and host_id != ''">
+ and mld.host_id = #{host_id}
+ </if>
+ <if test="loc_no != null and loc_no != ''">
+ and mld.loc_no like concat('%',#{loc_no},'%')
+ </if>
+ <if test="locNo != null and locNo != ''">
+ and mld.loc_no like concat('%',#{loc_no},'%')
+ </if>
+ <if test="matnr != null and matnr != ''">
+ and mld.matnr like concat('%',#{matnr},'%')
+ </if>
+ <if test="maktx != null and maktx != ''">
+ and mld.maktx like concat('%',#{maktx},'%')
+ </if>
+ <if test="startTime!=null and endTime!=null">
+ and mld.update_time between #{startTime} and #{endTime}
+ </if>
+ </sql>
+ <update id="updateStockFreeze">
+ update man_node
+ set status = #{status}
+ , update_time = getdate()
+ where 1=1
+ and name = #{name}
+ </update>
<select id="selectByUuid" resultMap="BaseResultMap">
select * from man_node where 1=1 and uuid=#{uuid} and host_id = #{hostId} and status = 1
</select>
+ <select id="listByPage" resultMap="BaseResultMap">
+ select * from
+ (
+ SELECT
+ ROW_NUMBER() over (order by mld.create_time desc) as row,
+ mld.*
+ FROM man_loc_detl mld
+ LEFT JOIN man_node mn ON mld.node_id = mn.id
+ LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
+ LEFT JOIN man_tag mt ON mm.tag_id = mt.id
+ WHERE 1=1
+ AND (CHARINDEX(','+#{node_id}+',', ','+mn.path+',') > 0 OR mn.id = #{node_id})
+ AND (CHARINDEX(','+#{tag_id}+',', ','+mt.path+',') > 0 OR mt.id = #{tag_id})
+ <include refid="nodeCondition"></include>
+ ) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
+ </select>
+
+ <select id="listByPageCount" parameterType="java.util.Map" resultType="java.lang.Integer">
+ select
+ count(1)
+ FROM man_loc_detl mld
+ LEFT JOIN man_node mn ON mld.node_id = mn.id
+ LEFT JOIN man_mat mm ON mld.matnr = mm.matnr
+ LEFT JOIN man_tag mt ON mm.tag_id = mt.id
+ WHERE 1=1
+ AND (CHARINDEX(','+#{node_id}+',', ','+mn.path+',') > 0 OR mn.id = #{node_id})
+ AND (CHARINDEX(','+#{tag_id}+',', ','+mt.path+',') > 0 OR mt.id = #{tag_id})
+ <include refid="nodeCondition"></include>
+ </select>
+ <select id="getRommendLoc" resultType="java.lang.String">
+ select name from man_node
+ where level = 3
+ and (row1 >=#{rowBeg} and row1 <= #{rowEnd})
+ and (bay1 >=#{bayBeg} and bay1 <= #{bayEnd})
+ and (lev1 >=#{levBeg} and lev1 <= #{levEnd})
+
+ </select>
</mapper>
--
Gitblit v1.9.1