50 lines
1.9 KiB
XML
50 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.sa.zentao.mapper.BaseMenuMapper">
|
|
<resultMap id="BaseResultMap" type="com.sa.zentao.entity.BaseMenu">
|
|
<result column="id" property="id"/>
|
|
<result column="parent_id" property="parentId"/>
|
|
<result column="name" property="name"/>
|
|
<result column="action" property="action"/>
|
|
<result column="sort" property="sort"/>
|
|
<result column="is_sys" property="isSys"/>
|
|
<result column="icon" property="icon"/>
|
|
<result column="create_time" property="createTime"/>
|
|
<result column="update_time" property="updateTime"/>
|
|
<result column="level" property="level"/>
|
|
</resultMap>
|
|
<select id="findAll" resultType="com.sa.zentao.entity.BaseMenu">
|
|
select * from base_menu
|
|
</select>
|
|
<delete id="deleteWithChild">
|
|
delete from base_menu where id=#{id} or parent_id=#{id}
|
|
</delete>
|
|
<select id="findMenuIds" resultType="Integer">
|
|
select id from base_menu where id=#{id} or parent_id=#{id}
|
|
</select>
|
|
<select id="selectMenuByParentId" resultMap="BaseResultMap">
|
|
select * from base_menu
|
|
<where>
|
|
<if test="parentId != null">
|
|
and parent_id = #{parentId}
|
|
</if>
|
|
<if test="parentId == null">
|
|
and parent_id is null
|
|
</if>
|
|
</where>
|
|
</select>
|
|
|
|
|
|
<select id="queryListByLoginUser" resultMap="BaseResultMap">
|
|
SELECT m.* from base_menu m,base_role_authority ra,base_role r,base_user_role ur
|
|
WHERE m.id=ra.menu_id and ra.role_id=r.id and r.id=ur.role_id
|
|
and ur.user_id=#{riskUserId}
|
|
|
|
</select>
|
|
|
|
<select id="queryAllList" resultMap="BaseResultMap">
|
|
SELECT m.* from base_menu m
|
|
</select>
|
|
|
|
</mapper>
|