From 933a73d131fc5eabea3e952166b3e91ac3b1b69c Mon Sep 17 00:00:00 2001 From: weizhihong Date: Mon, 17 Oct 2022 15:01:41 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E3=80=90=E5=8E=BB=E9=99=A4=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=89=8D=E7=AB=AF=E5=94=AF=E4=B8=80=E7=B4=A2=E5=BC=95?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/20221017-wei-project_view.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/20221017-wei-project_view.sql diff --git a/sql/20221017-wei-project_view.sql b/sql/20221017-wei-project_view.sql new file mode 100644 index 000000000..740cb55b9 --- /dev/null +++ b/sql/20221017-wei-project_view.sql @@ -0,0 +1,2 @@ +alter table `joylink`.`project_view` +drop index `mark_key`; \ No newline at end of file From d869ce06da5051788e446457869fa7f12dce84f5 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Mon, 17 Oct 2022 16:04:16 +0800 Subject: [PATCH 02/12] paper --- .../draftData/DraftMapDisStationService.java | 92 +++++++++---------- .../paper/PaperCompositionService.java | 28 +++--- 2 files changed, 58 insertions(+), 62 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java index 12bd55e52..b620eda69 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java @@ -11,6 +11,8 @@ import club.joylink.rtss.vo.client.PageVO; 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.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -18,6 +20,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; @Service public class DraftMapDisStationService { @@ -28,119 +31,110 @@ public class DraftMapDisStationService { * 新建调度台业务 */ @Transactional(rollbackFor = Exception.class) - public void create(MapDisStationNewVO vo){ - List find = this.findByMapIdAndCode(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); + public void create(MapDisStationNewVO vo) { + List find = this.findByMapIdAndCode(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); draftMapDisStationDAO.insertSelective(entity); } + /** * 存储 */ @Transactional(rollbackFor = Exception.class) - public void store(MapDisStationNewVO vo){ - List find = this.findByMapIdAndCode(vo.getMapId(),vo.getCode()); - if(CollectionUtils.isEmpty(find)){ + public void store(MapDisStationNewVO vo) { + List find = this.findByMapIdAndCode(vo.getMapId(), vo.getCode()); + if (CollectionUtils.isEmpty(find)) { DraftMapDisStation entity = convert(vo); this.draftMapDisStationDAO.insert(entity); - }else{ + } else { DraftMapDisStation entity = convert(vo); entity.setId(find.get(0).getId()); this.draftMapDisStationDAO.updateByPrimaryKey(entity); } } + /** * 更新调度台业务 */ @Transactional(rollbackFor = Exception.class) - public void update(MapDisStationNewVO vo){ - List 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())); + public void update(MapDisStationNewVO vo) { + List 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())); DraftMapDisStation entity = convert(vo); entity.setId(find.get(0).getId()); // this.draftMapDisStationDAO.updateByPrimaryKeySelective(entity); } + /** * 删除调度台业务 */ @Transactional(rollbackFor = Exception.class) - public void delete(Long mapId,String code){ + public void delete(Long mapId, String code) { DraftMapDisStationExample example = new DraftMapDisStationExample(); example.createCriteria().andMapIdEqualTo(mapId).andCodeEqualTo(code); this.draftMapDisStationDAO.deleteByExample(example); } + @Transactional(readOnly = true) - public MapDisStationNewVO getByMapIdAndCode(Long mapId, String code){ - List list = this.findByMapIdAndCode(mapId,code); - if(!CollectionUtils.isEmpty(list)){ + public MapDisStationNewVO getByMapIdAndCode(Long mapId, String code) { + List list = this.findByMapIdAndCode(mapId, code); + if (!CollectionUtils.isEmpty(list)) { DraftMapDisStation entity = list.get(0); return convert(entity); } return null; } @Transactional(readOnly = true) - public PageVO findByPage(Long mapId, DraftMapDisStationController.FindByPageReq req){ - PageVO page = new PageVO<>(); + public PageVO findByPage(Long mapId, DraftMapDisStationController.FindByPageReq req) { + final String orderBy = "id" + (req.getDesc() ? " desc" : ""); + PageHelper.startPage(req.getPageNum(), req.getPageSize(), orderBy); DraftMapDisStationExample example = new DraftMapDisStationExample(); 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"; - long startIndex = (req.getPageNum() - 1) * req.getPageSize(); - // - if (req.getDesc()) { - example.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize())); - } else { - example.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize())); - } - List pContent = this.draftMapDisStationDAO.selectByExample(example); - if (null != pContent) { - pContent.forEach(t -> { - page.getList().add(convert(t)); - }); - } + Page pContent = (Page) this.draftMapDisStationDAO.selectByExample(example); + List voList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(pContent.getResult())) { + voList = pContent.getResult().stream().map(DraftMapDisStationService::convert).collect(Collectors.toList()); } - return page; + return PageVO.convert(pContent, voList); } + @Transactional(readOnly = true) - public List getAll(Long mapId){ + public List getAll(Long mapId) { List list = new ArrayList<>(); DraftMapDisStationExample example = new DraftMapDisStationExample(); example.createCriteria().andMapIdEqualTo(mapId); List find = draftMapDisStationDAO.selectByExample(example); - if(!CollectionUtils.isEmpty(find)){ - find.forEach(entity->{ - list.add(convert(entity)); - }); + if (!CollectionUtils.isEmpty(find)) { + find.forEach(entity -> { + list.add(convert(entity)); + }); } return list; } + @Transactional(readOnly = true) - private List findByMapIdAndCode(Long mapId, String code){ + private List findByMapIdAndCode(Long mapId, String code) { DraftMapDisStationExample example = new DraftMapDisStationExample(); example.createCriteria().andMapIdEqualTo(mapId).andCodeEqualTo(code); return draftMapDisStationDAO.selectByExample(example); } ////////////////////////////////////////////////////////////////////// - public static MapDisStationNewVO convert(DraftMapDisStation from){ + public static MapDisStationNewVO convert(DraftMapDisStation from) { MapDisStationNewVO vo = new MapDisStationNewVO(); vo.setId(from.getId()); vo.setCode(from.getCode()); 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()); return vo; } - public static DraftMapDisStation convert(MapDisStationNewVO from){ + + public static DraftMapDisStation convert(MapDisStationNewVO from) { DraftMapDisStation entity = new DraftMapDisStation(); - if(null!=from.getId()){ + if (null != from.getId()) { entity.setId(from.getId()); } entity.setMapId(from.getMapId()); diff --git a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java index e6b333bcf..550f502c4 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java @@ -358,6 +358,20 @@ public class PaperCompositionService { return pcState.getValue(); }).collect(Collectors.toList())); // + //1--创建时间 2--更新时间 3--名称;默认值为1; + String orderBy = "create_time"; + switch (req.getOrderBy()) { + case 1: + orderBy = "create_time"; + break; + case 2: + orderBy = "update_time"; + break; + case 3: + orderBy = "name"; + break; + } + // PageVO page = new PageVO<>(); long sum = compositionDAO.countByExample(pcEx); page.setTotal(sum); @@ -365,19 +379,7 @@ public class PaperCompositionService { page.setPageSize(req.getPageSize()); page.setList(new ArrayList<>()); if (sum > 0) { - //1--创建时间 2--更新时间 3--名称;默认值为1; - String orderBy = "create_time"; - switch (req.getOrderBy()) { - case 1: - orderBy = "create_time"; - break; - case 2: - orderBy = "update_time"; - break; - case 3: - orderBy = "name"; - break; - } + long startIndex = (req.getPageNum() - 1) * req.getPageSize(); // if (req.getDesc()) { From 522d446516ba6898d198cdf44e85b9784be09dcf Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Mon, 17 Oct 2022 16:13:16 +0800 Subject: [PATCH 03/12] paper --- .../paper/PaperCompositionService.java | 100 +++++++----------- 1 file changed, 39 insertions(+), 61 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java index 550f502c4..fd99958d3 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java @@ -16,6 +16,8 @@ import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.paper.*; import club.joylink.rtss.vo.paper.convertor.PaperCompositionConvertor; import club.joylink.rtss.vo.paper.convertor.PaperRuleConvertor; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -281,44 +283,32 @@ public class PaperCompositionService { return pcState.getValue(); }).collect(Collectors.toList())); // - PageVO 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; - String orderBy = "create_time"; - switch (req.getOrderBy()) { - case 1: - orderBy = "create_time"; - break; - case 2: - orderBy = "update_time"; - break; - case 3: - orderBy = "name"; - break; - } - long startIndex = (req.getPageNum() - 1) * req.getPageSize(); - // - if (req.getDesc()) { - pcEx.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize())); - } else { - pcEx.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize())); - } - // - List content = compositionDAO.selectByExample(pcEx); - if (null != content) { - page.setList(new ArrayList<>(content.size())); - content.forEach(pc -> { - List prList = this.findRuleByPcId(pc.getId()); - page.getList().add(PaperCompositionConvertor.convert(pc, prList)); - }); - } + //1--创建时间 2--更新时间 3--名称;默认值为1; + String orderBy = "create_time"; + switch (req.getOrderBy()) { + case 1: + orderBy = "create_time"; + break; + case 2: + orderBy = "update_time"; + break; + case 3: + orderBy = "name"; + break; } + orderBy+=(req.getDesc()?" desc":""); + // + PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy); + Page sqlPage = (Page) compositionDAO.selectByExample(pcEx); + final List rtList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(sqlPage.getResult())){ + sqlPage.getResult().forEach(pc->{ + List prList = this.findRuleByPcId(pc.getId()); + rtList.add(PaperCompositionConvertor.convert(pc, prList)); + }); + } + // + PageVO page = PageVO.convert(sqlPage,rtList); // if (!CollectionUtils.isEmpty(page.getList())) { page.getList().forEach(pc -> { @@ -371,32 +361,20 @@ public class PaperCompositionService { orderBy = "name"; break; } + orderBy+=(req.getDesc()?" desc":""); // - PageVO 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) { - - long startIndex = (req.getPageNum() - 1) * req.getPageSize(); - // - if (req.getDesc()) { - pcEx.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize())); - } else { - pcEx.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize())); - } - // - List content = compositionDAO.selectByExample(pcEx); - if (null != content) { - page.setList(new ArrayList<>(content.size())); - content.forEach(pc -> { - List prList = this.findRuleByPcId(pc.getId()); - page.getList().add(PaperCompositionConvertor.convert(pc, prList)); - }); - } + PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy); + Page sqlPage = (Page) compositionDAO.selectByExample(pcEx); + final List rtList = new ArrayList<>(); + if(!CollectionUtils.isEmpty(sqlPage.getResult())){ + sqlPage.getResult().forEach(pc->{ + List prList = this.findRuleByPcId(pc.getId()); + rtList.add(PaperCompositionConvertor.convert(pc, prList)); + }); } + // + PageVO page = PageVO.convert(sqlPage,rtList); + // if (!CollectionUtils.isEmpty(page.getList())) { page.getList().forEach(pc -> { pc.setCreatorInfo(this.findCreatorInfo(pc.getCreatorId())); From 5310fc7819e9527d9a6ad878dda5bcf1b3208d40 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Mon, 17 Oct 2022 16:28:46 +0800 Subject: [PATCH 04/12] paper --- .../paper/PaperUserFindPageService.java | 73 ++++++------------- 1 file changed, 24 insertions(+), 49 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/paper/PaperUserFindPageService.java b/src/main/java/club/joylink/rtss/services/paper/PaperUserFindPageService.java index 9cfae3285..2b5d894cc 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PaperUserFindPageService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PaperUserFindPageService.java @@ -19,6 +19,8 @@ import club.joylink.rtss.vo.paper.FindPaperUserForClassReqVo; import club.joylink.rtss.vo.paper.FindPaperUserForCompositionReqVo; 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.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -66,7 +68,6 @@ public class PaperUserFindPageService { */ @Transactional(readOnly = true) public PageVO findPaperUserByPageForClass(FindPaperUserForClassReqVo req){ - PageVO page = new PageVO<>(); PaperComposition pc = paperCompositionDAO.selectByPrimaryKey(req.getPcId()); PaperExceptionAssert.PcExisted.assertNotNull(pc,"试卷定义不存在"); // @@ -83,38 +84,24 @@ public class PaperUserFindPageService { case Complete:c.andScoreIsNotNull();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(); - long startIndex = (req.getPageNum() - 1) * req.getPageSize(); - // - if (req.getDesc()) { - example.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize())); - } else { - example.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize())); - } - List pContent = this.paperUserDAO.selectByExample(example); - if (null != pContent) { - pContent.forEach(t -> { - page.getList().add(PaperUserConvertor.convert(pc,t)); - }); - } + // + String orderBy = req.getOrderBy().with()+(req.getDesc()?" desc":""); + PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy); + Page sqlPage = (Page) this.paperUserDAO.selectByExample(example); + // + List rtContent= new ArrayList<>(); + if(!CollectionUtils.isEmpty(sqlPage.getResult())){ + sqlPage.getResult().forEach(t -> { + rtContent.add(PaperUserConvertor.convert(pc,t)); + }); } - - - return page; + return PageVO.convert(sqlPage,rtContent); } /** * 分页查询某个试卷蓝图的所有用户试卷基本信息 */ @Transactional(readOnly = true) public PageVO findPaperUserByPage(FindPaperUserForCompositionReqVo req) { - PageVO page = new PageVO<>(); // PaperComposition pc = paperCompositionDAO.selectByPrimaryKey(req.getPcId()); PaperExceptionAssert.PcExisted.assertNotNull(pc,"试卷定义不存在"); @@ -127,30 +114,18 @@ public class PaperUserFindPageService { case Complete:c.andScoreIsNotNull();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(); - long startIndex = (req.getPageNum() - 1) * req.getPageSize(); - // - if (req.getDesc()) { - example.setOrderByClause(String.format("%s desc limit %s,%s", orderBy, startIndex, req.getPageSize())); - } else { - example.setOrderByClause(String.format("%s limit %s,%s", orderBy, startIndex, req.getPageSize())); - } - List pContent = this.paperUserDAO.selectByExample(example); - if (null != pContent) { - pContent.forEach(t -> { - page.getList().add(PaperUserConvertor.convert(pc,t)); - }); - } - } // - return page; + String orderBy = req.getOrderBy().with()+(req.getDesc()?" desc":""); + PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy); + Page sqlPage = (Page) this.paperUserDAO.selectByExample(example); + // + List rtContent= new ArrayList<>(); + if(!CollectionUtils.isEmpty(sqlPage.getResult())){ + sqlPage.getResult().forEach(t -> { + rtContent.add(PaperUserConvertor.convert(pc,t)); + }); + } + return PageVO.convert(sqlPage,rtContent); } /** * 查询某个班级的所有学生的userId From 0e348519660f50a31ce74845da13fc6fcfc6feea Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Mon, 17 Oct 2022 17:07:42 +0800 Subject: [PATCH 05/12] paper --- .../joylink/rtss/services/paper/PaperCompositionService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java index fd99958d3..1ff9452dc 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java @@ -124,7 +124,6 @@ public class PaperCompositionService { curPc.setCreateTime(LocalDateTime.now()); curPc.setUpdateTime(LocalDateTime.now()); curPc.setCreatorId(user.getId()); - curPc.setState(PaperCompositionState.Editing.getValue()); compositionDAO.updateByPrimaryKeySelective(curPc); // 更新规则 this.updateCompositionRule(req.getRuleList(), req.getId()); From a912a25c51672d440791d9fd3b84d4162b86b742 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 18 Oct 2022 09:38:54 +0800 Subject: [PATCH 06/12] permission --- .../RtsPermissionDistributeDAO.java | 34 + .../permission/PermissionDistribute.java | 71 ++ .../PermissionDistributeExample.java | 953 ++++++++++++++++++ .../entity/permission/PermissionSubject.java | 5 + .../permission/PermissionSubjectExample.java | 60 ++ .../permission/PermissionSubjectDAO.xml | 27 +- .../permission/RtsPermissionDistributeDAO.xml | 331 ++++++ 7 files changed, 1476 insertions(+), 5 deletions(-) create mode 100644 src/main/java/club/joylink/rtss/dao/permission/RtsPermissionDistributeDAO.java create mode 100644 src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java create mode 100644 src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java create mode 100644 src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml diff --git a/src/main/java/club/joylink/rtss/dao/permission/RtsPermissionDistributeDAO.java b/src/main/java/club/joylink/rtss/dao/permission/RtsPermissionDistributeDAO.java new file mode 100644 index 000000000..031301515 --- /dev/null +++ b/src/main/java/club/joylink/rtss/dao/permission/RtsPermissionDistributeDAO.java @@ -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 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); +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java new file mode 100644 index 000000000..a2eeae9e2 --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java @@ -0,0 +1,71 @@ +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 LocalDateTime createTime; + + /** + * 修改时间 + */ + private LocalDateTime updateTime; + + /** + * 开始时间 + */ + private LocalDateTime startTime; + + /** + * 结束时间 + */ + private LocalDateTime endTime; + + /** + * 创建者id + */ + private Long creatorId; + + /** + * 备注描述 + */ + private String dsc; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java new file mode 100644 index 000000000..a63c9e3fc --- /dev/null +++ b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java @@ -0,0 +1,953 @@ +package club.joylink.rtss.entity.permission; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +public class PermissionDistributeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public PermissionDistributeExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Long value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Long value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Long value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Long value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Long value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Long value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Long value1, Long value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Long value1, Long value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andPermissionIdIsNull() { + addCriterion("permission_id is null"); + return (Criteria) this; + } + + public Criteria andPermissionIdIsNotNull() { + addCriterion("permission_id is not null"); + return (Criteria) this; + } + + public Criteria andPermissionIdEqualTo(Long value) { + addCriterion("permission_id =", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotEqualTo(Long value) { + addCriterion("permission_id <>", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdGreaterThan(Long value) { + addCriterion("permission_id >", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdGreaterThanOrEqualTo(Long value) { + addCriterion("permission_id >=", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdLessThan(Long value) { + addCriterion("permission_id <", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdLessThanOrEqualTo(Long value) { + addCriterion("permission_id <=", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdIn(List values) { + addCriterion("permission_id in", values, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotIn(List values) { + addCriterion("permission_id not in", values, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdBetween(Long value1, Long value2) { + addCriterion("permission_id between", value1, value2, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotBetween(Long value1, Long value2) { + addCriterion("permission_id not between", value1, value2, "permissionId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdIsNull() { + addCriterion("source_subject_id is null"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdIsNotNull() { + addCriterion("source_subject_id is not null"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdEqualTo(Long value) { + addCriterion("source_subject_id =", value, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdNotEqualTo(Long value) { + addCriterion("source_subject_id <>", value, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdGreaterThan(Long value) { + addCriterion("source_subject_id >", value, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdGreaterThanOrEqualTo(Long value) { + addCriterion("source_subject_id >=", value, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdLessThan(Long value) { + addCriterion("source_subject_id <", value, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdLessThanOrEqualTo(Long value) { + addCriterion("source_subject_id <=", value, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdIn(List values) { + addCriterion("source_subject_id in", values, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdNotIn(List values) { + addCriterion("source_subject_id not in", values, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdBetween(Long value1, Long value2) { + addCriterion("source_subject_id between", value1, value2, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andSourceSubjectIdNotBetween(Long value1, Long value2) { + addCriterion("source_subject_id not between", value1, value2, "sourceSubjectId"); + return (Criteria) this; + } + + public Criteria andAmountIsNull() { + addCriterion("amount is null"); + return (Criteria) this; + } + + public Criteria andAmountIsNotNull() { + addCriterion("amount is not null"); + return (Criteria) this; + } + + public Criteria andAmountEqualTo(Integer value) { + addCriterion("amount =", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotEqualTo(Integer value) { + addCriterion("amount <>", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThan(Integer value) { + addCriterion("amount >", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountGreaterThanOrEqualTo(Integer value) { + addCriterion("amount >=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThan(Integer value) { + addCriterion("amount <", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountLessThanOrEqualTo(Integer value) { + addCriterion("amount <=", value, "amount"); + return (Criteria) this; + } + + public Criteria andAmountIn(List values) { + addCriterion("amount in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotIn(List values) { + addCriterion("amount not in", values, "amount"); + return (Criteria) this; + } + + public Criteria andAmountBetween(Integer value1, Integer value2) { + addCriterion("amount between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andAmountNotBetween(Integer value1, Integer value2) { + addCriterion("amount not between", value1, value2, "amount"); + return (Criteria) this; + } + + public Criteria andRemainsIsNull() { + addCriterion("remains is null"); + return (Criteria) this; + } + + public Criteria andRemainsIsNotNull() { + addCriterion("remains is not null"); + return (Criteria) this; + } + + public Criteria andRemainsEqualTo(Integer value) { + addCriterion("remains =", value, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsNotEqualTo(Integer value) { + addCriterion("remains <>", value, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsGreaterThan(Integer value) { + addCriterion("remains >", value, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsGreaterThanOrEqualTo(Integer value) { + addCriterion("remains >=", value, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsLessThan(Integer value) { + addCriterion("remains <", value, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsLessThanOrEqualTo(Integer value) { + addCriterion("remains <=", value, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsIn(List values) { + addCriterion("remains in", values, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsNotIn(List values) { + addCriterion("remains not in", values, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsBetween(Integer value1, Integer value2) { + addCriterion("remains between", value1, value2, "remains"); + return (Criteria) this; + } + + public Criteria andRemainsNotBetween(Integer value1, Integer value2) { + addCriterion("remains not between", value1, value2, "remains"); + return (Criteria) this; + } + + public Criteria andForeverIsNull() { + addCriterion("forever is null"); + return (Criteria) this; + } + + public Criteria andForeverIsNotNull() { + addCriterion("forever is not null"); + return (Criteria) this; + } + + public Criteria andForeverEqualTo(Boolean value) { + addCriterion("forever =", value, "forever"); + return (Criteria) this; + } + + public Criteria andForeverNotEqualTo(Boolean value) { + addCriterion("forever <>", value, "forever"); + return (Criteria) this; + } + + public Criteria andForeverGreaterThan(Boolean value) { + addCriterion("forever >", value, "forever"); + return (Criteria) this; + } + + public Criteria andForeverGreaterThanOrEqualTo(Boolean value) { + addCriterion("forever >=", value, "forever"); + return (Criteria) this; + } + + public Criteria andForeverLessThan(Boolean value) { + addCriterion("forever <", value, "forever"); + return (Criteria) this; + } + + public Criteria andForeverLessThanOrEqualTo(Boolean value) { + addCriterion("forever <=", value, "forever"); + return (Criteria) this; + } + + public Criteria andForeverIn(List values) { + addCriterion("forever in", values, "forever"); + return (Criteria) this; + } + + public Criteria andForeverNotIn(List values) { + addCriterion("forever not in", values, "forever"); + return (Criteria) this; + } + + public Criteria andForeverBetween(Boolean value1, Boolean value2) { + addCriterion("forever between", value1, value2, "forever"); + return (Criteria) this; + } + + public Criteria andForeverNotBetween(Boolean value1, Boolean value2) { + addCriterion("forever not between", value1, value2, "forever"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(LocalDateTime value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(LocalDateTime value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(LocalDateTime value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(LocalDateTime value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(LocalDateTime value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(LocalDateTime value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(LocalDateTime value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(LocalDateTime value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(LocalDateTime value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(LocalDateTime value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(LocalDateTime value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(LocalDateTime value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(LocalDateTime value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(LocalDateTime value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(LocalDateTime value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(LocalDateTime value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(LocalDateTime value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(LocalDateTime value1, LocalDateTime value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNull() { + addCriterion("creator_id is null"); + return (Criteria) this; + } + + public Criteria andCreatorIdIsNotNull() { + addCriterion("creator_id is not null"); + return (Criteria) this; + } + + public Criteria andCreatorIdEqualTo(Long value) { + addCriterion("creator_id =", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotEqualTo(Long value) { + addCriterion("creator_id <>", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThan(Long value) { + addCriterion("creator_id >", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) { + addCriterion("creator_id >=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThan(Long value) { + addCriterion("creator_id <", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdLessThanOrEqualTo(Long value) { + addCriterion("creator_id <=", value, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdIn(List values) { + addCriterion("creator_id in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotIn(List values) { + addCriterion("creator_id not in", values, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdBetween(Long value1, Long value2) { + addCriterion("creator_id between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andCreatorIdNotBetween(Long value1, Long value2) { + addCriterion("creator_id not between", value1, value2, "creatorId"); + return (Criteria) this; + } + + public Criteria andDscIsNull() { + addCriterion("dsc is null"); + return (Criteria) this; + } + + public Criteria andDscIsNotNull() { + addCriterion("dsc is not null"); + return (Criteria) this; + } + + public Criteria andDscEqualTo(String value) { + addCriterion("dsc =", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscNotEqualTo(String value) { + addCriterion("dsc <>", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscGreaterThan(String value) { + addCriterion("dsc >", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscGreaterThanOrEqualTo(String value) { + addCriterion("dsc >=", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscLessThan(String value) { + addCriterion("dsc <", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscLessThanOrEqualTo(String value) { + addCriterion("dsc <=", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscLike(String value) { + addCriterion("dsc like", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscNotLike(String value) { + addCriterion("dsc not like", value, "dsc"); + return (Criteria) this; + } + + public Criteria andDscIn(List values) { + addCriterion("dsc in", values, "dsc"); + return (Criteria) this; + } + + public Criteria andDscNotIn(List values) { + addCriterion("dsc not in", values, "dsc"); + return (Criteria) this; + } + + public Criteria andDscBetween(String value1, String value2) { + addCriterion("dsc between", value1, value2, "dsc"); + return (Criteria) this; + } + + public Criteria andDscNotBetween(String value1, String value2) { + addCriterion("dsc not between", value1, value2, "dsc"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/permission/PermissionSubject.java b/src/main/java/club/joylink/rtss/entity/permission/PermissionSubject.java index fc1496a6e..e4607f621 100644 --- a/src/main/java/club/joylink/rtss/entity/permission/PermissionSubject.java +++ b/src/main/java/club/joylink/rtss/entity/permission/PermissionSubject.java @@ -65,5 +65,10 @@ public class PermissionSubject implements Serializable { */ private LocalDateTime createTime; + /** + * 来自对应的分发id(rts_permission_distribute) + */ + private Long distributeId; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/club/joylink/rtss/entity/permission/PermissionSubjectExample.java b/src/main/java/club/joylink/rtss/entity/permission/PermissionSubjectExample.java index 97eaecddf..cf1bd4061 100644 --- a/src/main/java/club/joylink/rtss/entity/permission/PermissionSubjectExample.java +++ b/src/main/java/club/joylink/rtss/entity/permission/PermissionSubjectExample.java @@ -804,6 +804,66 @@ public class PermissionSubjectExample { addCriterion("create_time not between", value1, value2, "createTime"); 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 values) { + addCriterion("distribute_id in", values, "distributeId"); + return (Criteria) this; + } + + public Criteria andDistributeIdNotIn(List 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; + } } /** diff --git a/src/main/resources/mybatis/mapper/permission/PermissionSubjectDAO.xml b/src/main/resources/mybatis/mapper/permission/PermissionSubjectDAO.xml index 49c61160f..8d9889b19 100644 --- a/src/main/resources/mybatis/mapper/permission/PermissionSubjectDAO.xml +++ b/src/main/resources/mybatis/mapper/permission/PermissionSubjectDAO.xml @@ -13,6 +13,7 @@ + @@ -74,7 +75,7 @@ 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 @@ -239,6 +248,9 @@ create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + distribute_id = #{record.distributeId,jdbcType=BIGINT}, + @@ -256,7 +268,8 @@ forever = #{record.forever,jdbcType=BIT}, start_time = #{record.startTime,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} @@ -294,6 +307,9 @@ create_time = #{createTime,jdbcType=TIMESTAMP}, + + distribute_id = #{distributeId,jdbcType=BIGINT}, + where id = #{id,jdbcType=BIGINT} @@ -308,7 +324,8 @@ forever = #{forever,jdbcType=BIT}, start_time = #{startTime,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} \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml b/src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml new file mode 100644 index 000000000..6baed1d85 --- /dev/null +++ b/src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, permission_id, source_subject_id, amount, remains, forever, create_time, update_time, + start_time, end_time, creator_id, dsc + + + + + delete from rts_permission_distribute + where id = #{id,jdbcType=BIGINT} + + + delete from rts_permission_distribute + + + + + + insert into rts_permission_distribute (id, permission_id, source_subject_id, + amount, remains, forever, + 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}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, + #{endTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=BIGINT}, #{dsc,jdbcType=VARCHAR} + ) + + + insert into rts_permission_distribute + + + id, + + + permission_id, + + + source_subject_id, + + + amount, + + + remains, + + + forever, + + + create_time, + + + update_time, + + + start_time, + + + end_time, + + + creator_id, + + + dsc, + + + + + #{id,jdbcType=BIGINT}, + + + #{permissionId,jdbcType=BIGINT}, + + + #{sourceSubjectId,jdbcType=BIGINT}, + + + #{amount,jdbcType=INTEGER}, + + + #{remains,jdbcType=INTEGER}, + + + #{forever,jdbcType=BIT}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{startTime,jdbcType=TIMESTAMP}, + + + #{endTime,jdbcType=TIMESTAMP}, + + + #{creatorId,jdbcType=BIGINT}, + + + #{dsc,jdbcType=VARCHAR}, + + + + + + update rts_permission_distribute + + + 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}, + + + 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}, + + + + + + + + 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}, + 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} + + + + + + update rts_permission_distribute + + + permission_id = #{permissionId,jdbcType=BIGINT}, + + + source_subject_id = #{sourceSubjectId,jdbcType=BIGINT}, + + + amount = #{amount,jdbcType=INTEGER}, + + + remains = #{remains,jdbcType=INTEGER}, + + + forever = #{forever,jdbcType=BIT}, + + + 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 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}, + 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} + + \ No newline at end of file From fe9333fbb5373a8f36bf1d26e167942d30db7add Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 18 Oct 2022 09:43:55 +0800 Subject: [PATCH 07/12] permission --- .../AcPermissionDistributeController.java | 12 ++++++++++++ .../permission2/PermissionSubjectController.java | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java diff --git a/src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java b/src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java new file mode 100644 index 000000000..4c68a2928 --- /dev/null +++ b/src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java @@ -0,0 +1,12 @@ +package club.joylink.rtss.controller.permission2; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 权限分发业务接口V2 + */ +@RestController +@RequestMapping("/api/v2/permission/distribute") +public class AcPermissionDistributeController { +} diff --git a/src/main/java/club/joylink/rtss/controller/permission2/PermissionSubjectController.java b/src/main/java/club/joylink/rtss/controller/permission2/PermissionSubjectController.java index 78250b41a..db319323d 100644 --- a/src/main/java/club/joylink/rtss/controller/permission2/PermissionSubjectController.java +++ b/src/main/java/club/joylink/rtss/controller/permission2/PermissionSubjectController.java @@ -2,8 +2,9 @@ package club.joylink.rtss.controller.permission2; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + /** - * 主体(用户或组织)的权限管理接口
+ * 主体(用户或组织)的权限管理接口V2
*/ @RestController @RequestMapping("/api/v2/permission/subject") From 013b58f6bd57ff38ebd06556e4699b90005cea9e Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 18 Oct 2022 09:52:42 +0800 Subject: [PATCH 08/12] page --- .../rtss/services/draftData/DraftMapDisStationService.java | 5 ++++- .../joylink/rtss/services/paper/PaperCompositionService.java | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java b/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java index b620eda69..eb6e65768 100644 --- a/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java +++ b/src/main/java/club/joylink/rtss/services/draftData/DraftMapDisStationService.java @@ -89,10 +89,13 @@ public class DraftMapDisStationService { @Transactional(readOnly = true) public PageVO findByPage(Long mapId, DraftMapDisStationController.FindByPageReq req) { final String orderBy = "id" + (req.getDesc() ? " desc" : ""); - PageHelper.startPage(req.getPageNum(), req.getPageSize(), orderBy); DraftMapDisStationExample example = new DraftMapDisStationExample(); example.createCriteria().andMapIdEqualTo(mapId); + // + PageHelper.startPage(req.getPageNum(), req.getPageSize(), orderBy); Page pContent = (Page) this.draftMapDisStationDAO.selectByExample(example); + PageHelper.clearPage(); + // List voList = new ArrayList<>(); if (!CollectionUtils.isEmpty(pContent.getResult())) { voList = pContent.getResult().stream().map(DraftMapDisStationService::convert).collect(Collectors.toList()); diff --git a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java index 1ff9452dc..726fe2c54 100644 --- a/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java +++ b/src/main/java/club/joylink/rtss/services/paper/PaperCompositionService.java @@ -299,6 +299,8 @@ public class PaperCompositionService { // PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy); Page sqlPage = (Page) compositionDAO.selectByExample(pcEx); + PageHelper.clearPage(); + // final List rtList = new ArrayList<>(); if(!CollectionUtils.isEmpty(sqlPage.getResult())){ sqlPage.getResult().forEach(pc->{ @@ -364,6 +366,8 @@ public class PaperCompositionService { // PageHelper.startPage(req.getPageNum(),req.getPageSize(),orderBy); Page sqlPage = (Page) compositionDAO.selectByExample(pcEx); + PageHelper.clearPage(); + // final List rtList = new ArrayList<>(); if(!CollectionUtils.isEmpty(sqlPage.getResult())){ sqlPage.getResult().forEach(pc->{ From b40ccfe775bec324e9c616d6beac2473874be60c Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 18 Oct 2022 10:29:05 +0800 Subject: [PATCH 09/12] permission --- .../permission/AcPermissionService.java | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/src/main/java/club/joylink/rtss/services/permission/AcPermissionService.java b/src/main/java/club/joylink/rtss/services/permission/AcPermissionService.java index 4a1d43749..74d6d358b 100644 --- a/src/main/java/club/joylink/rtss/services/permission/AcPermissionService.java +++ b/src/main/java/club/joylink/rtss/services/permission/AcPermissionService.java @@ -10,6 +10,8 @@ import club.joylink.rtss.vo.client.PageVO; import club.joylink.rtss.vo.permission.*; import club.joylink.rtss.vo.permission.convertor.PermissionConvertor; 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.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -186,29 +188,19 @@ public class AcPermissionService { } } // - PageVO page = new PageVO<>(); - long sum = this.permissionDAO.countByExample(permissionExample); - page.setTotal(sum); - page.setPageNum(req.getPageNum()); - page.setPageSize(req.getPageSize()); - page.setList(new ArrayList<>()); - if (sum > 0) { - // - String orderBy = req.getOrderByType().with(); - long startIndex = (req.getPageNum() - 1) * req.getPageSize(); - // - if (req.getDesc()) { - 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 pContent = this.permissionDAO.selectByExample(permissionExample); - if (!CollectionUtils.isEmpty(pContent)) { - page.setList(pContent.stream().map(PermissionConvertor::convertPermissionBasicRspVoFrom).collect(Collectors.toList())); - } + final String orderBy = req.getOrderByType().with() + (req.getDesc() ? " desc" : ""); + PageHelper.startPage(req.getPageNum(), req.getPageSize(), orderBy); + Page sqlPage = (Page) this.permissionDAO.selectByExample(permissionExample); + PageHelper.clearPage(); + // + List rtList = new ArrayList<>(); + if (!CollectionUtils.isEmpty(sqlPage.getResult())) { + rtList=sqlPage.getResult().stream().map(PermissionConvertor::convertPermissionBasicRspVoFrom).collect(Collectors.toList()); } - return page; + // + return PageVO.convert(sqlPage,rtList); } + /////////////////////////////////////////////////////////////////////////////////////////////////////// private List findAbilitiesByPermissionId(Long permissionId) { PermissionSystemAbilityExample psaExample = new PermissionSystemAbilityExample(); From 24dd1cead9f3420ad65c0682e339ca19936d5ed5 Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 18 Oct 2022 13:08:19 +0800 Subject: [PATCH 10/12] permission --- .../AcPermissionDistributeController.java | 25 +++++++ .../CreatePermissionDistributeReqVo.java | 44 +++++++++++ .../CreatePermissionDistributeRspVo.java | 32 ++++++++ .../FindPermissionDistributeByPageReqVo.java | 72 ++++++++++++++++++ .../permission/PermissionDistributeRspVo.java | 73 +++++++++++++++++++ 5 files changed, 246 insertions(+) create mode 100644 src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeReqVo.java create mode 100644 src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeRspVo.java create mode 100644 src/main/java/club/joylink/rtss/vo/permission/FindPermissionDistributeByPageReqVo.java create mode 100644 src/main/java/club/joylink/rtss/vo/permission/PermissionDistributeRspVo.java diff --git a/src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java b/src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java index 4c68a2928..1b975c8f3 100644 --- a/src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java +++ b/src/main/java/club/joylink/rtss/controller/permission2/AcPermissionDistributeController.java @@ -1,5 +1,12 @@ 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; @@ -9,4 +16,22 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/api/v2/permission/distribute") public class AcPermissionDistributeController { + /** + * 创建权限分发 + */ + @PostMapping("/create") + public CreatePermissionDistributeRspVo createPermissionDistribute(@RequestBody CreatePermissionDistributeReqVo req) { + + return null; + } + + /** + * 分页获取权限分发列表 + */ + @PostMapping("/find/page") + public PageVO findPermissionDistributeByPage(@RequestBody FindPermissionDistributeByPageReqVo req) { + + return null; + } + } diff --git a/src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeReqVo.java b/src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeReqVo.java new file mode 100644 index 000000000..e0d6e46b2 --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeReqVo.java @@ -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; +} diff --git a/src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeRspVo.java b/src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeRspVo.java new file mode 100644 index 000000000..237839aa4 --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/permission/CreatePermissionDistributeRspVo.java @@ -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; +} diff --git a/src/main/java/club/joylink/rtss/vo/permission/FindPermissionDistributeByPageReqVo.java b/src/main/java/club/joylink/rtss/vo/permission/FindPermissionDistributeByPageReqVo.java new file mode 100644 index 000000000..86723fc63 --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/permission/FindPermissionDistributeByPageReqVo.java @@ -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 map = new HashMap<>(); + + static { + for (OrderByType t : values()) { + map.put(t.value, t); + } + } + } +} diff --git a/src/main/java/club/joylink/rtss/vo/permission/PermissionDistributeRspVo.java b/src/main/java/club/joylink/rtss/vo/permission/PermissionDistributeRspVo.java new file mode 100644 index 000000000..e7f09c177 --- /dev/null +++ b/src/main/java/club/joylink/rtss/vo/permission/PermissionDistributeRspVo.java @@ -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; +} From 0a752feb47b8d917bb85226914b7bb42b2e458dd Mon Sep 17 00:00:00 2001 From: xzb <223@qq.com> Date: Tue, 18 Oct 2022 13:19:15 +0800 Subject: [PATCH 11/12] permission --- .../permission/PermissionDistribute.java | 11 ++- .../PermissionDistributeExample.java | 62 +++++++++++++- .../permission/RtsPermissionDistributeDAO.xml | 85 +++++++++++-------- 3 files changed, 119 insertions(+), 39 deletions(-) diff --git a/src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java index a2eeae9e2..b8266a334 100644 --- a/src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java +++ b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistribute.java @@ -5,8 +5,8 @@ import java.time.LocalDateTime; import lombok.Data; /** - * @author - * + * @author + * */ @Data public class PermissionDistribute implements Serializable { @@ -37,6 +37,11 @@ public class PermissionDistribute implements Serializable { */ private Boolean forever; + /** + * 权限分发状态 + */ + private Integer status; + /** * 创建时间 */ @@ -68,4 +73,4 @@ public class PermissionDistribute implements Serializable { private String dsc; private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java index a63c9e3fc..791f5c1cb 100644 --- a/src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java +++ b/src/main/java/club/joylink/rtss/entity/permission/PermissionDistributeExample.java @@ -485,6 +485,66 @@ public class PermissionDistributeExample { return (Criteria) this; } + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; @@ -950,4 +1010,4 @@ public class PermissionDistributeExample { this(condition, value, secondValue, null); } } -} \ No newline at end of file +} diff --git a/src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml b/src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml index 6baed1d85..9a3ab4d61 100644 --- a/src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml +++ b/src/main/resources/mybatis/mapper/permission/RtsPermissionDistributeDAO.xml @@ -8,6 +8,7 @@ + @@ -74,8 +75,8 @@ - id, permission_id, source_subject_id, amount, remains, forever, create_time, update_time, - start_time, end_time, creator_id, dsc + id, permission_id, source_subject_id, amount, remains, forever, `status`, create_time, + update_time, start_time, end_time, creator_id, dsc