strWHerePlate+=" AND (GP.PROD_DATE > TO_CHAR(SYSdate + '"+intPLATE_DAYS_DIFF.ToString()+"' ,'yyyyMMdd') or GP.STLGRD in ( SELECT STLGRD FROM NISCO.QP_NISCO_CHMC WHERE STLGRD_FL='N' AND STLGRD IN('A20050NIQQT', 'A20051NIQQT', 'A20090NIQQT', 'A20092NIQQT', 'A20093NIQQT')))";
//测试test指定
//strWHerePlate += " AND GP.PLATE_NO in ('24105918350201')";
//strWHerePlate += " AND GP.PLATE_NO in ('24105657140201')";
strWHerePlate+=" AND (GP.PROD_DATE > TO_CHAR(SYSdate + '"+intPLATE_DAYS_DIFF.ToString()+"' ,'yyyyMMdd') or GP.STLGRD in ( SELECT STLGRD FROM NISCO.QP_NISCO_CHMC WHERE STLGRD_FL='N' AND STLGRD IN('A20050NIQQT', 'A20051NIQQT', 'A20090NIQQT', 'A20092NIQQT', 'A20093NIQQT')))";
}
//余材自动替代周期
if(intORD_DAYS_DIFF!=0)
{//测试test指定
//strWHereOrd += " AND boi.ORD_NO='OMB22110001' AND boi.ORD_ITEM='020'";
//strWHereOrd += " AND boi.ORD_NO='OMB22110001' AND boi.ORD_ITEM='023'";
strWHereOrd+=" AND (boi.CUST_DEL_TO_DATE > TO_CHAR(SYSdate + '"+intORD_DAYS_DIFF.ToString()+"' ,'yyyyMMdd') or boi.STLGRD in ( SELECT STLGRD FROM NISCO.QP_NISCO_CHMC WHERE STLGRD_FL='N' AND STLGRD IN('A20050NIQQT','A20051NIQQT','A20090NIQQT','A20092NIQQT','A20093NIQQT'))) ";