From b507862fc92f914d1e3e4755fd09e901f2f817a7 Mon Sep 17 00:00:00 2001 From: DirectionOfMind <3182967682@qq.com> Date: Tue, 26 Jan 2021 18:00:07 +0800 Subject: [PATCH] fix --- .../performance/controller/IndicatorLibraryController.java | 4 ++-- .../lz/modules/performance/dao/IndicatorLibraryMapper.java | 4 ++-- .../performance/service/IndicatorLibraryService.java | 2 +- .../service/impl/IndicatorLibraryServiceImpl.java | 6 +++--- .../resources/mapper/performance/IndicatorLibraryMapper.xml | 6 ++++++ 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java index 3460b06d..b85c1228 100644 --- a/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java +++ b/src/main/java/com/lz/modules/performance/controller/IndicatorLibraryController.java @@ -93,8 +93,8 @@ public class IndicatorLibraryController { @GetMapping("/statistical") @ApiOperation("统计指标") @ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeRes.class)}) - public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标维度id",name = "type") Long type) { - List dtos = indicatorLibraryService.statisticalByType(type); + public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标维度id",name = "type") Long type,@RequestParam(name = "name",required = false) @ApiParam(value = "指标名称",name = "name") String name) { + List dtos = indicatorLibraryService.statisticalByType(type,name); return R.ok().put("data",dtos); } } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java index bd648613..fc449c37 100644 --- a/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java +++ b/src/main/java/com/lz/modules/performance/dao/IndicatorLibraryMapper.java @@ -42,11 +42,11 @@ public interface IndicatorLibraryMapper extends BaseMapper { void updateIndicatorLibrarysMove(@Param("ids")List ids,@Param("indicatorType")Long indicatorType); - List statisticalByType(@Param("type") Long type); + List statisticalByType(@Param("type") Long type,@Param("name") String name); int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType); - int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType,@Param("type") Long type); + int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType,@Param("type") Long type,@Param("name") String name); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java index 2a8f09ee..5b1a4a8f 100644 --- a/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java +++ b/src/main/java/com/lz/modules/performance/service/IndicatorLibraryService.java @@ -41,7 +41,7 @@ public interface IndicatorLibraryService extends IService { void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto); - List statisticalByType(Long indicatorType); + List statisticalByType(Long indicatorType,String name); int deleteIndicatorLibrarysIndicatorType(Integer indicatorType); diff --git a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java index 02eb4eda..6ea8db5b 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/IndicatorLibraryServiceImpl.java @@ -99,13 +99,13 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl statisticalByType(Long type) { - List dtos = indicatorLibraryMapper.statisticalByType(type); + public List statisticalByType(Long type,String name) { + List dtos = indicatorLibraryMapper.statisticalByType(type,name); StatisticalIndicatorTypeRes dto = new StatisticalIndicatorTypeRes(); dto.setName("未分类指标"); dto.setIndicatorType(0); dto.setDelete(1); - int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0,type); + int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0,type,name); dto.setCount(count); if(count>0){ dtos.add(dto); diff --git a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml index c81a8472..3a4870ab 100644 --- a/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml +++ b/src/main/resources/mapper/performance/IndicatorLibraryMapper.xml @@ -138,6 +138,9 @@ and type = #{type} + + and name like concat('%',#{name},'%') + GROUP BY indicator_type) l on t.id = l.indicator_type where t.is_delete = 0 and t.type=0 @@ -159,6 +162,9 @@ and type in (SELECT id from lz_result_dimension where is_delete = 0) + + and name like concat('%',#{name},'%') +