理解偏了 改一下:
${if(reportDate=today(),"SELECT
P.ORG_ID,
P.ORG_NAME,
p.LIQ_PROD_DAILY ,
p.STATION_NAME,
P.PROD_DATE
FROM
PC_cZ_P34D_PL434N_DqqILY p
WHERE
p.org_id = '"+org_id+"'
and p.prod_date = to_date('"+reportDate+"', 'yyyy-MM-dd')
ORDER BY p.org_id ,P.PROD_DATE DESC",if(reportDate<today(),"SELECT
P.ORG_ID,
P.ORG_NAME,
p.LIQ_PROD_DAILY ,
p.STATION_NAME,
P.PROD_DATE
FROM
PC_cZ_P34D_PL434N_DqqILY p
WHERE
p.org_id = '"+org_id+"'
and p.prod_date <= to_date('"+today()+"', 'yyyy-MM-dd')
ORDER BY p.org_id ,P.PROD_DATE DESC","SELECT
P.ORG_ID,
P.ORG_NAME,
p.LIQ_PROD_DAILY ,
p.STATION_NAME,
P.PROD_DATE
FROM
PC_cZ_P34D_PL434N_DqqILY p
WHERE
p.org_id = '"+org_id+"'
and p.prod_date = to_date('"+reportDate+"', 'yyyy-MM-dd')
ORDER BY p.org_id ,P.PROD_DATE DESC"))}
---------------
太复杂了简化一下
SELECT
P.ORG_ID,
P.ORG_NAME,
p.LIQ_PROD_DAILY ,
p.STATION_NAME,
P.PROD_DATE
FROM
PC_cZ_P34D_PL434N_DqqILY p
WHERE
p.org_id = '${org_id}'
and ${if(reportDate<today(),"p.prod_date <= to_date('"+today()+"', 'yyyy-MM-dd')","p.prod_date = to_date('"+today()+"', 'yyyy-MM-dd')")}
ORDER BY p.org_id ,P.PROD_DATE DESC