This commit is contained in:
DirectionOfMind 2021-01-22 15:26:25 +08:00
parent 74096d648c
commit e5a8a04f88
3 changed files with 9 additions and 4 deletions

View File

@ -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(Long type); List<StatisticalIndicatorTypeRes> statisticalByType(@Param("type") Long type);
int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType); int deleteIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType);
int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType); int countIndicatorLibrarysByIndicatorType(@Param("indicatorType") Integer indicatorType,@Param("type") Long type);
} }

View File

@ -105,7 +105,7 @@ public class IndicatorLibraryServiceImpl extends ServiceImpl<IndicatorLibraryMap
dto.setName("未分类指标"); dto.setName("未分类指标");
dto.setIndicatorType(0); dto.setIndicatorType(0);
dto.setDelete(1); dto.setDelete(1);
int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0); int count = indicatorLibraryMapper.countIndicatorLibrarysByIndicatorType(0,type);
dto.setCount(count); dto.setCount(count);
if(count>0){ if(count>0){
dtos.add(dto); dtos.add(dto);

View File

@ -153,7 +153,12 @@
<select id="countIndicatorLibrarysByIndicatorType" resultType="java.lang.Integer"> <select id="countIndicatorLibrarysByIndicatorType" resultType="java.lang.Integer">
select COUNT(1) from lz_indicator_library where indicator_type=#{indicatorType} and is_delete = 0 select COUNT(1) from lz_indicator_library where indicator_type=#{indicatorType} and is_delete = 0
and type in (SELECT id from lz_result_dimension where is_delete = 0) <if test="type!=null and type!=0">
and type = #{type}
</if>
<if test="type==null or type==0">
and type in (SELECT id from lz_result_dimension where is_delete = 0)
</if>
</select> </select>