替换 mgr_role_canteen 表为 sys_role_canteen
替换 mgr_role_warehouse 表为 sys_role_warehouse
This commit is contained in:
parent
31b5076320
commit
c040602a3c
|
|
@ -6,7 +6,7 @@ import com.bonus.canteen.core.common.utils.BaseTreeNode;
|
|||
public class AllocCanteenTreeVO extends BaseTreeNode {
|
||||
private String treeName;
|
||||
private Integer treeType;
|
||||
private Integer halfSelect;
|
||||
// private Integer halfSelect;
|
||||
private Integer bizType;
|
||||
|
||||
public boolean ifCanteen() {
|
||||
|
|
@ -25,9 +25,9 @@ public class AllocCanteenTreeVO extends BaseTreeNode {
|
|||
return this.treeType;
|
||||
}
|
||||
|
||||
public Integer getHalfSelect() {
|
||||
return this.halfSelect;
|
||||
}
|
||||
// public Integer getHalfSelect() {
|
||||
// return this.halfSelect;
|
||||
// }
|
||||
|
||||
public Integer getBizType() {
|
||||
return this.bizType;
|
||||
|
|
@ -41,9 +41,9 @@ public class AllocCanteenTreeVO extends BaseTreeNode {
|
|||
this.treeType = treeType;
|
||||
}
|
||||
|
||||
public void setHalfSelect(final Integer halfSelect) {
|
||||
this.halfSelect = halfSelect;
|
||||
}
|
||||
// public void setHalfSelect(final Integer halfSelect) {
|
||||
// this.halfSelect = halfSelect;
|
||||
// }
|
||||
|
||||
public void setBizType(final Integer bizType) {
|
||||
this.bizType = bizType;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
|
||||
import java.io.Serializable;
|
||||
|
||||
@TableName("mgr_role_warehouse")
|
||||
@TableName("sys_role_warehouse")
|
||||
@ApiModel("角色仓库表")
|
||||
public class MgrRoleWarehouse implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||
|
||||
import java.io.Serializable;
|
||||
|
||||
@TableName("mgr_role_canteen")
|
||||
@TableName("sys_role_canteen")
|
||||
@ApiModel("角色区域、食堂、档口表")
|
||||
public class MgrRoleCanteen implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
@ -16,8 +16,8 @@ public class MgrRoleCanteen implements Serializable {
|
|||
private Long dataId;
|
||||
@ApiModelProperty("类型:1:区域,2:食堂,3:档口")
|
||||
private Integer type;
|
||||
@ApiModelProperty("节点状态:1全选;2半选")
|
||||
private Integer halfSelect;
|
||||
// @ApiModelProperty("节点状态:1全选;2半选")
|
||||
// private Integer halfSelect;
|
||||
|
||||
public Long getRoleId() {
|
||||
return this.roleId;
|
||||
|
|
@ -31,9 +31,9 @@ public class MgrRoleCanteen implements Serializable {
|
|||
return this.type;
|
||||
}
|
||||
|
||||
public Integer getHalfSelect() {
|
||||
return this.halfSelect;
|
||||
}
|
||||
// public Integer getHalfSelect() {
|
||||
// return this.halfSelect;
|
||||
// }
|
||||
|
||||
public MgrRoleCanteen setRoleId(final Long roleId) {
|
||||
this.roleId = roleId;
|
||||
|
|
@ -50,9 +50,9 @@ public class MgrRoleCanteen implements Serializable {
|
|||
return this;
|
||||
}
|
||||
|
||||
public MgrRoleCanteen setHalfSelect(final Integer halfSelect) {
|
||||
this.halfSelect = halfSelect;
|
||||
return this;
|
||||
}
|
||||
// public MgrRoleCanteen setHalfSelect(final Integer halfSelect) {
|
||||
// this.halfSelect = halfSelect;
|
||||
// return this;
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.canteen.core.auth.role.mapper.MgrRoleWarehouseMapper">
|
||||
<insert id="insertBatch" parameterType="object">
|
||||
insert into mgr_role_warehouse
|
||||
insert into sys_role_warehouse
|
||||
values
|
||||
<foreach collection="warehouseList" item="warehouseId" index="index" separator=",">
|
||||
(#{roleId}, #{warehouseId})
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<choose>
|
||||
<when test="'3'.toString() == authPO.roleType.toString()">
|
||||
(SELECT r.warehouse_id
|
||||
FROM mgr_role_warehouse r
|
||||
FROM sys_role_warehouse r
|
||||
LEFT JOIN sys_role o ON o.role_id = r.role_id
|
||||
LEFT JOIN sys_user_role u ON r.role_id = u.role_id
|
||||
WHERE u.user_id = #{authPO.userId}
|
||||
|
|
|
|||
|
|
@ -2,27 +2,28 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.canteen.core.auth.role.mapper.MgrRoleCanteenMapper">
|
||||
<insert id="insertBatch" parameterType="object">
|
||||
insert into mgr_role_canteen
|
||||
insert into sys_role_canteen
|
||||
values
|
||||
<foreach collection="canteenList" item="canteen" index="index" separator=",">
|
||||
(#{roleId}, #{canteen.dataId}, #{canteen.type}, #{canteen.halfSelect})
|
||||
(#{roleId}, #{canteen.dataId}, #{canteen.type})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<select id="getTenantCanteen" resultType="com.bonus.canteen.core.allocation.canteen.vo.AllocCanteenTreeVO">
|
||||
<choose>
|
||||
<when test="'3'.toString() == authPO.roleType.toString()">
|
||||
SELECT half_select, id, parent_id, tree_name, tree_type, biz_type
|
||||
FROM (select data_id,
|
||||
half_select
|
||||
from (SELECT r.data_id, r.half_select
|
||||
FROM mgr_role_canteen r
|
||||
SELECT id, parent_id, tree_name, tree_type, biz_type
|
||||
FROM (select data_id
|
||||
# ,half_select
|
||||
from (SELECT r.data_id
|
||||
# , r.half_select
|
||||
FROM sys_role_canteen r
|
||||
LEFT JOIN sys_role o ON o.role_id = r.role_id
|
||||
LEFT JOIN sys_user_role u ON r.role_id = u.role_id
|
||||
WHERE u.user_id = #{authPO.userId}
|
||||
AND o.role_key = #{authPO.roleCode}
|
||||
AND o.del_flag = 0) s
|
||||
ORDER BY data_id, half_select) t
|
||||
ORDER BY data_id) t
|
||||
LEFT JOIN (SELECT #{merchantId} AS id,
|
||||
-1 AS parent_id,
|
||||
merchant_name AS tree_name,
|
||||
|
|
@ -107,9 +108,9 @@
|
|||
|
||||
<select id="getRoleListByDataId" resultType="com.bonus.canteen.core.auth.role.entity.MgrRole">
|
||||
SELECT mrc.role_id
|
||||
FROM mgr_role_canteen mrc
|
||||
FROM sys_role_canteen mrc
|
||||
WHERE mrc.data_id = #{dataId}
|
||||
AND mrc.half_select = #{excludeMiddle}
|
||||
# AND mrc.half_select = #{excludeMiddle}
|
||||
<if test="roleId != null">
|
||||
AND mrc.role_id != #{roleId}
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -259,12 +259,12 @@
|
|||
<if test="'3'.toString() == authPO.roleType.toString()">
|
||||
AND EXISTS(
|
||||
SELECT NULL
|
||||
FROM mgr_role_canteen it1
|
||||
FROM sys_role_canteen it1
|
||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||
WHERE it2.del_flag = 0
|
||||
AND it2.role_key = #{authPO.roleCode}
|
||||
AND it1.half_select = 1
|
||||
# AND it1.half_select = 1
|
||||
AND it3.user_id = #{authPO.userId}
|
||||
AND (oai.stall_id = it1.data_id or oai.canteen_id = it1.data_id)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -20,23 +20,23 @@
|
|||
AND (
|
||||
EXISTS(
|
||||
SELECT NULL
|
||||
FROM mgr_role_canteen it1
|
||||
FROM sys_role_canteen it1
|
||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||
WHERE it2.del_flag = 0
|
||||
AND it2.role_key = #{authPO.roleCode}
|
||||
AND it1.half_select = 1
|
||||
# AND it1.half_select = 1
|
||||
AND it3.user_id = #{authPO.userId}
|
||||
AND (a.canteen_id = it1.data_id)
|
||||
)
|
||||
OR EXISTS (
|
||||
SELECT NULL
|
||||
FROM mgr_role_canteen it1
|
||||
FROM sys_role_canteen it1
|
||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||
WHERE it2.del_flag = 0
|
||||
AND it2.role_key = #{authPO.roleCode}
|
||||
AND it1.half_select = 1
|
||||
# AND it1.half_select = 1
|
||||
AND it3.user_id = #{authPO.userId}
|
||||
AND (a.stall_id = it1.data_id)
|
||||
)
|
||||
|
|
@ -128,23 +128,23 @@
|
|||
AND (
|
||||
EXISTS(
|
||||
SELECT NULL
|
||||
FROM mgr_role_canteen it1
|
||||
FROM sys_role_canteen it1
|
||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||
WHERE it2.del_flag = 0
|
||||
AND it2.role_key = #{authPO.roleCode}
|
||||
AND it1.half_select = 1
|
||||
# AND it1.half_select = 1
|
||||
AND it3.user_id = #{authPO.userId}
|
||||
AND (o.canteen_id = it1.data_id)
|
||||
)
|
||||
OR EXISTS (
|
||||
SELECT NULL
|
||||
FROM mgr_role_canteen it1
|
||||
FROM sys_role_canteen it1
|
||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||
WHERE it2.del_flag = 0
|
||||
AND it2.role_key = #{authPO.roleCode}
|
||||
AND it1.half_select = 1
|
||||
# AND it1.half_select = 1
|
||||
AND it3.user_id = #{authPO.userId}
|
||||
AND (o.stall_id = it1.data_id)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -7,23 +7,23 @@
|
|||
AND (
|
||||
EXISTS(
|
||||
SELECT NULL
|
||||
FROM mgr_role_canteen it1
|
||||
FROM sys_role_canteen it1
|
||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||
WHERE it2.del_flag = 0
|
||||
AND it2.role_key = #{authPO.roleCode}
|
||||
AND it1.half_select = 1
|
||||
# AND it1.half_select = 1
|
||||
AND it3.user_id = #{authPO.userId}
|
||||
AND (a.stall_id = it1.data_id)
|
||||
)
|
||||
OR EXISTS (
|
||||
SELECT NULL
|
||||
FROM mgr_role_canteen it1
|
||||
FROM sys_role_canteen it1
|
||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||
WHERE it2.del_flag = 0
|
||||
AND it2.role_key = #{authPO.roleCode}
|
||||
AND it1.half_select = 1
|
||||
# AND it1.half_select = 1
|
||||
AND it3.user_id = #{authPO.userId}
|
||||
AND (a.canteen_id = it1.data_id)
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue