From 591e3b8a10ed15023f3ad9e5a72a887ef89b0bb2 Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期一, 26 八月 2024 20:47:46 +0800
Subject: [PATCH] 修改判空方式
---
pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml | 100 ++++++++++++++++++++++++++++---------------------
1 files changed, 57 insertions(+), 43 deletions(-)
diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
index dffaf9f..646cb91 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
@@ -13,7 +13,7 @@
<result property="isStart" column="is_start" jdbcType="TINYINT"/>
<result property="isEnd" column="is_end" jdbcType="TINYINT"/>
<result property="isRecord" column="is_record" jdbcType="TINYINT"/>
- <result property="equipCycleContent" column="equip_cycle_content" jdbcType="VARCHAR"/>
+ <result property="deviceCycleContent" column="device_cycle_content" jdbcType="VARCHAR"/>
<result property="deleted" column="deleted" jdbcType="TINYINT"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<association property="instruction"
@@ -23,7 +23,7 @@
<sql id="Base_Column_List">
id,process_id,sort,
content,node_type,is_start,is_end,
- is_record,equip_cycle_content,deleted,
+ is_record,device_cycle_content,deleted,
remark
</sql>
@@ -49,40 +49,47 @@
delete from pr_production_node
where process_id = #{processId,jdbcType=BIGINT}
</delete>
+ <delete id="deleteByNodeId" parameterType="arraylist">
+ delete from pr_production_node
+ where id in
+ <foreach collection="list" item="item" index="index" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </delete>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrProductionNode" useGeneratedKeys="true">
insert into pr_production_node
<trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">id,</if>
- <if test="processId != null">process_id,</if>
- <if test="sort != null">sort,</if>
- <if test="content != null">content,</if>
- <if test="nodeType != null">node_type,</if>
- <if test="isStart != null">is_start,</if>
- <if test="isEnd != null">is_end,</if>
- <if test="isRecord != null">is_record,</if>
- <if test="equipCycleContent != null">equip_cycle_content,</if>
- <if test="deleted != null">deleted,</if>
- <if test="remark != null">remark,</if>
+ <if test="id != null and id !=''">id,</if>
+ <if test="isEnd!= null and isEnd !=''">process_id,</if>
+ <if test="sort != null and sort !=''">sort,</if>
+ <if test="content != null and content !=''">content,</if>
+ <if test="nodeType!= null and nodeType !=''">node_type,</if>
+ <if test="isStart!= null and isStart !=''">is_start,</if>
+ <if test="isEnd!= null and isEnd !=''">is_end,</if>
+ <if test="isRecord!= null and isRecord !=''">is_record,</if>
+ <if test="deviceCycleContent != null and deviceCycleContent !=''">device_cycle_content,</if>
+ <if test="deleted != null and deleted !=''">deleted,</if>
+ <if test="remark != null and remark !=''">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">#{id,jdbcType=BIGINT},</if>
- <if test="processId != null">#{processId,jdbcType=BIGINT},</if>
- <if test="sort != null">#{sort,jdbcType=INTEGER},</if>
- <if test="content != null">#{content,jdbcType=VARCHAR},</if>
- <if test="nodeType != null">#{nodeType,jdbcType=INTEGER},</if>
- <if test="isStart != null">#{isStart,jdbcType=TINYINT},</if>
- <if test="isEnd != null">#{isEnd,jdbcType=TINYINT},</if>
- <if test="isRecord != null">#{isRecord,jdbcType=TINYINT},</if>
- <if test="equipCycleContent != null">#{equipCycleContent,jdbcType=VARCHAR},</if>
- <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if>
- <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
+ <if test="id != null and id !=''">#{id,jdbcType=BIGINT},</if>
+ <if test="isEnd!= null and isEnd !=''">#{processId,jdbcType=BIGINT},</if>
+ <if test="sort != null and sort !=''">#{sort,jdbcType=INTEGER},</if>
+ <if test="content != null and content !=''">#{content,jdbcType=VARCHAR},</if>
+ <if test="nodeType!= null and nodeType !=''">#{nodeType,jdbcType=INTEGER},</if>
+ <if test="isStart!= null and isStart !=''">#{isStart,jdbcType=TINYINT},</if>
+ <if test="isEnd!= null and isEnd !=''">#{isEnd,jdbcType=TINYINT},</if>
+ <if test="isRecord!= null and isRecord !=''">#{isRecord,jdbcType=TINYINT},</if>
+ <if test="deviceCycleContent != null and deviceCycleContent !=''">#{deviceCycleContent,jdbcType=VARCHAR},</if>
+ <if test="deleted != null and deleted !=''">#{deleted,jdbcType=TINYINT},</if>
+ <if test="remark != null and remark !=''">#{remark,jdbcType=VARCHAR},</if>
</trim>
</insert>
<insert id="insertMany" parameterType="java.util.List">
INSERT INTO pr_production_node (id,process_id,sort,
content,node_type,is_start,is_end,
- is_record,equip_cycle_content,deleted,
+ is_record,device_cycle_content,deleted,
remark) VALUES
<foreach item="item" index="index" collection="list" open="(" separator="),(" close=")">
#{item.id},
@@ -93,7 +100,7 @@
#{item.isStart},
#{item.isEnd},
#{item.isRecord},
- #{item.equipCycleContent},
+ #{item.deviceCycleContent},
#{item.deleted},
#{item.remark}
</foreach>
@@ -103,34 +110,34 @@
<update id="updateByPrimaryKeySelective" parameterType="com.dy.pmsGlobal.pojoPr.PrProductionNode">
update pr_production_node
<set>
- <if test="processId != null">
+ <if test="isEnd!= null and isEnd !=''">
process_id = #{processId,jdbcType=BIGINT},
</if>
- <if test="sort != null">
+ <if test="sort != null and sort !=''">
sort = #{sort,jdbcType=INTEGER},
</if>
- <if test="content != null">
+ <if test="content != null and content !=''">
content = #{content,jdbcType=VARCHAR},
</if>
- <if test="nodeType != null">
+ <if test="nodeType!= null and nodeType !=''">
node_type = #{nodeType,jdbcType=INTEGER},
</if>
- <if test="isStart != null">
+ <if test="isStart!= null and isStart !=''">
is_start = #{isStart,jdbcType=TINYINT},
</if>
- <if test="isEnd != null">
+ <if test="isEnd!= null and isEnd !=''">
is_end = #{isEnd,jdbcType=TINYINT},
</if>
- <if test="isRecord != null">
+ <if test="isRecord!= null and isRecord !=''">
is_record = #{isRecord,jdbcType=TINYINT},
</if>
- <if test="equipCycleContent != null">
- equip_cycle_content = #{equipCycleContent,jdbcType=VARCHAR},
+ <if test="deviceCycleContent != null and deviceCycleContent !=''">
+ device_cycle_content = #{deviceCycleContent,jdbcType=VARCHAR},
</if>
- <if test="deleted != null">
+ <if test="deleted != null and deleted !=''">
deleted = #{deleted,jdbcType=TINYINT},
</if>
- <if test="remark != null">
+ <if test="remark != null and remark !=''">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
@@ -142,16 +149,23 @@
<include refid="Base_Column_List" />
from pr_production_node
<trim prefix="where" suffixOverrides="and">
- <if test="processId != null">
+ <if test="processId!= null and processId !=''">
process_id = #{processId,jdbcType=BIGINT} and
</if>
</trim>
order by sort asc
- <trim prefix="limit " >
- <if test="start != null and count != null">
- #{start}, #{count}
- </if>
- </trim>
+<!-- <trim prefix="limit " >-->
+<!-- <if test="start != null and count != null">-->
+<!-- #{start}, #{count}-->
+<!-- </if>-->
+<!-- </trim>-->
+ </select>
+ <select id="isEndNode" resultType="java.lang.Boolean">
+ select
+ n.sort >=n1.sort
+ from pr_production_node n
+ left join pr_production_node n1 on n.process_id = n1.process_id
+ where n1.id = #{id} and n.is_end=1
</select>
<update id="deleteLogicById" parameterType="java.lang.Long">
--
Gitblit v1.8.0