From 258806b499187bd356dc12ff694fc05b169b88b3 Mon Sep 17 00:00:00 2001 From: wangna0328 <3402195679@qq.com> Date: Fri, 1 Aug 2025 17:18:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E5=BA=A6=E6=A8=A1=E5=9D=97=E6=8C=89?= =?UTF-8?q?=E9=9C=80=E6=B1=82=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90=EF=BC=8C?= =?UTF-8?q?=E4=B8=94=E9=80=9A=E8=BF=87=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/dite/znpt/mapper/RegulationMapper.java | 6 +++++- .../dite/znpt/mapper/RegulationTypeMapper.java | 7 ++++++- .../com/dite/znpt/service/RegulationService.java | 4 +++- .../dite/znpt/service/RegulationTypeService.java | 4 +++- .../znpt/service/impl/RegulationServiceImpl.java | 4 ++-- .../service/impl/RegulationTypeServiceImpl.java | 16 +++++++++------- .../web/controller/RegulationController.java | 6 ++++-- .../web/controller/RegulationTypeController.java | 6 ++++-- 8 files changed, 36 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/com/dite/znpt/mapper/RegulationMapper.java b/core/src/main/java/com/dite/znpt/mapper/RegulationMapper.java index 8b5d072..dc23993 100644 --- a/core/src/main/java/com/dite/znpt/mapper/RegulationMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/RegulationMapper.java @@ -19,9 +19,13 @@ public interface RegulationMapper extends BaseMapper { * @param page 分页参数 * @param status 状态 * @param type 类型 + * @param title 提案标题 + * @param proposer 提案人 * @return 分页结果 */ Page selectRegulationListWithCreator(Page page, @Param("status") String status, - @Param("type") String type); + @Param("type") String type, + @Param("title") String title, + @Param("proposer") String proposer); } \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/mapper/RegulationTypeMapper.java b/core/src/main/java/com/dite/znpt/mapper/RegulationTypeMapper.java index 1065361..5f7cfb8 100644 --- a/core/src/main/java/com/dite/znpt/mapper/RegulationTypeMapper.java +++ b/core/src/main/java/com/dite/znpt/mapper/RegulationTypeMapper.java @@ -18,7 +18,12 @@ public interface RegulationTypeMapper extends BaseMapper { * 分页查询制度类型列表(包含创建人姓名) * @param page 分页参数 * @param typeName 类型名称 + * @param status 状态 + * @param remark 备注 * @return 分页结果 */ - Page selectRegulationTypeListWithCreator(Page page, @Param("typeName") String typeName); + Page selectRegulationTypeListWithCreator(Page page, + @Param("typeName") String typeName, + @Param("status") String status, + @Param("remark") String remark); } \ No newline at end of file diff --git a/core/src/main/java/com/dite/znpt/service/RegulationService.java b/core/src/main/java/com/dite/znpt/service/RegulationService.java index 27cfe85..b24957f 100644 --- a/core/src/main/java/com/dite/znpt/service/RegulationService.java +++ b/core/src/main/java/com/dite/znpt/service/RegulationService.java @@ -17,9 +17,11 @@ public interface RegulationService extends IService { * @param pageSize 页大小 * @param status 状态 * @param type 类型 + * @param title 提案标题 + * @param proposer 提案人 * @return 结果 */ - Result getRegulationList(Integer page, Integer pageSize, String status, String type); + Result getRegulationList(Integer page, Integer pageSize, String status, String type, String title, String proposer); /** * 创建制度提案 diff --git a/core/src/main/java/com/dite/znpt/service/RegulationTypeService.java b/core/src/main/java/com/dite/znpt/service/RegulationTypeService.java index cba5e41..c5b8715 100644 --- a/core/src/main/java/com/dite/znpt/service/RegulationTypeService.java +++ b/core/src/main/java/com/dite/znpt/service/RegulationTypeService.java @@ -16,9 +16,11 @@ public interface RegulationTypeService extends IService { * @param page 页码 * @param size 页大小 * @param typeName 类型名称 + * @param status 状态 + * @param remark 备注 * @return 结果 */ - Result getRegulationTypes(Integer page, Integer size, String typeName); + Result getRegulationTypes(Integer page, Integer size, String typeName, String status, String remark); /** * 创建制度类型 diff --git a/core/src/main/java/com/dite/znpt/service/impl/RegulationServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/RegulationServiceImpl.java index bdc09c6..cf52e5f 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/RegulationServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/RegulationServiceImpl.java @@ -68,12 +68,12 @@ public class RegulationServiceImpl extends ServiceImpl pageParam = new Page<>(page, pageSize); // 使用关联查询获取创建人姓名 - Page result = this.baseMapper.selectRegulationListWithCreator(pageParam, status, type); + Page result = this.baseMapper.selectRegulationListWithCreator(pageParam, status, type, title, proposer); // 如果是获取已发布的制度,需要添加确认状态 if (status != null && "PUBLISHED".equals(status)) { diff --git a/core/src/main/java/com/dite/znpt/service/impl/RegulationTypeServiceImpl.java b/core/src/main/java/com/dite/znpt/service/impl/RegulationTypeServiceImpl.java index 5a7fd17..1a3616e 100644 --- a/core/src/main/java/com/dite/znpt/service/impl/RegulationTypeServiceImpl.java +++ b/core/src/main/java/com/dite/znpt/service/impl/RegulationTypeServiceImpl.java @@ -5,12 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.dite.znpt.domain.Result; -import com.dite.znpt.domain.entity.RegulationTypeEntity; import com.dite.znpt.domain.entity.RegulationEntity; -import com.dite.znpt.mapper.RegulationTypeMapper; +import com.dite.znpt.domain.entity.RegulationTypeEntity; import com.dite.znpt.mapper.RegulationMapper; +import com.dite.znpt.mapper.RegulationTypeMapper; import com.dite.znpt.service.RegulationTypeService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -24,17 +23,20 @@ import java.time.LocalDateTime; @Service public class RegulationTypeServiceImpl extends ServiceImpl implements RegulationTypeService { - @Autowired - private RegulationMapper regulationMapper; + private final RegulationMapper regulationMapper; + + public RegulationTypeServiceImpl(RegulationMapper regulationMapper) { + this.regulationMapper = regulationMapper; + } @Override @Transactional(readOnly = true) - public Result getRegulationTypes(Integer page, Integer size, String typeName) { + public Result getRegulationTypes(Integer page, Integer size, String typeName, String status, String remark) { try { Page pageParam = new Page<>(page, size); // 使用连表查询获取创建人姓名 - Page result = this.baseMapper.selectRegulationTypeListWithCreator(pageParam, typeName); + Page result = this.baseMapper.selectRegulationTypeListWithCreator(pageParam, typeName, status, remark); return Result.ok(result); } catch (Exception e) { diff --git a/web/src/main/java/com/dite/znpt/web/controller/RegulationController.java b/web/src/main/java/com/dite/znpt/web/controller/RegulationController.java index e51639f..c27dc10 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/RegulationController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/RegulationController.java @@ -26,8 +26,10 @@ public class RegulationController { public Result getRegulationList(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size, @RequestParam(required = false) String status, - @RequestParam(required = false) String type) { - return regulationService.getRegulationList(page, size, status, type); + @RequestParam(required = false) String type, + @RequestParam(required = false) String title, + @RequestParam(required = false) String proposer) { + return regulationService.getRegulationList(page, size, status, type, title, proposer); } @ApiOperation(value = "创建制度提案", httpMethod = "POST") diff --git a/web/src/main/java/com/dite/znpt/web/controller/RegulationTypeController.java b/web/src/main/java/com/dite/znpt/web/controller/RegulationTypeController.java index 6d1c230..1862cad 100644 --- a/web/src/main/java/com/dite/znpt/web/controller/RegulationTypeController.java +++ b/web/src/main/java/com/dite/znpt/web/controller/RegulationTypeController.java @@ -25,8 +25,10 @@ public class RegulationTypeController { @GetMapping public Result getRegulationTypes(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int size, - @RequestParam(required = false) String typeName) { - return regulationTypeService.getRegulationTypes(page, size, typeName); + @RequestParam(required = false) String typeName, + @RequestParam(required = false) String status, + @RequestParam(required = false) String remark) { + return regulationTypeService.getRegulationTypes(page, size, typeName, status, remark); } @ApiOperation(value = "创建制度类型", httpMethod = "POST")