From 5b207a55bdd10f1516031f629217daac069b64fd Mon Sep 17 00:00:00 2001
From: 刘小明 <liuxm_a@163.com>
Date: 星期五, 30 八月 2024 11:40:31 +0800
Subject: [PATCH] 添加免登录查询所有排班接口;

---
 pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml |   85 +++++++++++++++++++++++++++---------------
 1 files changed, 54 insertions(+), 31 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 7f4b6e1..05fdb15 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrProductionNodeMapper.xml
@@ -9,35 +9,38 @@
         <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"/>
-        <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"
-            column="id" javaType="java.lang.Long" select="selectProNameById" fetchType="eager" />
+            column="id" javaType="java.lang.Long" select="com.dy.pmsGlobal.daoPr.PrWorkingInstructionMapper.selectByNodeId" fetchType="eager" />
     </resultMap>
 
     <sql id="Base_Column_List">
         id,process_id,sort,
-        content,is_start,is_end,
-        is_record,equip_cycle_content,deleted,
+        content,node_type,is_start,is_end,
+        is_record,device_cycle_content,deleted,
         remark
     </sql>
 
-    <select id="selectProNameById" resultMap="com.dy.pmsGlobal.daoPr.PrWorkingInstructionMapper.BaseResultMap">
-        select *
-        from pr_working_instruction
-        where node_id = #{id,jdbcType=BIGINT}
-    </select>
+<!--    <select id="selectProNameById" resultMap="com.dy.pmsGlobal.daoPr.PrWorkingInstructionMapper.BaseResultMap">-->
+<!--        select *-->
+<!--        from pr_working_instruction-->
+<!--        where node_id = #{id,jdbcType=BIGINT}-->
+<!--    </select>-->
     <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List" />
         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} 
@@ -46,48 +49,58 @@
         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="processId!= null">process_id,</if>
                 <if test="sort != null">sort,</if>
-                <if test="content != null">content,</if>
+                <if test="content != null and content !=''">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="deviceCycleContent != null and deviceCycleContent !=''">device_cycle_content,</if>
                 <if test="deleted != null">deleted,</if>
-                <if test="remark != null">remark,</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="isEnd != null">#{processId,jdbcType=BIGINT},</if>
                 <if test="sort != null">#{sort,jdbcType=INTEGER},</if>
-                <if test="content != null">#{content,jdbcType=VARCHAR},</if>
+                <if test="content != null and content !=''">#{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="deviceCycleContent != null and deviceCycleContent !=''">#{deviceCycleContent,jdbcType=VARCHAR},</if>
                 <if test="deleted != null">#{deleted,jdbcType=TINYINT},</if>
-                <if test="remark != null">#{remark,jdbcType=VARCHAR},</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,is_start,is_end,
-        is_record,equip_cycle_content,deleted,
+        content,node_type,is_start,is_end,
+        is_record,device_cycle_content,deleted,
         remark) VALUES
        <foreach item="item" index="index" collection="list" open="(" separator="),(" close=")">
            #{item.id},
            #{item.processId},
            #{item.sort},
            #{item.content},
+           #{item.nodeType},
            #{item.isStart},
            #{item.isEnd},
            #{item.isRecord},
-           #{item.equipCycleContent},
+           #{item.deviceCycleContent},
            #{item.deleted},
            #{item.remark}
        </foreach>
@@ -103,8 +116,11 @@
                 <if test="sort != null">
                     sort = #{sort,jdbcType=INTEGER},
                 </if>
-                <if test="content != null">
+                <if test="content != null and content !=''">
                     content = #{content,jdbcType=VARCHAR},
+                </if>
+                <if test="nodeType != null">
+                    node_type = #{nodeType,jdbcType=INTEGER},
                 </if>
                 <if test="isStart != null">
                     is_start = #{isStart,jdbcType=TINYINT},
@@ -115,13 +131,13 @@
                 <if test="isRecord != null">
                     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">
                     deleted = #{deleted,jdbcType=TINYINT},
                 </if>
-                <if test="remark != null">
+                <if test="remark != null and remark !=''">
                     remark = #{remark,jdbcType=VARCHAR},
                 </if>
         </set>
@@ -133,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">
                 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