左侧统计

This commit is contained in:
why 2023-04-20 17:45:33 +08:00
parent 5df7af2170
commit f71c2f5bef
1 changed files with 23 additions and 10 deletions

View File

@ -121,19 +121,32 @@
</select>
<select id="getLeft3Data" resultType="com.kening.vordm.vo.GroupByUse">
select t.sponsor_organization as `name`, count(*) as cnt, 'sponsorOrganization' as `type`
from disaster_info t
where t.sponsor_organization != ''
GROUP BY t.sponsor_organization
ORDER BY cnt desc LIMIT 5
-- select t.sponsor_organization as `name`, count(*) as cnt, 'sponsorOrganization' as `type`
-- from disaster_info t
-- where t.sponsor_organization != ''
-- GROUP BY t.sponsor_organization
-- ORDER BY cnt desc LIMIT 5
SELECT
g.username AS `name`,
count(*) AS cnt,
'sponsorOrganization' AS `type`
FROM
disaster_info t
INNER JOIN guest_manage_disaster_ref gm ON gm.disaster_id = t.id
INNER JOIN guest_info g ON g.id = gm.sponsor_id
WHERE
gm.`status` != 2
GROUP BY
gm.sponsor_id
ORDER BY
cnt DESC
LIMIT 5
</select>
<select id="getLeft4Data" resultType="com.kening.vordm.vo.GroupByUse">
select gi.organization as `name`, count(*) as cnt, 'responseOrganization' as `type`
from guest_manage_disaster_ref t
INNER JOIN guest_info gi on gi.id = t.manager_id
where gi.organization != '' and t.`status` = '1'
GROUP BY gi.organization
select b.`name` as `name`, count(*) as cnt, 'responseOrganization' as `type`
from disaster_info t INNER JOIN blade_user b on t.chief_id = b.id
GROUP BY t.chief_id
ORDER BY cnt desc LIMIT 5
</select>