From 09ee5added9d59e90310a2586e846137ea597b19 Mon Sep 17 00:00:00 2001
From: LSH
Date: 星期五, 01 十二月 2023 13:15:42 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/PlanUrlMapper.xml |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/src/main/resources/mapper/PlanUrlMapper.xml b/src/main/resources/mapper/PlanUrlMapper.xml
index 5c4ede6..3b3c260 100644
--- a/src/main/resources/mapper/PlanUrlMapper.xml
+++ b/src/main/resources/mapper/PlanUrlMapper.xml
@@ -21,28 +21,32 @@
         select id from man_plan_url
         where 1=1
         and plan_id=#{planId}
-    </select>
-
-    <select id="selectPlanUrlIdByPlanId2" resultType="java.lang.Integer">
-        select id from man_plan_url
-        where 1=1
-        and plan_id=#{planId}
-        and type = #{type}
-        and hide_url = #{hideUrl}
+        <if test="type != 0">
+            and type=#{type}
+        </if>
+        <if test="hideUrl != 0">
+            and hide_url=#{hideUrl}
+        </if>
+        <if test="status != 0">
+            and status=#{status}
+        </if>
+        or (plan_id=#{planId} and hide_url=0 )
     </select>
 
     <select id="selectPlanUrlByPlanId" resultMap="BaseResultMap">
         select * from man_plan_url
         where 1=1
         and plan_id=#{planId}
-    </select>
-
-    <select id="selectPlanUrlByPlanId2" resultMap="BaseResultMap">
-        select * from man_plan_url
-        where 1=1
-        and plan_id=#{planId}
-        and type = #{type}
-        and hide_url = #{hideUrl}
+        <if test="type != 0">
+            and type=#{type}
+        </if>
+        <if test="hideUrl != 0">
+            and hide_url=#{hideUrl}
+        </if>
+        <if test="status != 0">
+            and status=#{status}
+        </if>
+        or (plan_id=#{planId} and hide_url=0 )
     </select>
 
 </mapper>

--
Gitblit v1.9.1