成果字典增删查改,成果聚类分析

This commit is contained in:
13036795865 2025-05-26 11:08:23 +08:00
parent 7c6617626a
commit 5dd17b1142
10 changed files with 82 additions and 20 deletions

View File

@ -109,9 +109,17 @@ public class AchievementDictDataController extends BaseController
*/ */
@ApiOperation("根据成果字典分类查询成果值") @ApiOperation("根据成果字典分类查询成果值")
@GetMapping(value = "/getDictDateByType") @GetMapping(value = "/getDictDateByType")
public AjaxResult dictType(@PathVariable String dictType) public AjaxResult getDictDateByType(@PathVariable String dictType)
{ {
List<KeyValueVo> data = achievementDictDataService.selectDictDataByType(dictType); List<KeyValueVo> data = achievementDictDataService.selectDictDataByType(dictType);
return success(data); return success(data);
} }
@ApiOperation("根据成果字典分类")
@GetMapping(value = "/getDictTypes")
public AjaxResult getDictTypes()
{
List<String> data = achievementDictDataService.getDictTypes();
return success(data);
}
} }

View File

@ -1,6 +1,7 @@
package com.microservices.dms.achievementLibrary.domain; package com.microservices.dms.achievementLibrary.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -174,6 +175,16 @@ public class SchoolEnterpriseAchievements extends BaseEntity {
//团队名称 //团队名称
private String teamName; private String teamName;
private List<AchievementTeam> teamList;
public List<AchievementTeam> getTeamList() {
return teamList;
}
public void setTeamList(List<AchievementTeam> teamList) {
this.teamList = teamList;
}
public String getTeamName() { public String getTeamName() {
return teamName; return teamName;
} }

View File

@ -66,4 +66,6 @@ public interface AchievementDictDataMapper
List<KeyValueVo> selectDictDataByType(@Param("dictType") String dictType); List<KeyValueVo> selectDictDataByType(@Param("dictType") String dictType);
int selectDictDataByLabel(@Param("label") String label,@Param("type") String type); int selectDictDataByLabel(@Param("label") String label,@Param("type") String type);
List<String> getDictTypes();
} }

View File

@ -66,4 +66,6 @@ public interface AchievementTeamMapper
public int deleteAchievementTeamByIds(Long[] ids); public int deleteAchievementTeamByIds(Long[] ids);
void deleteAchievementTeamByAId(@Param("aid") Long aid); void deleteAchievementTeamByAId(@Param("aid") Long aid);
List<AchievementTeam> selectAchievementTeamByAchId(@Param("achId") Long achId);
} }

View File

@ -62,4 +62,6 @@ public interface IAchievementDictDataService
public int deleteAchievementDictDataByDictCode(Long dictCode); public int deleteAchievementDictDataByDictCode(Long dictCode);
List<KeyValueVo> selectDictDataByType(String dictType); List<KeyValueVo> selectDictDataByType(String dictType);
List<String> getDictTypes();
} }

View File

@ -108,4 +108,9 @@ public class AchievementDictDataServiceImpl implements IAchievementDictDataServi
public List<KeyValueVo> selectDictDataByType(String dictType) { public List<KeyValueVo> selectDictDataByType(String dictType) {
return achievementDictDataMapper.selectDictDataByType(dictType); return achievementDictDataMapper.selectDictDataByType(dictType);
} }
@Override
public List<String> getDictTypes() {
return achievementDictDataMapper.getDictTypes();
}
} }

View File

@ -5,7 +5,9 @@ import java.util.stream.Collectors;
import com.microservices.common.core.exception.ServiceException; import com.microservices.common.core.exception.ServiceException;
import com.microservices.common.core.utils.DateUtils; import com.microservices.common.core.utils.DateUtils;
import com.microservices.common.core.utils.StringUtils;
import com.microservices.common.security.utils.SecurityUtils; import com.microservices.common.security.utils.SecurityUtils;
import com.microservices.dms.achievementLibrary.domain.AchievementTeam;
import com.microservices.dms.achievementLibrary.domain.Achievements; import com.microservices.dms.achievementLibrary.domain.Achievements;
import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper; import com.microservices.dms.achievementLibrary.mapper.AchievementTeamMapper;
import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper; import com.microservices.dms.achievementLibrary.mapper.AchievementsMapper;
@ -46,7 +48,15 @@ public class SchoolEnterpriseAchievementsServiceImpl implements ISchoolEnterpris
@Override @Override
public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id) public SchoolEnterpriseAchievements selectSchoolEnterpriseAchievementsById(Long id)
{ {
return schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id); SchoolEnterpriseAchievements sAchievements = schoolEnterpriseAchievementsMapper.selectSchoolEnterpriseAchievementsById(id);
if(StringUtils.isNotNull(sAchievements)){
Long achId = sAchievements.getId();
List<AchievementTeam> teamList = achievementTeamMapper.selectAchievementTeamByAchId(achId);
if(StringUtils.isNotNull(teamList) && teamList.size() > 0){
sAchievements.setTeamList(teamList);
}
}
return sAchievements;
} }
/** /**

View File

@ -101,4 +101,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDictDataByLabel" resultType="int"> <select id="selectDictDataByLabel" resultType="int">
select count(1) from achievement_dict_data where dict_type = #{type} and dict_label = #{label} select count(1) from achievement_dict_data where dict_type = #{type} and dict_label = #{label}
</select> </select>
<select id="getDictTypes" resultType="String">
select distinct dict_type from achievement_dict_data
</select>
</mapper> </mapper>

View File

@ -125,4 +125,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
from achievement_team from achievement_team
where achievement_id = #{aid} where achievement_id = #{aid}
</delete> </delete>
<select id="selectAchievementTeamByAchId" resultMap="AchievementTeamResult">
<include refid="selectAchievementTeamVo"/>
where achievement_id = #{achId}
</select>
</mapper> </mapper>

View File

@ -540,24 +540,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="getAreaStatistic" resultType="com.microservices.dms.achievementLibrary.domain.AreaStatisticVo"> <select id="getAreaStatistic" resultType="com.microservices.dms.achievementLibrary.domain.AreaStatisticVo">
select z.name as "areaName", select
z.field_1 as "areaKey", z.name as "areaName",
z.remark as "remark", z.field_1 as "areaKey",
sum(z.kyxm) as "kyxmSum", z.remark as "remark",
sum(z.ckrw) as "ckrwSum", sum(z.kyxm) as "kyxmSum",
sum(z.kfjs) as "kfjsSum", sum(z.ckrw) as "ckrwSum",
sum(z.xqcg) as "xqcgSum" sum(z.kfjs) as "kfjsSum",
from (select r.name, sum(z.xqcg) as "xqcgSum"
r.field_1, from (
r.remark, select r.name,
case when r.source = 1 then tmp else 0 end as "kyxm", r.field_1,
case when r.source = 2 then tmp else 0 end as "ckrw", r.remark,
case when r.source = 3 then tmp else 0 end as "kfjs", case when r.source = 1 then tmp else 0 end as "kyxm",
case when r.source = 4 then tmp else 0 end as "xqcg" case when r.source = 2 then tmp else 0 end as "ckrw",
from (select c.name, a.source, count(1) as "tmp", a.field_1, c.remark case when r.source = 3 then tmp else 0 end as "kfjs",
from achievements a case when r.source = 4 then tmp else 0 end as "xqcg"
inner join categories c on a.field_1 = c.id from (
group by c.name, a.source, a.field_1, c.remark) r) z select t.name,t.source,count(1) as "tmp",t.field_1,t.remark
from (
select c.name,a.source, a.field_1,c.remark
from achievements a
left join project_categories c on a.field_1 = c.id where a.source='1'
union all
select c.name, a.source, a.field_1, c.remark
from achievements a
left join categories c on a.field_1 = c.id where a.source in ('2','3','4')
)t
where t.field_1 is not null and t.field_1 !=""
group by t.name, t.source, t.field_1, t.remark
) r
) z
<where> <where>
<if test="areaKey != null and areaKey != ''"> <if test="areaKey != null and areaKey != ''">
and z.field_1 = #{areaKey} and z.field_1 = #{areaKey}