清除mgrrole相关

This commit is contained in:
sxu 2025-03-25 15:49:01 +08:00
parent 6c8eea05f5
commit 63b9752eff
7 changed files with 2 additions and 317 deletions

View File

@ -1,222 +0,0 @@
package com.bonus.canteen.core.auth.role.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.time.LocalDateTime;
@TableName("sys_role")
@ApiModel("系统角色表")
@Data
public class MgrRole extends Model<MgrRole> {
private static final long serialVersionUID = 1L;
@TableId
@ApiModelProperty("主键id")
private Long id;
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("角色名称")
private String roleName;
@ApiModelProperty("角色标识")
private String roleCode;
@ApiModelProperty("描述")
private String roleDesc;
@ApiModelProperty("类型")
private Integer dsType;
@ApiModelProperty("ds_scope")
private String dsScope;
@ApiModelProperty("食堂类范围id")
private Long canteenEffId;
@ApiModelProperty("人员类范围id")
private Long custEffId;
@ApiModelProperty("菜品类范围id")
private Long dishesEffId;
@ApiModelProperty("仓库类范围Id")
private Long warehouseEffId;
@ApiModelProperty("标识")
private Integer delFlag;
@ApiModelProperty("乐观锁")
private Integer revision;
@TableField(
value = "crby",
fill = FieldFill.INSERT
)
@ApiModelProperty("创建人")
private String crby;
@ApiModelProperty("创建时间")
private LocalDateTime crtime;
@ApiModelProperty("更新人")
@TableField(
value = "upby",
fill = FieldFill.UPDATE
)
private String upby;
@ApiModelProperty("更新时间")
private LocalDateTime uptime;
@ApiModelProperty("角色类型")
private Integer roleType;
@ApiModelProperty("归属区域")
private Long areaId;
public Long getId() {
return this.id;
}
public Long getRoleId() {
return this.roleId;
}
public String getRoleName() {
return this.roleName;
}
public String getRoleCode() {
return this.roleCode;
}
public String getRoleDesc() {
return this.roleDesc;
}
public Integer getDsType() {
return this.dsType;
}
public String getDsScope() {
return this.dsScope;
}
public Long getCanteenEffId() {
return this.canteenEffId;
}
public Long getCustEffId() {
return this.custEffId;
}
public Long getDishesEffId() {
return this.dishesEffId;
}
public Long getWarehouseEffId() {
return this.warehouseEffId;
}
public Integer getDelFlag() {
return this.delFlag;
}
public Integer getRevision() {
return this.revision;
}
public String getCrby() {
return this.crby;
}
public LocalDateTime getCrtime() {
return this.crtime;
}
public String getUpby() {
return this.upby;
}
public LocalDateTime getUptime() {
return this.uptime;
}
public Integer getRoleType() {
return this.roleType;
}
public Long getAreaId() {
return this.areaId;
}
public void setId(final Long id) {
this.id = id;
}
public void setRoleId(final Long roleId) {
this.roleId = roleId;
}
public void setRoleName(final String roleName) {
this.roleName = roleName;
}
public void setRoleCode(final String roleCode) {
this.roleCode = roleCode;
}
public void setRoleDesc(final String roleDesc) {
this.roleDesc = roleDesc;
}
public void setDsType(final Integer dsType) {
this.dsType = dsType;
}
public void setDsScope(final String dsScope) {
this.dsScope = dsScope;
}
public void setCanteenEffId(final Long canteenEffId) {
this.canteenEffId = canteenEffId;
}
public void setCustEffId(final Long custEffId) {
this.custEffId = custEffId;
}
public void setDishesEffId(final Long dishesEffId) {
this.dishesEffId = dishesEffId;
}
public void setWarehouseEffId(final Long warehouseEffId) {
this.warehouseEffId = warehouseEffId;
}
public void setDelFlag(final Integer delFlag) {
this.delFlag = delFlag;
}
public void setRevision(final Integer revision) {
this.revision = revision;
}
public void setCrby(final String crby) {
this.crby = crby;
}
public void setCrtime(final LocalDateTime crtime) {
this.crtime = crtime;
}
public void setUpby(final String upby) {
this.upby = upby;
}
public void setUptime(final LocalDateTime uptime) {
this.uptime = uptime;
}
public void setRoleType(final Integer roleType) {
this.roleType = roleType;
}
public void setAreaId(final Long areaId) {
this.areaId = areaId;
}
}

View File

@ -11,8 +11,4 @@ import java.util.List;
@Mapper
public interface MgrRoleAreaMapper extends BaseMapper<MgrRoleArea> {
List<Long> getTenantAreaIdList(@Param("excludeMiddle") Integer excludeMiddle, @Param("authPO") MgrUserAuthPO mgrUserAuthPO);
//
// void insertBatch(@Param("roleId") Long roleId, @Param("areaList") List<MgrRoleAreaDTO> areaList);
//
// List<MgrRole> getRoleListByDataId(@Param("dataId") Long dataId, @Param("roleIdList") List<Long> roleIdList, @Param("excludeMiddle") Integer excludeMiddle);
}

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.allocation.canteen.vo.AllocCanteenTreeVO;
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
import com.bonus.canteen.core.auth.role.dto.MgrRoleCanteenDTO;
import com.bonus.canteen.core.auth.role.entity.MgrRole;
import com.bonus.canteen.core.auth.role.entity.MgrRoleCanteen;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -17,5 +16,5 @@ public interface MgrRoleCanteenMapper extends BaseMapper<MgrRoleCanteen> {
List<AllocCanteenTreeVO> getTenantCanteen(@Param("excludeMiddle") Integer excludeMiddle, @Param("merchantId") Long merchantId, @Param("authPO") MgrUserAuthPO mgrUserAuthPO, @Param("delFlag") Integer delFlag);
List<MgrRole> getRoleListByDataId(@Param("dataId") Long dataId, @Param("roleId") Long roleId, @Param("excludeMiddle") Integer excludeMiddle);
// List<MgrRole> getRoleListByDataId(@Param("dataId") Long dataId, @Param("roleId") Long roleId, @Param("excludeMiddle") Integer excludeMiddle);
}

View File

@ -3,7 +3,6 @@ package com.bonus.canteen.core.auth.role.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
import com.bonus.canteen.core.auth.role.dto.MgrRoleOrgDTO;
import com.bonus.canteen.core.auth.role.entity.MgrRole;
import com.bonus.canteen.core.auth.role.entity.MgrRoleOrg;
import com.bonus.canteen.core.customer.dto.CustOrgTreeDTO;
import org.apache.ibatis.annotations.Mapper;
@ -17,5 +16,5 @@ public interface MgrRoleOrgMapper extends BaseMapper<MgrRoleOrg> {
List<CustOrgTreeDTO> getTenantOrg(@Param("excludeMiddle") Integer excludeMiddle, @Param("authPO") MgrUserAuthPO mgrUserAuthPO, @Param("delFlag") Integer delFlag);
List<MgrRole> getRoleListByOrgId(@Param("orgId") Long orgId, @Param("roleId") Long roleId, @Param("excludeMiddle") Integer excludeMiddle);
// List<MgrRole> getRoleListByOrgId(@Param("orgId") Long orgId, @Param("roleId") Long roleId, @Param("excludeMiddle") Integer excludeMiddle);
}

View File

@ -105,15 +105,4 @@
</otherwise>
</choose>
</select>
<select id="getRoleListByDataId" resultType="com.bonus.canteen.core.auth.role.entity.MgrRole">
SELECT mrc.role_id
FROM sys_role_canteen mrc
WHERE mrc.data_id = #{dataId}
<!-- AND mrc.half_select = #{excludeMiddle} -->
<if test="roleId != null">
AND mrc.role_id != #{roleId}
</if>
GROUP BY mrc.role_id
</select>
</mapper>

View File

@ -11,9 +11,6 @@
WHERE u.user_id = #{authPO.userId}
AND o.role_key = #{authPO.roleCode}
AND o.del_flag = 0
<!-- <if test="excludeMiddle == 1">-->
<!-- AND r.half_select = 1-->
<!-- </if>-->
</select>
<insert id="insertBatch">
@ -23,18 +20,4 @@
(#{roleId}, #{area.dataId})
</foreach>
</insert>
<select id="getRoleListByDataId" resultType="com.bonus.canteen.core.auth.role.entity.MgrRole">
SELECT mra.role_id
FROM sys_role_area mra
WHERE mra.area_id = #{dataId}
<!-- AND mra.half_select = #{excludeMiddle} -->
<if test="roleIdList != null and roleIdList.size() != 0">
AND mra.role_id NOT IN
<foreach collection="roleIdList" item="roleId" index="index" open="(" close=")" separator=",">
#{roleId}
</foreach>
</if>
GROUP BY mra.role_id
</select>
</mapper>

View File

@ -45,63 +45,4 @@
</otherwise>
</choose>
</select>
<!-- <select id="getTenantOrg" resultType="com.bonus.canteen.core.customer.dto.CustOrgTreeDTO">-->
<!-- SELECT c.org_id,-->
<!-- c.org_num,-->
<!-- c.org_name,-->
<!-- c.org_full_name,-->
<!-- c.org_level,-->
<!-- c.super_id,-->
<!-- c.sort-->
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
<!-- ,-->
<!-- t.half_select-->
<!-- </if>-->
<!-- FROM-->
<!-- <choose>-->
<!-- <when test="'2'.toString() == authPO.roleType.toString()">-->
<!-- ( select org_id,-->
<!-- half_select-->
<!-- from (-->
<!-- SELECT o.org_id, o.half_select-->
<!-- FROM mgr_role_org o-->
<!-- LEFT JOIN mgr_role r ON r.role_id = o.role_id-->
<!-- LEFT JOIN mgr_user_role u ON o.role_id = u.role_id-->
<!-- WHERE r.del_flag = 2-->
<!-- AND u.user_id = #{authPO.userId}-->
<!-- AND r.role_code = #{authPO.roleCode}-->
<!-- ) s-->
<!-- ORDER BY org_id, half_select) t-->
<!-- LEFT JOIN cust_org c ON c.org_id = t.org_id-->
<!-- <where>-->
<!-- <if test="delFlag != null">-->
<!-- AND c.if_del = #{delFlag}-->
<!-- </if>-->
<!-- <if test="excludeMiddle == 1">-->
<!-- AND t.half_select = 1-->
<!-- </if>-->
<!-- </where>-->
<!-- </when>-->
<!-- <otherwise>-->
<!-- cust_org c-->
<!-- <where>-->
<!-- <if test="delFlag != null">-->
<!-- AND c.if_del = #{delFlag}-->
<!-- </if>-->
<!-- </where>-->
<!-- </otherwise>-->
<!-- </choose>-->
<!-- </select>-->
<select id="getRoleListByOrgId" resultType="com.bonus.canteen.core.auth.role.entity.MgrRole">
SELECT mro.role_id
FROM sys_role_dept mro
WHERE mro.dept_id = #{orgId}
<!-- AND mro.half_select = #{excludeMiddle} -->
<if test="roleId != null">
AND mro.role_id != #{roleId}
</if>
GROUP BY mro.role_id
</select>
</mapper>