123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <?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.mofangchuxing.aska.dao.mapper.SysMenuMapper">
- <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.SysMenu">
- <id property="menuId" column="menu_id" jdbcType="BIGINT"/>
- <result property="parentId" column="parent_id" jdbcType="BIGINT"/>
- <result property="name" column="name" jdbcType="VARCHAR"/>
- <result property="url" column="url" jdbcType="VARCHAR"/>
- <result property="perms" column="perms" jdbcType="VARCHAR"/>
- <result property="type" column="type" jdbcType="INTEGER"/>
- <result property="icon" column="icon" jdbcType="VARCHAR"/>
- <result property="orderNum" column="order_num" jdbcType="INTEGER"/>
- <result property="htmlPath" column="html_path" jdbcType="VARCHAR"/>
- <result property="htmlClass" column="html_class" jdbcType="VARCHAR"/>
- <result property="state" column="state" jdbcType="TINYINT"/>
- <result property="createId" column="create_id" jdbcType="BIGINT"/>
- <result property="createName" column="create_name" jdbcType="VARCHAR"/>
- <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
- <result property="menuLevel" column="menu_level" jdbcType="INTEGER"/>
- <result property="englishName" column="english_name" jdbcType="VARCHAR"/>
- <result property="role" column="role" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- menu_id,parent_id,name,
- url,perms,type,
- icon,order_num,html_path,
- html_class,state,create_id,
- create_name,create_time,menu_level,
- english_name,role
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from sys_menu
- where menu_id = #{menuId,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from sys_menu
- where menu_id = #{menuId,jdbcType=BIGINT}
- </delete>
- <insert id="insert" keyColumn="menu_id" keyProperty="menuId" parameterType="com.mofangchuxing.aska.dao.domain.SysMenu" useGeneratedKeys="true">
- insert into sys_menu
- ( menu_id,parent_id,name
- ,url,perms,type
- ,icon,order_num,html_path
- ,html_class,state,create_id
- ,create_name,create_time,menu_level
- ,english_name,role)
- values (#{menuId,jdbcType=BIGINT},#{parentId,jdbcType=BIGINT},#{name,jdbcType=VARCHAR}
- ,#{url,jdbcType=VARCHAR},#{perms,jdbcType=VARCHAR},#{type,jdbcType=INTEGER}
- ,#{icon,jdbcType=VARCHAR},#{orderNum,jdbcType=INTEGER},#{htmlPath,jdbcType=VARCHAR}
- ,#{htmlClass,jdbcType=VARCHAR},#{state,jdbcType=TINYINT},#{createId,jdbcType=BIGINT}
- ,#{createName,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{menuLevel,jdbcType=INTEGER}
- ,#{englishName,jdbcType=VARCHAR},#{role,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" keyColumn="menu_id" keyProperty="menuId" parameterType="com.mofangchuxing.aska.dao.domain.SysMenu" useGeneratedKeys="true">
- insert into sys_menu
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="menuId != null">menu_id,</if>
- <if test="parentId != null">parent_id,</if>
- <if test="name != null">name,</if>
- <if test="url != null">url,</if>
- <if test="perms != null">perms,</if>
- <if test="type != null">type,</if>
- <if test="icon != null">icon,</if>
- <if test="orderNum != null">order_num,</if>
- <if test="htmlPath != null">html_path,</if>
- <if test="htmlClass != null">html_class,</if>
- <if test="state != null">state,</if>
- <if test="createId != null">create_id,</if>
- <if test="createName != null">create_name,</if>
- <if test="createTime != null">create_time,</if>
- <if test="menuLevel != null">menu_level,</if>
- <if test="englishName != null">english_name,</if>
- <if test="role != null">role,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="menuId != null">#{menuId,jdbcType=BIGINT},</if>
- <if test="parentId != null">#{parentId,jdbcType=BIGINT},</if>
- <if test="name != null">#{name,jdbcType=VARCHAR},</if>
- <if test="url != null">#{url,jdbcType=VARCHAR},</if>
- <if test="perms != null">#{perms,jdbcType=VARCHAR},</if>
- <if test="type != null">#{type,jdbcType=INTEGER},</if>
- <if test="icon != null">#{icon,jdbcType=VARCHAR},</if>
- <if test="orderNum != null">#{orderNum,jdbcType=INTEGER},</if>
- <if test="htmlPath != null">#{htmlPath,jdbcType=VARCHAR},</if>
- <if test="htmlClass != null">#{htmlClass,jdbcType=VARCHAR},</if>
- <if test="state != null">#{state,jdbcType=TINYINT},</if>
- <if test="createId != null">#{createId,jdbcType=BIGINT},</if>
- <if test="createName != null">#{createName,jdbcType=VARCHAR},</if>
- <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
- <if test="menuLevel != null">#{menuLevel,jdbcType=INTEGER},</if>
- <if test="englishName != null">#{englishName,jdbcType=VARCHAR},</if>
- <if test="role != null">#{role,jdbcType=VARCHAR},</if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.SysMenu">
- update sys_menu
- <set>
- <if test="parentId != null">
- parent_id = #{parentId,jdbcType=BIGINT},
- </if>
- <if test="name != null">
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="url != null">
- url = #{url,jdbcType=VARCHAR},
- </if>
- <if test="perms != null">
- perms = #{perms,jdbcType=VARCHAR},
- </if>
- <if test="type != null">
- type = #{type,jdbcType=INTEGER},
- </if>
- <if test="icon != null">
- icon = #{icon,jdbcType=VARCHAR},
- </if>
- <if test="orderNum != null">
- order_num = #{orderNum,jdbcType=INTEGER},
- </if>
- <if test="htmlPath != null">
- html_path = #{htmlPath,jdbcType=VARCHAR},
- </if>
- <if test="htmlClass != null">
- html_class = #{htmlClass,jdbcType=VARCHAR},
- </if>
- <if test="state != null">
- state = #{state,jdbcType=TINYINT},
- </if>
- <if test="createId != null">
- create_id = #{createId,jdbcType=BIGINT},
- </if>
- <if test="createName != null">
- create_name = #{createName,jdbcType=VARCHAR},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="menuLevel != null">
- menu_level = #{menuLevel,jdbcType=INTEGER},
- </if>
- <if test="englishName != null">
- english_name = #{englishName,jdbcType=VARCHAR},
- </if>
- <if test="role != null">
- role = #{role,jdbcType=VARCHAR},
- </if>
- </set>
- where menu_id = #{menuId,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.SysMenu">
- update sys_menu
- set
- parent_id = #{parentId,jdbcType=BIGINT},
- name = #{name,jdbcType=VARCHAR},
- url = #{url,jdbcType=VARCHAR},
- perms = #{perms,jdbcType=VARCHAR},
- type = #{type,jdbcType=INTEGER},
- icon = #{icon,jdbcType=VARCHAR},
- order_num = #{orderNum,jdbcType=INTEGER},
- html_path = #{htmlPath,jdbcType=VARCHAR},
- html_class = #{htmlClass,jdbcType=VARCHAR},
- state = #{state,jdbcType=TINYINT},
- create_id = #{createId,jdbcType=BIGINT},
- create_name = #{createName,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- menu_level = #{menuLevel,jdbcType=INTEGER},
- english_name = #{englishName,jdbcType=VARCHAR},
- role = #{role,jdbcType=VARCHAR}
- where menu_id = #{menuId,jdbcType=BIGINT}
- </update>
- <select id="listMenuAll" parameterType="java.util.Map"
- resultType="com.mofangchuxing.aska.domain.entity.SysMenuEntity">
- SELECT mu.menu_id AS menuId,
- mu.`name` AS name,
- mu.html_path AS htmlPath,
- mu.html_class AS htmlClass,
- mu.type AS type,
- mu.order_num as orderNum,
- mu.state as state,
- mu.url as url,
- mu.perms as perms,
- mu.menu_id AS id,
- mu.`name` AS label,
- mu.parent_id AS parentId,
- mu.menu_level as menuLevel,
- mu.english_name as englishName
- FROM sys_menu mu
- WHERE mu.role = #{role}
- ORDER BY mu.order_num ASC
- </select>
- </mapper>
|