| | |
| | | <mapper namespace="com.sandu.ximon.dao.mapper.MenuMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.Menu"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="title" column="title" jdbcType="VARCHAR"/> |
| | | <result property="pid" column="pid" jdbcType="BIGINT"/> |
| | | <result property="seq" column="seq" jdbcType="INTEGER"/> |
| | | <result property="icon" column="icon" jdbcType="VARCHAR"/> |
| | | <result property="path" column="path" jdbcType="VARCHAR"/> |
| | | <result property="hidden" column="hidden" jdbcType="BOOLEAN"/> |
| | | <result property="component" column="component" jdbcType="VARCHAR"/> |
| | | <result property="routerName" column="router_name" jdbcType="VARCHAR"/> |
| | | <result property="permission" column="permission" jdbcType="VARCHAR"/> |
| | | <result property="type" column="type" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="title" column="title" jdbcType="VARCHAR"/> |
| | | <result property="pid" column="pid" jdbcType="BIGINT"/> |
| | | <result property="seq" column="seq" jdbcType="INTEGER"/> |
| | | <result property="icon" column="icon" jdbcType="VARCHAR"/> |
| | | <result property="path" column="path" jdbcType="VARCHAR"/> |
| | | <result property="hidden" column="hidden" jdbcType="BOOLEAN"/> |
| | | <result property="component" column="component" jdbcType="VARCHAR"/> |
| | | <result property="routerName" column="router_name" jdbcType="VARCHAR"/> |
| | | <result property="permission" column="permission" jdbcType="VARCHAR"/> |
| | | <result property="type" column="type" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | |
| | | permission,type,create_time, |
| | | update_time |
| | | </sql> |
| | | <select id="listMenu" resultType="java.lang.Long"> |
| | | SELECT id FROM menu |
| | | </select> |
| | | |
| | | <select id="listMenuIfBinding" resultType="java.lang.Long"> |
| | | SELECT t1.id |
| | | FROM menu t1 |
| | | LEFT JOIN role_menu_relation t2 ON t1.id = t2.menu_id |
| | | <where> |
| | | t2.menu_id = #{id} |
| | | </where> |
| | | </select> |
| | | <select id="listMenuIfBinding1" resultType="java.lang.Long" parameterType="java.lang.Long"> |
| | | SELECT t1.id |
| | | FROM menu t1 |
| | | <where> |
| | | t1.pid = #{id} |
| | | </where> |
| | | |
| | | </select> |
| | | |
| | | <select id="listMenuById" resultType="com.sandu.ximon.dao.domain.Menu"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | menu t1 |
| | | <where> |
| | | t1.id IN |
| | | <foreach collection="menuIdList" open="(" close=")" item="id" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </where> |
| | | ORDER BY t1.seq ASC |
| | | |
| | | </select> |
| | | |
| | | <select id="getUserPermissionListById" resultType="com.sandu.ximon.dao.domain.Menu"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | menu t1 |
| | | <where> |
| | | <if test="menuIds != null"> |
| | | t1.id IN |
| | | <foreach collection="menuIds" open="(" close=")" item="id" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | </where> |
| | | ORDER BY t1.seq ASC |
| | | </select> |
| | | </mapper> |