feat【资源库】创客成果数统计SQL错误、【资源库】参与评审竞赛数统计错误

This commit is contained in:
刘华中 2025-05-16 16:26:10 +08:00
parent fad993e486
commit ee97b24e51
2 changed files with 8 additions and 6 deletions

View File

@ -388,7 +388,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="indexCompetitionStatistic" resultType="java.util.Map">
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(distinct open_competition_id) from competition_resource_library) as CompetitionCount
from achievements

View File

@ -522,11 +522,12 @@
</select>
<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
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
where is_transferred_to_results_library = 1
where is_transferred_to_results_library = 1) tmp
</select>
<select id="getConvertedTasksCount" resultType="java.lang.Long">