|
|
@ -322,62 +322,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<select id="selectTargetDraftDaynewRangeList" parameterType="com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo" resultType="java.util.HashMap"> |
|
|
|
select GROUP_CONCAT(organize_name) as cname,GROUP_CONCAT(value_result) as cut, cdate from ( |
|
|
|
<select id="selectTargetDraftDaynewRangeList" parameterType="com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo" resultType="com.lzbi.draft.domain.vo.TargetDraftDayRangeResVo"> |
|
|
|
select |
|
|
|
d.organize_name as cname, |
|
|
|
d.value_result as value_result, |
|
|
|
CONCAT(d.date_year, '-', d.date_month, '-' , d.date_day) as cdate |
|
|
|
from |
|
|
|
dc_busi_target_draft_daynew d, |
|
|
|
dc_busi_report_target_config c, |
|
|
|
dc_base_target_model m, |
|
|
|
( |
|
|
|
select |
|
|
|
d.organize_name , |
|
|
|
c.report_name , |
|
|
|
d.value_result , |
|
|
|
m.target_unit,CONCAT(d.date_year, '-', d.date_month, '-' , d.date_day) as cdate |
|
|
|
max(CONCAT( date_year , date_month , date_day)) max_date, |
|
|
|
target_model_code, |
|
|
|
organize_id |
|
|
|
from |
|
|
|
dc_busi_target_draft_daynew d, |
|
|
|
dc_busi_report_target_config c, |
|
|
|
dc_base_target_model m, |
|
|
|
( |
|
|
|
select |
|
|
|
max(CONCAT( date_year , date_month , date_day)) max_date, |
|
|
|
target_model_code, |
|
|
|
organize_id |
|
|
|
from |
|
|
|
dc_busi_target_draft_daynew |
|
|
|
where |
|
|
|
organize_id in |
|
|
|
<foreach item="orgId" collection="orgIds" open="(" separator="," close=")"> |
|
|
|
#{orgId} |
|
|
|
</foreach> |
|
|
|
and CONCAT(date_year , date_month , date_day) >= #{beginDate} |
|
|
|
and CONCAT(date_year , date_month , date_day) <= #{endDate} |
|
|
|
group by |
|
|
|
target_model_code, |
|
|
|
organize_id,date_year , date_month , date_day |
|
|
|
) md, |
|
|
|
( |
|
|
|
select |
|
|
|
max(asset_code) asset_code |
|
|
|
from |
|
|
|
dc_base_asset_info |
|
|
|
where |
|
|
|
org_id in |
|
|
|
<foreach item="orgId" collection="orgIds" open="(" separator="," close=")"> |
|
|
|
#{orgId} |
|
|
|
</foreach> |
|
|
|
and asset_level = #{assetLevel} |
|
|
|
and asset_type = #{assetType} |
|
|
|
group by org_id |
|
|
|
) a |
|
|
|
dc_busi_target_draft_daynew |
|
|
|
where |
|
|
|
organize_id in |
|
|
|
<foreach item="orgId" collection="orgIds" open="(" separator="," close=")"> |
|
|
|
#{orgId} |
|
|
|
</foreach> |
|
|
|
and CONCAT(date_year , date_month , date_day) >= #{beginDate} |
|
|
|
and CONCAT(date_year , date_month , date_day) <= #{endDate} |
|
|
|
group by |
|
|
|
target_model_code, |
|
|
|
organize_id,date_year , date_month , date_day |
|
|
|
) md, |
|
|
|
( |
|
|
|
select |
|
|
|
max(asset_code) asset_code |
|
|
|
from |
|
|
|
dc_base_asset_info |
|
|
|
where |
|
|
|
d.asset_code = a.asset_code |
|
|
|
and CONCAT(d.date_year , d.date_month , d.date_day) = md.max_date |
|
|
|
and d.target_model_code = md.target_model_code |
|
|
|
and d.organize_id = md.organize_id |
|
|
|
and d.target_model_code = c.target_model_code |
|
|
|
and d.target_model_code = m.target_model_code |
|
|
|
and c.report_name in |
|
|
|
<foreach item="reportName" collection="reportNames" open="(" separator="," close=")"> |
|
|
|
#{reportName} |
|
|
|
org_id in |
|
|
|
<foreach item="orgId" collection="orgIds" open="(" separator="," close=")"> |
|
|
|
#{orgId} |
|
|
|
</foreach> |
|
|
|
order by md.max_date |
|
|
|
)t group by cdate |
|
|
|
and asset_level = #{assetLevel} |
|
|
|
and asset_type = #{assetType} |
|
|
|
group by org_id |
|
|
|
) a |
|
|
|
where |
|
|
|
d.asset_code = a.asset_code |
|
|
|
and CONCAT(d.date_year , d.date_month , d.date_day) = md.max_date |
|
|
|
and d.target_model_code = md.target_model_code |
|
|
|
and d.organize_id = md.organize_id |
|
|
|
and d.target_model_code = c.target_model_code |
|
|
|
and d.target_model_code = m.target_model_code |
|
|
|
and c.report_name in |
|
|
|
<foreach item="reportName" collection="reportNames" open="(" separator="," close=")"> |
|
|
|
#{reportName} |
|
|
|
</foreach> |
|
|
|
order by md.max_date |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectTargetDraftDaynewAggregateList" parameterType="com.lzbi.draft.domain.vo.TargetDraftDaynewReqVo" resultType="com.lzbi.draft.domain.vo.TargetDraftDaynewAggregateResVo"> |
|
|
|