From 1416681fe19d6e9feb1538b1f64a2bcd7f53a5fe Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期五, 05 七月 2024 14:00:33 +0800
Subject: [PATCH] add getworklast

---
 pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 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 0aef9a4..046ca0c 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
@@ -9,6 +9,7 @@
         <result property="processId" column="process_id" jdbcType="BIGINT"/>
         <result property="sort" column="sort" jdbcType="INTEGER"/>
         <result property="content" column="content" jdbcType="VARCHAR"/>
+        <result property="nodeType" column="node_type" jdbcType="INTEGER"/>
         <result property="isStart" column="is_start" jdbcType="TINYINT"/>
         <result property="isEnd" column="is_end" jdbcType="TINYINT"/>
         <result property="isRecord" column="is_record" jdbcType="TINYINT"/>
@@ -21,7 +22,7 @@
 
     <sql id="Base_Column_List">
         id,process_id,sort,
-        content,is_start,is_end,
+        content,node_type,is_start,is_end,
         is_record,equip_cycle_content,deleted,
         remark
     </sql>
@@ -37,7 +38,9 @@
         from pr_production_node
         where  id = #{id,jdbcType=BIGINT} 
     </select>
-
+    <select id="selectNameByNodeId" parameterType="java.lang.Long" resultType="String">
+        select content from pr_production_node where id = #{id}
+    </select>
     <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
         delete from pr_production_node
         where  id = #{id,jdbcType=BIGINT} 
@@ -53,6 +56,7 @@
                 <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>
@@ -65,6 +69,7 @@
                 <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>
@@ -76,7 +81,7 @@
 
     <insert id="insertMany" parameterType="java.util.List">
        INSERT INTO pr_production_node (id,process_id,sort,
-        content,is_start,is_end,
+        content,node_type,is_start,is_end,
         is_record,equip_cycle_content,deleted,
         remark) VALUES
        <foreach item="item" index="index" collection="list" open="(" separator="),(" close=")">
@@ -84,6 +89,7 @@
            #{item.processId},
            #{item.sort},
            #{item.content},
+           #{item.nodeType},
            #{item.isStart},
            #{item.isEnd},
            #{item.isRecord},
@@ -105,6 +111,9 @@
                 </if>
                 <if test="content != null">
                     content = #{content,jdbcType=VARCHAR},
+                </if>
+                <if test="nodeType != null">
+                    node_type = #{nodeType,jdbcType=INTEGER},
                 </if>
                 <if test="isStart != null">
                     is_start = #{isStart,jdbcType=TINYINT},
@@ -144,6 +153,13 @@
             </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">
         update pr_production_node set deleted = 1

--
Gitblit v1.8.0