feat【资源库】创客成果数统计SQL错误、【资源库】参与评审竞赛数统计错误
This commit is contained in:
parent
fad993e486
commit
ee97b24e51
|
@ -388,7 +388,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
<select id="indexCompetitionStatistic" resultType="java.util.Map">
|
<select id="indexCompetitionStatistic" resultType="java.util.Map">
|
||||||
select COUNT(*) as CompetitionCountAchievementCount,
|
select COUNT(*) as CompetitionCountAchievementCount,
|
||||||
IFNULL(SUM(is_expert_audit), 0) as expertAuditCount,
|
(select COUNT(distinct crl.open_competition_id) from achievements a join competition_resource_library crl
|
||||||
|
on a.source_id = crl.id where source = '3' and a.is_expert_audit = 1) as expertAuditCount,
|
||||||
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='3') as clickCount,
|
(select count(1) from clickers c inner join achievements a ON a.id = c.click_id where click_type = 'Achievements' and a.source='3') as clickCount,
|
||||||
(select COUNT(distinct open_competition_id) from competition_resource_library) as CompetitionCount
|
(select COUNT(distinct open_competition_id) from competition_resource_library) as CompetitionCount
|
||||||
from achievements
|
from achievements
|
||||||
|
|
|
@ -522,11 +522,12 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getConvertedTaskAmount" resultType="java.lang.Double">
|
<select id="getConvertedTaskAmount" resultType="java.lang.Double">
|
||||||
select IFNULL(sum(t.bounty), 0)
|
select IFNULL(SUM(bounty), 0)
|
||||||
|
from (select distinct t.id, t.bounty
|
||||||
from tasks t
|
from tasks t
|
||||||
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
|
join (select distinct task_id from papers where status = 2) p on t.id = p.task_id
|
||||||
join task_resource_library on t.id = task_resource_library.task_id
|
join task_resource_library on t.id = task_resource_library.task_id
|
||||||
where is_transferred_to_results_library = 1
|
where is_transferred_to_results_library = 1) tmp
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getConvertedTasksCount" resultType="java.lang.Long">
|
<select id="getConvertedTasksCount" resultType="java.lang.Long">
|
||||||
|
|
Loading…
Reference in New Issue