fix
This commit is contained in:
parent
45e074f89a
commit
b507862fc9
@ -93,8 +93,8 @@ public class IndicatorLibraryController {
|
|||||||
@GetMapping("/statistical")
|
@GetMapping("/statistical")
|
||||||
@ApiOperation("统计指标")
|
@ApiOperation("统计指标")
|
||||||
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeRes.class)})
|
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = StatisticalIndicatorTypeRes.class)})
|
||||||
public R statistical(@RequestParam(name = "type",required = false) @ApiParam(value = "指标维度id",name = "type") Long 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);
|
List<StatisticalIndicatorTypeRes> dtos = indicatorLibraryService.statisticalByType(type,name);
|
||||||
return R.ok().put("data",dtos);
|
return R.ok().put("data",dtos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -42,11 +42,11 @@ public interface IndicatorLibraryMapper extends BaseMapper<IndicatorLibrary> {
|
|||||||
|
|
||||||
void updateIndicatorLibrarysMove(@Param("ids")List<Long> ids,@Param("indicatorType")Long indicatorType);
|
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 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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ public interface IndicatorLibraryService extends IService<IndicatorLibrary> {
|
|||||||
|
|
||||||
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
|
void updateIndicatorLibrarysMove(IndicatorLibraryMoveDto dto);
|
||||||
|
|
||||||
List<StatisticalIndicatorTypeRes> statisticalByType(Long indicatorType);
|
List<StatisticalIndicatorTypeRes> statisticalByType(Long indicatorType,String name);
|
||||||
|
|
||||||
int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);
|
int deleteIndicatorLibrarysIndicatorType(Integer indicatorType);
|
||||||
|
|
||||||
|
|||||||
@ -99,13 +99,13 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl<IndicatorLibraryMap
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<StatisticalIndicatorTypeRes> statisticalByType(Long type) {
|
public List<StatisticalIndicatorTypeRes> statisticalByType(Long type,String name) {
|
||||||
List<StatisticalIndicatorTypeRes> dtos = indicatorLibraryMapper.statisticalByType(type);
|
List<StatisticalIndicatorTypeRes> dtos = indicatorLibraryMapper.statisticalByType(type,name);
|
||||||
StatisticalIndicatorTypeRes dto = new StatisticalIndicatorTypeRes();
|
StatisticalIndicatorTypeRes dto = new StatisticalIndicatorTypeRes();
|
||||||
dto.setName("未分类指标");
|
dto.setName("未分类指标");
|
||||||
dto.setIndicatorType(0);
|
dto.setIndicatorType(0);
|
||||||
dto.setDelete(1);
|
dto.setDelete(1);
|
||||||
int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0,type);
|
int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0,type,name);
|
||||||
dto.setCount(count);
|
dto.setCount(count);
|
||||||
if(count>0){
|
if(count>0){
|
||||||
dtos.add(dto);
|
dtos.add(dto);
|
||||||
|
|||||||
@ -138,6 +138,9 @@
|
|||||||
<if test="type!=null and type!=0">
|
<if test="type!=null and type!=0">
|
||||||
and type = #{type}
|
and type = #{type}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="name !=null and name !=''">
|
||||||
|
and name like concat('%',#{name},'%')
|
||||||
|
</if>
|
||||||
GROUP BY indicator_type) l
|
GROUP BY indicator_type) l
|
||||||
on t.id = l.indicator_type
|
on t.id = l.indicator_type
|
||||||
where t.is_delete = 0 and t.type=0
|
where t.is_delete = 0 and t.type=0
|
||||||
@ -159,6 +162,9 @@
|
|||||||
<if test="type==null or type==0">
|
<if test="type==null or type==0">
|
||||||
and type in (SELECT id from lz_result_dimension where is_delete = 0)
|
and type in (SELECT id from lz_result_dimension where is_delete = 0)
|
||||||
</if>
|
</if>
|
||||||
|
<if test="name !=null and name !=''">
|
||||||
|
and name like concat('%',#{name},'%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user