From c488d63b58458ea0dee56ffbb4c5b66b2141d4f1 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 30 五月 2025 09:59:30 +0800
Subject: [PATCH] 去除画蛇添足代码

---
 pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml
index e80217e..2bd1653 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrDeviceMapper.xml
@@ -32,27 +32,27 @@
         delete from pr_device
         where  batch_id = #{batchId,jdbcType=BIGINT}
     </delete>
-    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrDevice" useGeneratedKeys="true">
+    <insert id="insert" parameterType="com.dy.pmsGlobal.pojoPr.PrDevice">
         insert into pr_device
         ( id,pro_id,batch_id
         ,device_no,status)
         values (#{id,jdbcType=BIGINT},#{proId,jdbcType=BIGINT},#{batchId,jdbcType=BIGINT}
         ,#{deviceNo,jdbcType=BIGINT},#{status,jdbcType=TINYINT})
     </insert>
-    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.dy.pmsGlobal.pojoPr.PrDevice" useGeneratedKeys="true">
+    <insert id="insertSelective" parameterType="com.dy.pmsGlobal.pojoPr.PrDevice">
         insert into pr_device
         <trim prefix="(" suffix=")" suffixOverrides=",">
                 <if test="id != null">id,</if>
                 <if test="proId != null">pro_id,</if>
                 <if test="batchId != null">batch_id,</if>
-                <if test="deviceNo != null">device_no,</if>
+                <if test="deviceNo != null and deviceNo !=''">device_no,</if>
                 <if test="status != null">status,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
                 <if test="id != null">#{id,jdbcType=BIGINT},</if>
                 <if test="proId != null">#{proId,jdbcType=BIGINT},</if>
                 <if test="batchId != null">#{batchId,jdbcType=BIGINT},</if>
-                <if test="deviceNo != null">#{deviceNo},</if>
+                <if test="deviceNo != null and deviceNo !=''">#{deviceNo},</if>
                 <if test="status != null">#{status,jdbcType=TINYINT},</if>
         </trim>
     </insert>
@@ -78,7 +78,7 @@
                 <if test="batchId != null">
                     batch_id = #{batchId,jdbcType=BIGINT},
                 </if>
-                <if test="deviceNo != null">
+                <if test="deviceNo != null and deviceNo !=''">
                     device_no = #{deviceNo},
                 </if>
                 <if test="status != null">
@@ -111,7 +111,7 @@
                 <if test="batchId != null">
                     batch_id = #{batchId,jdbcType=BIGINT} and
                 </if>
-                <if test="deviceNo != null">
+                <if test="deviceNo != null and deviceNo !=''">
                     device_no = #{deviceNo,jdbcType=BIGINT} and
                 </if>
                 <if test="status != null">
@@ -139,7 +139,7 @@
                 <if test="batchId != null">
                     batch_id = #{batchId,jdbcType=BIGINT} and
                 </if>
-                <if test="deviceNo != null">
+                <if test="deviceNo != null and deviceNo !=''">
                     device_no = #{deviceNo,jdbcType=BIGINT} and
                 </if>
                 <if test="status != null">

--
Gitblit v1.8.0