Commit b0b457c3 by 墨竹

feat:权限

parent 1c3b8093
package com.gic.haoban.manage.service.dao.mapper.role;
import com.gic.haoban.manage.service.entity.role.TabHaobanRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 好办小程序权限(TabHaobanRole)表数据库访问层
*
* @author mozhu
* @since 2022-09-06 16:35:04
*/
public interface TabHaobanRoleMapper {
/**
* 通过ID查询单条数据
*
* @param roleId 主键
* @return 实例对象
*/
TabHaobanRole queryById(Long roleId);
/**
* 新增数据
*
* @param tabHaobanRole 实例对象
* @return 影响行数
*/
int insert(TabHaobanRole tabHaobanRole);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanRole> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TabHaobanRole> entities);
/**
* 修改数据
*
* @param tabHaobanRole 实例对象
* @return 影响行数
*/
int update(TabHaobanRole tabHaobanRole);
}
package com.gic.haoban.manage.service.dao.mapper.role;
import com.gic.haoban.manage.service.entity.role.TabHaobanRoleMenu;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 好办小程序菜单(TabHaobanRoleMenu)表数据库访问层
*
* @author mozhu
* @since 2022-09-06 16:35:10
*/
public interface TabHaobanRoleMenuMapper {
/**
* 通过ID查询单条数据
*
* @param menuId 主键
* @return 实例对象
*/
TabHaobanRoleMenu queryById(Long menuId);
/**
* 新增数据
*
* @param tabHaobanRoleMenu 实例对象
* @return 影响行数
*/
int insert(TabHaobanRoleMenu tabHaobanRoleMenu);
/**
* 批量新增数据(MyBatis原生foreach方法)
*
* @param entities List<TabHaobanRoleMenu> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TabHaobanRoleMenu> entities);
/**
* 修改数据
*
* @param tabHaobanRoleMenu 实例对象
* @return 影响行数
*/
int update(TabHaobanRoleMenu tabHaobanRoleMenu);
}
package com.gic.haoban.manage.service.entity.role;
import java.io.Serializable;
import java.util.Date;
/**
* 好办小程序权限(TabHaobanRole)实体类
*
* @author mozhu
* @since 2022-09-06 16:35:07
*/
public class TabHaobanRole implements Serializable {
private static final long serialVersionUID = 554109287178364863L;
private Long roleId;
/**
* 权限名称
*/
private String roleName;
/**
* 权限id
*/
private Long menuId;
/**
* 权限code
*/
private String menuCode;
/**
* 0:导购;1:店长;3:区经
*/
private Integer clerkType;
private String wxEnterpriseId;
private String enterpriseId;
private String creatorId;
private String creatorName;
private String modifierId;
private String modifierName;
/**
* 1:正常;0:删除
*/
private Integer statusFlag;
private Date createTime;
private Date updateTime;
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public String getRoleName() {
return roleName;
}
public void setRoleName(String roleName) {
this.roleName = roleName;
}
public Long getMenuId() {
return menuId;
}
public void setMenuId(Long menuId) {
this.menuId = menuId;
}
public String getMenuCode() {
return menuCode;
}
public void setMenuCode(String menuCode) {
this.menuCode = menuCode;
}
public Integer getClerkType() {
return clerkType;
}
public void setClerkType(Integer clerkType) {
this.clerkType = clerkType;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getCreatorId() {
return creatorId;
}
public void setCreatorId(String creatorId) {
this.creatorId = creatorId;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
public String getModifierId() {
return modifierId;
}
public void setModifierId(String modifierId) {
this.modifierId = modifierId;
}
public String getModifierName() {
return modifierName;
}
public void setModifierName(String modifierName) {
this.modifierName = modifierName;
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
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;
}
}
package com.gic.haoban.manage.service.entity.role;
import java.io.Serializable;
import java.util.Date;
/**
* 好办小程序菜单(TabHaobanRoleMenu)实体类
*
* @author mozhu
* @since 2022-09-06 16:35:10
*/
public class TabHaobanRoleMenu implements Serializable {
private static final long serialVersionUID = 909873156099677525L;
private Long menuId;
/**
* 菜单code
*/
private String menuCode;
/**
* 菜单名称
*/
private String menuName;
/**
* 菜单url
*/
private String menuUrl;
/**
* 菜单图标url
*/
private String iconUrl;
/**
* 层级
*/
private Integer menuLevel;
/**
* 0:菜单;1:按钮
*/
private Integer menuType;
/**
* 排序
*/
private Integer menuSort;
/**
* 父code
*/
private String parentCode;
/**
* 1:正常;0:删除
*/
private Integer statusFlag;
private Date createTime;
private Date updateTime;
public Long getMenuId() {
return menuId;
}
public void setMenuId(Long menuId) {
this.menuId = menuId;
}
public String getMenuCode() {
return menuCode;
}
public void setMenuCode(String menuCode) {
this.menuCode = menuCode;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
public String getMenuUrl() {
return menuUrl;
}
public void setMenuUrl(String menuUrl) {
this.menuUrl = menuUrl;
}
public String getIconUrl() {
return iconUrl;
}
public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl;
}
public Integer getMenuLevel() {
return menuLevel;
}
public void setMenuLevel(Integer menuLevel) {
this.menuLevel = menuLevel;
}
public Integer getMenuType() {
return menuType;
}
public void setMenuType(Integer menuType) {
this.menuType = menuType;
}
public Integer getMenuSort() {
return menuSort;
}
public void setMenuSort(Integer menuSort) {
this.menuSort = menuSort;
}
public String getParentCode() {
return parentCode;
}
public void setParentCode(String parentCode) {
this.parentCode = parentCode;
}
public Integer getStatusFlag() {
return statusFlag;
}
public void setStatusFlag(Integer statusFlag) {
this.statusFlag = statusFlag;
}
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;
}
}
package com.gic.haoban.manage.service.service.role;
import com.gic.haoban.manage.service.entity.role.TabHaobanRoleMenu;
/**
* 好办小程序菜单(TabHaobanRoleMenu)表服务接口
*
* @author mozhu
* @since 2022-09-06 16:35:11
*/
public interface HaobanRoleMenuService {
/**
* 通过ID查询单条数据
*
* @param menuId 主键
* @return 实例对象
*/
TabHaobanRoleMenu queryById(Long menuId);
/**
* 新增数据
*
* @param tabHaobanRoleMenu 实例对象
* @return 实例对象
*/
TabHaobanRoleMenu insert(TabHaobanRoleMenu tabHaobanRoleMenu);
/**
* 修改数据
*
* @param tabHaobanRoleMenu 实例对象
* @return 实例对象
*/
TabHaobanRoleMenu update(TabHaobanRoleMenu tabHaobanRoleMenu);
/**
* 通过主键删除数据
*
* @param menuId 主键
* @return 是否成功
*/
boolean deleteById(Long menuId);
}
package com.gic.haoban.manage.service.service.role;
import com.gic.haoban.manage.service.entity.role.TabHaobanRole;
/**
* 好办小程序权限(TabHaobanRole)表服务接口
*
* @author mozhu
* @since 2022-09-06 16:35:10
*/
public interface HaobanRoleService {
/**
* 通过ID查询单条数据
*
* @param roleId 主键
* @return 实例对象
*/
TabHaobanRole queryById(Long roleId);
/**
* 新增数据
*
* @param tabHaobanRole 实例对象
* @return 实例对象
*/
TabHaobanRole insert(TabHaobanRole tabHaobanRole);
/**
* 修改数据
*
* @param tabHaobanRole 实例对象
* @return 实例对象
*/
TabHaobanRole update(TabHaobanRole tabHaobanRole);
/**
* 通过主键删除数据
*
* @param roleId 主键
* @return 是否成功
*/
boolean deleteById(Long roleId);
}
package com.gic.haoban.manage.service.service.role.impl;
import com.gic.haoban.manage.service.dao.mapper.role.TabHaobanRoleMenuMapper;
import com.gic.haoban.manage.service.entity.role.TabHaobanRoleMenu;
import com.gic.haoban.manage.service.service.role.HaobanRoleMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 好办小程序菜单(TabHaobanRoleMenu)表服务实现类
*
* @author mozhu
* @since 2022-09-06 16:35:11
*/
@Service
public class HaobanRoleMenuServiceImpl implements HaobanRoleMenuService {
@Autowired
private TabHaobanRoleMenuMapper tabHaobanRoleMenuMapper;
/**
* 通过ID查询单条数据
*
* @param menuId 主键
* @return 实例对象
*/
@Override
public TabHaobanRoleMenu queryById(Long menuId) {
return this.tabHaobanRoleMenuMapper.queryById(menuId);
}
/**
* 新增数据
*
* @param tabHaobanRoleMenu 实例对象
* @return 实例对象
*/
@Override
public TabHaobanRoleMenu insert(TabHaobanRoleMenu tabHaobanRoleMenu) {
this.tabHaobanRoleMenuMapper.insert(tabHaobanRoleMenu);
return tabHaobanRoleMenu;
}
/**
* 修改数据
*
* @param tabHaobanRoleMenu 实例对象
* @return 实例对象
*/
@Override
public TabHaobanRoleMenu update(TabHaobanRoleMenu tabHaobanRoleMenu) {
this.tabHaobanRoleMenuMapper.update(tabHaobanRoleMenu);
return this.queryById(tabHaobanRoleMenu.getMenuId());
}
/**
* 通过主键删除数据
*
* @param menuId 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long menuId) {
return false;
}
}
package com.gic.haoban.manage.service.service.role.impl;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.manage.service.dao.mapper.role.TabHaobanRoleMapper;
import com.gic.haoban.manage.service.entity.role.TabHaobanRole;
import com.gic.haoban.manage.service.service.role.HaobanRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* 好办小程序权限(TabHaobanRole)表服务实现类
*
* @author mozhu
* @since 2022-09-06 16:35:10
*/
@Service
public class HaobanRoleServiceImpl implements HaobanRoleService {
@Autowired
private TabHaobanRoleMapper tabHaobanRoleMapper;
/**
* 通过ID查询单条数据
*
* @param roleId 主键
* @return 实例对象
*/
@Override
public TabHaobanRole queryById(Long roleId) {
return this.tabHaobanRoleMapper.queryById(roleId);
}
/**
* 新增数据
*
* @param tabHaobanRole 实例对象
* @return 实例对象
*/
@Override
public TabHaobanRole insert(TabHaobanRole tabHaobanRole) {
tabHaobanRole.setRoleId(UniqueIdUtils.uniqueLong());
tabHaobanRole.setCreateTime(new Date());
tabHaobanRole.setUpdateTime(new Date());
this.tabHaobanRoleMapper.insert(tabHaobanRole);
return tabHaobanRole;
}
/**
* 修改数据
*
* @param tabHaobanRole 实例对象
* @return 实例对象
*/
@Override
public TabHaobanRole update(TabHaobanRole tabHaobanRole) {
tabHaobanRole.setUpdateTime(new Date());
this.tabHaobanRoleMapper.update(tabHaobanRole);
return this.queryById(tabHaobanRole.getRoleId());
}
/**
* 通过主键删除数据
*
* @param roleId 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long roleId) {
return false;
}
}
<?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.haoban.manage.service.dao.mapper.role.TabHaobanRoleMapper">
<resultMap type="com.gic.haoban.manage.service.entity.role.TabHaobanRole" id="TabHaobanRoleMap">
<result property="roleId" column="role_id" jdbcType="INTEGER"/>
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
<result property="menuId" column="menu_id" jdbcType="INTEGER"/>
<result property="menuCode" column="menu_code" jdbcType="VARCHAR"/>
<result property="clerkType" column="clerk_type" jdbcType="INTEGER"/>
<result property="wxEnterpriseId" column="wx_enterprise_id" jdbcType="VARCHAR"/>
<result property="enterpriseId" column="enterprise_id" jdbcType="VARCHAR"/>
<result property="creatorId" column="creator_id" jdbcType="VARCHAR"/>
<result property="creatorName" column="creator_name" jdbcType="VARCHAR"/>
<result property="modifierId" column="modifier_id" jdbcType="VARCHAR"/>
<result property="modifierName" column="modifier_name" jdbcType="VARCHAR"/>
<result property="statusFlag" column="status_flag" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
role_id, role_name, menu_id, menu_code, clerk_type, wx_enterprise_id, enterprise_id, creator_id, creator_name, modifier_id, modifier_name, status_flag, create_time, update_time
</sql>
<!--查询单个-->
<select id="queryById" resultMap="TabHaobanRoleMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_role
where role_id = #{roleId}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="roleId" useGeneratedKeys="true">
insert into tab_haoban_role(role_id, role_name, menu_id, menu_code, clerk_type, wx_enterprise_id, enterprise_id, creator_id, creator_name, modifier_id, modifier_name, status_flag, create_time, update_time)
values (#{roleId}, #{roleName}, #{menuId}, #{menuCode}, #{clerkType}, #{wxEnterpriseId}, #{enterpriseId}, #{creatorId}, #{creatorName}, #{modifierId}, #{modifierName}, #{statusFlag}, #{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="roleId" useGeneratedKeys="true">
insert into tab_haoban_role(role_id, role_name, menu_id, menu_code, clerk_type, wx_enterprise_id, enterprise_id,
creator_id, creator_name, modifier_id, modifier_name, status_flag, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.roleId}, #{entity.roleName}, #{entity.menuId}, #{entity.menuCode}, #{entity.clerkType},
#{entity.wxEnterpriseId}, #{entity.enterpriseId}, #{entity.creatorId}, #{entity.creatorName},
#{entity.modifierId}, #{entity.modifierName}, #{entity.statusFlag}, #{entity.createTime},
#{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tab_haoban_role
<set>
<if test="roleName != null and roleName != ''">
role_name = #{roleName},
</if>
<if test="menuId != null">
menu_id = #{menuId},
</if>
<if test="menuCode != null and menuCode != ''">
menu_code = #{menuCode},
</if>
<if test="clerkType != null">
clerk_type = #{clerkType},
</if>
<if test="wxEnterpriseId != null and wxEnterpriseId != ''">
wx_enterprise_id = #{wxEnterpriseId},
</if>
<if test="enterpriseId != null and enterpriseId != ''">
enterprise_id = #{enterpriseId},
</if>
<if test="creatorId != null and creatorId != ''">
creator_id = #{creatorId},
</if>
<if test="creatorName != null and creatorName != ''">
creator_name = #{creatorName},
</if>
<if test="modifierId != null and modifierId != ''">
modifier_id = #{modifierId},
</if>
<if test="modifierName != null and modifierName != ''">
modifier_name = #{modifierName},
</if>
<if test="statusFlag != null">
status_flag = #{statusFlag},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where role_id = #{roleId}
</update>
</mapper>
<?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.haoban.manage.service.dao.mapper.role.TabHaobanRoleMenuMapper">
<resultMap type="com.gic.haoban.manage.service.entity.role.TabHaobanRoleMenu" id="TabHaobanRoleMenuMap">
<result property="menuId" column="menu_id" jdbcType="INTEGER"/>
<result property="menuCode" column="menu_code" jdbcType="VARCHAR"/>
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
<result property="menuUrl" column="menu_url" jdbcType="VARCHAR"/>
<result property="iconUrl" column="icon_url" jdbcType="VARCHAR"/>
<result property="menuLevel" column="menu_level" jdbcType="INTEGER"/>
<result property="menuType" column="menu_type" jdbcType="INTEGER"/>
<result property="menuSort" column="menu_sort" jdbcType="INTEGER"/>
<result property="parentCode" column="parent_code" jdbcType="VARCHAR"/>
<result property="statusFlag" column="status_flag" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
menu_id, menu_code, menu_name, menu_url, icon_url, menu_level, menu_type, menu_sort, parent_code, status_flag, create_time, update_time
</sql>
<!--查询单个-->
<select id="queryById" resultMap="TabHaobanRoleMenuMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_role_menu
where menu_id = #{menuId}
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="menuId" useGeneratedKeys="true">
insert into tab_haoban_role_menu(menu_id, menu_code, menu_name, menu_url, icon_url, menu_level, menu_type, menu_sort, parent_code, status_flag, create_time, update_time)
values (#{menuId}, #{menuCode}, #{menuName}, #{menuUrl}, #{iconUrl}, #{menuLevel}, #{menuType}, #{menuSort}, #{parentCode}, #{statusFlag}, #{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="menuId" useGeneratedKeys="true">
insert into tab_haoban_role_menu(menu_id, menu_code, menu_name, menu_url, icon_url, menu_level, menu_type,
menu_sort, parent_code, status_flag, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.menuId}, #{entity.menuCode}, #{entity.menuName}, #{entity.menuUrl}, #{entity.iconUrl},
#{entity.menuLevel}, #{entity.menuType}, #{entity.menuSort}, #{entity.parentCode}, #{entity.statusFlag},
#{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tab_haoban_role_menu
<set>
<if test="menuCode != null and menuCode != ''">
menu_code = #{menuCode},
</if>
<if test="menuName != null and menuName != ''">
menu_name = #{menuName},
</if>
<if test="menuUrl != null and menuUrl != ''">
menu_url = #{menuUrl},
</if>
<if test="iconUrl != null and iconUrl != ''">
icon_url = #{iconUrl},
</if>
<if test="menuLevel != null">
menu_level = #{menuLevel},
</if>
<if test="menuType != null">
menu_type = #{menuType},
</if>
<if test="menuSort != null">
menu_sort = #{menuSort},
</if>
<if test="parentCode != null and parentCode != ''">
parent_code = #{parentCode},
</if>
<if test="statusFlag != null">
status_flag = #{statusFlag},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where menu_id = #{menuId}
</update>
</mapper>
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