fix
This commit is contained in:
parent
9b91874ff2
commit
b81cc49401
@ -109,10 +109,10 @@ public class IndicatorLibraryController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/statistical")
|
||||
@GetMapping("/statistical")
|
||||
@ApiOperation("统计指标")
|
||||
public R statistical() {
|
||||
List<StatisticalIndicatorTypeDto> dtos = indicatorLibraryService.statisticalByIndicatorType();
|
||||
public R statistical(@RequestParam("indicatorType") @ApiParam(value = "指标分类id",name = "indicatorType") Long indicatorType) {
|
||||
List<StatisticalIndicatorTypeDto> dtos = indicatorLibraryService.statisticalByIndicatorType(indicatorType);
|
||||
return R.ok().put("data",dtos);
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ public interface IndicatorLibraryMapper extends BaseMapper<IndicatorLibrary> {
|
||||
|
||||
void updateIndicatorLibrarysMove(@Param("ids")List<Long> ids,@Param("indicatorType")Long indicatorType);
|
||||
|
||||
List<StatisticalIndicatorTypeDto> statisticalByIndicatorType();
|
||||
List<StatisticalIndicatorTypeDto> statisticalByIndicatorType(Long indicatorType);
|
||||
|
||||
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
|
||||
}
|
||||
@ -41,7 +41,7 @@ public interface IndicatorLibraryService extends IService<IndicatorLibrary> {
|
||||
|
||||
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
|
||||
|
||||
List<StatisticalIndicatorTypeDto> statisticalByIndicatorType();
|
||||
List<StatisticalIndicatorTypeDto> statisticalByIndicatorType(Long indicatorType);
|
||||
|
||||
int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);
|
||||
|
||||
|
||||
@ -103,8 +103,8 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl<IndicatorLibraryMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatisticalIndicatorTypeDto> statisticalByIndicatorType() {
|
||||
List<StatisticalIndicatorTypeDto> dtos = indicatorLibraryMapper.statisticalByIndicatorType();
|
||||
public List<StatisticalIndicatorTypeDto> statisticalByIndicatorType(Long indicatorType) {
|
||||
List<StatisticalIndicatorTypeDto> dtos = indicatorLibraryMapper.statisticalByIndicatorType(indicatorType);
|
||||
StatisticalIndicatorTypeDto dto = new StatisticalIndicatorTypeDto();
|
||||
dto.setName("全部分类");
|
||||
dto.setIndicatorType(null);
|
||||
|
||||
@ -125,9 +125,12 @@
|
||||
|
||||
<select id="statisticalByIndicatorType"
|
||||
resultType="com.lz.modules.performance.dto.StatisticalIndicatorTypeDto">
|
||||
SELECT t.id indicatorType,t.name,IFNULL(l.count,0) count from lz_indicator_type t
|
||||
LEFT JOIN (SELECT name,indicator_type,count(indicator_type) count from lz_indicator_library where is_delete = 0 GROUP BY indicator_type) l
|
||||
on t.is_delete = 0 and t.id = l.indicator_type
|
||||
SELECT t.name,l.indicator_type,count(l.indicator_type) count from lz_indicator_type t RIGHT JOIN lz_indicator_library l
|
||||
on t.id = l.indicator_type where t.is_delete = 0 and l.is_delete=0
|
||||
<if test="indicatorType!=null">
|
||||
and l.indicator_type=#{indicatorType}
|
||||
</if>
|
||||
GROUP BY indicator_type
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user