select iyear,
to_char(imonth) as imonth,
group_code,
group_name,
plate_code,
plate_name,
unit_code,
substr ('00000' || unit_code,-5) AS unit_code1,
unit_name,
invent_amount/10000 as invent_amount,
backlog_amount/10000 as backlog_amount,
ar_amount/10000 as ar_amount,
update_time,
c_year_month,
d_year_month,
iquarter
from tf_sum_invent_trend
WHERE 1=1
<年度> AND IYEAR IN (?{年度}) </年度>
UNION
select iyear,
'年初' imonth,
group_code,
group_name,
plate_code,
plate_name,
unit_code,
substr ('00000' || unit_code,-5) AS unit_code1,
unit_name,
invent_amount/10000 as invent_amount,
backlog_amount/10000 as backlog_amount,
ar_amount/10000 as ar_amount,
update_time,
c_year_month,
d_year_month,
iquarter
from tf_sum_invent_trend
WHERE IMONTH = 12
<年度> AND IYEAR = (?{年度})-1 </年度>
请问,现在数据库里有2021年1-12月和2022年1-12月的数据,展示某一年的数据时,想要同时展示年初数据(年初数据为上一年12月的数据),我在创建数据集时用到了参数,为什么最后制作出来的报告,年初数据不是上一年度12月的数据er'sh
|