Browse Source

修复部分sql未加is_deleted筛选

test
smallchill 6 years ago
parent
commit
66a2c96d5a
  1. 5
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/ClientMapper.xml
  2. 6
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictMapper.xml
  3. 100
      blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml
  4. 3
      blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml

5
blade-service/blade-system/src/main/java/org/springblade/system/mapper/ClientMapper.xml

@ -18,9 +18,4 @@
<result column="remark" property="remark"/>
</resultMap>
<select id="selectClientPage" resultMap="clientResultMap">
select * from blade_client where is_deleted = 0
</select>
</mapper>

6
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictMapper.xml

@ -35,18 +35,18 @@
<select id="getValue" resultType="java.lang.String">
select
dict_value
from blade_dict where code = #{param1} and dict_key = #{param2} limit 1
from blade_dict where code = #{param1} and dict_key = #{param2} and is_deleted = 0 limit 1
</select>
<!-- oracle 版本 -->
<!--<select id="getValue" resultType="java.lang.String">
select
dict_value
from blade_dict where code = #{param1, jdbcType=VARCHAR} and dict_key = #{param2} rownum 1
from blade_dict where code = #{param1, jdbcType=VARCHAR} and dict_key = #{param2} and dict_key >= 0 rownum 1
</select>-->
<select id="getList" resultMap="dictResultMap">
select code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1}
select code, dict_key, dict_value, sort, remark from blade_dict where code = #{param1} and dict_key >= 0 and is_deleted = 0
</select>
<select id="tree" resultMap="treeNodeResultMap">

100
blade-service/blade-system/src/main/java/org/springblade/system/mapper/MenuMapper.xml

@ -30,7 +30,7 @@
<!-- 通用查询结果列 -->
<sql id="baseColumnList">
select
id, code, parent_code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted
id, code, parent_code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted
</sql>
<select id="selectMenuPage" resultMap="menuResultMap">
@ -46,7 +46,7 @@
</select>
<select id="roleMenu" resultMap="menuResultMap">
select * from blade_menu where is_deleted = 0 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
select * from blade_menu where is_deleted = 0 and id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
@ -54,58 +54,58 @@
<select id="routes" resultMap="menuResultMap">
SELECT
*
*
FROM
blade_menu
blade_menu
WHERE
category = 1
AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
is_deleted = 0 and category = 1
and id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach> )
</select>
<select id="buttons" resultMap="menuResultMap">
SELECT
id,
parent_id,
`code`,
`name`,
alias,
path,
source,
action,
sort
id,
parent_id,
`code`,
`name`,
alias,
path,
source,
action,
sort
FROM
blade_menu
blade_menu
WHERE
id IN (
SELECT parent_id FROM blade_menu
WHERE ( category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
) ) )
is_deleted = 0 and id IN (
SELECT parent_id FROM blade_menu
WHERE ( category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
) ) )
UNION ALL
SELECT
id,
parent_id,
`code`,
`name`,
alias,
path,
source,
action,
sort
id,
parent_id,
`code`,
`name`,
alias,
path,
source,
action,
sort
FROM
blade_menu
blade_menu
WHERE
( category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>) )
is_deleted = 0 and category = 2 AND id IN ( SELECT menu_id FROM blade_role_menu WHERE role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>)
</select>
<select id="grantTree" resultMap="treeNodeResultMap">
@ -129,18 +129,18 @@
<select id="authRoutes" resultType="org.springblade.system.dto.MenuDTO">
SELECT
GROUP_CONCAT(r.role_alias) as alias,
m.path
GROUP_CONCAT(r.role_alias) as alias,
m.path
FROM
blade_role_menu rm
LEFT JOIN blade_menu m ON rm.menu_id = m.id
LEFT JOIN blade_role r ON rm.role_id = r.id
blade_role_menu rm
LEFT JOIN blade_menu m ON rm.menu_id = m.id
LEFT JOIN blade_role r ON rm.role_id = r.id
WHERE
rm.role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND m.path IS NOT NULL
rm.role_id IN
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
AND m.path IS NOT NULL and m.is_deleted = 0
GROUP BY m.path
</select>

3
blade-service/blade-user/src/main/java/org/springblade/system/user/mapper/UserMapper.xml

@ -59,6 +59,7 @@
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
<select id="getRoleAlias" resultType="java.lang.String">
@ -71,6 +72,7 @@
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
<select id="getDeptName" resultType="java.lang.String">
@ -83,6 +85,7 @@
<foreach collection="array" item="ids" index="index" open="(" close=")" separator=",">
#{ids}
</foreach>
and is_deleted = 0
</select>
</mapper>

Loading…
Cancel
Save