SELECT he.name as 姓名 FROM OMS_OE_ORDER_TYPES_REPORT T ,oms_oe_order_types tt, hr_employee he, sys_user su, OMS_LO_REMAIN olr, OMS_LO_RESPONSIBLE res where tt.order_type_id=t.order_type_id and t.order_type_id =olr.order_type_id --and tt.UNIT_ID=T.UNIT_ID --and tt.CREATED_BY=res.CREATED_BY --and su.CREATED_BY=res.CREATED_BY and res.CREATED_BY=olr.CREATED_BY and olr.created_by=su.employee_id and he.EMPLOYEE_ID=su.EMPLOYEE_ID --and tt.LAST_UPDATED_BY=su.LAST_UPDATED_BY --and su.LAST_UPDATED_BY=res.LAST_UPDATED_BY --and res.LAST_UPDATED_BY=olr.LAST_UPDATED_BY --and su.LAST_UPDATE_LOGIN=olr.LAST_UPDATE_LOGIN and T.PA_UNIT_CODE=${tp} AND tt.left_flag='Y' and olr.status<>9 ${if(len(BookDates)=0,"","and res.START_DATE>=to_date('"+BookDates+"','yyyy-mm-dd') and res.high_version='Y'")} ${if(len(BookDates)=0,"","and res.START_DATE<=to_date('"+BookDatee+"','yyyy-mm-dd')and res.high_version='Y'")} ${if(len(BookDates_c)=0,"","and res.PZ_DATE>=to_date('"+BookDates_c+"','yyyy-mm-dd')")} ${if(len(BookDates_c)=0,"","and res.PZ_DATE<=to_date('"+BookDatee_c+"','yyyy-mm-dd')")} group by he.name -------------------------------------------------------------------------------------------- SELECT count(olr.remain_no) as 差错 FROM OMS_OE_ORDER_TYPES_REPORT T ,oms_oe_order_types tt, hr_employee he, sys_user su, OMS_LO_REMAIN olr, OMS_LO_RESPONSIBLE res where tt.order_type_id=t.order_type_id and t.order_type_id =olr.order_type_id and res.CREATED_BY=olr.CREATED_BY and olr.created_by=su.employee_id and he.EMPLOYEE_ID=su.EMPLOYEE_ID and T.PA_UNIT_CODE=${tp} AND tt.left_flag='Y' and olr.TYPES='遗留单' and olr.REMAIN_KIND=1 and olr.remain_no is not null and olr.status<>9 ${if(len(BookDates)=0,"","and res.START_DATE>=to_date('"+BookDates+"','yyyy-mm-dd') and res.high_version='Y'")} ${if(len(BookDates)=0,"","and res.START_DATE<=to_date('"+BookDatee+"','yyyy-mm-dd')and res.high_version='Y'")} ${if(len(BookDates_c)=0,"","and res.PZ_DATE>=to_date('"+BookDates_c+"','yyyy-mm-dd')")} ${if(len(BookDates_c)=0,"","and res.PZ_DATE<=to_date('"+BookDatee_c+"','yyyy-mm-dd')")} |