|
|
@ -5,21 +5,31 @@ |
|
|
|
|
|
|
|
<select id="selectVolunteerSummaryDaily" resultType="com.epmet.evaluationindex.screen.dto.result.AgeDistributionResultDTO"> |
|
|
|
SELECT |
|
|
|
age_level_1 AS "ageLevel1", |
|
|
|
age_level_2 AS "ageLevel2", |
|
|
|
age_level_3 AS "ageLevel3", |
|
|
|
age_level_4 AS "ageLevel4", |
|
|
|
age_level_5 AS "ageLevel5", |
|
|
|
age_level_6 AS "ageLevel6", |
|
|
|
male_count AS "maleCount", |
|
|
|
female_count AS "femaleCount" |
|
|
|
SUM(age_level_1) AS "ageLevel1", |
|
|
|
SUM(age_level_2) AS "ageLevel2", |
|
|
|
SUM(age_level_3) AS "ageLevel3", |
|
|
|
SUM(age_level_4) AS "ageLevel4", |
|
|
|
SUM(age_level_5) AS "ageLevel5", |
|
|
|
SUM(age_level_6) AS "ageLevel6", |
|
|
|
SUM(male_count) AS "maleCount", |
|
|
|
SUM(female_count) AS "femaleCount" |
|
|
|
FROM |
|
|
|
screen_kc_volunteer_summary_daily |
|
|
|
WHERE |
|
|
|
del_flag = '0' |
|
|
|
AND customer_id = #{customerId} |
|
|
|
ORDER BY |
|
|
|
date_id DESC, created_time DESC |
|
|
|
LIMIT 1 |
|
|
|
AND date_id = ( |
|
|
|
select |
|
|
|
date_id |
|
|
|
from |
|
|
|
screen_kc_volunteer_summary_daily |
|
|
|
where |
|
|
|
del_flag = '0' |
|
|
|
and customer_id = #{customerId} |
|
|
|
order by |
|
|
|
date_id desc, |
|
|
|
created_time desc |
|
|
|
limit 1 |
|
|
|
) |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|