成果字典增删查改,成果聚类分析
This commit is contained in:
parent
7c6617626a
commit
5dd17b1142
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -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.name as "areaName",
|
||||||
z.field_1 as "areaKey",
|
z.field_1 as "areaKey",
|
||||||
z.remark as "remark",
|
z.remark as "remark",
|
||||||
sum(z.kyxm) as "kyxmSum",
|
sum(z.kyxm) as "kyxmSum",
|
||||||
sum(z.ckrw) as "ckrwSum",
|
sum(z.ckrw) as "ckrwSum",
|
||||||
sum(z.kfjs) as "kfjsSum",
|
sum(z.kfjs) as "kfjsSum",
|
||||||
sum(z.xqcg) as "xqcgSum"
|
sum(z.xqcg) as "xqcgSum"
|
||||||
from (select r.name,
|
from (
|
||||||
|
select r.name,
|
||||||
r.field_1,
|
r.field_1,
|
||||||
r.remark,
|
r.remark,
|
||||||
case when r.source = 1 then tmp else 0 end as "kyxm",
|
case when r.source = 1 then tmp else 0 end as "kyxm",
|
||||||
case when r.source = 2 then tmp else 0 end as "ckrw",
|
case when r.source = 2 then tmp else 0 end as "ckrw",
|
||||||
case when r.source = 3 then tmp else 0 end as "kfjs",
|
case when r.source = 3 then tmp else 0 end as "kfjs",
|
||||||
case when r.source = 4 then tmp else 0 end as "xqcg"
|
case when r.source = 4 then tmp else 0 end as "xqcg"
|
||||||
from (select c.name, a.source, count(1) as "tmp", a.field_1, c.remark
|
from (
|
||||||
|
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
|
from achievements a
|
||||||
inner join categories c on a.field_1 = c.id
|
left join project_categories c on a.field_1 = c.id where a.source='1'
|
||||||
group by c.name, a.source, a.field_1, c.remark) r) z
|
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}
|
||||||
|
|
Loading…
Reference in New Issue