|
|
@ -6,28 +6,31 @@ |
|
|
|
|
|
|
|
<select id="selectCategoryAnalysis" resultType="com.epmet.dto.result.screen.CategoryAnalysisResultDTO"> |
|
|
|
SELECT D.CATEGORY_NAME AS categoryName, |
|
|
|
M.PROJECT_TOTAL AS projectTotal |
|
|
|
M.PROJECT_TOTAL AS projectTotal, |
|
|
|
m.DATE_ID as dateId, |
|
|
|
m.CATEGORY_CODE as categoryCode |
|
|
|
FROM screen_project_category_org_daily m |
|
|
|
left join customer_project_category_dict d |
|
|
|
on(m.CATEGORY_CODE=D.CATEGORY_CODE |
|
|
|
AND D.DEL_FLAG='0' |
|
|
|
and d.CUSTOMER_ID=#{customerId}) |
|
|
|
WHERE M.DEL_FLAG = '0' |
|
|
|
AND M.ORG_ID = #{agencyId} |
|
|
|
AND M.DATE_ID = ( |
|
|
|
select |
|
|
|
date_id |
|
|
|
from |
|
|
|
screen_project_category_org_daily |
|
|
|
where |
|
|
|
del_flag = '0' |
|
|
|
and ORG_ID = #{agencyId} |
|
|
|
and CUSTOMER_ID=#{customerId} |
|
|
|
order by |
|
|
|
date_id desc, |
|
|
|
created_time desc |
|
|
|
limit 1 |
|
|
|
) |
|
|
|
AND M.ORG_ID = #{agencyId} |
|
|
|
and M.CUSTOMER_ID=#{customerId} |
|
|
|
AND M.DATE_ID = ( |
|
|
|
select |
|
|
|
date_id |
|
|
|
from |
|
|
|
screen_project_category_org_daily |
|
|
|
where |
|
|
|
del_flag = '0' |
|
|
|
and ORG_ID = #{agencyId} |
|
|
|
and CUSTOMER_ID=#{customerId} |
|
|
|
order by |
|
|
|
date_id desc, |
|
|
|
created_time desc |
|
|
|
limit 1 |
|
|
|
) |
|
|
|
ORDER BY M.PROJECT_TOTAL desc,D.CATEGORY_NAME asc |
|
|
|
limit 20 |
|
|
|
</select> |
|
|
|