Stringsql2="select sod.*, agp.sURL from tSalesOrderDtl sod left join V_GetminAgentGoodsPic agp on agp.nAgentID = sod.nAgentID and agp.nGoodsID = sod.nGoodsID and agp.sPicTypeID = 1 where sod.sSalesOrderID in ("+StringUtil.join("', '","'","'",orderIds)+")";
Stringsql4="select sosd.*, agp.sURL from tSalesOrderSubDtl sosd left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1 where sosd.sSubOrderID in ("+StringUtil.join("', '","'","'",subIds)+")";
+" agp.sURL from tSalesOrderSubDtl sosd left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1"
+" where sosd.sSubOrderID in ("+StringUtil.join("', '","'","'",subIds)+")";
Stringsql2="select sosd.*, agp.sURL, pm.sPromoTheme, pm.sPromoActionType sPromoType, pm.sPromoActionTypeID sPromoTypeID from tSalesOrderSubDtl sosd left join tYWPromoMain pm on pm.sPromoPaperNO = sosd.sPromoPaperNO left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1 where sosd.sSubOrderID in ("+StringUtil.join("', '","'","'",subIds)+")";
+" from tSalesOrderSubDtl sosd left join tYWPromoMain pm on pm.sPromoPaperNO = sosd.sPromoPaperNO left join V_GetminAgentGoodsPic agp on agp.nAgentID = sosd.nAgentID and agp.nGoodsID = sosd.nGoodsID and agp.sPicTypeID = 1"
+" where sosd.sSubOrderID in ("+StringUtil.join("', '","'","'",subIds)+")";