From 014b2f06e5b6b72c86134279e5766f1e413b315c Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期四, 07 十二月 2023 16:34:33 +0800
Subject: [PATCH] Mapper.xml文件中,查询条件中字符串属性条件判断,增加不是空串的判断。

---
 pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
index 4182d95..1110ae8 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaBlockMapper.xml
@@ -40,13 +40,13 @@
     count(*)
     from ba_block
       <trim prefix="where " suffixOverrides="and">
-        <if test="name != null">
+        <if test="name != null and name != ''">
           name like concat('%', #{name}, '%') and
         </if>
-        <if test="header != null">
+        <if test="header != null and header != ''">
           header like concat('%', #{header}, '%') and
         </if>
-        <if test="phone != null">
+        <if test="phone != null and phone != ''">
           phone = '#{phone,jdbcType=VARCHAR}' and
         </if>
         <if test="area != null">
@@ -60,13 +60,13 @@
     <include refid="Base_Column_List" />
     from ba_block
     <trim prefix="where " suffixOverrides="and">
-      <if test="name != null">
+      <if test="name != null and name != ''">
         name like concat('%', #{name}, '%') and
       </if>
-      <if test="header != null">
+      <if test="header != null and header != ''">
         header = '#{header,jdbcType=VARCHAR}' and
       </if>
-      <if test="phone != null">
+      <if test="phone != null and phone != ''">
         phone = '#{phone,jdbcType=VARCHAR}' and
       </if>
       <if test="area != null">
@@ -76,12 +76,12 @@
     order by id DESC
     <trim prefix="limit " >
       <if test="start != null and count != null">
-        #{start}, #{count}
+        #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
       </if>
     </trim>
   </select>
 
-  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoBa.BaBlock">
+  <insert id="putin" parameterType="com.dy.pipIrrGlobal.pojoBa.BaBlock">
     <!--@mbg.generated-->
     insert into ba_block (id, `name`, `header`, phone, area, color, remark, deleted)
     values (#{id,jdbcType=BIGINT},

--
Gitblit v1.8.0