fix
This commit is contained in:
parent
b81cc49401
commit
ad2bdac0b5
@ -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);
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user