Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王琮
platform
Commits
3aeff8e0
Commit
3aeff8e0
authored
Nov 01, 2022
by
王国存
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问卷管理-绩效汇总列表优化
parent
c870d6be
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
33 deletions
+30
-33
QuestionnaireCtrl.java
src/main/java/com/tiptimes/ctrl/QuestionnaireCtrl.java
+10
-8
Questionnaire.xml
src/main/resources/mapper/Questionnaire.xml
+20
-25
No files found.
src/main/java/com/tiptimes/ctrl/QuestionnaireCtrl.java
View file @
3aeff8e0
...
...
@@ -374,24 +374,26 @@ public class QuestionnaireCtrl {
map
.
put
(
"msg"
,
""
);
Map
<
String
,
Object
>
data
=
new
HashMap
();
//列表排序
String
sorting
=
""
;
if
(
performanceSummary
.
getSorting
().
equals
(
"desc"
)){
sorting
=
"tr.create_time desc"
;
}
else
{
sorting
=
"basicIndicators,guideIndicators,rewardIndicators desc"
;
}
performanceSummary
.
setSorting
(
sorting
);
int
totalScore
=
0
;
//查询空间的不同指标的分数
List
<
PerformanceSummary
>
performanceSummaryList
=
questionnaireService
.
selectPerformanceSummaryList
(
performanceSummary
);
if
(
performanceSummaryList
.
size
()
>
0
){
for
(
PerformanceSummary
total
:
performanceSummaryList
){
//基础指标最高30分,引导指标最高50分,奖励指标最高10分
if
(
total
.
getGuideIndicators
()
>
50
){
total
.
setGuideIndicators
(
50
);
}
if
(
total
.
getRewardIndicators
()
>
30
){
total
.
setRewardIndicators
(
30
);
}
//计算各个空间指标的总分
totalScore
=
total
.
getBasicIndicators
()
+
total
.
getGuideIndicators
()
+
total
.
getRewardIndicators
();
total
.
setTotalScore
(
totalScore
);
}
data
.
put
(
"performanceSummaryList"
,
performanceSummaryList
);
data
.
put
(
"totalScore"
,
totalScore
);
}
map
.
put
(
"data"
,
data
);
...
...
src/main/resources/mapper/Questionnaire.xml
View file @
3aeff8e0
...
...
@@ -123,41 +123,36 @@
<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 '30'
ELSE '0'
END as basicIndicators,
CASE WHEN tr.process_status = 2 THEN '0' WHEN tr.process_status = 3 THEN '30' 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
CASE WHEN COUNT(ta.score) > 50 THEN 50 WHEN COUNT(ta.score) THEN COUNT(ta.score) ELSE '0' END as score
FROM t_questions AS tq
LEFT JOIN t_answer AS ta ON ta.`group` = tq.id
LEFT JOIN t_record AS tr ON tr.id = ta.record_id
WHERE tq.`status` = 1 AND ta.`group` in('2','5','6','8','9','12','13','14','15','16')
) 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
CASE WHEN COUNT(ta.score) > 10 THEN 10 WHEN COUNT(ta.score) THEN COUNT(ta.score) ELSE '0' END as score
FROM t_questions AS tq
LEFT JOIN t_answer AS ta ON ta.`group` = tq.id
LEFT JOIN t_record AS tr ON tr.id = ta.record_id and ta.`group` BETWEEN 17 and 21
WHERE tq.`status` = 1
) as rewardIndicators
FROM
t_questions AS tq
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
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}
ORDER BY
<if
test=
"sorting != null and sorting != ''"
>
${sorting}
</if>
</select>
<!--绩效汇总导出-->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment