From 207823b94f5627fae49d29b51b5ce7186a70c8e0 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期六, 04 一月 2025 09:59:48 +0800
Subject: [PATCH] #
---
src/main/resources/mapper/NodeMapper.xml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/NodeMapper.xml b/src/main/resources/mapper/NodeMapper.xml
index c83cd82..ac96844 100644
--- a/src/main/resources/mapper/NodeMapper.xml
+++ b/src/main/resources/mapper/NodeMapper.xml
@@ -24,11 +24,63 @@
<result column="update_time" property="updateTime" />
<result column="update_by" property="updateBy" />
<result column="memo" property="memo" />
+ <result column="row1" property="row1" />
+ <result column="bay1" property="bay1" />
+ <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>
<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>
</mapper>
--
Gitblit v1.9.1