feat(dict): 添加字典明细查询功能并重构系统服务代码结构

This commit is contained in:
2026-01-14 20:20:11 +08:00
parent c008daaaa1
commit cf65b4f5ab
103 changed files with 6109 additions and 5984 deletions
@@ -1,18 +1,29 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.odboy.system.dal.mysql.SystemDictDetailMapper">
<select id="selectPageByArgs" resultType="cn.odboy.system.dal.dataobject.SystemDictDetailTb">
SELECT
t1.*
FROM system_dict_detail t1 LEFT JOIN system_dict t2 ON t1.dict_id = t2.id
<where>
<if test="args.dictName != null and args.dictName != ''">
AND t2.name = #{args.dictName}
</if>
<if test="args.label != null and args.label != ''">
AND t1.label = #{args.label}
</if>
</where>
ORDER BY t1.dict_sort
</select>
<select id="selectPageByArgs" resultType="cn.odboy.system.dal.model.response.SystemDictDetailVo">
SELECT
t1.*
FROM system_dict_detail t1 LEFT JOIN system_dict t2 ON t1.dict_id = t2.id
<where>
<if test="args.dictName != null and args.dictName != ''">
AND t2.name = #{args.dictName}
</if>
<if test="args.label != null and args.label != ''">
AND t1.label = #{args.label}
</if>
</where>
ORDER BY t1.dict_sort
</select>
<select id="listDictDetailByName" resultType="cn.odboy.system.dal.model.response.SystemDictDetailVo">
SELECT t1.*
FROM system_dict_detail t1
LEFT JOIN system_dict t2 ON t1.dict_id = t2.id
<where>
<if test="name != null and name != ''">
AND t2.name = #{name}
</if>
</where>
ORDER BY t1.dict_sort
</select>
</mapper>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.odboy.system.dal.mysql.SystemRoleDeptMapper">
<select id="listUserDeptByRoleId" resultType="cn.odboy.system.dal.dataobject.SystemDeptTb">
SELECT DISTINCT t1.*, t1.dept_id as id
FROM system_dept t1
LEFT JOIN system_roles_depts t2 ON t1.dept_id = t2.dept_id
WHERE t2.role_id = #{roleId}
</select>
</mapper>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.odboy.system.dal.mysql.SystemUserJobMapper">
<select id="listUserJobByUserId" resultType="cn.odboy.system.dal.dataobject.SystemJobTb">
SELECT DISTINCT t1.*
FROM system_job t1
LEFT JOIN system_users_jobs t2 ON t1.id = t2.job_id
WHERE t1.enabled = 1
AND t2.user_id = #{userId}
</select>
</mapper>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.odboy.system.dal.mysql.SystemUserRoleMapper">
<select id="listUserRoleByUserId" resultType="cn.odboy.system.dal.dataobject.SystemRoleTb">
SELECT DISTINCT t1.*, t1.role_id as id
FROM system_role t1
LEFT JOIN system_users_roles t2 ON t1.role_id = t2.role_id
WHERE t2.user_id = #{userId}
</select>
</mapper>