From 05683f2b2bdbdbe21cf17ad523c21ab338bd1c54 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期二, 19 七月 2022 21:49:55 +0800
Subject: [PATCH] 优化添加设备 功能
---
java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml | 60 +++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 45 insertions(+), 15 deletions(-)
diff --git a/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml
old mode 100644
new mode 100755
index ee5e218..7994579
--- a/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/community/MenuServiceDaoImplMapper.xml
@@ -8,9 +8,9 @@
<!-- 淇濆瓨璺敱淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
<insert id="saveMenuGroupInfo" parameterType="Map">
insert into m_menu_group(
- g_id,name,icon,label,seq,description,group_type,store_type_cd
+ g_id,name,icon,label,seq,description,group_type,store_type
) values (
- #{gId},#{name},#{icon},#{label},#{seq},#{description},#{groupType},#{storeTypeCd}
+ #{gId},#{name},#{icon},#{label},#{seq},#{description},#{groupType},#{storeType}
)
</insert>
@@ -18,7 +18,7 @@
<!-- 鏌ヨ璺敱淇℃伅 add by wuxw 2018-07-03 -->
<select id="getMenuGroupInfo" parameterType="Map" resultType="Map">
- select t.g_id,t.name,t.icon,t.label,t.seq,t.description,t.g_id gId,t.group_type groupType,t.store_type_cd storeTypeCd
+ select t.g_id,t.name,t.icon,t.label,t.seq,t.description,t.g_id gId,t.group_type groupType,t.store_type storeType
from m_menu_group t
where t.status_cd= '0'
<if test="gId !=null and gId != ''">
@@ -36,8 +36,8 @@
<if test="groupType !=null and groupType != ''">
and t.group_type= #{groupType}
</if>
- <if test="storeTypeCd !=null and storeTypeCd != ''">
- and t.store_type_cd= #{storeTypeCd}
+ <if test="storeType !=null and storeType != ''">
+ and t.store_type= #{storeType}
</if>
<if test="seq !=null">
and t.seq= #{seq}
@@ -76,8 +76,8 @@
<if test="seq !=null ">
t.seq= #{seq},
</if>
- <if test="storeTypeCd !=null and storeTypeCd != ''">
- t.store_type_cd= #{storeTypeCd},
+ <if test="storeType !=null and storeType != ''">
+ t.store_type= #{storeType},
</if>
<if test="description !=null and description != ''">
t.description= #{description}
@@ -91,7 +91,7 @@
<select id="queryMenuGroupsCount" parameterType="Map" resultType="Map">
select count(1) count
from m_menu_group t
- where 1 =1
+ where t.status_cd= '0'
<if test="gId !=null and gId != ''">
and t.g_id= #{gId}
</if>
@@ -113,8 +113,8 @@
<if test="seq !=null">
and t.seq= #{seq}
</if>
- <if test="storeTypeCd !=null and storeTypeCd != ''">
- and t.store_type_cd= #{storeTypeCd}
+ <if test="storeType !=null and storeType != ''">
+ and t.store_type= #{storeType}
</if>
<if test="description !=null and description != ''">
and t.description= #{description}
@@ -146,8 +146,9 @@
<!-- 鏌ヨ璺敱淇℃伅 add by wuxw 2018-07-03 -->
<select id="getBasePrivilegeInfo" parameterType="Map" resultType="Map">
- select t.p_id,t.name,t.domain,t.resource,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,st.name stName
from p_privilege t
+ left join store_type st on t.domain=st.store_type_cd
where t.status_cd= '0'
<if test="pId !=null and pId != ''">
and t.p_id= #{pId}
@@ -253,11 +254,13 @@
<select id="getMenuInfo" parameterType="Map" resultType="Map">
select DISTINCT t.m_id mId,t.name,t.g_id gId,t.url,t.seq,t.p_id pId,t.description,t.is_show isShow,
if(t.is_show='Y','鏄剧ず','涓嶆樉绀�') isShowName,
- t.m_id pId,t.name pName
- from m_menu t,p_privilege p
+ t.m_id pId,t.name pName,mg.name menuGroupName,mg.store_type,st.name storeTypeName
+ from m_menu t,p_privilege p,m_menu_group mg,store_type st
where t.status_cd= '0'
and p.status_cd= '0'
and t.m_id = p.m_id
+ and t.g_id = mg.g_id
+ and mg.store_type = st.store_type_cd
<if test="gId !=null and gId != ''">
and t.g_id= #{gId}
</if>
@@ -316,7 +319,7 @@
AND ppr.status_cd = '0'
)
</if>
- order by t.seq asc
+ order by t.seq
<if test="page != -1 and page != null ">
limit #{page}, #{row}
</if>
@@ -359,10 +362,12 @@
<!-- 鏌ヨ璺敱鏁伴噺 add by wuxw 2018-07-03 -->
<select id="queryMenusCount" parameterType="Map" resultType="Map">
select count(DISTINCT(t.m_id)) count
- from m_menu t,p_privilege p
+ from m_menu t,p_privilege p,m_menu_group mg,store_type st
where t.status_cd= '0'
and p.status_cd= '0'
and t.m_id = p.m_id
+ and t.g_id = mg.g_id
+ and mg.store_type = st.store_type_cd
<if test="gId !=null and gId != ''">
and t.g_id= #{gId}
</if>
@@ -452,5 +457,30 @@
AND ppr.status_cd = '0'
</select>
+ <select id="hasPrivilege" parameterType="Map" resultType="Map">
+ SELECT DISTINCT tt.p_id `pId`,tt.name,tt.pg_id pgId,tt.pg_name pgName,tt.description,tt.create_time createTime FROM (
+ 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.p_id = #{pId}
+ 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.p_id = #{pId}
+ 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'
+ ) tt
+ </select>
+
+
</mapper>
--
Gitblit v1.8.0