43 lines
1.9 KiB
XML
43 lines
1.9 KiB
XML
<?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="com.dkha.dao.SysMenuDao">
|
|
|
|
<select id="getById" resultType="com.dkha.entity.SysMenuEntity">
|
|
select t1.*,
|
|
(select lang.field_value from sys_language lang where lang.table_name='sys_menu' and lang.field_name='name'
|
|
and lang.table_id=t1.pid and lang.language=#{language}) as parentName,
|
|
(select lang.field_value from sys_language lang where lang.table_name='sys_menu' and lang.field_name='name'
|
|
and lang.table_id=t1.id and lang.language=#{language}) as name
|
|
from sys_menu t1
|
|
where t1.id = #{id} and t1.del_flag = 0
|
|
</select>
|
|
|
|
<select id="getMenuList" resultType="com.dkha.entity.SysMenuEntity">
|
|
select t1.*, (select lang.field_value from sys_language lang where lang.table_name='sys_menu' and lang.field_name='name'
|
|
and lang.table_id=t1.id and lang.language=#{language}) as name
|
|
from sys_menu t1 where t1.del_flag = 0
|
|
<if test="type != null">
|
|
and t1.type = #{type}
|
|
</if>
|
|
order by t1.sort asc
|
|
</select>
|
|
|
|
<select id="getUserMenuList" resultType="com.dkha.entity.SysMenuEntity">
|
|
select t3.*, (select lang.field_value from sys_language lang where lang.table_name='sys_menu' and lang.field_name='name'
|
|
and lang.table_id=t3.id and lang.language=#{language}) as name from sys_role_user t1
|
|
left join sys_role_menu t2 on t1.role_id = t2.role_id
|
|
left join sys_menu t3 on t2.menu_id = t3.id
|
|
where t1.user_id = #{userId} and t3.del_flag = 0
|
|
<if test="type != null">
|
|
and t3.type = #{type}
|
|
</if>
|
|
order by t3.sort asc
|
|
</select>
|
|
|
|
<select id="getListPid" resultType="com.dkha.entity.SysMenuEntity">
|
|
select * from sys_menu where del_flag = 0 and pid = #{value}
|
|
</select>
|
|
|
|
</mapper>
|