This commit is contained in:
DirectionOfMind 2021-01-26 18:00:07 +08:00
parent 45e074f89a
commit b507862fc9
5 changed files with 14 additions and 8 deletions

View File

@ -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<StatisticalIndicatorTypeRes> 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<StatisticalIndicatorTypeRes> dtos = indicatorLibraryService.statisticalByType(type,name);
return R.ok().put("data",dtos);
}
}

View File

@ -42,11 +42,11 @@ public interface IndicatorLibraryMapper extends BaseMapper<IndicatorLibrary> {
void updateIndicatorLibrarysMove(@Param("ids")List<Long> ids,@Param("indicatorType")Long indicatorType);
List<StatisticalIndicatorTypeRes> statisticalByType(@Param("type") Long type);
List<StatisticalIndicatorTypeRes> 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);
}

View File

@ -41,7 +41,7 @@ public interface IndicatorLibraryService extends IService<IndicatorLibrary> {
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
List<StatisticalIndicatorTypeRes> statisticalByType(Long indicatorType);
List<StatisticalIndicatorTypeRes> statisticalByType(Long indicatorType,String name);
int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);

View File

@ -99,13 +99,13 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl<IndicatorLibraryMap
}
@Override
public List<StatisticalIndicatorTypeRes> statisticalByType(Long type) {
List<StatisticalIndicatorTypeRes> dtos = indicatorLibraryMapper.statisticalByType(type);
public List<StatisticalIndicatorTypeRes> statisticalByType(Long type,String name) {
List<StatisticalIndicatorTypeRes> 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);

View File

@ -138,6 +138,9 @@
<if test="type!=null and type!=0">
and type = #{type}
</if>
<if test="name !=null and name !=''">
and name like concat('%',#{name},'%')
</if>
GROUP BY indicator_type) l
on t.id = l.indicator_type
where t.is_delete = 0 and t.type=0
@ -159,6 +162,9 @@
<if test="type==null or type==0">
and type in (SELECT id from lz_result_dimension where is_delete = 0)
</if>
<if test="name !=null and name !=''">
and name like concat('%',#{name},'%')
</if>
</select>