Commit ffacb08d authored by 刘鑫鹏's avatar 刘鑫鹏

修改导出文件

parent 69da8f77
......@@ -562,6 +562,32 @@ public class QuestionnaireCtrl {
return map;
}
@RequestMapping({"/selectPerformanceList"})
@ResponseBody
public Map<String, Object> selectPerformanceList(@RequestBody PerformanceSummary performanceSummary){
Map<String, Object> map = new HashMap();
map.put("result", true);
map.put("msg", "");
Map<String, Object> data = new HashMap();
List<PerformanceSummary> performanceSummaryList = questionnaireService.selectPerformanceList(performanceSummary);
if (!performanceSummaryList.isEmpty()) {
for (PerformanceSummary summary : performanceSummaryList) {
float totalScore = summary.getBasicIndicators()+summary.getGuideIndicators()+summary.getRewardIndicators();
summary.setTotalScore(totalScore);
}
data.put("performanceSummaryList", performanceSummaryList);
}
map.put("data", data);
return map;
}
/**
* 2022年10月新增加功能问卷管理-审批页面根据基础指标、引导指标和奖励指标导出所有空间的数据
*
......
......@@ -91,6 +91,11 @@ public interface QuestionnaireDao {
List<PerformanceSummary> selectPerformanceSummaryListNew(PerformanceSummary performanceSummary);
List<PerformanceSummary> selectPerformanceList(PerformanceSummary performanceSummary);
List<FullTimeWorkPerson> selectFullTimeWorkPersonList(@Param("recordId") String recordId);
List<SiteCondition> selectSiteConditionList();
......@@ -133,6 +138,12 @@ public interface QuestionnaireDao {
List<PerformanceSummaryTotal> queryGuideAndRewardIndexListNew(@Param("qnYear") Integer qnYear);
List<PerformanceSummary> queryGuideAndRewardList(@Param("qnYear") Integer qnYear);
List<PerformanceSummary> queryGuideAndReward (@Param("qnYear") Integer qnYear,@Param("recordId") Integer recordId);
List<PerformanceSummary> queryRewardReward (@Param("qnYear") Integer qnYear,@Param("recordId") Integer recordId);
Integer updateAnswerScore(Answer answer);
List<Review> selectAnswerByStatus(@Param("recordId") Long recordId);
......@@ -188,6 +199,20 @@ public interface QuestionnaireDao {
@Param("id20") Integer id20
);
List<IncubatedEnterprises> selectIncubatedEnterprisesListFour(
@Param("qnYear") Integer qnYear,
@Param("createId") String createId,
@Param("id16") Integer id16,
@Param("id17") Integer id17,
@Param("id18") Integer id18,
@Param("id19") Integer id19,
@Param("id20") Integer id20
);
List<EmploymentSituation> selectEmploymentSituationListNew(
@Param("qnYear") Integer qnYear,
@Param("createId") String createId,
......@@ -235,6 +260,32 @@ public interface QuestionnaireDao {
);
List<SigningMentors> selectSigningMentorsListSeven(
@Param("qnYear") Integer qnYear,
@Param("createId") String createId,
@Param("id35") Integer id35,
@Param("id36") Integer id36,
@Param("id37") Integer id37,
@Param("id38") Integer id38,
@Param("id39") Integer id39,
@Param("id40") Integer id40,
@Param("id41") Integer id41,
@Param("id42") Integer id42,
@Param("id43") Integer id43,
@Param("id44") Integer id44,
@Param("id45") Integer id45,
@Param("id46") Integer id46,
@Param("id47") Integer id47,
@Param("id48") Integer id48,
@Param("id49") Integer id49,
@Param("id50") Integer id50,
@Param("id51") Integer id51
);
List<OrganizationActivity> selectOrganizationActivityListNew(
@Param("qnYear") Integer qnYear,
@Param("createId") String createId,
......
......@@ -28,6 +28,17 @@ public class PerformanceSummary {
private String sorting; //排序使用 - desc 默认 --asc 升
private Integer recordId;
public Integer getRecordId() {
return recordId;
}
public void setRecordId(Integer recordId) {
this.recordId = recordId;
}
public String getOptinName() {
return optinName;
}
......@@ -88,13 +99,14 @@ public class PerformanceSummary {
'}';
}
public PerformanceSummary(String optinName, float basicIndicators, float guideIndicators, float rewardIndicators, float totalScore, String sorting) {
public PerformanceSummary(String optinName, float basicIndicators, float guideIndicators, float rewardIndicators, float totalScore, String sorting,int recordId) {
this.optinName = optinName;
this.basicIndicators = basicIndicators;
this.guideIndicators = guideIndicators;
this.rewardIndicators = rewardIndicators;
this.totalScore = totalScore;
this.sorting = sorting;
this.recordId = recordId;
}
public PerformanceSummary() {
......
......@@ -116,6 +116,10 @@ public interface QuestionnaireService {
List<PerformanceSummary> selectPerformanceSummaryListNew(PerformanceSummary performanceSummary);
List<PerformanceSummary> selectPerformanceList(PerformanceSummary performanceSummary);
void exportFullTimeWorkPerson(HttpServletRequest request, HttpServletResponse response, String index, String recordId);
void exportPerformanceSummary(HttpServletRequest request, HttpServletResponse response);
......
......@@ -1866,7 +1866,7 @@
AND qn_year = #{qnYear}
</if>
</where>
GROUP BY t_answer.`group`, t_record.create_by
GROUP BY t_record.create_by
) as queation
WHERE queation.isWhetherSpace IS NOT NULL
ORDER BY spaceName;
......@@ -1880,6 +1880,191 @@
SELECT t_questionnaire.id FROM t_questionnaire
WHERE t_questionnaire.qn_year = #{qnYear}))
</select>
<select id="selectPerformanceList" resultType="com.tiptimes.model.PerformanceSummary">
SELECT tr.qn_year as qnYear,
tr.create_by as createBy,
tre.record_id as recordId,
CASE
WHEN tr.process_status = 2 THEN
0
WHEN tr.process_status = 3 THEN
30
ELSE 0
END AS basicIndicators,
CASE
WHEN SUM( CASE WHEN tre.approval_status = 2 THEN tre.score ELSE 0 END) > 50 THEN
50
ELSE SUM( CASE WHEN tre.approval_status = 2 THEN tre.score ELSE 0 END)
END AS guideIndicators,
CASE
WHEN SUM( CASE WHEN tre.approval_status = 3 THEN tre.score ELSE 0 END) > 10 THEN
10
ELSE SUM(CASE WHEN tre.approval_status = 3 THEN tre.score ELSE 0 END)
END AS rewardIndicators
FROM t_record tr
LEFT JOIN t_review tre ON tre.record_id = tr.id
WHERE tre.approval_status IN (1, 2, 3)
AND tr.process_status = '3'
<if test="qnYear == null or qnYear == ''"><!-- 年份 -->
AND tr.qn_year = YEAR(NOW())
</if>
<if test="qnYear != null and qnYear != ''"><!-- 年份 -->
AND tr.qn_year = #{qnYear}
</if>
<if test="createBy != null and createBy != ''">
and tr.create_by like concat('%', #{createBy},'%')
</if>
GROUP BY tr.qn_year,
tr.create_by
ORDER BY tr.id ASC
</select>
<select id="queryGuideAndRewardList" resultType="com.tiptimes.model.PerformanceSummary">
SELECT tr.qn_year as qnYear,
tr.create_by as createBy,
tre.record_id as recordId,
CASE
WHEN tr.process_status = 2 THEN
0
WHEN tr.process_status = 3 THEN
30
ELSE 0
END AS basicIndicators,
CASE
WHEN SUM(CASE WHEN tre.approval_status = 2 THEN tre.score ELSE 0 END) > 50 THEN
50
ELSE SUM( CASE WHEN tre.approval_status = 2 THEN tre.score ELSE 0 END)
END AS guideIndicators,
CASE
WHEN SUM(CASE WHEN tre.approval_status = 3 THEN tre.score ELSE 0 END) > 10 THEN
10
ELSE SUM(CASE WHEN tre.approval_status = 3 THEN tre.score ELSE 0 END)
END AS rewardIndicators
FROM t_record tr
LEFT JOIN t_review tre ON tre.record_id = tr.id
WHERE tre.approval_status IN (1, 2, 3)
AND tr.process_status = '3'
<if test="qnYear != null and qnYear != ''"><!-- 年份 -->
AND tr.qn_year = #{qnYear}
</if>
GROUP BY tr.qn_year,
tr.create_by
ORDER BY tr.id ASC
</select>
<select id="queryGuideAndReward" resultType="com.tiptimes.model.PerformanceSummary">
SELECT
tr.qn_year AS qnYear,
tr.create_by AS createBy,
tre.record_id AS record_id,
tre.score as guideIndicators
FROM
t_record tr
LEFT JOIN t_review tre ON tre.record_id = tr.id
WHERE
tre.approval_status = 2
AND tr.process_status = '3'
AND tr.qn_year = #{qnYear}
AND tre.record_id = #{recordId}
GROUP BY
tre.group_id
ORDER BY
tr.id ASC
</select>
<select id="queryRewardReward" resultType="com.tiptimes.model.PerformanceSummary">
SELECT
tr.qn_year AS qnYear,
tr.create_by AS createBy,
tre.record_id AS record_id,
tre.score as rewardIndicators
FROM
t_record tr
LEFT JOIN t_review tre ON tre.record_id = tr.id
WHERE
tre.approval_status = 3
AND tr.process_status = '3'
AND tr.qn_year = #{qnYear}
AND tre.record_id = #{recordId}
GROUP BY
tre.group_id
ORDER BY
tr.id ASC
</select>
<select id="selectSigningMentorsListSeven" resultType="com.tiptimes.model.exportDTO.SigningMentors">
SELECT *
FROM (
SELECT t_answer.`group`,
t_record.create_by as spaceName,
MAX(IF(options_id = #{id35}, `value`, NULL)) as mentorName,
MAX(IF(options_id = #{id36}, `value`, NULL)) as gender,
MAX(IF(options_id = #{id37}, `value`, NULL)) as record,
MAX(IF(options_id = #{id38}, `value`, NULL)) as phoneNumber,
MAX(IF(options_id = #{id39}, `value`, NULL)) as unit,
MAX(IF(options_id = #{id40}, `value`, NULL)) as position,
MAX(IF(options_id = #{id41}, `value`, NULL)) as theTitle,
MAX(IF(options_id = #{id42}, `value`, NULL)) as signingDate,
MAX(IF(options_id = #{id43}, `value`, NULL)) as contractTime,
MAX(IF(options_id = #{id44}, `value`, NULL)) as coachingCategory,
MAX(IF(options_id = #{id45}, `value`, NULL)) as coaching,
MAX(IF(options_id = #{id46}, `value`, NULL)) as participated,
MAX(IF(options_id = #{id47}, `value`, NULL)) as contestantYear,
MAX(IF(options_id = #{id48}, `value`, NULL)) as guideTrack,
MAX(IF(options_id = #{id49}, `value`, NULL)) as isMaterials,
MAX(IF(options_id = #{id50}, `value`, NULL)) as mentor,
MAX(IF(options_id = #{id51}, `value`, NULL)) as isSupporting
FROM t_answer
LEFT JOIN t_record
ON t_record.id = t_answer.record_id
<where>
t_record.process_status = 3 and t_answer.`group`=17
<if test="createId != null and createId != ''">
AND create_id = #{createId}
</if>
<if test="qnYear == null or qnYear == ''"><!-- 年份 -->
AND qn_year = YEAR(NOW())
</if>
<if test="qnYear != null and qnYear != ''"><!-- 年份 -->
AND qn_year = #{qnYear}
</if>
</where>
GROUP BY t_answer.`group`, t_record.create_by
) as queation
WHERE queation.mentorName IS NOT NULL
ORDER BY spaceName
</select>
<select id="selectIncubatedEnterprisesListFour"
resultType="com.tiptimes.model.exportDTO.IncubatedEnterprises">
SELECT *
FROM (
SELECT t_answer.`group`,
t_record.create_by as spaceName,
MAX(IF(options_id = #{id16}, `value`, NULL)) as enterpriseName,
MAX(IF(options_id = #{id17}, `value`, NULL)) as isSubmitScreenshot,
MAX(IF(options_id = #{id18}, `value`, NULL)) as isSubmitCertificate,
MAX(IF(options_id = #{id19}, `value`, NULL)) as isSubmitIncubation,
MAX(IF(options_id = #{id20}, `value`, NULL)) as isEntryYear
FROM t_answer
LEFT JOIN t_record ON t_record.id = t_answer.record_id
<where>
t_record.process_status = 3 and t_answer.`group`=14
<if test="createId != null and createId != ''">
AND create_id = #{createId}
</if>
<if test="qnYear == null or qnYear == ''"><!-- 年份 -->
AND qn_year = YEAR(NOW())
</if>
<if test="qnYear != null and qnYear != ''"><!-- 年份 -->
AND qn_year = #{qnYear}
</if>
</where>
GROUP BY t_answer.`group`, t_record.create_by
) as queation
WHERE queation.enterpriseName IS NOT NULL
ORDER BY spaceName
</select>
<!-- <select id="queryArray" resultType="java.lang.Integer">-->
<!-- SELECT t_options.id FROM t_options-->
......
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