This commit is contained in:
DirectionOfMind 2021-01-19 17:42:58 +08:00
parent b81cc49401
commit ad2bdac0b5
4 changed files with 18 additions and 1 deletions

View File

@ -111,7 +111,7 @@ public class IndicatorLibraryController {
@GetMapping("/statistical")
@ApiOperation("统计指标")
public R statistical(@RequestParam("indicatorType") @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
public R statistical(@RequestParam(name = "indicatorType",required = false) @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
List<StatisticalIndicatorTypeDto> dtos = indicatorLibraryService.statisticalByIndicatorType(indicatorType);
return R.ok().put("data",dtos);
}

View File

@ -45,4 +45,8 @@ public interface IndicatorLibraryMapper extends BaseMapper<IndicatorLibrary> {
List<StatisticalIndicatorTypeDto> statisticalByIndicatorType(Long indicatorType);
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
}

View File

@ -114,6 +114,14 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl<IndicatorLibraryMap
}
//加入首位
dtos.add(0,dto);
dto = new StatisticalIndicatorTypeDto();
dto.setName("未分类指标");
dto.setIndicatorType(0);
int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0);
dto.setCount(count);
if(count>0){
dtos.add(0,dto);
}
return dtos;
}

View File

@ -139,5 +139,10 @@
</update>
<select id="countIndicatorLibrarysByIndicatorType" resultType="java.lang.Integer">
select COUNT(1) from lz_indicator_library where indicator_type=#{indicatorType} and is_delete = 0
</select>
</mapper>