From 022ffe220344d387380fad4ffe33ebcf318c6eab Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期四, 09 七月 2020 10:42:08 +0800
Subject: [PATCH] 优化错别字

---
 java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml |   42 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml
index 326c309..76dec7e 100644
--- a/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml
@@ -60,7 +60,7 @@
             <if test="icon !=null and icon != ''">
                 t.icon= #{icon},
             </if>
-            <if test="label !=null and label != ''">
+            <if test="label !=null ">
                 t.label= #{label},
             </if>
             <if test="seq !=null ">
@@ -122,9 +122,9 @@
     <!-- 淇濆瓨璺敱淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
     <insert id="saveBasePrivilegeInfo" parameterType="Map">
         insert into p_privilege(
-        p_id,name,domain,description
+        p_id,name,resource,domain,description
         ) values (
-        #{pId},#{name},#{domain},#{description}
+        #{pId},#{name},#{resource},#{domain},#{description}
         )
 
     </insert>
@@ -132,7 +132,7 @@
 
     <!-- 鏌ヨ璺敱淇℃伅 add by wuxw 2018-07-03 -->
     <select id="getBasePrivilegeInfo" parameterType="Map" resultType="Map">
-        select t.p_id,t.name,t.domain,t.description,t.p_id pId,t.create_time createTime
+        select t.p_id,t.name,t.domain,t.resource,t.description,t.p_id pId,t.create_time createTime
         from p_privilege t
         where t.status_cd= '0'
         <if test="pId !=null and pId != ''">
@@ -140,6 +140,9 @@
         </if>
         <if test="name !=null and name != ''">
             and t.name like concat('%',#{name},'%')
+        </if>
+        <if test="resource !=null and resource != ''">
+            and t.resource = #{resource}
         </if>
         <if test="domain !=null and domain != ''">
             and t.domain= #{domain}
@@ -161,6 +164,9 @@
             </if>
             <if test="name !=null and name != ''">
                 t.name= #{name},
+            </if>
+            <if test="resource !=null and resource != ''">
+                t.resource= #{resource},
             </if>
             <if test="domain !=null and domain != ''">
                 t.domain= #{domain},
@@ -202,8 +208,14 @@
         <if test="name !=null and name != ''">
             and t.name like concat('%',#{name},'%')
         </if>
+        <if test="resource !=null and resource != ''">
+            and t.resource = #{resource}
+        </if>
         <if test="domain !=null and domain != ''">
             and t.domain= #{domain}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
         </if>
     </select>
 
@@ -397,5 +409,27 @@
         </if>
     </select>
 
+    <select id="checkUserHasResource" parameterType="Map" resultType="Map">
+        SELECT pp.*,'-1' AS pg_id,'' AS pg_name FROM p_privilege_user ppu,p_privilege pp
+            WHERE ppu.`p_id` = pp.`p_id`
+                AND pp.`resource` = #{resource}
+                AND ppu.`privilege_flag` = '0'
+                AND ppu.`user_id` = #{userId}
+                AND ppu.`status_cd` = '0'
+                AND pp.`status_cd` = '0'
+        UNION
+        SELECT pp.*,ppg.pg_id,ppg.name pg_name FROM p_privilege_user ppu,p_privilege_group ppg,p_privilege pp,p_privilege_rel ppr
+            WHERE ppu.`p_id` = ppr.pg_id
+                AND ppr.pg_id = ppg.pg_id
+                AND ppr.p_id = pp.`p_id`
+                AND pp.`resource` = #{resource}
+                AND ppu.`privilege_flag` = '1'
+                AND ppu.`user_id` = #{userId}
+                AND ppu.`status_cd` = '0'
+                AND pp.`status_cd` = '0'
+                AND ppg.status_cd = '0'
+                AND ppr.status_cd = '0'
+    </select>
+
 
 </mapper>

--
Gitblit v1.8.0