Commit f3475986 authored by 王国存's avatar 王国存

新增功能--绩效总分列表

parent 64999bfc
......@@ -352,5 +352,36 @@ public class QuestionnaireCtrl {
return fileUrl;
}
/**
* 统计中众创空间的分数
* @param
* @return
*/
@RequestMapping({"/selectPerformanceSummaryList"})
@ResponseBody
public Map<String, Object> selectPerformanceSummaryList(PerformanceSummary performanceSummary){
Map<String, Object> map = new HashMap();
map.put("result", true);
map.put("msg", "");
Map<String, Object> data = new HashMap();
int totalScore = 0;
//查询空间的不同指标的分数
List<PerformanceSummary> performanceSummaryList = questionnaireService.selectPerformanceSummaryList(performanceSummary);
if(performanceSummaryList.size() > 0){
for(PerformanceSummary total : performanceSummaryList){
//计算各个空间指标的哦总分
totalScore = total.getBasicIndicators() + total.getGuideIndicators() + total.getRewardIndicators();
}
data.put("performanceSummaryList",performanceSummaryList);
data.put("totalScore",totalScore);
}
map.put("data",data);
return map;
}
}
package com.tiptimes.dao;
import com.tiptimes.model.Answer;
import com.tiptimes.model.PerformanceSummary;
import com.tiptimes.model.Record;
import com.tiptimes.model.Review;
import org.apache.ibatis.annotations.Param;
......@@ -35,4 +36,6 @@ public interface QuestionnaireDao {
List<String> selectFileId(@Param("optionId") Long optionId,
@Param("recordId")Long recordId);
List<PerformanceSummary> selectPerformanceSummaryList(PerformanceSummary performanceSummary);
}
package com.tiptimes.model;
public class PerformanceSummary {
private String optinName;//众创空间名称
private int basicIndicators;//基础指标得分
private int guideIndicators;//引导指标得分
private int rewardIndicators;//奖励指标得分
private int totalScore;//合计得分
private String sorting; //排序使用 - desc 默认 --asc 升
public String getOptinName() {
return optinName;
}
public void setOptinName(String optinName) {
this.optinName = optinName;
}
public int getBasicIndicators() {
return basicIndicators;
}
public void setBasicIndicators(int basicIndicators) {
this.basicIndicators = basicIndicators;
}
public int getGuideIndicators() {
return guideIndicators;
}
public void setGuideIndicators(int guideIndicators) {
this.guideIndicators = guideIndicators;
}
public int getRewardIndicators() {
return rewardIndicators;
}
public void setRewardIndicators(int rewardIndicators) {
this.rewardIndicators = rewardIndicators;
}
public int getTotalScore() {
return totalScore;
}
public void setTotalScore(int totalScore) {
this.totalScore = totalScore;
}
public String getSorting() {
return sorting;
}
public void setSorting(String sorting) {
this.sorting = sorting;
}
@Override
public String toString() {
return "PerformanceSummary{" +
"optinName='" + optinName + '\'' +
", basicIndicators=" + basicIndicators +
", guideIndicators=" + guideIndicators +
", rewardIndicators=" + rewardIndicators +
", totalScore=" + totalScore +
", sorting='" + sorting + '\'' +
'}';
}
}
package com.tiptimes.service;
import com.tiptimes.model.Answer;
import com.tiptimes.model.PerformanceSummary;
import com.tiptimes.model.Record;
import com.tiptimes.model.Review;
......@@ -89,6 +90,9 @@ public interface QuestionnaireService {
//根据选项id查询文件对应id
List<String> selectFileId(Long optionId,Long recordId);
//统计众创空间的分数
List<PerformanceSummary> selectPerformanceSummaryList(PerformanceSummary performanceSummary);
}
......@@ -3,6 +3,7 @@ package com.tiptimes.service.impl;
import com.tiptimes.dao.QuestionnaireDao;
import com.tiptimes.model.Answer;
import com.tiptimes.model.PerformanceSummary;
import com.tiptimes.model.Record;
import com.tiptimes.model.Review;
import com.tiptimes.service.QuestionnaireService;
......@@ -136,4 +137,9 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
public List<String> selectFileId(Long optionId, Long recordId) {
return questionnaireDao.selectFileId(optionId,recordId);
}
@Override
public List<PerformanceSummary> selectPerformanceSummaryList(PerformanceSummary performanceSummary){
return questionnaireDao.selectPerformanceSummaryList(performanceSummary);
}
}
......@@ -118,4 +118,46 @@
<select id="selectFileId" resultType="java.lang.String">
select `value` from t_answer where options_id=#{optionId} and record_id =#{recordId}
</select>
<select id="selectPerformanceSummaryList" resultType="com.tiptimes.model.PerformanceSummary">
SELECT
ta.value as optinName,
CASE WHEN tr.process_status = 2 THEN '0'
WHEN tr.process_status = 3 THEN '10'
ELSE '0'
END as basicIndicators,
(
SELECT
COUNT(ta.score) as score
FROM
t_questions AS tq
LEFT JOIN t_options AS o ON o.question_id = tq.id AND o.id = '1'
LEFT JOIN t_answer AS ta ON ta.options_id = o.id AND ta.`group` in('2','5','6','8','9','12','13','14','15','16')
LEFT JOIN t_record AS tr on tr.id = ta.record_id
WHERE o.`status` = 1 and tq.`status` = 1
) as guideIndicators,
(
SELECT
COUNT(ta.score) as score
FROM
t_questions AS tq
LEFT JOIN t_options AS o ON o.question_id = tq.id AND o.id = '1'
LEFT JOIN t_answer AS ta ON ta.options_id = o.id AND ta.`group` = '1'
LEFT JOIN t_record AS tr on tr.id = ta.record_id and ta.`group` BETWEEN 17 and 21
WHERE o.`status` = 1 and tq.`status` = 1
) as rewardIndicators
FROM
t_questions AS tq
LEFT JOIN t_options AS o ON o.question_id = tq.id AND o.id = '1'
LEFT JOIN t_answer AS ta ON ta.options_id = o.id AND ta.`group` = '1'
LEFT JOIN t_record AS tr on tr.id = ta.record_id and ta.`group` BETWEEN 1 and 11
WHERE o.`status` = 1 and tq.`status` = 1
<if test=" optinName!= null and optinName !=''">
AND ta.value LIKE CONCAT('%', #{optinName}, '%')
</if>
ORDER BY ta.value ${sorting}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment