1.增加角色扫码单据类型授权接口
2.新增数据表SQL CREATE TABLE `spms`.`basic_bussiness_type_role` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id', `role_id` int NULL COMMENT '角色id', `action` varchar(255) NULL COMMENT '业务类型', PRIMARY KEY (`id`) );master
parent
e6cc462036
commit
77e7511157
@ -0,0 +1,27 @@
|
||||
package com.glxp.sale.admin.dao.basic;
|
||||
|
||||
import com.glxp.sale.admin.entity.basic.BasicBussinessTypeRoleEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface BasicBussinessTypeRoleDao {
|
||||
|
||||
public List<BasicBussinessTypeRoleEntity> getListByRoleId(@Param("roleId") Long roleId);
|
||||
|
||||
/**
|
||||
* 删除此角色下所有的扫码单据类型授权数据
|
||||
*
|
||||
* @param roleId
|
||||
*/
|
||||
void deleteByRoleId(@Param("roleId") Long roleId);
|
||||
|
||||
/**
|
||||
* 插入授权数据
|
||||
*
|
||||
* @param basicBussinessTypeRoleEntities
|
||||
*/
|
||||
void insert(@Param("basicBussinessTypeRoleEntities") List<BasicBussinessTypeRoleEntity> basicBussinessTypeRoleEntities);
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.glxp.sale.admin.entity.basic;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 扫码单据类型和角色关联表
|
||||
*/
|
||||
@Data
|
||||
public class BasicBussinessTypeRoleEntity {
|
||||
|
||||
private Integer id;
|
||||
|
||||
//角色id
|
||||
private Long role_id;
|
||||
|
||||
//业务类型
|
||||
private String action;
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?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.glxp.sale.admin.dao.basic.BasicBussinessTypeRoleDao">
|
||||
<select id="getListByRoleId" resultType="com.glxp.sale.admin.entity.basic.BasicBussinessTypeRoleEntity">
|
||||
select *
|
||||
from basic_bussiness_type_role
|
||||
where role_id = #{roleId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByRoleId">
|
||||
delete
|
||||
from basic_bussiness_type_role
|
||||
where role_id = #{roleId}
|
||||
</delete>
|
||||
|
||||
<insert id="insert" parameterType="com.glxp.sale.admin.entity.basic.BasicBussinessTypeRoleEntity">
|
||||
insert into basic_bussiness_type_role
|
||||
(role_id, action)
|
||||
values
|
||||
<foreach collection="basicBussinessTypeRoleEntities" index="index" item="item" separator=",">
|
||||
(#{item.role_id},
|
||||
#{item.action})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
Loading…
Reference in New Issue