From 7eb15b6ad824380f8a444f51e0c664fa1b821c58 Mon Sep 17 00:00:00 2001 From: walker-sheng Date: Thu, 15 Jul 2021 10:56:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A02d=E6=A8=A1=E5=9E=8B=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E7=89=88=E6=9C=AC=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rtss/controller/model2d/Model2dController.java | 11 +++++++++++ .../joylink/rtss/services/model2d/Model2dService.java | 8 ++++++++ .../rtss/services/model2d/Model2dServiceImpl.java | 10 ++++++++++ 3 files changed, 29 insertions(+) diff --git a/src/main/java/club/joylink/rtss/controller/model2d/Model2dController.java b/src/main/java/club/joylink/rtss/controller/model2d/Model2dController.java index ff94a7c6d..df4ed41ec 100644 --- a/src/main/java/club/joylink/rtss/controller/model2d/Model2dController.java +++ b/src/main/java/club/joylink/rtss/controller/model2d/Model2dController.java @@ -69,6 +69,17 @@ public class Model2dController { return this.model2dService.queryAllVersionOf(code); } + /** + * 分页查询某个模型历史版本数据 + * @param code + * @return + */ + @GetMapping("/{code}/versions/paging") + public PageVO pageQueryVersion(@PathVariable String code, Model2dQueryVO queryVO) { + return model2dService.pageQueryVersion(code, queryVO); + } + + /** * 回滚版本 * @param code diff --git a/src/main/java/club/joylink/rtss/services/model2d/Model2dService.java b/src/main/java/club/joylink/rtss/services/model2d/Model2dService.java index ebb2b2375..ef0fdb620 100644 --- a/src/main/java/club/joylink/rtss/services/model2d/Model2dService.java +++ b/src/main/java/club/joylink/rtss/services/model2d/Model2dService.java @@ -46,6 +46,14 @@ public interface Model2dService { */ List queryAllVersionOf(String code); + /** + * 分页查询某个模型历史版本数据 + * @param code + * @param queryVO + * @return + */ + PageVO pageQueryVersion(String code, Model2dQueryVO queryVO); + /** * 回滚版本 * @param code diff --git a/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java b/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java index eb242f395..0ccdb1571 100644 --- a/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java +++ b/src/main/java/club/joylink/rtss/services/model2d/Model2dServiceImpl.java @@ -105,6 +105,16 @@ public class Model2dServiceImpl implements Model2dService { return Model2dVO.convert2VOList(model2ds); } + @Override + public PageVO pageQueryVersion(String code, Model2dQueryVO queryVO) { + Model2dExample example = new Model2dExample(); + example.createCriteria() + .andCodeEqualTo(code); + PageHelper.startPage(queryVO.getPageNum(), queryVO.getPageSize()); + Page page = (Page) this.model2dDAO.selectByExampleWithBLOBs(example); + return PageVO.convert(page, Model2dVO.convert2VOList(page.getResult())); + } + @Override public void rollbackVersion(String code, Integer version) { BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.assertNotNull(code);