| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406 |
- <?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.izouma.awesomeadmin.dao.SysMenuMapper" >
- <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.SysMenu" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="parent_id" property="parentId" jdbcType="INTEGER" />
- <result column="parent_ids" property="parentIds" jdbcType="VARCHAR" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="sort" property="sort" jdbcType="DECIMAL" />
- <result column="href" property="href" jdbcType="VARCHAR" />
- <result column="target" property="target" jdbcType="VARCHAR" />
- <result column="icon" property="icon" jdbcType="VARCHAR" />
- <result column="is_show" property="isShow" jdbcType="CHAR" />
- <result column="permission" property="permission" jdbcType="VARCHAR" />
- <result column="create_by" property="createBy" jdbcType="VARCHAR" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
- <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
- <result column="remarks" property="remarks" jdbcType="VARCHAR" />
- <result column="del_flag" property="delFlag" jdbcType="CHAR" />
- <result column="menu_type" property="menuType" jdbcType="CHAR" />
- <result column="can_move" property="canMove" jdbcType="CHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, parent_id, parent_ids, name, sort, href, target, icon, is_show, permission, create_by,
- create_date, update_by, update_date, remarks, del_flag, menu_type, can_move,handheld
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from sys_menu
- where id = #{id,jdbcType=INTEGER}
- </select>
- <select id="selectByPrimaryKeys" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from sys_menu
- where FIND_IN_SET(id, #{ids,jdbcType=INTEGER}) and del_flag = 'N'
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from sys_menu
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.SysMenu" useGeneratedKeys="true" keyProperty="id">
- insert into sys_menu
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="parentId != null" >
- parent_id,
- </if>
- <if test="parentIds != null" >
- parent_ids,
- </if>
- <if test="name != null" >
- name,
- </if>
- <if test="sort != null" >
- sort,
- </if>
- <if test="href != null" >
- href,
- </if>
- <if test="target != null" >
- target,
- </if>
- <if test="icon != null" >
- icon,
- </if>
- <if test="isShow != null" >
- is_show,
- </if>
- <if test="permission != null" >
- permission,
- </if>
- <if test="createBy != null" >
- create_by,
- </if>
- <if test="createDate != null" >
- create_date,
- </if>
- <if test="updateBy != null" >
- update_by,
- </if>
- <if test="updateDate != null" >
- update_date,
- </if>
- <if test="remarks != null" >
- remarks,
- </if>
- <if test="delFlag != null" >
- del_flag,
- </if>
- <if test="menuType != null" >
- menu_type,
- </if>
- <if test="handheld != null" >
- handheld,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=INTEGER},
- </if>
- <if test="parentId != null" >
- #{parentId,jdbcType=INTEGER},
- </if>
- <if test="parentIds != null" >
- #{parentIds,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="sort != null" >
- #{sort,jdbcType=DECIMAL},
- </if>
- <if test="href != null" >
- #{href,jdbcType=VARCHAR},
- </if>
- <if test="target != null" >
- #{target,jdbcType=VARCHAR},
- </if>
- <if test="icon != null" >
- #{icon,jdbcType=VARCHAR},
- </if>
- <if test="isShow != null" >
- #{isShow,jdbcType=CHAR},
- </if>
- <if test="permission != null" >
- #{permission,jdbcType=VARCHAR},
- </if>
- <if test="createBy != null" >
- #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createDate != null" >
- #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateBy != null" >
- #{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateDate != null" >
- #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null" >
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="delFlag != null" >
- #{delFlag,jdbcType=CHAR},
- </if>
- <if test="menuType != null" >
- #{menuType,jdbcType=CHAR},
- </if>
- <if test="handheld != null" >
- #{handheld,jdbcType=CHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.SysMenu" >
- update sys_menu
- <set >
- <if test="parentId != null" >
- parent_id = #{parentId,jdbcType=INTEGER},
- </if>
- <if test="parentIds != null" >
- parent_ids = #{parentIds,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="sort != null" >
- sort = #{sort,jdbcType=DECIMAL},
- </if>
- <if test="href != null" >
- href = #{href,jdbcType=VARCHAR},
- </if>
- <if test="target != null" >
- target = #{target,jdbcType=VARCHAR},
- </if>
- <if test="icon != null" >
- icon = #{icon,jdbcType=VARCHAR},
- </if>
- <if test="isShow != null" >
- is_show = #{isShow,jdbcType=CHAR},
- </if>
- <if test="permission != null" >
- permission = #{permission,jdbcType=VARCHAR},
- </if>
- <if test="createBy != null" >
- create_by = #{createBy,jdbcType=VARCHAR},
- </if>
- <if test="createDate != null" >
- create_date = #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateBy != null" >
- update_by = #{updateBy,jdbcType=VARCHAR},
- </if>
- <if test="updateDate != null" >
- update_date = #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="remarks != null" >
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="delFlag != null" >
- del_flag = #{delFlag,jdbcType=CHAR},
- </if>
- <if test="menuType != null" >
- menu_type = #{menuType,jdbcType=CHAR},
- </if>
- <if test="handheld != null" >
- handheld = #{handheld,jdbcType=CHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="querySysMenusByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
- select <include refid="Base_Column_List"/> from sys_menu
- <where>
- and del_flag = 'N'
- <if test="record.id != null and !"".equals(record.id)">
- and id = #{record.id}
- </if>
- <if test="record.parentId != null and !"".equals(record.parentId)">
- and parent_id = #{record.parentId}
- </if>
- <if test="record.parentIds != null and !"".equals(record.parentIds)">
- and parent_ids = #{record.parentIds}
- </if>
- <if test="record.name != null and !"".equals(record.name)">
- and name = #{record.name}
- </if>
- <if test="record.sort != null and !"".equals(record.sort)">
- and sort = #{record.sort}
- </if>
- <if test="record.href != null and !"".equals(record.href)">
- and href = #{record.href}
- </if>
- <if test="record.target != null and !"".equals(record.target)">
- and target = #{record.target}
- </if>
- <if test="record.icon != null and !"".equals(record.icon)">
- and icon = #{record.icon}
- </if>
- <if test="record.isShow != null and !"".equals(record.isShow)">
- and is_show = #{record.isShow}
- </if>
- <if test="record.permission != null and !"".equals(record.permission)">
- and permission = #{record.permission}
- </if>
- <if test="record.createBy != null and !"".equals(record.createBy)">
- and create_by = #{record.createBy}
- </if>
- <if test="record.createDate != null and !"".equals(record.createDate)">
- and create_date = #{record.createDate}
- </if>
- <if test="record.updateBy != null and !"".equals(record.updateBy)">
- and update_by = #{record.updateBy}
- </if>
- <if test="record.updateDate != null and !"".equals(record.updateDate)">
- and update_date = #{record.updateDate}
- </if>
- <if test="record.remarks != null and !"".equals(record.remarks)">
- and remarks = #{record.remarks}
- </if>
- <if test="record.delFlag != null and !"".equals(record.delFlag)">
- and del_flag = #{record.delFlag}
- </if>
- <if test="record.menuType != null and !"".equals(record.menuType)">
- and menu_type = #{record.menuType}
- </if>
- <if test="record.handheld != null and !"".equals(record.handheld)">
- and handheld = #{record.handheld}
- </if>
- </where>
- order by id desc
- </select>
- <select id="queryAllSysMenu" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
- select <include refid="Base_Column_List"/> from sys_menu
- <where>
- and del_flag = 'N'
- <if test="id != null and !"".equals(id)">
- and id = #{id}
- </if>
- <if test="parentId != null and !"".equals(parentId)">
- and parent_id = #{parentId}
- </if>
- <if test="parentIds != null and !"".equals(parentIds)">
- and parent_ids = #{parentIds}
- </if>
- <if test="name != null and !"".equals(name)">
- and name = #{name}
- </if>
- <if test="sort != null and !"".equals(sort)">
- and sort = #{sort}
- </if>
- <if test="href != null and !"".equals(href)">
- and href = #{href}
- </if>
- <if test="target != null and !"".equals(target)">
- and target = #{target}
- </if>
- <if test="icon != null and !"".equals(icon)">
- and icon = #{icon}
- </if>
- <if test="isShow != null and !"".equals(isShow)">
- and is_show = #{isShow}
- </if>
- <if test="permission != null and !"".equals(permission)">
- and permission = #{permission}
- </if>
- <if test="createBy != null and !"".equals(createBy)">
- and create_by = #{createBy}
- </if>
- <if test="createDate != null and !"".equals(createDate)">
- and create_date = #{createDate}
- </if>
- <if test="updateBy != null and !"".equals(updateBy)">
- and update_by = #{updateBy}
- </if>
- <if test="updateDate != null and !"".equals(updateDate)">
- and update_date = #{updateDate}
- </if>
- <if test="remarks != null and !"".equals(remarks)">
- and remarks = #{remarks}
- </if>
- <if test="delFlag != null and !"".equals(delFlag)">
- and del_flag = #{delFlag}
- </if>
- <if test="menuType != null and !"".equals(menuType)">
- and menu_type = #{menuType}
- </if>
- <if test="handheld != null and !"".equals(handheld)">
- and handheld = #{handheld}
- </if>
- </where>
- order by id desc
- </select>
- <select id="querySysMenu" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.SysMenu">
- select <include refid="Base_Column_List"/> from sys_menu
- <where>
- and del_flag = 'N'
- <if test="id != null and !"".equals(id)">
- and id = #{id}
- </if>
- <if test="parentId != null and !"".equals(parentId)">
- and parent_id = #{parentId}
- </if>
- <if test="parentIds != null and !"".equals(parentIds)">
- and parent_ids = #{parentIds}
- </if>
- <if test="name != null and !"".equals(name)">
- and name = #{name}
- </if>
- <if test="sort != null and !"".equals(sort)">
- and sort = #{sort}
- </if>
- <if test="href != null and !"".equals(href)">
- and href = #{href}
- </if>
- <if test="target != null and !"".equals(target)">
- and target = #{target}
- </if>
- <if test="icon != null and !"".equals(icon)">
- and icon = #{icon}
- </if>
- <if test="isShow != null and !"".equals(isShow)">
- and is_show = #{isShow}
- </if>
- <if test="permission != null and !"".equals(permission)">
- and permission = #{permission}
- </if>
- <if test="createBy != null and !"".equals(createBy)">
- and create_by = #{createBy}
- </if>
- <if test="createDate != null and !"".equals(createDate)">
- and create_date = #{createDate}
- </if>
- <if test="updateBy != null and !"".equals(updateBy)">
- and update_by = #{updateBy}
- </if>
- <if test="updateDate != null and !"".equals(updateDate)">
- and update_date = #{updateDate}
- </if>
- <if test="remarks != null and !"".equals(remarks)">
- and remarks = #{remarks}
- </if>
- <if test="delFlag != null and !"".equals(delFlag)">
- and del_flag = #{delFlag}
- </if>
- <if test="menuType != null and !"".equals(menuType)">
- and menu_type = #{menuType}
- </if>
- <if test="handheld != null and !"".equals(handheld)">
- and handheld = #{handheld}
- </if>
- </where>
- LIMIT 1
- </select>
- <update id="delete">
- UPDATE sys_menu SET del_flag = 'Y'
- <where>
- AND id = #{id}
- </where>
- </update>
- </mapper>
|