Commit e630eb9c by 陶光胜

菜单

parent c0a1d7c0
package com.gic.auth.dao.mapper;
import com.gic.auth.entity.TabSysMenu;
import java.util.List;
public interface TabSysMenuMapper {
/**
* 根据主键删除
*
* @param menuId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer menuId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabSysMenu record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabSysMenu record);
/**
* 根据主键查询
*
* @param menuId 主键
* @return 实体对象
*/
TabSysMenu selectByPrimaryKey(Integer menuId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabSysMenu record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysMenu record);
List<TabSysMenu> listMenu();
}
\ No newline at end of file
package com.gic.auth.entity;
import java.util.Date;
/**
* tab_sys_menu
*/
public class TabSysMenu {
/**
*
*/
private Integer menuId;
/**
* 菜单名称
*/
private String menuName;
/**
* 所在项目
*/
private String project;
/**
* 菜单路由
*/
private String menuUrl;
/**
* 上级菜单id
*/
private Integer parentId;
/**
* 0当前页1新开页
*/
private Integer target;
/**
*
*/
private String iconUrl;
/**
*
*/
private Integer sort;
/**
* 0删除1有效
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
*
*/
private Integer level;
/**
* 是否显示在菜单栏的菜单,0否1是
*/
private Integer isShow;
public Integer getMenuId() {
return menuId;
}
public void setMenuId(Integer menuId) {
this.menuId = menuId;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
public String getProject() {
return project;
}
public void setProject(String project) {
this.project = project;
}
public String getMenuUrl() {
return menuUrl;
}
public void setMenuUrl(String menuUrl) {
this.menuUrl = menuUrl;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Integer getTarget() {
return target;
}
public void setTarget(Integer target) {
this.target = target;
}
public String getIconUrl() {
return iconUrl;
}
public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getIsShow() {
return isShow;
}
public void setIsShow(Integer isShow) {
this.isShow = isShow;
}
}
\ No newline at end of file
<?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.gic.auth.dao.mapper.TabSysMenuMapper">
<resultMap id="BaseResultMap" type="com.gic.auth.entity.TabSysMenu">
<id column="menu_id" jdbcType="INTEGER" property="menuId" />
<result column="menu_name" jdbcType="VARCHAR" property="menuName" />
<result column="project" jdbcType="VARCHAR" property="project" />
<result column="menu_url" jdbcType="VARCHAR" property="menuUrl" />
<result column="parent_id" jdbcType="INTEGER" property="parentId" />
<result column="target" jdbcType="INTEGER" property="target" />
<result column="icon_url" jdbcType="VARCHAR" property="iconUrl" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="is_show" jdbcType="INTEGER" property="isShow" />
</resultMap>
<sql id="Base_Column_List">
menu_id, menu_name, project, menu_url, parent_id, target, icon_url, sort, status,
create_time, update_time, level, is_show
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu
where menu_id = #{menuId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_menu
where menu_id = #{menuId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysMenu">
insert into tab_sys_menu (menu_id, menu_name, project,
menu_url, parent_id, target,
icon_url, sort, status,
create_time, update_time, level,
is_show)
values (#{menuId,jdbcType=INTEGER}, #{menuName,jdbcType=VARCHAR}, #{project,jdbcType=VARCHAR},
#{menuUrl,jdbcType=VARCHAR}, #{parentId,jdbcType=INTEGER}, #{target,jdbcType=INTEGER},
#{iconUrl,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{level,jdbcType=INTEGER},
#{isShow,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysMenu">
insert into tab_sys_menu
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="menuId != null">
menu_id,
</if>
<if test="menuName != null">
menu_name,
</if>
<if test="project != null">
project,
</if>
<if test="menuUrl != null">
menu_url,
</if>
<if test="parentId != null">
parent_id,
</if>
<if test="target != null">
target,
</if>
<if test="iconUrl != null">
icon_url,
</if>
<if test="sort != null">
sort,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="level != null">
level,
</if>
<if test="isShow != null">
is_show,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="menuId != null">
#{menuId,jdbcType=INTEGER},
</if>
<if test="menuName != null">
#{menuName,jdbcType=VARCHAR},
</if>
<if test="project != null">
#{project,jdbcType=VARCHAR},
</if>
<if test="menuUrl != null">
#{menuUrl,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
#{parentId,jdbcType=INTEGER},
</if>
<if test="target != null">
#{target,jdbcType=INTEGER},
</if>
<if test="iconUrl != null">
#{iconUrl,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="level != null">
#{level,jdbcType=INTEGER},
</if>
<if test="isShow != null">
#{isShow,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.auth.entity.TabSysMenu">
update tab_sys_menu
<set>
<if test="menuName != null">
menu_name = #{menuName,jdbcType=VARCHAR},
</if>
<if test="project != null">
project = #{project,jdbcType=VARCHAR},
</if>
<if test="menuUrl != null">
menu_url = #{menuUrl,jdbcType=VARCHAR},
</if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=INTEGER},
</if>
<if test="target != null">
target = #{target,jdbcType=INTEGER},
</if>
<if test="iconUrl != null">
icon_url = #{iconUrl,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="level != null">
level = #{level,jdbcType=INTEGER},
</if>
<if test="isShow != null">
is_show = #{isShow,jdbcType=INTEGER},
</if>
</set>
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.auth.entity.TabSysMenu">
update tab_sys_menu
set menu_name = #{menuName,jdbcType=VARCHAR},
project = #{project,jdbcType=VARCHAR},
menu_url = #{menuUrl,jdbcType=VARCHAR},
parent_id = #{parentId,jdbcType=INTEGER},
target = #{target,jdbcType=INTEGER},
icon_url = #{iconUrl,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
level = #{level,jdbcType=INTEGER},
is_show = #{isShow,jdbcType=INTEGER}
where menu_id = #{menuId,jdbcType=INTEGER}
</update>
<select id="listMenu" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_menu
where status=1
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment