select to_char(r.PROD_DATE, 'yyyy-mm') ,sum(r.ACCEPT_TWO_VOL) -- 月合计 , avg(r.ACCEPT_TWO_VOL) --日平均 ,count(r.ACCEPT_TWO_VOL) --当月天数 from HOUR_TWO bc left join P_LINE_S_SHIFT r on r.work_shifts = bc.xb_name and r.org_id = '${org_id}' where to_char(r.PROD_DATE, 'yyyy-mm') ='${format(reportYearMonth, 'yyyy-MM') }' group by to_char(r.PROD_DATE, 'yyyy-mm') order by bc.db_sort_code, bc.sort_code,r.prod_date |