bug 3334\3319\3332

This commit is contained in:
13036795865 2025-06-18 10:13:50 +08:00
parent 47cb86ad7c
commit f53c9b74f4
3 changed files with 27 additions and 13 deletions

View File

@ -186,6 +186,7 @@ public class BigScreenStatisticService {
return competitionResourceLibraryMapper.getCompetitionHot();
}
public List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd() {
Date[] currentYear = DateUtil.getLast12Months();

View File

@ -130,7 +130,7 @@
ci.status as competition_status,
cu.works_name as competition_submission_name,
cu.created_at as submission_time,
cu.leader as submitter,
IFNULL(cu.leader,us.nickname) as submitter,
submission_type,
cu.org_name as submitting_unit,
IFNULL(crl.submission_summary,cu.sub_item) as submission_summary,
@ -151,6 +151,7 @@
ci.is_expert_audit
from competition_infos ci
join (select * from competition_users where `status` = 3) cu on ci.id = cu.competition_info_id
inner join users us on cu.user_id=us.id
left join competition_resource_library crl on crl.competition_user_id = cu.id
<where>
<if test="openCompetitionId != null ">and open_competition_id = #{openCompetitionId}</if>
@ -253,9 +254,9 @@
</select>
<select id="getCompetitionTransferCount" resultType="java.lang.Long">
select COUNT(*)
from achievements
where source = '3'
select count(1) from competition_users cu
inner join competition_infos ci on cu.competition_info_id = ci.id
inner join attachments at on cu.id=at.container_id
</select>
<select id="getCompetitionNeedAuditCount" resultType="java.lang.Long">
@ -274,22 +275,34 @@
select t.title as name, achievementCount, enrollCount, paperCount, t.id as `id`,(achievementCount+enrollCount+paperCount) as total
from (select c.title,
c.id,
c.updated_at,
(select count(*) from achievements a where source='3' and a.source_id = c.id ) as achievementCount,
(select count(*) from competition_users cu where cu.competition_info_id = c.id) as enrollCount,
(select count(*) from (select * from competition_users) cu inner join attachments on container_type = 'CompetitionUser' and container_id=cu.id where cu.competition_info_id=c.id) as paperCount
from competition_infos c ) as t
order by total desc
order by total desc,updated_at desc
limit 0,10
</select>
<select id="getCompetitionYearlyPaperAdd"
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">
select DATE_FORMAT(created_at, '%Y-%m') as 'k', count(*) as 'v'
from competition_infos
where created_at &gt;= #{s}
and created_at &lt;= #{e}
group by DATE_FORMAT(created_at, '%Y-%m')
order by DATE_FORMAT(created_at, '%Y-%m')
select
DATE_FORMAT(cu.created_at, '%Y-%m') as 'k', count(*) as 'v',"baoming" as type from competition_users cu
inner join competition_infos ci on cu.competition_info_id = ci.id
left join attachments at on cu.id=at.container_id
where cu.created_at &gt;= #{s} and cu.created_at &lt;= #{e}
group by DATE_FORMAT(cu.created_at, '%Y-%m'),type
order by DATE_FORMAT(cu.created_at, '%Y-%m')
union all
select
DATE_FORMAT(at.created_on, '%Y-%m')as 'k', count(*) as 'v',"report" as type from competition_users cu
inner join competition_infos ci on cu.competition_info_id = ci.id
inner join attachments at on cu.id=at.container_id
where at.created_on &gt;= #{s} and at.created_on &lt;= #{e}
group by DATE_FORMAT(at.created_on, '%Y-%m'),type
order by DATE_FORMAT(at.created_on, '%Y-%m')
</select>
<select id="getCompetitionYearlyFinish"
resultType="com.microservices.dms.resourceLibrary.domain.vo.KeyValVo">

View File

@ -428,14 +428,14 @@
tmp.taskAuditCount as "taskAuditSum",
tmp.competitionAuditCount as "competitionAuditSum",
(tmp.taskAuditCount + tmp.competitionAuditCount) as "total"
from (select e.expert_name,
from (select e.expert_name,e.created_on,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 1 and `status` in (1,2)) as taskAuditCount,
(select COUNT(distinct container_id) from task_expert where expert_id = e.id and container_type = 2 and `status` in (1,2)) as competitionAuditCount
from experts e
left join users u on e.user_id = u.id
where e.is_delete = '0'
and e.status = 1) tmp
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc
order by (tmp.taskAuditCount + tmp.competitionAuditCount) desc,tmp.created_on desc
limit 0,12
</select>