refactor: 字典模块重构
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.youlai.boot.system.mapper.DictDataMapper">
|
||||
<mapper namespace="com.youlai.boot.system.mapper.DictItemMapper">
|
||||
|
||||
<!-- 获取字典数据分页列表 -->
|
||||
<select id="getDictDataPage" resultType="com.youlai.boot.system.model.vo.DictDataPageVO">
|
||||
<select id="getDictItemPage" resultType="com.youlai.boot.system.model.vo.DictItemPageVO">
|
||||
SELECT
|
||||
id,
|
||||
dict_code,
|
||||
@@ -14,7 +14,7 @@
|
||||
sort,
|
||||
status
|
||||
FROM
|
||||
sys_dict_data
|
||||
sys_dict_item
|
||||
<where>
|
||||
<if test="queryParams.keywords!=null and queryParams.keywords.trim() neq ''">
|
||||
AND (
|
||||
@@ -36,7 +36,7 @@
|
||||
label,
|
||||
tag_type
|
||||
FROM
|
||||
sys_dict_data
|
||||
sys_dict_item
|
||||
WHERE
|
||||
status = 1 AND dict_code = #{dictCode}
|
||||
ORDER BY
|
||||
@@ -26,25 +26,4 @@
|
||||
t1.create_time DESC
|
||||
</select>
|
||||
|
||||
<resultMap id="DictWithDataMap" type="com.youlai.boot.system.model.vo.DictVO">
|
||||
<result column="name" property="name"/>
|
||||
<result column="dict_code" property="dictCode"/>
|
||||
<collection property="dictDataList"
|
||||
column="{dictCode=dict_code}"
|
||||
select="com.youlai.boot.system.mapper.DictDataMapper.getDictDataList">
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<!-- 获取字典列表(包含字典数据) -->
|
||||
<select id="getAllDictWithData" resultMap="DictWithDataMap">
|
||||
SELECT
|
||||
t1.name,
|
||||
t1.dict_code
|
||||
FROM
|
||||
sys_dict t1
|
||||
WHERE
|
||||
t1.is_deleted = 0 AND t1.status = 1
|
||||
ORDER BY
|
||||
t1.create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
LEFT JOIN sys_role r ON sur.role_id = r.id
|
||||
<where>
|
||||
u.is_deleted = 0
|
||||
<!-- 非超级管理员用户限制查看超级管理员 -->
|
||||
<if test="!queryParams.isRoot">
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
|
||||
Reference in New Issue
Block a user