Commit 0dbc7b0b by guojuxing

角色菜单权限接口

parent 46e3ee87
package com.gic.auth.dao.mapper;
import com.gic.auth.dto.MenuRoleDTO;
import com.gic.auth.entity.TabSysMenuRole;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabSysMenuRoleMapper {
/**
* 根据主键删除
*
* @param menuRoleId 主键
* @return 更新条目数
*/
int deleteByPrimaryKey(Integer menuRoleId);
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insert(TabSysMenuRole record);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int insertSelective(TabSysMenuRole record);
/**
* 根据主键查询
*
* @param menuRoleId 主键
* @return 实体对象
*/
TabSysMenuRole selectByPrimaryKey(Integer menuRoleId);
/**
* 根据主键动态更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKeySelective(TabSysMenuRole record);
/**
* 根据主键更新记录
*
* @param record 实体对象
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysMenuRole record);
/**
* 删除角色菜单
* @Title: deleteByRoleId

* @Description:

 * @author guojuxing
* @param roleId

* @return int


 */
int deleteByRoleId(@Param("roleId") Integer roleId);
/**
* 批量插入
* @Title: insertForeach

* @Description:

 * @author guojuxing
* @param list

* @return int


 */
int insertForeach(@Param("list") List<MenuRoleDTO> list);
/**
* 根据角色ID查询列表
* @Title: listMenuRoleByRoleId

* @Description:

 * @author guojuxing
* @param roleId

* @return java.util.List<com.gic.auth.dto.MenuRoleDTO>


 */
List<MenuRoleDTO> listMenuRoleByRoleId(@Param("roleId") Integer roleId);
}
\ No newline at end of file
package com.gic.auth.dao.mapper;
import com.gic.auth.dto.RoleListDTO;
import com.gic.auth.entity.TabSysRole;
import com.gic.auth.qo.RoleListQO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TabSysRoleMapper {
/**
......@@ -50,4 +55,24 @@ public interface TabSysRoleMapper {
* @return 更新条目数
*/
int updateByPrimaryKey(TabSysRole record);
/**
* 查询列表
* @Title: listRole

* @Description:

 * @author guojuxing
* @param params

* @return java.util.List<com.gic.auth.entity.TabSysRole>


 */
List<RoleListDTO> listRole(RoleListQO params);
/**
* 逻辑删除
* @Title: deleteByRoleId

* @Description:

 * @author guojuxing
* @param roleId

* @return int


 */
int deleteByRoleId(@Param("roleId") Integer roleId);
}
\ No newline at end of file
package com.gic.auth.entity;
import java.util.Date;
/**
* tab_sys_menu_role
*/
public class TabSysMenuRole {
/**
* id
*/
private Integer menuRoleId;
/**
* 菜单ID
*/
private Integer menuId;
/**
* 权限ID
*/
private Integer roleId;
/**
* 企业ID
*/
private Integer enterpriseId;
/**
* 状态1:有效 0:无效
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
public Integer getMenuRoleId() {
return menuRoleId;
}
public void setMenuRoleId(Integer menuRoleId) {
this.menuRoleId = menuRoleId;
}
public Integer getMenuId() {
return menuId;
}
public void setMenuId(Integer menuId) {
this.menuId = menuId;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
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;
}
}
\ No newline at end of file
package com.gic.auth.service;
import com.gic.auth.dto.MenuRoleDTO;
import java.util.List;
/**
* 角色菜单关联
* @ClassName: MenuRoleService

* @Description: 

* @author guojuxing

* @date 2019/9/3 9:39 AM

*/
public interface MenuRoleService {
/**
* 新增
* @Title: save

* @Description:

 * @author guojuxing
* @param dto

* @return void


 */
void save(MenuRoleDTO dto);
/**
* 删除角色相关菜单权限
* @Title: deleteByRoleId

* @Description:

 * @author guojuxing
* @param roleId

* @return void


 */
void deleteByRoleId(Integer roleId);
/**
* 批量插入
* @Title: insertForeach

* @Description:

 * @author guojuxing
* @param list

* @return void


 */
void insertForeach(List<MenuRoleDTO> list);
/**
* 根据角色ID查询列表
* @Title: listMenuRoleByRoleId

* @Description:

 * @author guojuxing
* @param roleId

* @return java.util.List<com.gic.auth.dto.MenuRoleDTO>


 */
List<MenuRoleDTO> listMenuRoleByRoleId(Integer roleId);
}
package com.gic.auth.service;
import com.gic.auth.dto.RoleDTO;
import com.gic.auth.dto.RoleListDTO;
import com.gic.auth.entity.TabSysRole;
import com.gic.auth.qo.RoleListQO;
import com.github.pagehelper.Page;
/**
* 角色权限接口
* @ClassName: RoleService

* @Description: 

* @author guojuxing

* @date 2019/9/3 9:37 AM

*/
public interface RoleService {
/**
* 新增
* @Title: save

* @Description:

 * @author guojuxing
* @param dto

* @return java.lang.Integer
 主键

 */
Integer save(RoleDTO dto);
/**
* 编辑
* @Title: update

* @Description:

 * @author guojuxing
* @param dto

* @return void


 */
void update(RoleDTO dto);
/**
* 逻辑删除
* @Title: deleteById

* @Description:

 * @author guojuxing
* @param id

* @return void


 */
void deleteById(Integer id);
/**
* 查询分页列表数据
* @Title: pageRole

* @Description:

 * @author guojuxing
* @param params

* @return com.github.pagehelper.Page<com.gic.auth.dto.RoleDTO>


 */
Page<RoleListDTO> pageRole(RoleListQO params);
TabSysRole getById(Integer id);
}
package com.gic.auth.service.impl;
import com.gic.auth.dao.mapper.TabSysMenuRoleMapper;
import com.gic.auth.dto.MenuRoleDTO;
import com.gic.auth.entity.TabSysMenuRole;
import com.gic.auth.service.MenuRoleService;
import com.gic.commons.util.EntityUtil;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@Service("menuRoleService")
public class MenuRoleServiceImpl implements MenuRoleService{
@Autowired
private TabSysMenuRoleMapper tabSysMenuRoleMapper;
@Override
public void save(MenuRoleDTO dto) {
tabSysMenuRoleMapper.insert(EntityUtil.changeEntityNew(TabSysMenuRole.class, dto));
}
@Transactional(rollbackFor = Exception.class)
@Override
public void deleteByRoleId(Integer roleId) {
tabSysMenuRoleMapper.deleteByRoleId(roleId);
}
@Override
public void insertForeach(List<MenuRoleDTO> list) {
}
@Override
public List<MenuRoleDTO> listMenuRoleByRoleId(Integer roleId) {
List<MenuRoleDTO> list = tabSysMenuRoleMapper.listMenuRoleByRoleId(roleId);
if (CollectionUtils.isNotEmpty(list)) {
return list;
}
return new ArrayList<>();
}
}
package com.gic.auth.service.impl;
import java.util.Date;
import java.util.List;
import com.gic.auth.dto.RoleListDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.auth.dao.mapper.TabSysRoleMapper;
import com.gic.auth.dto.RoleDTO;
import com.gic.auth.entity.TabSysRole;
import com.gic.auth.qo.RoleListQO;
import com.gic.auth.service.RoleService;
import com.gic.commons.util.EntityUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.transaction.annotation.Transactional;
@Service("roleService")
public class RoleServiceImpl implements RoleService{
@Autowired
private TabSysRoleMapper tabSysRoleMapper;
@Transactional(rollbackFor = Exception.class)
@Override
public Integer save(RoleDTO dto) {
TabSysRole record = EntityUtil.changeEntityNew(TabSysRole.class, dto);
tabSysRoleMapper.insert(record);
return record.getRoleId();
}
@Transactional(rollbackFor = Exception.class)
@Override
public void update(RoleDTO dto) {
dto.setUpdateTime(new Date());
tabSysRoleMapper.updateByPrimaryKeySelective(EntityUtil.changeEntityNew(TabSysRole.class, dto));
}
@Override
public void deleteById(Integer id) {
tabSysRoleMapper.deleteByRoleId(id);
}
@Override
public Page<RoleListDTO> pageRole(RoleListQO params) {
PageHelper.startPage(params.getCurrentPage(), params.getPageSize());
List<RoleListDTO> list = tabSysRoleMapper.listRole(params);
return (Page<RoleListDTO>) list;
}
@Override
public TabSysRole getById(Integer id) {
return tabSysRoleMapper.selectByPrimaryKey(id);
}
}
package com.gic.auth.service.outer.impl;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.MenuRoleDTO;
import com.gic.auth.service.MenuRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.auth.service.MenuRoleApiService;
import java.util.List;
@Service("menuRoleApiService")
public class MenuRoleApiServiceImpl implements MenuRoleApiService{
@Autowired
private MenuRoleService menuRoleService;
@Override
public ServiceResponse<List<MenuRoleDTO>> listMenuRoleByRoleId(Integer roleId) {
return ServiceResponse.success(menuRoleService.listMenuRoleByRoleId(roleId));
}
}
package com.gic.auth.service.outer.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.gic.auth.dto.RoleListDTO;
import com.gic.auth.entity.TabSysRole;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.error.ErrorCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.auth.dto.MenuRoleDTO;
import com.gic.auth.dto.RoleDTO;
import com.gic.auth.qo.RoleListQO;
import com.gic.auth.service.MenuRoleService;
import com.gic.auth.service.RoleApiService;
import com.gic.auth.service.RoleService;
import com.gic.auth.utils.ValidSplitUtils;
import com.gic.enterprise.utils.valid.ValidParamsUtils;
@Service("roleApiService")
public class RoleApiServiceImpl implements RoleApiService{
@Autowired
private RoleService roleService;
@Autowired
private MenuRoleService menuRoleService;
@Transactional(rollbackFor = Exception.class)
@Override
public ServiceResponse<Integer> save(RoleDTO dto) {
ServiceResponse paramValid = ValidParamsUtils.allCheckValidate(dto, RoleDTO.SaveRoleValid.class);
if (!paramValid.isSuccess()) {
return paramValid;
}
dto.setUpdateTime(new Date());
dto.setCreateTime(new Date());
dto.setStatus(1);
Integer roleId = roleService.save(dto);
//删除之前的角色菜单数据
menuRoleService.deleteByRoleId(dto.getRoleId());
ServiceResponse<Integer> menuRoleResponse = saveMenuRole(roleId, dto.getEnterpriseId(), dto.getMenuIds());
if (!menuRoleResponse.isSuccess()) {
//事物回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return menuRoleResponse;
}
@Transactional(rollbackFor = Exception.class)
@Override
public ServiceResponse<Integer> update(RoleDTO dto) {
TabSysRole record = roleService.getById(dto.getRoleId());
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "角色数据有误,查无数据");
}
ServiceResponse paramValid = ValidParamsUtils.allCheckValidate(dto, RoleDTO.EditRoleValid.class);
if (!paramValid.isSuccess()) {
return paramValid;
}
roleService.update(dto);
//删除之前的角色菜单数据
menuRoleService.deleteByRoleId(dto.getRoleId());
ServiceResponse<Integer> menuRoleResponse = saveMenuRole(dto.getRoleId(), record.getEnterpriseId(), dto.getMenuIds());
if (!menuRoleResponse.isSuccess()) {
//事物回滚
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return menuRoleResponse;
}
@Override
public ServiceResponse<RoleDTO> getById(Integer id) {
TabSysRole record = roleService.getById(id);
if (record == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "角色数据有误,查无数据");
}
List<MenuRoleDTO> menuRoleDTOList = menuRoleService.listMenuRoleByRoleId(id);
StringBuilder menuId = new StringBuilder();
for (MenuRoleDTO menuRole : menuRoleDTOList) {
menuId.append(menuRole.getMenuId()).append(",");
}
RoleDTO result = EntityUtil.changeEntityNew(RoleDTO.class, record);
String menuIds = menuId.toString();
result.setMenuIds(menuIds.substring(0, menuIds.length() - 1));
return ServiceResponse.success(result);
}
@Override
public ServiceResponse<Page<RoleListDTO>> pageRole(RoleListQO params) {
com.github.pagehelper.Page page = roleService.pageRole(params);
Page<RoleListDTO> resultPage = PageHelperUtils.changePageHelperToCurrentPage(page);
return ServiceResponse.success(resultPage);
}
private ServiceResponse<Integer> saveMenuRole(Integer roleId, Integer enterpriseId, String menuIds) {
String[] menuIdArr;
ServiceResponse<String[]> menuIdResponse = ValidSplitUtils.validStr(menuIds);
if (menuIdResponse.isSuccess()) {
menuIdArr = menuIdResponse.getResult();
} else {
return ServiceResponse.failure(menuIdResponse.getCode(), menuIdResponse.getMessage());
}
List<MenuRoleDTO> list = new ArrayList<>(menuIdArr.length);
for (String menuId : menuIdArr) {
MenuRoleDTO menuRoleDTO = new MenuRoleDTO();
menuRoleDTO.setEnterpriseId(enterpriseId);
menuRoleDTO.setRoleId(roleId);
menuRoleDTO.setMenuId(Integer.parseInt(menuId));
list.add(menuRoleDTO);
}
menuRoleService.insertForeach(list);
return ServiceResponse.success(roleId);
}
}
......@@ -3,6 +3,7 @@ package com.gic.auth.service.outer.impl;
import java.util.Date;
import java.util.List;
import com.gic.auth.utils.ValidSplitUtils;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -177,15 +178,15 @@ public class UserApiServiceImpl implements UserApiService {
String userResourceIds) {
String[] userRoleIdArr;
String[] userResourceIdArr;
ServiceResponse<Object> userRoleValid = validStr(userRoleIds);
ServiceResponse<String[]> userRoleValid = ValidSplitUtils.validStr(userRoleIds);
if (userRoleValid.isSuccess()) {
userRoleIdArr = (String[]) userRoleValid.getResult();
userRoleIdArr = userRoleValid.getResult();
} else {
return ServiceResponse.failure(userRoleValid.getCode(), userRoleValid.getMessage());
}
ServiceResponse<Object> userResourceIdValid = validStr(userResourceIds);
ServiceResponse<String[]> userResourceIdValid = ValidSplitUtils.validStr(userResourceIds);
if (userResourceIdValid.isSuccess()) {
userResourceIdArr = (String[]) userRoleValid.getResult();
userResourceIdArr = userRoleValid.getResult();
} else {
return ServiceResponse.failure(userResourceIdValid.getCode(), userResourceIdValid.getMessage());
}
......@@ -214,12 +215,4 @@ public class UserApiServiceImpl implements UserApiService {
return ServiceResponse.success(userId);
}
private static ServiceResponse<Object> validStr(String param) {
if (!StringUtils.isNumeric(param.replaceAll(",", ""))) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "数据格式有误,不是英文逗号隔开的数据");
}
String[] strArr = param.split(",");
return ServiceResponse.success(strArr);
}
}
......@@ -22,4 +22,6 @@
<dubbo:service interface="com.gic.auth.service.ResourceApiService" ref="resourceApiService" timeout="6000" />
<dubbo:service interface="com.gic.auth.service.AuthCodeApiService" ref="authCodeApiService" timeout="6000" />
<dubbo:service interface="com.gic.auth.service.UnionEnterpriseApiService" ref="unionEnterpriseApiService" timeout="6000" />
<!--角色-->
<dubbo:service interface="com.gic.auth.service.RoleApiService" ref="roleApiService" timeout="6000" />
</beans>
<?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.TabSysMenuRoleMapper">
<resultMap id="BaseResultMap" type="com.gic.auth.entity.TabSysMenuRole">
<id column="menu_role_id" jdbcType="INTEGER" property="menuRoleId" />
<result column="menu_id" jdbcType="INTEGER" property="menuId" />
<result column="role_id" jdbcType="INTEGER" property="roleId" />
<result column="enterprise_id" jdbcType="INTEGER" property="enterpriseId" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
menu_role_id, menu_id, role_id, enterprise_id, status, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu_role
where menu_role_id = #{menuRoleId,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_sys_menu_role
where menu_role_id = #{menuRoleId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysMenuRole">
insert into tab_sys_menu_role (menu_role_id, menu_id, role_id,
enterprise_id, status, create_time,
update_time)
values (#{menuRoleId,jdbcType=INTEGER}, #{menuId,jdbcType=INTEGER}, #{roleId,jdbcType=INTEGER},
#{enterpriseId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.auth.entity.TabSysMenuRole">
insert into tab_sys_menu_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="menuRoleId != null">
menu_role_id,
</if>
<if test="menuId != null">
menu_id,
</if>
<if test="roleId != null">
role_id,
</if>
<if test="enterpriseId != null">
enterprise_id,
</if>
<if test="status != null">
status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="menuRoleId != null">
#{menuRoleId,jdbcType=INTEGER},
</if>
<if test="menuId != null">
#{menuId,jdbcType=INTEGER},
</if>
<if test="roleId != null">
#{roleId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
#{enterpriseId,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>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.auth.entity.TabSysMenuRole">
update tab_sys_menu_role
<set>
<if test="menuId != null">
menu_id = #{menuId,jdbcType=INTEGER},
</if>
<if test="roleId != null">
role_id = #{roleId,jdbcType=INTEGER},
</if>
<if test="enterpriseId != null">
enterprise_id = #{enterpriseId,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>
</set>
where menu_role_id = #{menuRoleId,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.gic.auth.entity.TabSysMenuRole">
update tab_sys_menu_role
set menu_id = #{menuId,jdbcType=INTEGER},
role_id = #{roleId,jdbcType=INTEGER},
enterprise_id = #{enterpriseId,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where menu_role_id = #{menuRoleId,jdbcType=INTEGER}
</update>
<delete id="deleteByRoleId">
DELETE FROM tab_sys_menu_role
where role_id = #{roleId}
</delete>
<insert id="insertForeach" parameterType="java.util.List">
insert into tab_sys_menu_role (menu_role_id, menu_id, role_id,
enterprise_id, status, create_time,
update_time)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.menuRoleId},
#{item.menuId},
#{item.roleId},
#{item.enterpriseId},
#{item.status},
#{item.createTime},
#{item.updateTime}
)
</foreach>
</insert>
<select id="listMenuRoleByRoleId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_sys_menu_role
where role_id = #{roleId}
and status = 1
</select>
</mapper>
\ No newline at end of file
......@@ -22,7 +22,7 @@
delete from tab_sys_role
where role_id = #{roleId,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.auth.entity.TabSysRole">
<insert id="insert" parameterType="com.gic.auth.entity.TabSysRole" useGeneratedKeys="true" keyProperty="roleId">
insert into tab_sys_role (role_id, role_name, enterprise_id,
status, create_time, update_time
)
......@@ -103,4 +103,23 @@
update_time = #{updateTime,jdbcType=TIMESTAMP}
where role_id = #{roleId,jdbcType=INTEGER}
</update>
<select id="listRole" parameterType="com.gic.auth.qo.RoleListQO" resultType="com.gic.auth.dto.RoleListDTO">
select
a.role_id roleId,
a.role_name roleName,
(select count(b.user_id) from tab_sys_user_role b where a.role_id = b.role_id and b.status = 1 group b.user_id) authUserCount
from tab_sys_role a
where a.status = 1
and a.enterprise_id = #{enterpriseId}
<if test="search != null and search != '' ">
and ( a.role_name like concat('%', #{search}, '%') )
</if>
</select>
<update id="deleteByRoleId">
update tab_sys_role set status = 0
where role_id = #{roleId}
and status = 1
</update>
</mapper>
\ No newline at end of file
......@@ -43,4 +43,7 @@
<dubbo:reference interface="com.gic.auth.service.ResourceApiService" id="resourceApiService" timeout="6000" />
<dubbo:reference interface="com.gic.auth.service.AuthCodeApiService" id="authCodeApiService" timeout="6000" />
<dubbo:reference interface="com.gic.auth.service.UnionEnterpriseApiService" id="unionEnterpriseApiService" timeout="6000" />
<!--角色-->
<dubbo:reference interface="com.gic.auth.service.RoleApiService" id="roleApiService" timeout="6000" />
</beans>
\ 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