权限功能调整及权限主体禁用功能(未完成)

This commit is contained in:
tiger_zhou 2022-10-20 13:33:58 +08:00
parent f9b02894e0
commit 0b04b23537
16 changed files with 381 additions and 166 deletions

View File

@ -8,6 +8,7 @@ import club.joylink.rtss.vo.permission.subject.PermissionSubjectQueryVO;
import club.joylink.rtss.vo.permission.subject.PermissionSubjectVO; import club.joylink.rtss.vo.permission.subject.PermissionSubjectVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -27,4 +28,9 @@ public class PermissionSubjectController {
public PageVO<PermissionSubjectVO> page(PermissionSubjectQueryVO req) { public PageVO<PermissionSubjectVO> page(PermissionSubjectQueryVO req) {
return this.subjectService.page(req); return this.subjectService.page(req);
} }
@GetMapping(path = "/status/inValid/{subjectId}")
public void statusForInValid(@PathVariable Long subjectId){
this.subjectService.subjectAndDistributeStatusForInValid(subjectId);
}
} }

View File

@ -4,13 +4,41 @@ import java.util.List;
import club.joylink.rtss.entity.permission.PermissionSubject; import club.joylink.rtss.entity.permission.PermissionSubject;
import club.joylink.rtss.entity.permission.PermissionSubjectExample; import club.joylink.rtss.entity.permission.PermissionSubjectExample;
import club.joylink.rtss.vo.permission.subject.PermissionSubjectQueryVO;
import club.joylink.rtss.vo.permission.subject.PermissionSubjectVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Mapper @Mapper
@Repository @Repository
public interface PermissionSubjectDAO { public interface PermissionSubjectDAO {
@Select("<select>" +
"set global group_concat_max_len = 10240;" +
"set session group_concat_max_len = 10240;" +
"select t4.* from " +
"(" +
"select @ids _ids, (select @ids := group_concat(id) from rts_permission_subject where find_in_set(parent_id, @ids)) " +
" from rts_permission_subject t1 , (select @ids := #{currentLevelId}) t2 " +
" where t1.id >= #{currentLevelId} and @ids is not null " +
") t3, rts_permission_subject t4 " +
"where t4.id >= #{currentLevelId} and find_in_set(t4.id, t3._ids);" +
"</select>")
List<PermissionSubject> circleQueryChildById(Long currentLevelId);
@Select("<select>" +
"select A.id,A.subject_type,A.subject_id," +
"(case when A.subject_type = 'user' then B.name when A.subject_type = 'org' then C.name end) as named," +
"(case when A.subject_type = 'user' then B.nickname else '' end) as nick_name," +
"A.amount,A.remains,A.status,A.forever,A.start_time,A.end_time,A.create_time,D.name as permission_name,A.permission_id " +
" from rts_permission_subject A left join sys_account B on A.subject_type = 'user' and A.subject_id = B.id " +
" left join org C on A.subject_type = 'org' and A.subject_id = C.id " +
" left join rts_permission D on A.permission_id = D.id " +
" where 1 = 1 " +
" order by id desc " +
"</select>")
List<PermissionSubjectVO> customerQuery(PermissionSubjectQueryVO queryVO);
long countByExample(PermissionSubjectExample example); long countByExample(PermissionSubjectExample example);
int deleteByExample(PermissionSubjectExample example); int deleteByExample(PermissionSubjectExample example);

View File

@ -3,13 +3,25 @@ package club.joylink.rtss.dao.permission;
import club.joylink.rtss.entity.permission.SystemAbility; import club.joylink.rtss.entity.permission.SystemAbility;
import club.joylink.rtss.entity.permission.SystemAbilityExample; import club.joylink.rtss.entity.permission.SystemAbilityExample;
import java.util.List; import java.util.List;
import club.joylink.rtss.vo.permission.PermissionSystemAbilityVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Mapper @Mapper
@Repository @Repository
public interface SystemAbilityDAO { public interface SystemAbilityDAO {
@Select("<select>" +
"select A.id,B.permission_id,A.type,A.ability_id,A.status,A.name as ability_name " +
"from rts_system_ability A , rts_permission_system_ability B " +
"where 1 = 1 and A.id = B.system_ability_id " +
" <foreach collection=\"permissions\" open=\" and B.permission_id in (\" close=\")\" item=\"d\" separator=\" , \"> "+
" #{d} "+
" </foreach>" +
"</select>")
List<PermissionSystemAbilityVO> findSystemAbilityByPermissionId(List<Long> permissions);
long countByExample(SystemAbilityExample example); long countByExample(SystemAbilityExample example);
int deleteByExample(SystemAbilityExample example); int deleteByExample(SystemAbilityExample example);
@ -31,4 +43,4 @@ public interface SystemAbilityDAO {
int updateByPrimaryKeySelective(SystemAbility record); int updateByPrimaryKeySelective(SystemAbility record);
int updateByPrimaryKey(SystemAbility record); int updateByPrimaryKey(SystemAbility record);
} }

View File

@ -22,7 +22,7 @@ public class PermissionSubject implements Serializable {
private Long permissionId; private Long permissionId;
/** /**
* 主体类型(User,Org) * 主体类型(user,org)
*/ */
private String subjectType; private String subjectType;
@ -42,7 +42,7 @@ public class PermissionSubject implements Serializable {
private Integer remains; private Integer remains;
/** /**
* 状态 * 权限主体状态,Valid-有效InValid-无效
*/ */
private String status; private String status;
@ -70,7 +70,11 @@ public class PermissionSubject implements Serializable {
* 来自对应的分发id(rts_permission_distribute) * 来自对应的分发id(rts_permission_distribute)
*/ */
private Long distributeId; private Long distributeId;
;
/**
* 父级id 数据来源rts_permission_distribute表source_subject_id字段
*/
private Long parentId;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -864,6 +864,66 @@ public class PermissionSubjectExample {
addCriterion("distribute_id not between", value1, value2, "distributeId"); addCriterion("distribute_id not between", value1, value2, "distributeId");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andParentIdIsNull() {
addCriterion("parent_id is null");
return (Criteria) this;
}
public Criteria andParentIdIsNotNull() {
addCriterion("parent_id is not null");
return (Criteria) this;
}
public Criteria andParentIdEqualTo(Long value) {
addCriterion("parent_id =", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotEqualTo(Long value) {
addCriterion("parent_id <>", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThan(Long value) {
addCriterion("parent_id >", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdGreaterThanOrEqualTo(Long value) {
addCriterion("parent_id >=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThan(Long value) {
addCriterion("parent_id <", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdLessThanOrEqualTo(Long value) {
addCriterion("parent_id <=", value, "parentId");
return (Criteria) this;
}
public Criteria andParentIdIn(List<Long> values) {
addCriterion("parent_id in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotIn(List<Long> values) {
addCriterion("parent_id not in", values, "parentId");
return (Criteria) this;
}
public Criteria andParentIdBetween(Long value1, Long value2) {
addCriterion("parent_id between", value1, value2, "parentId");
return (Criteria) this;
}
public Criteria andParentIdNotBetween(Long value1, Long value2) {
addCriterion("parent_id not between", value1, value2, "parentId");
return (Criteria) this;
}
} }
/** /**

View File

@ -2,6 +2,7 @@ package club.joylink.rtss.entity.permission;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data; import lombok.Data;
/** /**
@ -15,6 +16,11 @@ public class SystemAbility implements Serializable {
*/ */
private Long id; private Long id;
/**
* 对应 rts_map_system 中的map_id
*/
private Long mapId;
/** /**
* 功能的类型 * 功能的类型
*/ */
@ -30,11 +36,6 @@ public class SystemAbility implements Serializable {
*/ */
private String name; private String name;
/**
* 功能的描述
*/
private String des;
/** /**
* 状态 * 状态
*/ */
@ -56,4 +57,4 @@ public class SystemAbility implements Serializable {
private LocalDateTime updateTime; private LocalDateTime updateTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }

View File

@ -1,7 +1,7 @@
package club.joylink.rtss.entity.permission; package club.joylink.rtss.entity.permission;
import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
public class SystemAbilityExample { public class SystemAbilityExample {
@ -185,6 +185,66 @@ public class SystemAbilityExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMapIdIsNull() {
addCriterion("map_id is null");
return (Criteria) this;
}
public Criteria andMapIdIsNotNull() {
addCriterion("map_id is not null");
return (Criteria) this;
}
public Criteria andMapIdEqualTo(Long value) {
addCriterion("map_id =", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotEqualTo(Long value) {
addCriterion("map_id <>", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdGreaterThan(Long value) {
addCriterion("map_id >", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdGreaterThanOrEqualTo(Long value) {
addCriterion("map_id >=", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdLessThan(Long value) {
addCriterion("map_id <", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdLessThanOrEqualTo(Long value) {
addCriterion("map_id <=", value, "mapId");
return (Criteria) this;
}
public Criteria andMapIdIn(List<Long> values) {
addCriterion("map_id in", values, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotIn(List<Long> values) {
addCriterion("map_id not in", values, "mapId");
return (Criteria) this;
}
public Criteria andMapIdBetween(Long value1, Long value2) {
addCriterion("map_id between", value1, value2, "mapId");
return (Criteria) this;
}
public Criteria andMapIdNotBetween(Long value1, Long value2) {
addCriterion("map_id not between", value1, value2, "mapId");
return (Criteria) this;
}
public Criteria andTypeIsNull() { public Criteria andTypeIsNull() {
addCriterion("`type` is null"); addCriterion("`type` is null");
return (Criteria) this; return (Criteria) this;
@ -385,76 +445,6 @@ public class SystemAbilityExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andDesIsNull() {
addCriterion("des is null");
return (Criteria) this;
}
public Criteria andDesIsNotNull() {
addCriterion("des is not null");
return (Criteria) this;
}
public Criteria andDesEqualTo(String value) {
addCriterion("des =", value, "des");
return (Criteria) this;
}
public Criteria andDesNotEqualTo(String value) {
addCriterion("des <>", value, "des");
return (Criteria) this;
}
public Criteria andDesGreaterThan(String value) {
addCriterion("des >", value, "des");
return (Criteria) this;
}
public Criteria andDesGreaterThanOrEqualTo(String value) {
addCriterion("des >=", value, "des");
return (Criteria) this;
}
public Criteria andDesLessThan(String value) {
addCriterion("des <", value, "des");
return (Criteria) this;
}
public Criteria andDesLessThanOrEqualTo(String value) {
addCriterion("des <=", value, "des");
return (Criteria) this;
}
public Criteria andDesLike(String value) {
addCriterion("des like", value, "des");
return (Criteria) this;
}
public Criteria andDesNotLike(String value) {
addCriterion("des not like", value, "des");
return (Criteria) this;
}
public Criteria andDesIn(List<String> values) {
addCriterion("des in", values, "des");
return (Criteria) this;
}
public Criteria andDesNotIn(List<String> values) {
addCriterion("des not in", values, "des");
return (Criteria) this;
}
public Criteria andDesBetween(String value1, String value2) {
addCriterion("des between", value1, value2, "des");
return (Criteria) this;
}
public Criteria andDesNotBetween(String value1, String value2) {
addCriterion("des not between", value1, value2, "des");
return (Criteria) this;
}
public Criteria andStatusIsNull() { public Criteria andStatusIsNull() {
addCriterion("`status` is null"); addCriterion("`status` is null");
return (Criteria) this; return (Criteria) this;
@ -595,52 +585,52 @@ public class SystemAbilityExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeEqualTo(LocalDateTime value) { public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime"); addCriterion("create_time =", value, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeNotEqualTo(LocalDateTime value) { public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime"); addCriterion("create_time <>", value, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeGreaterThan(LocalDateTime value) { public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime"); addCriterion("create_time >", value, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) { public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime"); addCriterion("create_time >=", value, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeLessThan(LocalDateTime value) { public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime"); addCriterion("create_time <", value, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) { public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime"); addCriterion("create_time <=", value, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeIn(List<LocalDateTime> values) { public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime"); addCriterion("create_time in", values, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeNotIn(List<LocalDateTime> values) { public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime"); addCriterion("create_time not in", values, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime"); addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime"); addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this; return (Criteria) this;
} }
@ -655,52 +645,52 @@ public class SystemAbilityExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeEqualTo(LocalDateTime value) { public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime"); addCriterion("update_time =", value, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) { public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime"); addCriterion("update_time <>", value, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeGreaterThan(LocalDateTime value) { public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime"); addCriterion("update_time >", value, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) { public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime"); addCriterion("update_time >=", value, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeLessThan(LocalDateTime value) { public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime"); addCriterion("update_time <", value, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) { public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime"); addCriterion("update_time <=", value, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeIn(List<LocalDateTime> values) { public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime"); addCriterion("update_time in", values, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeNotIn(List<LocalDateTime> values) { public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime"); addCriterion("update_time not in", values, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime"); addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime"); addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this; return (Criteria) this;
} }
@ -800,4 +790,4 @@ public class SystemAbilityExample {
this(condition, value, secondValue, null); this(condition, value, secondValue, null);
} }
} }
} }

View File

@ -3,15 +3,23 @@ package club.joylink.rtss.services.permission;
import club.joylink.rtss.dao.permission.PermissionSubjectDAO; import club.joylink.rtss.dao.permission.PermissionSubjectDAO;
import club.joylink.rtss.entity.permission.PermissionSubject; import club.joylink.rtss.entity.permission.PermissionSubject;
import club.joylink.rtss.entity.permission.PermissionSubjectExample; import club.joylink.rtss.entity.permission.PermissionSubjectExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.permission.PermissionSubjectTypeEnum;
import club.joylink.rtss.vo.permission.PermissionSystemAbilityVO;
import club.joylink.rtss.vo.permission.subject.PermissionSubjectQueryVO; import club.joylink.rtss.vo.permission.subject.PermissionSubjectQueryVO;
import club.joylink.rtss.vo.permission.subject.PermissionSubjectVO; import club.joylink.rtss.vo.permission.subject.PermissionSubjectVO;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
@ -19,11 +27,36 @@ public class PermissionSubjectService {
@Resource @Resource
private PermissionSubjectDAO subjectDAO; private PermissionSubjectDAO subjectDAO;
@Resource
private SystemAbilityService systemAbilityService;
public PageVO<PermissionSubjectVO> page(PermissionSubjectQueryVO queryVO){ public PageVO<PermissionSubjectVO> page(PermissionSubjectQueryVO queryVO){
PageHelper.startPage(queryVO.getPageNum(),queryVO.getPageSize()); PageHelper.startPage(queryVO.getPageNum(),queryVO.getPageSize());
PermissionSubjectExample example = new PermissionSubjectExample(); Page<PermissionSubjectVO> page = (Page<PermissionSubjectVO>) this.subjectDAO.customerQuery(queryVO);
PermissionSubjectExample.Criteria criteria = example.createCriteria(); List<Long> permissionList = page.getResult().stream().filter(Objects::nonNull).map(PermissionSubjectVO::getPermissionId).collect(Collectors.toList());
Page<PermissionSubject> page = (Page<PermissionSubject>) this.subjectDAO.selectByExample(example); List<PermissionSystemAbilityVO> abilityVOList = this.systemAbilityService.findSystemAbilityByPermissionId(permissionList);
return PageVO.convert(page,PermissionSubjectVO.convertorList(page.getResult())); Map<Long,List<PermissionSystemAbilityVO>> permissionMapList = abilityVOList.stream().collect(Collectors.groupingBy(PermissionSystemAbilityVO::getPermissionId));
for (PermissionSubjectVO subjectVO : page.getResult()) {
List<PermissionSystemAbilityVO> list = permissionMapList.get(subjectVO.getPermissionId());
if(!CollectionUtils.isEmpty(list)){
subjectVO.setSystemAbilityList(list);
}
}
return PageVO.convert(page);
}
public PermissionSubject findById(Long subjectId){
PermissionSubject ps = this.subjectDAO.selectByPrimaryKey(subjectId);
BusinessExceptionAssertEnum.DATA_NOT_EXIST.assertTrue(Objects.nonNull(ps),"");
return ps;
}
public void subjectAndDistributeStatusForInValid(Long subjectId){
PermissionSubject ps = this.findById(subjectId);
if(Objects.equals(ps.getSubjectType(),PermissionSubjectTypeEnum.user.name())){
List<PermissionSubject> psList = this.subjectDAO.circleQueryChildById(subjectId);
//TODO 循环设置主体状态
}
} }
} }

View File

@ -7,8 +7,11 @@ import club.joylink.rtss.entity.permission.PermissionSystemAbilityExample;
import club.joylink.rtss.entity.permission.SystemAbility; import club.joylink.rtss.entity.permission.SystemAbility;
import club.joylink.rtss.entity.permission.SystemAbilityExample; import club.joylink.rtss.entity.permission.SystemAbilityExample;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum; import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.mapSystem.RtsMapSystemService;
import club.joylink.rtss.vo.LoginUserInfoVO; import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.mapSystem.RtsMapSystemQueryVO;
import club.joylink.rtss.vo.client.mapSystem.RtsMapSystemVO;
import club.joylink.rtss.vo.permission.*; import club.joylink.rtss.vo.permission.*;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -19,9 +22,11 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static club.joylink.rtss.vo.permission.SystemAbilityStatus.Editing; import static club.joylink.rtss.vo.permission.SystemAbilityStatus.Editing;
@ -34,6 +39,8 @@ public class SystemAbilityService {
private SystemAbilityDAO systemAbilityDAO; private SystemAbilityDAO systemAbilityDAO;
@Resource @Resource
private PermissionSystemAbilityDAO permissionSystemAbilityDAO; private PermissionSystemAbilityDAO permissionSystemAbilityDAO;
@Resource
private RtsMapSystemService mapSystemService;
public SystemAbility findById(Long id){ public SystemAbility findById(Long id){
@ -58,13 +65,14 @@ public class SystemAbilityService {
this.checkSameName(req.getName()); this.checkSameName(req.getName());
SystemAbility ability=new SystemAbility(); SystemAbility ability=new SystemAbility();
ability.setName(req.getName()); ability.setName(req.getName());
ability.setDes(req.getDes()); ability.setMapId(req.getMapId());
ability.setCreatorId(creatorId); ability.setCreatorId(creatorId);
ability.setType(req.getType().name()); ability.setType(req.getType().name());
ability.setAbilityId(req.getFunctionId()); ability.setAbilityId(req.getFunctionId());
ability.setCreateTime(LocalDateTime.now()); ability.setCreateTime(LocalDateTime.now());
ability.setUpdateTime(LocalDateTime.now()); ability.setUpdateTime(LocalDateTime.now());
ability.setStatus(Enable.name()); ability.setStatus(Enable.name());
this.systemAbilityDAO.insertSelective(ability); this.systemAbilityDAO.insertSelective(ability);
} }
/** /**
@ -100,6 +108,7 @@ public class SystemAbilityService {
BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(vo.getId()),"数据id不能为空"); BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertTrue(Objects.nonNull(vo.getId()),"数据id不能为空");
SystemAbility dbSA = this.findById(vo.getId()); SystemAbility dbSA = this.findById(vo.getId());
dbSA.setType(vo.getType().name()); dbSA.setType(vo.getType().name());
dbSA.setMapId(vo.getMapId());
dbSA.setAbilityId(vo.getFunctionId()); dbSA.setAbilityId(vo.getFunctionId());
dbSA.setUpdateTime(LocalDateTime.now()); dbSA.setUpdateTime(LocalDateTime.now());
this.systemAbilityDAO.updateByPrimaryKeySelective(dbSA); this.systemAbilityDAO.updateByPrimaryKeySelective(dbSA);
@ -156,4 +165,25 @@ public class SystemAbilityService {
return PageVO.convert(page, questionVOS); return PageVO.convert(page, questionVOS);
} }
public List<PermissionSystemAbilityVO> findSystemAbilityByPermissionId(List<Long> permissions){
if(CollectionUtils.isEmpty(permissions)){
return Collections.emptyList();
}
return this.systemAbilityDAO.findSystemAbilityByPermissionId(permissions);
}
@Transactional
public void autoSynchMapSystemData(){
List<RtsMapSystemVO> voList = this.mapSystemService.listQuery(new RtsMapSystemQueryVO());
List<SystemAbility> abilities = this.systemAbilityDAO.selectByExample(new SystemAbilityExample());
if(CollectionUtils.isEmpty(abilities)){
this.systemAbilityDAO.insertSelective(null);
}else{
Map<String,SystemAbility> abilityMap = abilities.stream().collect(Collectors.toMap(k->k.getType() + k.getAbilityId() + k.getMapId(), Function.identity()));
Map<String,RtsMapSystemVO> mapSystemMap = voList.stream().collect(Collectors.toMap(k->k.getName() + k.getId() + k.getMapId(), Function.identity()));
}
}
} }

View File

@ -13,10 +13,7 @@ public class AutoCreateSystemAbilityReqVo {
*/ */
@NotNull @NotNull
private String name; private String name;
/**
* 权限功能描述
*/
private String des;
/** /**
* 权限功能类型 * 权限功能类型
*/ */
@ -29,4 +26,6 @@ public class AutoCreateSystemAbilityReqVo {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
@NotNull @NotNull
private Long functionId; private Long functionId;
private Long mapId;
} }

View File

@ -0,0 +1,16 @@
package club.joylink.rtss.vo.permission;
import lombok.Data;
import java.io.Serializable;
@Data
public class PermissionSystemAbilityVO implements Serializable {
private static final long serialVersionUID = 374617905492080377L;
private Long id;
private Long permissionId;
private String type;
private Long abilityId;
private String status;
private String abilityName;
}

View File

@ -26,4 +26,6 @@ public class UpdateAbilityFunctionReqVo {
@JsonSerialize(using = ToStringSerializer.class) @JsonSerialize(using = ToStringSerializer.class)
@NotNull @NotNull
private Long functionId; private Long functionId;
private Long mapId;
} }

View File

@ -5,4 +5,17 @@ import lombok.Data;
@Data @Data
public class PermissionSubjectQueryVO extends PageQueryVO { public class PermissionSubjectQueryVO extends PageQueryVO {
/**
* 查询类型 use/org
*/
private String subType;
/**
* 用户/org 对应的name
*/
private String named;
/**
* 权限主体状态,1-有效2-无效
*/
private String status;
} }

View File

@ -1,6 +1,7 @@
package club.joylink.rtss.vo.permission.subject; package club.joylink.rtss.vo.permission.subject;
import club.joylink.rtss.entity.permission.PermissionSubject; import club.joylink.rtss.entity.permission.PermissionSubject;
import club.joylink.rtss.vo.permission.PermissionSystemAbilityVO;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.Data; import lombok.Data;
@ -9,42 +10,37 @@ import java.util.List;
@Data @Data
public class PermissionSubjectVO { public class PermissionSubjectVO {
private Long id; private Long id;
/** /**
* 访问权限id * 主体类型 use/org
*/
private Long permissionId;
/**
* 主体类型(User,Org)
*/ */
private String subjectType; private String subjectType;
/** /**
* 主体id * 主体对应的id
*/ */
private Long subjectId; private Long subjectId;
/** /**
* 主体对该权限的总数量 * 主体名称
*/ */
private String named;
/**
* 用户昵称
*/
private String nickName;
private Integer amount; private Integer amount;
/** /**
* 主体对该权限的剩余数量 * 主体对该权限的剩余数量
*/ */
private Integer remains; private Integer remains;
/** /**
* 状态 * 状态
*/ */
private String status; private String status;
/** /**
* 是否永久1-true/0-false * 是否永久1-true/0-false
*/ */
private Boolean forever; private Boolean forever;
/** /**
* 开始时间 * 开始时间
*/ */
@ -59,12 +55,22 @@ public class PermissionSubjectVO {
* 创建时间 * 创建时间
*/ */
private LocalDateTime createTime; private LocalDateTime createTime;
/**
* 权限名称
*/
private String permissionName;
/**
* 访问权限id
*/
private Long permissionId;
/** /**
* 来自对应的分发id(rts_permission_distribute) * 来自对应的分发id(rts_permission_distribute)
*/ */
private Long distributeId; private Long distributeId;
private List<PermissionSystemAbilityVO> systemAbilityList;
/*
public static PermissionSubjectVO convertorBean(PermissionSubject ps) { public static PermissionSubjectVO convertorBean(PermissionSubject ps) {
PermissionSubjectVO vo = new PermissionSubjectVO(); PermissionSubjectVO vo = new PermissionSubjectVO();
vo.setId(ps.getId()); vo.setId(ps.getId());
@ -87,5 +93,5 @@ public class PermissionSubjectVO {
listData.add(convertorBean(ps)); listData.add(convertorBean(ps));
} }
return listData; return listData;
} }*/
} }

View File

@ -14,6 +14,7 @@
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" /> <result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="distribute_id" jdbcType="BIGINT" property="distributeId" /> <result column="distribute_id" jdbcType="BIGINT" property="distributeId" />
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -75,7 +76,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, permission_id, subject_type, subject_id, amount, remains, `status`, forever, id, permission_id, subject_type, subject_id, amount, remains, `status`, forever,
start_time, end_time, create_time, distribute_id start_time, end_time, create_time, distribute_id, parent_id
</sql> </sql>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.permission.PermissionSubjectExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="club.joylink.rtss.entity.permission.PermissionSubjectExample" resultMap="BaseResultMap">
select select
@ -115,19 +116,19 @@
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="club.joylink.rtss.entity.permission.PermissionSubject" keyColumn="id" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" parameterType="club.joylink.rtss.entity.permission.PermissionSubject">
insert into rts_permission_subject (id, permission_id, subject_type, insert into rts_permission_subject (id, permission_id, subject_type,
subject_id, amount, remains, subject_id, amount, remains,
`status`, forever, start_time, `status`, forever, start_time,
end_time, create_time, distribute_id end_time, create_time, distribute_id,
) parent_id)
values (#{id,jdbcType=BIGINT}, #{permissionId,jdbcType=BIGINT}, #{subjectType,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{permissionId,jdbcType=BIGINT}, #{subjectType,jdbcType=VARCHAR},
#{subjectId,jdbcType=BIGINT}, #{amount,jdbcType=INTEGER}, #{remains,jdbcType=INTEGER}, #{subjectId,jdbcType=BIGINT}, #{amount,jdbcType=INTEGER}, #{remains,jdbcType=INTEGER},
#{status,jdbcType=VARCHAR}, #{forever,jdbcType=BIT}, #{startTime,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR}, #{forever,jdbcType=BIT}, #{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{distributeId,jdbcType=BIGINT} #{endTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{distributeId,jdbcType=BIGINT},
) #{parentId,jdbcType=BIGINT})
</insert> </insert>
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.permission.PermissionSubject" keyColumn="id" keyProperty="id" useGeneratedKeys="true"> <insert id="insertSelective" parameterType="club.joylink.rtss.entity.permission.PermissionSubject">
insert into rts_permission_subject insert into rts_permission_subject
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -166,6 +167,9 @@
<if test="distributeId != null"> <if test="distributeId != null">
distribute_id, distribute_id,
</if> </if>
<if test="parentId != null">
parent_id,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -204,6 +208,9 @@
<if test="distributeId != null"> <if test="distributeId != null">
#{distributeId,jdbcType=BIGINT}, #{distributeId,jdbcType=BIGINT},
</if> </if>
<if test="parentId != null">
#{parentId,jdbcType=BIGINT},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.permission.PermissionSubjectExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="club.joylink.rtss.entity.permission.PermissionSubjectExample" resultType="java.lang.Long">
@ -251,6 +258,9 @@
<if test="record.distributeId != null"> <if test="record.distributeId != null">
distribute_id = #{record.distributeId,jdbcType=BIGINT}, distribute_id = #{record.distributeId,jdbcType=BIGINT},
</if> </if>
<if test="record.parentId != null">
parent_id = #{record.parentId,jdbcType=BIGINT},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -269,7 +279,8 @@
start_time = #{record.startTime,jdbcType=TIMESTAMP}, start_time = #{record.startTime,jdbcType=TIMESTAMP},
end_time = #{record.endTime,jdbcType=TIMESTAMP}, end_time = #{record.endTime,jdbcType=TIMESTAMP},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
distribute_id = #{record.distributeId,jdbcType=BIGINT} distribute_id = #{record.distributeId,jdbcType=BIGINT},
parent_id = #{record.parentId,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -310,6 +321,9 @@
<if test="distributeId != null"> <if test="distributeId != null">
distribute_id = #{distributeId,jdbcType=BIGINT}, distribute_id = #{distributeId,jdbcType=BIGINT},
</if> </if>
<if test="parentId != null">
parent_id = #{parentId,jdbcType=BIGINT},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -325,7 +339,8 @@
start_time = #{startTime,jdbcType=TIMESTAMP}, start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP}, end_time = #{endTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
distribute_id = #{distributeId,jdbcType=BIGINT} distribute_id = #{distributeId,jdbcType=BIGINT},
parent_id = #{parentId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="club.joylink.rtss.dao.permission.SystemAbilityDAO"> <mapper namespace="club.joylink.rtss.dao.SystemAbilityDAO">
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.permission.SystemAbility"> <resultMap id="BaseResultMap" type="club.joylink.rtss.entity.race2.SystemAbility">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="map_id" jdbcType="BIGINT" property="mapId" />
<result column="type" jdbcType="VARCHAR" property="type" /> <result column="type" jdbcType="VARCHAR" property="type" />
<result column="ability_id" jdbcType="BIGINT" property="abilityId" /> <result column="ability_id" jdbcType="BIGINT" property="abilityId" />
<result column="name" jdbcType="VARCHAR" property="name" /> <result column="name" jdbcType="VARCHAR" property="name" />
<result column="des" jdbcType="VARCHAR" property="des" />
<result column="status" jdbcType="VARCHAR" property="status" /> <result column="status" jdbcType="VARCHAR" property="status" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" /> <result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@ -71,9 +71,9 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, `type`, ability_id, `name`, des, `status`, creator_id, create_time, update_time id, map_id, `type`, ability_id, `name`, `status`, creator_id, create_time, update_time
</sql> </sql>
<select id="selectByExample" parameterType="club.joylink.rtss.entity.permission.SystemAbilityExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="club.joylink.rtss.entity.race2.SystemAbilityExample" resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
distinct distinct
@ -105,28 +105,31 @@
delete from rts_system_ability delete from rts_system_ability
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete> </delete>
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.permission.SystemAbilityExample"> <delete id="deleteByExample" parameterType="club.joylink.rtss.entity.race2.SystemAbilityExample">
delete from rts_system_ability delete from rts_system_ability
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="club.joylink.rtss.entity.permission.SystemAbility" keyColumn="id" keyProperty="id" useGeneratedKeys="true"> <insert id="insert" parameterType="club.joylink.rtss.entity.race2.SystemAbility">
insert into rts_system_ability (id, `type`, ability_id, insert into rts_system_ability (id, map_id, `type`,
`name`, des, `status`, ability_id, `name`, `status`,
creator_id, create_time, update_time creator_id, create_time, update_time
) )
values (#{id,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, #{abilityId,jdbcType=BIGINT}, values (#{id,jdbcType=BIGINT}, #{mapId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{des,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{abilityId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} #{creatorId,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.permission.SystemAbility" keyColumn="id" keyProperty="id" useGeneratedKeys="true"> <insert id="insertSelective" parameterType="club.joylink.rtss.entity.race2.SystemAbility">
insert into rts_system_ability insert into rts_system_ability
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
id, id,
</if> </if>
<if test="mapId != null">
map_id,
</if>
<if test="type != null"> <if test="type != null">
`type`, `type`,
</if> </if>
@ -136,9 +139,6 @@
<if test="name != null"> <if test="name != null">
`name`, `name`,
</if> </if>
<if test="des != null">
des,
</if>
<if test="status != null"> <if test="status != null">
`status`, `status`,
</if> </if>
@ -156,6 +156,9 @@
<if test="id != null"> <if test="id != null">
#{id,jdbcType=BIGINT}, #{id,jdbcType=BIGINT},
</if> </if>
<if test="mapId != null">
#{mapId,jdbcType=BIGINT},
</if>
<if test="type != null"> <if test="type != null">
#{type,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
</if> </if>
@ -165,9 +168,6 @@
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
</if> </if>
<if test="des != null">
#{des,jdbcType=VARCHAR},
</if>
<if test="status != null"> <if test="status != null">
#{status,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
</if> </if>
@ -182,7 +182,7 @@
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="club.joylink.rtss.entity.permission.SystemAbilityExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="club.joylink.rtss.entity.race2.SystemAbilityExample" resultType="java.lang.Long">
select count(*) from rts_system_ability select count(*) from rts_system_ability
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
@ -194,6 +194,9 @@
<if test="record.id != null"> <if test="record.id != null">
id = #{record.id,jdbcType=BIGINT}, id = #{record.id,jdbcType=BIGINT},
</if> </if>
<if test="record.mapId != null">
map_id = #{record.mapId,jdbcType=BIGINT},
</if>
<if test="record.type != null"> <if test="record.type != null">
`type` = #{record.type,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR},
</if> </if>
@ -203,9 +206,6 @@
<if test="record.name != null"> <if test="record.name != null">
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
</if> </if>
<if test="record.des != null">
des = #{record.des,jdbcType=VARCHAR},
</if>
<if test="record.status != null"> <if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
</if> </if>
@ -226,10 +226,10 @@
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update rts_system_ability update rts_system_ability
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
map_id = #{record.mapId,jdbcType=BIGINT},
`type` = #{record.type,jdbcType=VARCHAR}, `type` = #{record.type,jdbcType=VARCHAR},
ability_id = #{record.abilityId,jdbcType=BIGINT}, ability_id = #{record.abilityId,jdbcType=BIGINT},
`name` = #{record.name,jdbcType=VARCHAR}, `name` = #{record.name,jdbcType=VARCHAR},
des = #{record.des,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
creator_id = #{record.creatorId,jdbcType=BIGINT}, creator_id = #{record.creatorId,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
@ -238,9 +238,12 @@
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.permission.SystemAbility"> <update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.race2.SystemAbility">
update rts_system_ability update rts_system_ability
<set> <set>
<if test="mapId != null">
map_id = #{mapId,jdbcType=BIGINT},
</if>
<if test="type != null"> <if test="type != null">
`type` = #{type,jdbcType=VARCHAR}, `type` = #{type,jdbcType=VARCHAR},
</if> </if>
@ -250,9 +253,6 @@
<if test="name != null"> <if test="name != null">
`name` = #{name,jdbcType=VARCHAR}, `name` = #{name,jdbcType=VARCHAR},
</if> </if>
<if test="des != null">
des = #{des,jdbcType=VARCHAR},
</if>
<if test="status != null"> <if test="status != null">
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
</if> </if>
@ -268,16 +268,16 @@
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.permission.SystemAbility"> <update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.race2.SystemAbility">
update rts_system_ability update rts_system_ability
set `type` = #{type,jdbcType=VARCHAR}, set map_id = #{mapId,jdbcType=BIGINT},
`type` = #{type,jdbcType=VARCHAR},
ability_id = #{abilityId,jdbcType=BIGINT}, ability_id = #{abilityId,jdbcType=BIGINT},
`name` = #{name,jdbcType=VARCHAR}, `name` = #{name,jdbcType=VARCHAR},
des = #{des,jdbcType=VARCHAR},
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
creator_id = #{creatorId,jdbcType=BIGINT}, creator_id = #{creatorId,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>