From bda1153c2e149098782b6b25970a5aba0bb74640 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Fri, 12 Nov 2021 09:15:28 +0800
Subject: [PATCH] 1.许可

---
 src/main/java/org/springblade/modules/permit/mapper/PermitMapper.xml |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/springblade/modules/permit/mapper/PermitMapper.xml b/src/main/java/org/springblade/modules/permit/mapper/PermitMapper.xml
index 75cf977..29bf619 100644
--- a/src/main/java/org/springblade/modules/permit/mapper/PermitMapper.xml
+++ b/src/main/java/org/springblade/modules/permit/mapper/PermitMapper.xml
@@ -35,16 +35,25 @@
 
 
     <select id="selectPermitPage" resultMap="permitResultMap">
-        select * from sys_permit where 1=1
+        select si.* from sys_permit si left join
+        sys_jurisdiction sj
+        on
+        sj.id = si.jurisdiction where 1=1
         <if test="permit.ptype!=null and permit.ptype!=''">
-              and  ptype=#{permit.ptype}
+              and  si.ptype=#{permit.ptype}
         </if>
-        <if test="permit.usetype=='1'.toString()">
-            and jurisdiction in(${jurisdiction})
+        <if test="permit.jurisdiction!=null and permit.jurisdiction != '' and permit.jurisdiction!='1372091709474910209'">
+            and (sj.id = #{permit.jurisdiction} or sj.parent_id = #{permit.jurisdiction})
         </if>
-        <if test="permit.usetype=='2'.toString()">
-            and  jurisdiction=#{permit.jurisdiction}
-        </if>
+<!--        <if test="permit.usetype=='1'.toString()">-->
+<!--            and si.jurisdiction in(${jurisdiction})-->
+<!--        </if>-->
+<!--        <if test="permit.usetype=='2'.toString()">-->
+<!--            and  si.jurisdiction=#{permit.jurisdiction}-->
+<!--        </if>-->
+<!--        <if test="permit.usetype==''.toString()">-->
+<!--            and  si.jurisdiction=#{permit.jurisdiction}-->
+<!--        </if>-->
     </select>
 
     <select id="selectIn" resultType="java.util.HashMap">

--
Gitblit v1.9.3