From a746c1be84d5ed85d6d4ab1a00beb23ca15eba26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B9=85=E5=93=A5?= <787952492@qq.com> Date: Thu, 21 Apr 2022 17:04:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=9C=E5=9C=BA=E9=A1=B9=E7=9B=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E6=90=9C=E7=B4=A2=E6=9D=A1=E4=BB=B6=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/project/ProjectController.java | 8 +++ .../project/vo/ProjectSearchPageReqVO.java | 61 +++++++++++++++++++ .../farm/dal/mysql/project/ProjectMapper.java | 2 + .../farm/service/project/ProjectService.java | 5 ++ .../service/project/ProjectServiceImpl.java | 10 +++ .../mapper/project/ProjectMapper.xml | 26 ++++++++ 6 files changed, 112 insertions(+) create mode 100644 zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectSearchPageReqVO.java diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java index 39b32f5b..8cb1ac33 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/ProjectController.java @@ -85,6 +85,14 @@ public class ProjectController { return success(ProjectConvert.INSTANCE.convertPage(pageResult)); } + @GetMapping("/pageSearch") + @ApiOperation("获得农场项目搜索分页") + public CommonResult> getProjectSearchPage(@Valid ProjectSearchPageReqVO pageVO) { + System.out.println("进入搜索分页"); + PageResult resultPage = projectService.getProjectSearchPage(pageVO); + return success(ProjectConvert.INSTANCE.convertPage(resultPage)); + } + @GetMapping("/export-excel") @ApiOperation("导出农场项目 Excel") @PreAuthorize("@ss.hasPermission('farm:project:export')") diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectSearchPageReqVO.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectSearchPageReqVO.java new file mode 100644 index 00000000..422b6de4 --- /dev/null +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/controller/admin/project/vo/ProjectSearchPageReqVO.java @@ -0,0 +1,61 @@ +package cn.iocoder.yudao.module.farm.controller.admin.project.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; +import java.util.Date; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("管理后台 - 农场项目分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProjectSearchPageReqVO extends PageParam { + + @ApiModelProperty(value = "") + private String name; + + @ApiModelProperty(value = "") + private String content; + + @ApiModelProperty(value = "") + private String resources; + + @ApiModelProperty(value = "") + private String images; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始") + private LocalDateTime beginPlanStartTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束") + private LocalDateTime endPlanStartTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始") + private LocalDateTime beginPlanEndTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束") + private LocalDateTime endPlanEndTime; + + @ApiModelProperty(value = "") + private Integer weight; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束") + private Date endCreateTime; + +} diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java index 08cd2c69..ba44aa2a 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/dal/mysql/project/ProjectMapper.java @@ -43,4 +43,6 @@ public interface ProjectMapper extends BaseMapperX { .orderByDesc(ProjectDO::getId)); } + List getProjectSearchPage(ProjectSearchPageReqVO reqVO); + } diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java index 1b625dfe..b0d4263b 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectService.java @@ -59,6 +59,11 @@ public interface ProjectService { */ PageResult getProjectPage(ProjectPageReqVO pageReqVO); + /** + * 搜索条件农场项目分页 + **/ + PageResult getProjectSearchPage(ProjectSearchPageReqVO pageReqVO); + /** * 获得农场项目列表, 用于 Excel 导出 * diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java index b1cffb89..354ddfc5 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java @@ -74,6 +74,16 @@ public class ProjectServiceImpl implements ProjectService { return projectMapper.selectPage(pageReqVO); } + @Override + public PageResult getProjectSearchPage(ProjectSearchPageReqVO pageReqVO){ + pageReqVO.setPageNo(pageReqVO.getPageNo() - 1); + List list = projectMapper.getProjectSearchPage(pageReqVO); + PageResult result = new PageResult<>(); + result.setList(list); + result.setTotal(Long.valueOf(list.size())); + return result; + } + @Override public List getProjectList(ProjectExportReqVO exportReqVO) { return projectMapper.selectList(exportReqVO); diff --git a/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml index cc658b0c..17563c64 100644 --- a/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml +++ b/zsw-farm/zsw-farm-impl/src/main/resources/mapper/project/ProjectMapper.xml @@ -9,4 +9,30 @@ 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/ --> +