Merge remote-tracking branch 'origin/test-training2' into test-training2
# Conflicts: # src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java
This commit is contained in:
commit
a652d06bb6
2
sql/20221017-wei-project_view.sql
Normal file
2
sql/20221017-wei-project_view.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
alter table `joylink`.`project_view`
|
||||||
|
drop index `mark_key`;
|
@ -0,0 +1,37 @@
|
|||||||
|
package club.joylink.rtss.controller.permission2;
|
||||||
|
|
||||||
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
|
import club.joylink.rtss.vo.permission.CreatePermissionDistributeReqVo;
|
||||||
|
import club.joylink.rtss.vo.permission.CreatePermissionDistributeRspVo;
|
||||||
|
import club.joylink.rtss.vo.permission.FindPermissionDistributeByPageReqVo;
|
||||||
|
import club.joylink.rtss.vo.permission.PermissionDistributeRspVo;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限分发业务接口V2
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v2/permission/distribute")
|
||||||
|
public class AcPermissionDistributeController {
|
||||||
|
/**
|
||||||
|
* 创建权限分发
|
||||||
|
*/
|
||||||
|
@PostMapping("/create")
|
||||||
|
public CreatePermissionDistributeRspVo createPermissionDistribute(@RequestBody CreatePermissionDistributeReqVo req) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页获取权限分发列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/find/page")
|
||||||
|
public PageVO<PermissionDistributeRspVo> findPermissionDistributeByPage(@RequestBody FindPermissionDistributeByPageReqVo req) {
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -2,8 +2,9 @@ package club.joylink.rtss.controller.permission2;
|
|||||||
|
|
||||||
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主体(用户或组织)的权限管理接口<br>
|
* 主体(用户或组织)的权限管理接口V2<br>
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/v2/permission/subject")
|
@RequestMapping("/api/v2/permission/subject")
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
package club.joylink.rtss.dao.permission;
|
||||||
|
|
||||||
|
import club.joylink.rtss.entity.permission.PermissionDistribute;
|
||||||
|
import club.joylink.rtss.entity.permission.PermissionDistributeExample;
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Repository
|
||||||
|
public interface RtsPermissionDistributeDAO {
|
||||||
|
long countByExample(PermissionDistributeExample example);
|
||||||
|
|
||||||
|
int deleteByExample(PermissionDistributeExample example);
|
||||||
|
|
||||||
|
int deleteByPrimaryKey(Long id);
|
||||||
|
|
||||||
|
int insert(PermissionDistribute record);
|
||||||
|
|
||||||
|
int insertSelective(PermissionDistribute record);
|
||||||
|
|
||||||
|
List<PermissionDistribute> selectByExample(PermissionDistributeExample example);
|
||||||
|
|
||||||
|
PermissionDistribute selectByPrimaryKey(Long id);
|
||||||
|
|
||||||
|
int updateByExampleSelective(@Param("record") PermissionDistribute record, @Param("example") PermissionDistributeExample example);
|
||||||
|
|
||||||
|
int updateByExample(@Param("record") PermissionDistribute record, @Param("example") PermissionDistributeExample example);
|
||||||
|
|
||||||
|
int updateByPrimaryKeySelective(PermissionDistribute record);
|
||||||
|
|
||||||
|
int updateByPrimaryKey(PermissionDistribute record);
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package club.joylink.rtss.entity.permission;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PermissionDistribute implements Serializable {
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联权限id
|
||||||
|
*/
|
||||||
|
private Long permissionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分发来自subject id(rts_permission_subject)
|
||||||
|
*/
|
||||||
|
private Long sourceSubjectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总数量
|
||||||
|
*/
|
||||||
|
private Integer amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余数量
|
||||||
|
*/
|
||||||
|
private Integer remains;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否永久:true/false
|
||||||
|
*/
|
||||||
|
private Boolean forever;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限分发状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者id
|
||||||
|
*/
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注描述
|
||||||
|
*/
|
||||||
|
private String dsc;
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -65,5 +65,10 @@ public class PermissionSubject implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 来自对应的分发id(rts_permission_distribute)
|
||||||
|
*/
|
||||||
|
private Long distributeId;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
@ -804,6 +804,66 @@ public class PermissionSubjectExample {
|
|||||||
addCriterion("create_time not between", value1, value2, "createTime");
|
addCriterion("create_time not between", value1, value2, "createTime");
|
||||||
return (Criteria) this;
|
return (Criteria) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdIsNull() {
|
||||||
|
addCriterion("distribute_id is null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdIsNotNull() {
|
||||||
|
addCriterion("distribute_id is not null");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdEqualTo(Long value) {
|
||||||
|
addCriterion("distribute_id =", value, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdNotEqualTo(Long value) {
|
||||||
|
addCriterion("distribute_id <>", value, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdGreaterThan(Long value) {
|
||||||
|
addCriterion("distribute_id >", value, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdGreaterThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("distribute_id >=", value, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdLessThan(Long value) {
|
||||||
|
addCriterion("distribute_id <", value, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdLessThanOrEqualTo(Long value) {
|
||||||
|
addCriterion("distribute_id <=", value, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdIn(List<Long> values) {
|
||||||
|
addCriterion("distribute_id in", values, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdNotIn(List<Long> values) {
|
||||||
|
addCriterion("distribute_id not in", values, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("distribute_id between", value1, value2, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Criteria andDistributeIdNotBetween(Long value1, Long value2) {
|
||||||
|
addCriterion("distribute_id not between", value1, value2, "distributeId");
|
||||||
|
return (Criteria) this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,6 +8,10 @@ import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
|
|||||||
import club.joylink.rtss.util.JsonUtils;
|
import club.joylink.rtss.util.JsonUtils;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
import club.joylink.rtss.vo.map.logic.MapDisStationNewVO;
|
import club.joylink.rtss.vo.map.logic.MapDisStationNewVO;
|
||||||
|
import club.joylink.rtss.vo.paper.PaperUserInfoVo;
|
||||||
|
import club.joylink.rtss.vo.paper.convertor.PaperUserConvertor;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -26,94 +30,86 @@ public class DraftMapDisStationService {
|
|||||||
* 新建调度台业务
|
* 新建调度台业务
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(MapDisStationNewVO vo){
|
public void create(MapDisStationNewVO vo) {
|
||||||
List<DraftMapDisStation> find = this.findByMapIdAndCode(vo.getMapId(),vo.getCode());
|
List<DraftMapDisStation> find = this.findByMapIdAndCode(vo.getMapId(), vo.getCode());
|
||||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(CollectionUtils.isEmpty(find), String.format("草稿[mapId=%s code=%s]调度台逻辑数据已经存在",vo.getMapId(),vo.getCode()));
|
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(CollectionUtils.isEmpty(find), String.format("草稿[mapId=%s code=%s]调度台逻辑数据已经存在", vo.getMapId(), vo.getCode()));
|
||||||
DraftMapDisStation entity = convert(vo);
|
DraftMapDisStation entity = convert(vo);
|
||||||
draftMapDisStationDAO.insertSelective(entity);
|
draftMapDisStationDAO.insertSelective(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 存储
|
* 存储
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void store(MapDisStationNewVO vo){
|
public void store(MapDisStationNewVO vo) {
|
||||||
List<DraftMapDisStation> find = this.findByMapIdAndCode(vo.getMapId(),vo.getCode());
|
List<DraftMapDisStation> find = this.findByMapIdAndCode(vo.getMapId(), vo.getCode());
|
||||||
if(CollectionUtils.isEmpty(find)){
|
if (CollectionUtils.isEmpty(find)) {
|
||||||
DraftMapDisStation entity = convert(vo);
|
DraftMapDisStation entity = convert(vo);
|
||||||
this.draftMapDisStationDAO.insert(entity);
|
this.draftMapDisStationDAO.insert(entity);
|
||||||
}else{
|
} else {
|
||||||
DraftMapDisStation entity = convert(vo);
|
DraftMapDisStation entity = convert(vo);
|
||||||
entity.setId(find.get(0).getId());
|
entity.setId(find.get(0).getId());
|
||||||
this.draftMapDisStationDAO.updateByPrimaryKey(entity);
|
this.draftMapDisStationDAO.updateByPrimaryKey(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新调度台业务
|
* 更新调度台业务
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void update(MapDisStationNewVO vo){
|
public void update(MapDisStationNewVO vo) {
|
||||||
List<DraftMapDisStation> find = this.findByMapIdAndCode(vo.getMapId(),vo.getCode());
|
List<DraftMapDisStation> find = this.findByMapIdAndCode(vo.getMapId(), vo.getCode());
|
||||||
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != find && find.size()==1, String.format("草稿[mapId=%s code=%s]调度台逻辑数据不存在或不唯一",vo.getMapId(),vo.getCode()));
|
BusinessExceptionAssertEnum.SYSTEM_EXCEPTION.assertTrue(null != find && find.size() == 1, String.format("草稿[mapId=%s code=%s]调度台逻辑数据不存在或不唯一", vo.getMapId(), vo.getCode()));
|
||||||
DraftMapDisStation entity = convert(vo);
|
DraftMapDisStation entity = convert(vo);
|
||||||
entity.setId(find.get(0).getId());
|
entity.setId(find.get(0).getId());
|
||||||
//
|
//
|
||||||
this.draftMapDisStationDAO.updateByPrimaryKeySelective(entity);
|
this.draftMapDisStationDAO.updateByPrimaryKeySelective(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除调度台业务
|
* 删除调度台业务
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void delete(Long mapId,String code){
|
public void delete(Long mapId, String code) {
|
||||||
DraftMapDisStationExample example = new DraftMapDisStationExample();
|
DraftMapDisStationExample example = new DraftMapDisStationExample();
|
||||||
example.createCriteria().andMapIdEqualTo(mapId).andCodeEqualTo(code);
|
example.createCriteria().andMapIdEqualTo(mapId).andCodeEqualTo(code);
|
||||||
this.draftMapDisStationDAO.deleteByExample(example);
|
this.draftMapDisStationDAO.deleteByExample(example);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public MapDisStationNewVO getByMapIdAndCode(Long mapId, String code){
|
public MapDisStationNewVO getByMapIdAndCode(Long mapId, String code) {
|
||||||
List<DraftMapDisStation> list = this.findByMapIdAndCode(mapId,code);
|
List<DraftMapDisStation> list = this.findByMapIdAndCode(mapId, code);
|
||||||
if(!CollectionUtils.isEmpty(list)){
|
if (!CollectionUtils.isEmpty(list)) {
|
||||||
DraftMapDisStation entity = list.get(0);
|
DraftMapDisStation entity = list.get(0);
|
||||||
return convert(entity);
|
return convert(entity);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public PageVO<MapDisStationNewVO> findByPage(Long mapId, DraftMapDisStationController.FindByPageReq req){
|
public PageVO<MapDisStationNewVO> findByPage(Long mapId, DraftMapDisStationController.FindByPageReq req) {
|
||||||
PageVO<MapDisStationNewVO> page = new PageVO<>();
|
final String orderBy = "id" + (req.getDesc() ? " desc" : "");
|
||||||
DraftMapDisStationExample example = new DraftMapDisStationExample();
|
DraftMapDisStationExample example = new DraftMapDisStationExample();
|
||||||
example.createCriteria().andMapIdEqualTo(mapId);
|
example.createCriteria().andMapIdEqualTo(mapId);
|
||||||
long sum = draftMapDisStationDAO.countByExample(example);
|
|
||||||
page.setTotal(sum);
|
|
||||||
page.setPageNum(req.getPageNum());
|
|
||||||
page.setPageSize(req.getPageSize());
|
|
||||||
page.setList(new ArrayList<>());
|
|
||||||
if (sum > 0) {
|
|
||||||
//
|
//
|
||||||
String orderBy = "id";
|
PageHelper.startPage(req.getPageNum(), req.getPageSize(), orderBy);
|
||||||
long startIndex = (req.getPageNum() - 1) * req.getPageSize();
|
Page<DraftMapDisStation> pContent = (Page<DraftMapDisStation>) this.draftMapDisStationDAO.selectByExample(example);
|
||||||
|
PageHelper.clearPage();
|
||||||
//
|
//
|
||||||
if (req.getDesc()) {
|
List<MapDisStationNewVO> voList = new ArrayList<>();
|
||||||
example.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
if (!CollectionUtils.isEmpty(pContent.getResult())) {
|
||||||
} else {
|
voList = pContent.getResult().stream().map(DraftMapDisStationService::convert).collect(Collectors.toList());
|
||||||
example.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
|
||||||
}
|
}
|
||||||
List<DraftMapDisStation> pContent = this.draftMapDisStationDAO.selectByExample(example);
|
return PageVO.convert(pContent, voList);
|
||||||
if (null != pContent) {
|
|
||||||
pContent.forEach(t -> {
|
|
||||||
page.getList().add(convert(t));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public List<MapDisStationNewVO> getAll(Long mapId){
|
public List<MapDisStationNewVO> getAll(Long mapId) {
|
||||||
List<MapDisStationNewVO> list = new ArrayList<>();
|
List<MapDisStationNewVO> list = new ArrayList<>();
|
||||||
DraftMapDisStationExample example = new DraftMapDisStationExample();
|
DraftMapDisStationExample example = new DraftMapDisStationExample();
|
||||||
example.createCriteria().andMapIdEqualTo(mapId);
|
example.createCriteria().andMapIdEqualTo(mapId);
|
||||||
List<DraftMapDisStation> find = draftMapDisStationDAO.selectByExample(example);
|
List<DraftMapDisStation> find = draftMapDisStationDAO.selectByExample(example);
|
||||||
if(!CollectionUtils.isEmpty(find)){
|
if (!CollectionUtils.isEmpty(find)) {
|
||||||
find.forEach(entity->{
|
find.forEach(entity -> {
|
||||||
list.add(convert(entity));
|
list.add(convert(entity));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -127,18 +123,19 @@ public class DraftMapDisStationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
public static MapDisStationNewVO convert(DraftMapDisStation from){
|
public static MapDisStationNewVO convert(DraftMapDisStation from) {
|
||||||
MapDisStationNewVO vo = new MapDisStationNewVO();
|
MapDisStationNewVO vo = new MapDisStationNewVO();
|
||||||
vo.setId(from.getId());
|
vo.setId(from.getId());
|
||||||
vo.setCode(from.getCode());
|
vo.setCode(from.getCode());
|
||||||
vo.setMapId(from.getMapId());
|
vo.setMapId(from.getMapId());
|
||||||
vo.setStationList(JsonUtils.readCollection(from.getStationList(),ArrayList.class,String.class));
|
vo.setStationList(JsonUtils.readCollection(from.getStationList(), ArrayList.class, String.class));
|
||||||
vo.setName(from.getName());
|
vo.setName(from.getName());
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
public static DraftMapDisStation convert(MapDisStationNewVO from){
|
|
||||||
|
public static DraftMapDisStation convert(MapDisStationNewVO from) {
|
||||||
DraftMapDisStation entity = new DraftMapDisStation();
|
DraftMapDisStation entity = new DraftMapDisStation();
|
||||||
if(null!=from.getId()){
|
if (null != from.getId()) {
|
||||||
entity.setId(from.getId());
|
entity.setId(from.getId());
|
||||||
}
|
}
|
||||||
entity.setMapId(from.getMapId());
|
entity.setMapId(from.getMapId());
|
||||||
|
@ -16,6 +16,8 @@ import club.joylink.rtss.vo.client.PageVO;
|
|||||||
import club.joylink.rtss.vo.paper.*;
|
import club.joylink.rtss.vo.paper.*;
|
||||||
import club.joylink.rtss.vo.paper.convertor.PaperCompositionConvertor;
|
import club.joylink.rtss.vo.paper.convertor.PaperCompositionConvertor;
|
||||||
import club.joylink.rtss.vo.paper.convertor.PaperRuleConvertor;
|
import club.joylink.rtss.vo.paper.convertor.PaperRuleConvertor;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -122,7 +124,6 @@ public class PaperCompositionService {
|
|||||||
curPc.setCreateTime(LocalDateTime.now());
|
curPc.setCreateTime(LocalDateTime.now());
|
||||||
curPc.setUpdateTime(LocalDateTime.now());
|
curPc.setUpdateTime(LocalDateTime.now());
|
||||||
curPc.setCreatorId(user.getId());
|
curPc.setCreatorId(user.getId());
|
||||||
curPc.setState(PaperCompositionState.Editing.getValue());
|
|
||||||
compositionDAO.updateByPrimaryKeySelective(curPc);
|
compositionDAO.updateByPrimaryKeySelective(curPc);
|
||||||
// 更新规则
|
// 更新规则
|
||||||
this.updateCompositionRule(req.getRuleList(), req.getId());
|
this.updateCompositionRule(req.getRuleList(), req.getId());
|
||||||
@ -281,14 +282,6 @@ public class PaperCompositionService {
|
|||||||
return pcState.getValue();
|
return pcState.getValue();
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
//
|
//
|
||||||
PageVO<PaperCompositionWithRuleVo> page = new PageVO<>();
|
|
||||||
//
|
|
||||||
long sum = compositionDAO.countByExample(pcEx);
|
|
||||||
page.setTotal(sum);
|
|
||||||
page.setPageNum(req.getPageNum());
|
|
||||||
page.setPageSize(req.getPageSize());
|
|
||||||
page.setList(new ArrayList<>());
|
|
||||||
if (sum > 0) {
|
|
||||||
//1--创建时间 2--更新时间 3--名称;默认值为1;
|
//1--创建时间 2--更新时间 3--名称;默认值为1;
|
||||||
String orderBy = "create_time";
|
String orderBy = "create_time";
|
||||||
switch (req.getOrderBy()) {
|
switch (req.getOrderBy()) {
|
||||||
@ -302,23 +295,21 @@ public class PaperCompositionService {
|
|||||||
orderBy = "name";
|
orderBy = "name";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
long startIndex = (req.getPageNum() - 1) * req.getPageSize();
|
orderBy+=(req.getDesc()?" desc":"");
|
||||||
//
|
//
|
||||||
if (req.getDesc()) {
|
PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy);
|
||||||
pcEx.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
Page<PaperComposition> sqlPage = (Page<PaperComposition>) compositionDAO.selectByExample(pcEx);
|
||||||
} else {
|
PageHelper.clearPage();
|
||||||
pcEx.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
List<PaperComposition> content = compositionDAO.selectByExample(pcEx);
|
final List<PaperCompositionWithRuleVo> rtList = new ArrayList<>();
|
||||||
if (null != content) {
|
if(!CollectionUtils.isEmpty(sqlPage.getResult())){
|
||||||
page.setList(new ArrayList<>(content.size()));
|
sqlPage.getResult().forEach(pc->{
|
||||||
content.forEach(pc -> {
|
|
||||||
List<PaperRule> prList = this.findRuleByPcId(pc.getId());
|
List<PaperRule> prList = this.findRuleByPcId(pc.getId());
|
||||||
page.getList().add(PaperCompositionConvertor.convert(pc, prList));
|
rtList.add(PaperCompositionConvertor.convert(pc, prList));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
//
|
||||||
|
PageVO<PaperCompositionWithRuleVo> page = PageVO.convert(sqlPage,rtList);
|
||||||
//
|
//
|
||||||
if (!CollectionUtils.isEmpty(page.getList())) {
|
if (!CollectionUtils.isEmpty(page.getList())) {
|
||||||
page.getList().forEach(pc -> {
|
page.getList().forEach(pc -> {
|
||||||
@ -358,13 +349,6 @@ public class PaperCompositionService {
|
|||||||
return pcState.getValue();
|
return pcState.getValue();
|
||||||
}).collect(Collectors.toList()));
|
}).collect(Collectors.toList()));
|
||||||
//
|
//
|
||||||
PageVO<PaperCompositionWithRuleVo> page = new PageVO<>();
|
|
||||||
long sum = compositionDAO.countByExample(pcEx);
|
|
||||||
page.setTotal(sum);
|
|
||||||
page.setPageNum(req.getPageNum());
|
|
||||||
page.setPageSize(req.getPageSize());
|
|
||||||
page.setList(new ArrayList<>());
|
|
||||||
if (sum > 0) {
|
|
||||||
//1--创建时间 2--更新时间 3--名称;默认值为1;
|
//1--创建时间 2--更新时间 3--名称;默认值为1;
|
||||||
String orderBy = "create_time";
|
String orderBy = "create_time";
|
||||||
switch (req.getOrderBy()) {
|
switch (req.getOrderBy()) {
|
||||||
@ -378,23 +362,22 @@ public class PaperCompositionService {
|
|||||||
orderBy = "name";
|
orderBy = "name";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
long startIndex = (req.getPageNum() - 1) * req.getPageSize();
|
orderBy+=(req.getDesc()?" desc":"");
|
||||||
//
|
//
|
||||||
if (req.getDesc()) {
|
PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy);
|
||||||
pcEx.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
Page<PaperComposition> sqlPage = (Page<PaperComposition>) compositionDAO.selectByExample(pcEx);
|
||||||
} else {
|
PageHelper.clearPage();
|
||||||
pcEx.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
List<PaperComposition> content = compositionDAO.selectByExample(pcEx);
|
final List<PaperCompositionWithRuleVo> rtList = new ArrayList<>();
|
||||||
if (null != content) {
|
if(!CollectionUtils.isEmpty(sqlPage.getResult())){
|
||||||
page.setList(new ArrayList<>(content.size()));
|
sqlPage.getResult().forEach(pc->{
|
||||||
content.forEach(pc -> {
|
|
||||||
List<PaperRule> prList = this.findRuleByPcId(pc.getId());
|
List<PaperRule> prList = this.findRuleByPcId(pc.getId());
|
||||||
page.getList().add(PaperCompositionConvertor.convert(pc, prList));
|
rtList.add(PaperCompositionConvertor.convert(pc, prList));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
//
|
||||||
|
PageVO<PaperCompositionWithRuleVo> page = PageVO.convert(sqlPage,rtList);
|
||||||
|
//
|
||||||
if (!CollectionUtils.isEmpty(page.getList())) {
|
if (!CollectionUtils.isEmpty(page.getList())) {
|
||||||
page.getList().forEach(pc -> {
|
page.getList().forEach(pc -> {
|
||||||
pc.setCreatorInfo(this.findCreatorInfo(pc.getCreatorId()));
|
pc.setCreatorInfo(this.findCreatorInfo(pc.getCreatorId()));
|
||||||
|
@ -19,6 +19,8 @@ import club.joylink.rtss.vo.paper.FindPaperUserForClassReqVo;
|
|||||||
import club.joylink.rtss.vo.paper.FindPaperUserForCompositionReqVo;
|
import club.joylink.rtss.vo.paper.FindPaperUserForCompositionReqVo;
|
||||||
import club.joylink.rtss.vo.paper.PaperUserInfoVo;
|
import club.joylink.rtss.vo.paper.PaperUserInfoVo;
|
||||||
import club.joylink.rtss.vo.paper.convertor.PaperUserConvertor;
|
import club.joylink.rtss.vo.paper.convertor.PaperUserConvertor;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -66,7 +68,6 @@ public class PaperUserFindPageService {
|
|||||||
*/
|
*/
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public PageVO<PaperUserInfoVo> findPaperUserByPageForClass(FindPaperUserForClassReqVo req){
|
public PageVO<PaperUserInfoVo> findPaperUserByPageForClass(FindPaperUserForClassReqVo req){
|
||||||
PageVO<PaperUserInfoVo> page = new PageVO<>();
|
|
||||||
PaperComposition pc = paperCompositionDAO.selectByPrimaryKey(req.getPcId());
|
PaperComposition pc = paperCompositionDAO.selectByPrimaryKey(req.getPcId());
|
||||||
PaperExceptionAssert.PcExisted.assertNotNull(pc,"试卷定义不存在");
|
PaperExceptionAssert.PcExisted.assertNotNull(pc,"试卷定义不存在");
|
||||||
//
|
//
|
||||||
@ -83,38 +84,24 @@ public class PaperUserFindPageService {
|
|||||||
case Complete:c.andScoreIsNotNull();break;
|
case Complete:c.andScoreIsNotNull();break;
|
||||||
case All:break;
|
case All:break;
|
||||||
}
|
}
|
||||||
long sum = paperUserDAO.countByExample(example);
|
|
||||||
page.setTotal(sum);
|
|
||||||
page.setPageNum(req.getPageNum());
|
|
||||||
page.setPageSize(req.getPageSize());
|
|
||||||
page.setList(new ArrayList<>());
|
|
||||||
if (sum > 0) {
|
|
||||||
//
|
//
|
||||||
String orderBy = req.getOrderBy().with();
|
String orderBy = req.getOrderBy().with()+(req.getDesc()?" desc":"");
|
||||||
long startIndex = (req.getPageNum() - 1) * req.getPageSize();
|
PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy);
|
||||||
|
Page<PaperUser> sqlPage = (Page<PaperUser>) this.paperUserDAO.selectByExample(example);
|
||||||
//
|
//
|
||||||
if (req.getDesc()) {
|
List<PaperUserInfoVo> rtContent= new ArrayList<>();
|
||||||
example.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
if(!CollectionUtils.isEmpty(sqlPage.getResult())){
|
||||||
} else {
|
sqlPage.getResult().forEach(t -> {
|
||||||
example.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
rtContent.add(PaperUserConvertor.convert(pc,t));
|
||||||
}
|
|
||||||
List<PaperUser> pContent = this.paperUserDAO.selectByExample(example);
|
|
||||||
if (null != pContent) {
|
|
||||||
pContent.forEach(t -> {
|
|
||||||
page.getList().add(PaperUserConvertor.convert(pc,t));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
return PageVO.convert(sqlPage,rtContent);
|
||||||
|
|
||||||
|
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 分页查询某个试卷蓝图的所有用户试卷基本信息
|
* 分页查询某个试卷蓝图的所有用户试卷基本信息
|
||||||
*/
|
*/
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
public PageVO<PaperUserInfoVo> findPaperUserByPage(FindPaperUserForCompositionReqVo req) {
|
public PageVO<PaperUserInfoVo> findPaperUserByPage(FindPaperUserForCompositionReqVo req) {
|
||||||
PageVO<PaperUserInfoVo> page = new PageVO<>();
|
|
||||||
//
|
//
|
||||||
PaperComposition pc = paperCompositionDAO.selectByPrimaryKey(req.getPcId());
|
PaperComposition pc = paperCompositionDAO.selectByPrimaryKey(req.getPcId());
|
||||||
PaperExceptionAssert.PcExisted.assertNotNull(pc,"试卷定义不存在");
|
PaperExceptionAssert.PcExisted.assertNotNull(pc,"试卷定义不存在");
|
||||||
@ -127,30 +114,18 @@ public class PaperUserFindPageService {
|
|||||||
case Complete:c.andScoreIsNotNull();break;
|
case Complete:c.andScoreIsNotNull();break;
|
||||||
case All:break;
|
case All:break;
|
||||||
}
|
}
|
||||||
long sum = paperUserDAO.countByExample(example);
|
|
||||||
page.setTotal(sum);
|
|
||||||
page.setPageNum(req.getPageNum());
|
|
||||||
page.setPageSize(req.getPageSize());
|
|
||||||
page.setList(new ArrayList<>());
|
|
||||||
if (sum > 0) {
|
|
||||||
//
|
//
|
||||||
String orderBy = req.getOrderBy().with();
|
String orderBy = req.getOrderBy().with()+(req.getDesc()?" desc":"");
|
||||||
long startIndex = (req.getPageNum() - 1) * req.getPageSize();
|
PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy);
|
||||||
|
Page<PaperUser> sqlPage = (Page<PaperUser>) this.paperUserDAO.selectByExample(example);
|
||||||
//
|
//
|
||||||
if (req.getDesc()) {
|
List<PaperUserInfoVo> rtContent= new ArrayList<>();
|
||||||
example.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
if(!CollectionUtils.isEmpty(sqlPage.getResult())){
|
||||||
} else {
|
sqlPage.getResult().forEach(t -> {
|
||||||
example.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
rtContent.add(PaperUserConvertor.convert(pc,t));
|
||||||
}
|
|
||||||
List<PaperUser> pContent = this.paperUserDAO.selectByExample(example);
|
|
||||||
if (null != pContent) {
|
|
||||||
pContent.forEach(t -> {
|
|
||||||
page.getList().add(PaperUserConvertor.convert(pc,t));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
return PageVO.convert(sqlPage,rtContent);
|
||||||
//
|
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 查询某个班级的所有学生的userId
|
* 查询某个班级的所有学生的userId
|
||||||
|
@ -10,6 +10,8 @@ import club.joylink.rtss.vo.client.PageVO;
|
|||||||
import club.joylink.rtss.vo.permission.*;
|
import club.joylink.rtss.vo.permission.*;
|
||||||
import club.joylink.rtss.vo.permission.convertor.PermissionConvertor;
|
import club.joylink.rtss.vo.permission.convertor.PermissionConvertor;
|
||||||
import club.joylink.rtss.vo.permission.convertor.SystemAbilityConvertor;
|
import club.joylink.rtss.vo.permission.convertor.SystemAbilityConvertor;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -186,29 +188,19 @@ public class AcPermissionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
PageVO<PermissionBasicRspVo> page = new PageVO<>();
|
final String orderBy = req.getOrderByType().with() + (req.getDesc() ? " desc" : "");
|
||||||
long sum = this.permissionDAO.countByExample(permissionExample);
|
PageHelper.startPage(req.getPageNum(), req.getPageSize(), orderBy);
|
||||||
page.setTotal(sum);
|
Page<Permission> sqlPage = (Page<Permission>) this.permissionDAO.selectByExample(permissionExample);
|
||||||
page.setPageNum(req.getPageNum());
|
PageHelper.clearPage();
|
||||||
page.setPageSize(req.getPageSize());
|
|
||||||
page.setList(new ArrayList<>());
|
|
||||||
if (sum > 0) {
|
|
||||||
//
|
//
|
||||||
String orderBy = req.getOrderByType().with();
|
List<PermissionBasicRspVo> rtList = new ArrayList<>();
|
||||||
long startIndex = (req.getPageNum() - 1) * req.getPageSize();
|
if (!CollectionUtils.isEmpty(sqlPage.getResult())) {
|
||||||
|
rtList=sqlPage.getResult().stream().map(PermissionConvertor::convertPermissionBasicRspVoFrom).collect(Collectors.toList());
|
||||||
|
}
|
||||||
//
|
//
|
||||||
if (req.getDesc()) {
|
return PageVO.convert(sqlPage,rtList);
|
||||||
permissionExample.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
|
||||||
} else {
|
|
||||||
permissionExample.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize()));
|
|
||||||
}
|
|
||||||
List<Permission> pContent = this.permissionDAO.selectByExample(permissionExample);
|
|
||||||
if (!CollectionUtils.isEmpty(pContent)) {
|
|
||||||
page.setList(pContent.stream().map(PermissionConvertor::convertPermissionBasicRspVoFrom).collect(Collectors.toList()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return page;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
private List<SystemAbility> findAbilitiesByPermissionId(Long permissionId) {
|
private List<SystemAbility> findAbilitiesByPermissionId(Long permissionId) {
|
||||||
PermissionSystemAbilityExample psaExample = new PermissionSystemAbilityExample();
|
PermissionSystemAbilityExample psaExample = new PermissionSystemAbilityExample();
|
||||||
|
@ -45,6 +45,7 @@ public enum FindPcType {
|
|||||||
public Integer getValue() {
|
public Integer getValue() {
|
||||||
return this.state;
|
return this.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 试卷蓝图状态:1-正在编辑,2-封存(不能修改),3-已经被使用(不能修改删除)<br>
|
* 试卷蓝图状态:1-正在编辑,2-封存(不能修改),3-已经被使用(不能修改删除)<br>
|
||||||
* 选填<br>
|
* 选填<br>
|
||||||
@ -65,6 +66,7 @@ public enum FindPcType {
|
|||||||
list.add(PaperCompositionState.Locked);
|
list.add(PaperCompositionState.Locked);
|
||||||
list.add(PaperCompositionState.Used);
|
list.add(PaperCompositionState.Used);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case Locked:
|
case Locked:
|
||||||
list.add(PaperCompositionState.Locked);
|
list.add(PaperCompositionState.Locked);
|
||||||
break;
|
break;
|
||||||
@ -74,6 +76,7 @@ public enum FindPcType {
|
|||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
private static Map<Integer, FindPcType> map = new HashMap<>();
|
private static Map<Integer, FindPcType> map = new HashMap<>();
|
||||||
|
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
package club.joylink.rtss.vo.permission;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreatePermissionDistributeReqVo {
|
||||||
|
/**
|
||||||
|
* 关联权限id
|
||||||
|
*/
|
||||||
|
private Long permissionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分发来自subject id(rts_permission_subject)
|
||||||
|
*/
|
||||||
|
private Long sourceSubjectId;
|
||||||
|
/**
|
||||||
|
* 总数量
|
||||||
|
*/
|
||||||
|
private Integer amount;
|
||||||
|
/**
|
||||||
|
* 是否永久:true/false
|
||||||
|
*/
|
||||||
|
private Boolean forever;
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注描述
|
||||||
|
*/
|
||||||
|
private String dsc;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package club.joylink.rtss.vo.permission;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CreatePermissionDistributeRspVo {
|
||||||
|
/**
|
||||||
|
* 分发id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 关联权限id
|
||||||
|
*/
|
||||||
|
private Long permissionId;
|
||||||
|
/**
|
||||||
|
* 分发来自subject id(rts_permission_subject)
|
||||||
|
*/
|
||||||
|
private Long sourceSubjectId;
|
||||||
|
/**
|
||||||
|
* 总数量
|
||||||
|
*/
|
||||||
|
private Integer amount;
|
||||||
|
/**
|
||||||
|
* 是否永久:true/false
|
||||||
|
*/
|
||||||
|
private Boolean forever;
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package club.joylink.rtss.vo.permission;
|
||||||
|
|
||||||
|
import club.joylink.rtss.vo.client.PageQueryVO;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonValue;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class FindPermissionDistributeByPageReqVo extends PageQueryVO {
|
||||||
|
/**
|
||||||
|
* 权限分发备注描述
|
||||||
|
*/
|
||||||
|
private String dsc;
|
||||||
|
/**
|
||||||
|
* 权限分发备注描述模糊查询,默认true
|
||||||
|
*/
|
||||||
|
private Boolean dscLike=true;
|
||||||
|
/**
|
||||||
|
* 是否降序,true-降序,false-升序,默认值为true;
|
||||||
|
*/
|
||||||
|
private Boolean desc = true;
|
||||||
|
/**
|
||||||
|
* 排序类型,默认按权限分发创建时间排序,序列化为数值:1-权限分发创建时间,2-权限分发更新时间,3-权限分发开始时间,4-权限分发结束时间,5-权限分发总数量,6-权限分发剩余数量
|
||||||
|
*/
|
||||||
|
private OrderByType orderByType = OrderByType.OrderByCreateTime;
|
||||||
|
|
||||||
|
/////////////////////////////////////////////
|
||||||
|
public static enum OrderByType {
|
||||||
|
OrderByCreateTime(1, "create_time"),
|
||||||
|
OrderByUpdateTime(2,"update_time"),
|
||||||
|
OrderByStartTime(3,"start_time"),
|
||||||
|
OrderByEndTime(4,"end_time"),
|
||||||
|
OrderByAmount(5,"amount"),
|
||||||
|
OrderByRemains(6,"remains"),
|
||||||
|
;
|
||||||
|
private Integer value;
|
||||||
|
private String orderBy;
|
||||||
|
|
||||||
|
private OrderByType(Integer value, String orderBy) {
|
||||||
|
this.value = value;
|
||||||
|
this.orderBy = orderBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String with(Boolean desc) {
|
||||||
|
if(null!=desc){
|
||||||
|
return this.orderBy+(desc?" desc":"");
|
||||||
|
}
|
||||||
|
return this.orderBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonCreator
|
||||||
|
public static OrderByType getItem(Integer value) {
|
||||||
|
return map.get(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonValue
|
||||||
|
public Integer getValue() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<Integer, OrderByType> map = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
for (OrderByType t : values()) {
|
||||||
|
map.put(t.value, t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package club.joylink.rtss.vo.permission;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PermissionDistributeRspVo{
|
||||||
|
/**
|
||||||
|
* 权限分发id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联权限id
|
||||||
|
*/
|
||||||
|
private Long permissionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分发来自subject id(rts_permission_subject)
|
||||||
|
*/
|
||||||
|
private Long sourceSubjectId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总数量
|
||||||
|
*/
|
||||||
|
private Integer amount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 剩余数量
|
||||||
|
*/
|
||||||
|
private Integer remains;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否永久:true/false
|
||||||
|
*/
|
||||||
|
private Boolean forever;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建者id
|
||||||
|
*/
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注描述
|
||||||
|
*/
|
||||||
|
private String dsc;
|
||||||
|
}
|
@ -13,6 +13,7 @@
|
|||||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
||||||
<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" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Example_Where_Clause">
|
<sql id="Example_Where_Clause">
|
||||||
<where>
|
<where>
|
||||||
@ -74,7 +75,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
|
start_time, end_time, create_time, distribute_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
|
||||||
@ -118,11 +119,13 @@
|
|||||||
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)
|
end_time, create_time, distribute_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})
|
#{endTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{distributeId,jdbcType=BIGINT}
|
||||||
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.permission.PermissionSubject">
|
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.permission.PermissionSubject">
|
||||||
insert into rts_permission_subject
|
insert into rts_permission_subject
|
||||||
@ -160,6 +163,9 @@
|
|||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time,
|
create_time,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="distributeId != null">
|
||||||
|
distribute_id,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@ -195,6 +201,9 @@
|
|||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
#{createTime,jdbcType=TIMESTAMP},
|
#{createTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="distributeId != null">
|
||||||
|
#{distributeId,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">
|
||||||
@ -239,6 +248,9 @@
|
|||||||
<if test="record.createTime != null">
|
<if test="record.createTime != null">
|
||||||
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.distributeId != null">
|
||||||
|
distribute_id = #{record.distributeId,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" />
|
||||||
@ -256,7 +268,8 @@
|
|||||||
forever = #{record.forever,jdbcType=BIT},
|
forever = #{record.forever,jdbcType=BIT},
|
||||||
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}
|
||||||
<if test="_parameter != null">
|
<if test="_parameter != null">
|
||||||
<include refid="Update_By_Example_Where_Clause" />
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
</if>
|
</if>
|
||||||
@ -294,6 +307,9 @@
|
|||||||
<if test="createTime != null">
|
<if test="createTime != null">
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="distributeId != null">
|
||||||
|
distribute_id = #{distributeId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=BIGINT}
|
where id = #{id,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
@ -308,7 +324,8 @@
|
|||||||
forever = #{forever,jdbcType=BIT},
|
forever = #{forever,jdbcType=BIT},
|
||||||
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}
|
||||||
where id = #{id,jdbcType=BIGINT}
|
where id = #{id,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
</mapper>
|
</mapper>
|
@ -0,0 +1,346 @@
|
|||||||
|
<?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="club.joylink.rtss.dao.permission.RtsPermissionDistributeDAO">
|
||||||
|
<resultMap id="BaseResultMap" type="club.joylink.rtss.entity.permission.PermissionDistribute">
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="permission_id" jdbcType="BIGINT" property="permissionId" />
|
||||||
|
<result column="source_subject_id" jdbcType="BIGINT" property="sourceSubjectId" />
|
||||||
|
<result column="amount" jdbcType="INTEGER" property="amount" />
|
||||||
|
<result column="remains" jdbcType="INTEGER" property="remains" />
|
||||||
|
<result column="forever" jdbcType="BIT" property="forever" />
|
||||||
|
<result column="status" jdbcType="INTEGER" property="status" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
||||||
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||||
|
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
|
||||||
|
<result column="dsc" jdbcType="VARCHAR" property="dsc" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Update_By_Example_Where_Clause">
|
||||||
|
<where>
|
||||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||||
|
<if test="criteria.valid">
|
||||||
|
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||||
|
<foreach collection="criteria.criteria" item="criterion">
|
||||||
|
<choose>
|
||||||
|
<when test="criterion.noValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.singleValue">
|
||||||
|
and ${criterion.condition} #{criterion.value}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.betweenValue">
|
||||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||||
|
</when>
|
||||||
|
<when test="criterion.listValue">
|
||||||
|
and ${criterion.condition}
|
||||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||||
|
#{listItem}
|
||||||
|
</foreach>
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</foreach>
|
||||||
|
</trim>
|
||||||
|
</if>
|
||||||
|
</foreach>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, permission_id, source_subject_id, amount, remains, forever, `status`, create_time,
|
||||||
|
update_time, start_time, end_time, creator_id, dsc
|
||||||
|
</sql>
|
||||||
|
<select id="selectByExample" parameterType="club.joylink.rtss.entity.permission.PermissionDistributeExample" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<if test="distinct">
|
||||||
|
distinct
|
||||||
|
</if>
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from rts_permission_distribute
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
<if test="orderByClause != null">
|
||||||
|
order by ${orderByClause}
|
||||||
|
</if>
|
||||||
|
<if test="limit != null">
|
||||||
|
<if test="offset != null">
|
||||||
|
limit ${offset}, ${limit}
|
||||||
|
</if>
|
||||||
|
<if test="offset == null">
|
||||||
|
limit ${limit}
|
||||||
|
</if>
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="Base_Column_List" />
|
||||||
|
from rts_permission_distribute
|
||||||
|
where id = #{id,jdbcType=BIGINT}
|
||||||
|
</select>
|
||||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||||
|
delete from rts_permission_distribute
|
||||||
|
where id = #{id,jdbcType=BIGINT}
|
||||||
|
</delete>
|
||||||
|
<delete id="deleteByExample" parameterType="club.joylink.rtss.entity.permission.PermissionDistributeExample">
|
||||||
|
delete from rts_permission_distribute
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
<insert id="insert" parameterType="club.joylink.rtss.entity.permission.PermissionDistribute">
|
||||||
|
insert into rts_permission_distribute (id, permission_id, source_subject_id,
|
||||||
|
amount, remains, forever,
|
||||||
|
`status`, create_time, update_time,
|
||||||
|
start_time, end_time, creator_id,
|
||||||
|
dsc)
|
||||||
|
values (#{id,jdbcType=BIGINT}, #{permissionId,jdbcType=BIGINT}, #{sourceSubjectId,jdbcType=BIGINT},
|
||||||
|
#{amount,jdbcType=INTEGER}, #{remains,jdbcType=INTEGER}, #{forever,jdbcType=BIT},
|
||||||
|
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=BIGINT},
|
||||||
|
#{dsc,jdbcType=VARCHAR})
|
||||||
|
</insert>
|
||||||
|
<insert id="insertSelective" parameterType="club.joylink.rtss.entity.permission.PermissionDistribute">
|
||||||
|
insert into rts_permission_distribute
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
id,
|
||||||
|
</if>
|
||||||
|
<if test="permissionId != null">
|
||||||
|
permission_id,
|
||||||
|
</if>
|
||||||
|
<if test="sourceSubjectId != null">
|
||||||
|
source_subject_id,
|
||||||
|
</if>
|
||||||
|
<if test="amount != null">
|
||||||
|
amount,
|
||||||
|
</if>
|
||||||
|
<if test="remains != null">
|
||||||
|
remains,
|
||||||
|
</if>
|
||||||
|
<if test="forever != null">
|
||||||
|
forever,
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
`status`,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="startTime != null">
|
||||||
|
start_time,
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
end_time,
|
||||||
|
</if>
|
||||||
|
<if test="creatorId != null">
|
||||||
|
creator_id,
|
||||||
|
</if>
|
||||||
|
<if test="dsc != null">
|
||||||
|
dsc,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="id != null">
|
||||||
|
#{id,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="permissionId != null">
|
||||||
|
#{permissionId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="sourceSubjectId != null">
|
||||||
|
#{sourceSubjectId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="amount != null">
|
||||||
|
#{amount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="remains != null">
|
||||||
|
#{remains,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="forever != null">
|
||||||
|
#{forever,jdbcType=BIT},
|
||||||
|
</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>
|
||||||
|
<if test="startTime != null">
|
||||||
|
#{startTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
#{endTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="creatorId != null">
|
||||||
|
#{creatorId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="dsc != null">
|
||||||
|
#{dsc,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
<select id="countByExample" parameterType="club.joylink.rtss.entity.permission.PermissionDistributeExample" resultType="java.lang.Long">
|
||||||
|
select count(*) from rts_permission_distribute
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<update id="updateByExampleSelective" parameterType="map">
|
||||||
|
update rts_permission_distribute
|
||||||
|
<set>
|
||||||
|
<if test="record.id != null">
|
||||||
|
id = #{record.id,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.permissionId != null">
|
||||||
|
permission_id = #{record.permissionId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.sourceSubjectId != null">
|
||||||
|
source_subject_id = #{record.sourceSubjectId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.amount != null">
|
||||||
|
amount = #{record.amount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.remains != null">
|
||||||
|
remains = #{record.remains,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.forever != null">
|
||||||
|
forever = #{record.forever,jdbcType=BIT},
|
||||||
|
</if>
|
||||||
|
<if test="record.status != null">
|
||||||
|
`status` = #{record.status,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="record.createTime != null">
|
||||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.updateTime != null">
|
||||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.startTime != null">
|
||||||
|
start_time = #{record.startTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.endTime != null">
|
||||||
|
end_time = #{record.endTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="record.creatorId != null">
|
||||||
|
creator_id = #{record.creatorId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="record.dsc != null">
|
||||||
|
dsc = #{record.dsc,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByExample" parameterType="map">
|
||||||
|
update rts_permission_distribute
|
||||||
|
set id = #{record.id,jdbcType=BIGINT},
|
||||||
|
permission_id = #{record.permissionId,jdbcType=BIGINT},
|
||||||
|
source_subject_id = #{record.sourceSubjectId,jdbcType=BIGINT},
|
||||||
|
amount = #{record.amount,jdbcType=INTEGER},
|
||||||
|
remains = #{record.remains,jdbcType=INTEGER},
|
||||||
|
forever = #{record.forever,jdbcType=BIT},
|
||||||
|
`status` = #{record.status,jdbcType=INTEGER},
|
||||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
||||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||||
|
start_time = #{record.startTime,jdbcType=TIMESTAMP},
|
||||||
|
end_time = #{record.endTime,jdbcType=TIMESTAMP},
|
||||||
|
creator_id = #{record.creatorId,jdbcType=BIGINT},
|
||||||
|
dsc = #{record.dsc,jdbcType=VARCHAR}
|
||||||
|
<if test="_parameter != null">
|
||||||
|
<include refid="Update_By_Example_Where_Clause" />
|
||||||
|
</if>
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKeySelective" parameterType="club.joylink.rtss.entity.permission.PermissionDistribute">
|
||||||
|
update rts_permission_distribute
|
||||||
|
<set>
|
||||||
|
<if test="permissionId != null">
|
||||||
|
permission_id = #{permissionId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="sourceSubjectId != null">
|
||||||
|
source_subject_id = #{sourceSubjectId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="amount != null">
|
||||||
|
amount = #{amount,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="remains != null">
|
||||||
|
remains = #{remains,jdbcType=INTEGER},
|
||||||
|
</if>
|
||||||
|
<if test="forever != null">
|
||||||
|
forever = #{forever,jdbcType=BIT},
|
||||||
|
</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>
|
||||||
|
<if test="startTime != null">
|
||||||
|
start_time = #{startTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="endTime != null">
|
||||||
|
end_time = #{endTime,jdbcType=TIMESTAMP},
|
||||||
|
</if>
|
||||||
|
<if test="creatorId != null">
|
||||||
|
creator_id = #{creatorId,jdbcType=BIGINT},
|
||||||
|
</if>
|
||||||
|
<if test="dsc != null">
|
||||||
|
dsc = #{dsc,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
</set>
|
||||||
|
where id = #{id,jdbcType=BIGINT}
|
||||||
|
</update>
|
||||||
|
<update id="updateByPrimaryKey" parameterType="club.joylink.rtss.entity.permission.PermissionDistribute">
|
||||||
|
update rts_permission_distribute
|
||||||
|
set permission_id = #{permissionId,jdbcType=BIGINT},
|
||||||
|
source_subject_id = #{sourceSubjectId,jdbcType=BIGINT},
|
||||||
|
amount = #{amount,jdbcType=INTEGER},
|
||||||
|
remains = #{remains,jdbcType=INTEGER},
|
||||||
|
forever = #{forever,jdbcType=BIT},
|
||||||
|
`status` = #{status,jdbcType=INTEGER},
|
||||||
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
|
start_time = #{startTime,jdbcType=TIMESTAMP},
|
||||||
|
end_time = #{endTime,jdbcType=TIMESTAMP},
|
||||||
|
creator_id = #{creatorId,jdbcType=BIGINT},
|
||||||
|
dsc = #{dsc,jdbcType=VARCHAR}
|
||||||
|
where id = #{id,jdbcType=BIGINT}
|
||||||
|
</update>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user