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
Hide 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 {
...
@@ -374,24 +374,26 @@ public class QuestionnaireCtrl {
map
.
put
(
"msg"
,
""
);
map
.
put
(
"msg"
,
""
);
Map
<
String
,
Object
>
data
=
new
HashMap
();
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
;
int
totalScore
=
0
;
//查询空间的不同指标的分数
//查询空间的不同指标的分数
List
<
PerformanceSummary
>
performanceSummaryList
=
questionnaireService
.
selectPerformanceSummaryList
(
performanceSummary
);
List
<
PerformanceSummary
>
performanceSummaryList
=
questionnaireService
.
selectPerformanceSummaryList
(
performanceSummary
);
if
(
performanceSummaryList
.
size
()
>
0
){
if
(
performanceSummaryList
.
size
()
>
0
){
for
(
PerformanceSummary
total
:
performanceSummaryList
){
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
();
totalScore
=
total
.
getBasicIndicators
()
+
total
.
getGuideIndicators
()
+
total
.
getRewardIndicators
();
total
.
setTotalScore
(
totalScore
);
}
}
data
.
put
(
"performanceSummaryList"
,
performanceSummaryList
);
data
.
put
(
"performanceSummaryList"
,
performanceSummaryList
);
data
.
put
(
"totalScore"
,
totalScore
);
}
}
map
.
put
(
"data"
,
data
);
map
.
put
(
"data"
,
data
);
...
...
src/main/resources/mapper/Questionnaire.xml
View file @
3aeff8e0
...
@@ -123,41 +123,36 @@
...
@@ -123,41 +123,36 @@
<select
id=
"selectPerformanceSummaryList"
resultType=
"com.tiptimes.model.PerformanceSummary"
>
<select
id=
"selectPerformanceSummaryList"
resultType=
"com.tiptimes.model.PerformanceSummary"
>
SELECT
SELECT
ta.value as optinName,
ta.value as optinName,
CASE WHEN tr.process_status = 2 THEN '0'
CASE WHEN tr.process_status = 2 THEN '0' WHEN tr.process_status = 3 THEN '30' ELSE '0' END as basicIndicators,
WHEN tr.process_status = 3 THEN '30'
ELSE '0'
END as basicIndicators,
(
(
SELECT
SELECT
COUNT(ta.score) as score
CASE WHEN COUNT(ta.score) > 50 THEN 50 WHEN COUNT(ta.score) THEN COUNT(ta.score) ELSE '0' END as score
FROM
FROM t_questions AS tq
t_questions AS tq
LEFT JOIN t_answer AS ta ON ta.`group` = tq.id
LEFT JOIN t_options AS o ON o.question_id = tq.id AND o.id = '1'
LEFT JOIN t_record AS tr ON tr.id = ta.record_id
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')
WHERE tq.`status` = 1 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,
) as guideIndicators,
(
(
SELECT
SELECT
COUNT(ta.score) as score
CASE WHEN COUNT(ta.score) > 10 THEN 10 WHEN COUNT(ta.score) THEN COUNT(ta.score) ELSE '0' END as score
FROM
FROM t_questions AS tq
t_questions AS tq
LEFT JOIN t_answer AS ta ON ta.`group` = tq.id
LEFT JOIN t_options AS o ON o.question_id = tq.id AND o.id = '1'
LEFT JOIN t_record AS tr ON tr.id = ta.record_id and ta.`group` BETWEEN 17 and 21
LEFT JOIN t_answer AS ta ON ta.options_id = o.id AND ta.`group` = '1'
WHERE tq.`status` = 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
) 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_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_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
WHERE o.`status` = 1 and tq.`status` = 1
<if
test=
" optinName!= null and optinName !=''"
>
<if
test=
" optinName!= null and optinName !=''"
>
AND ta.value LIKE CONCAT('%', #{optinName}, '%')
AND ta.value LIKE CONCAT('%', #{optinName}, '%')
</if>
</if>
ORDER BY ta.value ${sorting}
ORDER BY
<if
test=
"sorting != null and sorting != ''"
>
${sorting}
</if>
</select>
</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