All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mappers.system.DefaultSysMenuMapper.xml Maven / Gradle / Ivy

There is a newer version: 3.0.6
Show newest version
<?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.lframework.starter.mybatis.mappers.system.DefaultSysMenuMapper">

    <sql id="SysMenuDto_sql">
        SELECT
            *
        FROM sys_menu
    </sql>

    <select id="query" resultType="com.lframework.starter.mybatis.entity.DefaultSysMenu">
        <include refid="SysMenuDto_sql"/>
        ORDER BY code
    </select>
    <select id="selector" resultType="com.lframework.starter.mybatis.entity.DefaultSysMenu">
        <include refid="SysMenuDto_sql"/>
        <where>
            <if test="vo != null">
                <if test="vo.display != null">
                    AND display = #{vo.display}
                </if>
            </if>
            AND display IN (0, 1)
        </where>
        ORDER BY code
    </select>
    <select id="findById" resultType="com.lframework.starter.mybatis.entity.DefaultSysMenu">
        <include refid="SysMenuDto_sql"/>
        WHERE id = #{id}
    </select>
    <select id="getChildrenById" resultType="com.lframework.starter.mybatis.entity.DefaultSysMenu">
        <include refid="SysMenuDto_sql"/>
        WHERE parent_id = #{id}
    </select>
    <select id="getByRoleId" resultType="com.lframework.starter.mybatis.entity.DefaultSysMenu">
        <include refid="SysMenuDto_sql"/>
        WHERE id IN (
        SELECT
        menu_id
        FROM sys_role_menu
        WHERE role_id = #{roleId}
        )
        ORDER BY code
    </select>
</mapper>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy