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/PrScheduleMapper.xml |   38 +++++++++++++++++++-------------------
 1 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/PrScheduleMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/PrScheduleMapper.xml
index 745d8ee..401102e 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/PrScheduleMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/PrScheduleMapper.xml
@@ -41,36 +41,36 @@
     <!--@mbg.generated-->
     insert into pr_schedule
     <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+      <if test="id != null and id !=''">
         id,
       </if>
-      <if test="userId != null">
+      <if test="userId != null and userId !=''">
         user_id,
       </if>
-      <if test="scheduleDate != null">
+      <if test="scheduleDate != null and scheduleDate !=''">
         schedule_date,
       </if>
-      <if test="deleted != null">
+      <if test="deleted != null and deleted !=''">
         deleted,
       </if>
-      <if test="dt != null">
+      <if test="dt != null and dt !=''">
         dt,
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
+      <if test="id != null and id !=''">
         #{id,jdbcType=BIGINT},
       </if>
-      <if test="userId != null">
+      <if test="userId != null and userId !=''">
         #{userId,jdbcType=BIGINT},
       </if>
-      <if test="scheduleDate != null">
+      <if test="scheduleDate != null  and scheduleDate !=''">
         #{scheduleDate,jdbcType=VARCHAR},
       </if>
-      <if test="deleted != null">
+      <if test="deleted != null and deleted !=''">
         #{deleted,jdbcType=TINYINT},
       </if>
-      <if test="dt != null">
+      <if test="dt != null and dt !=''">
         #{dt,jdbcType=TIMESTAMP},
       </if>
     </trim>
@@ -79,13 +79,13 @@
     <!--@mbg.generated-->
     update pr_schedule
     <set>
-      <if test="userId != null">
+      <if test="userId != null and userId !=''">
         user_id = #{userId,jdbcType=BIGINT},
       </if>
-      <if test="scheduleDate != null">
+      <if test="scheduleDate != null  and scheduleDate !=''">
         schedule_date = #{scheduleDate,jdbcType=VARCHAR},
       </if>
-      <if test="deleted != null">
+      <if test="deleted != null and deleted !=''">
         deleted = #{deleted,jdbcType=TINYINT},
       </if>
     </set>
@@ -104,10 +104,10 @@
     select count(1)
     from pr_schedule
     where deleted = 0
-    <if test="userId != null">
+    <if test="userId != null and userId !=''">
       and user_id = #{userId,jdbcType=BIGINT}
     </if>
-    <if test="scheduleDate != null">
+    <if test="scheduleDate != null  and scheduleDate !=''">
       and schedule_date = #{scheduleDate,jdbcType=VARCHAR}
     </if>
   </select>
@@ -117,10 +117,10 @@
     <include refid="Base_Column_List" />
     from pr_schedule
     where deleted = 0
-    <if test="userId != null">
+    <if test="userId != null and userId !=''">
       and user_id = #{userId}
     </if>
-    <if test="scheduleDate != null">
+    <if test="scheduleDate != null  and scheduleDate !=''">
       and schedule_date = #{scheduleDate}
     </if>
   </select>
@@ -130,10 +130,10 @@
     <include refid="Base_Column_List" />
     from pr_schedule
     where deleted = 0
-    <if test="userId != null">
+    <if test="userId != null  and userId !=''">
       and user_id = #{userId}
     </if>
-    <if test="scheduleDate != null">
+    <if test="scheduleDate != null  and scheduleDate !=''">
       and schedule_date = #{scheduleDate}
     </if>
     order by schedule_date desc

--
Gitblit v1.8.0