args.add("((sAgentContractNO is null or sAgentContractNO = '') and nGoodsID is null)");
args.add("((t.sAgentContractNO is null or t.sAgentContractNO = '') and t.nGoodsID is null)");
for(Stringuid:uidAry){
if(StringUtil.isBlank(uid)){
continue;
}
String[]kv=uid.split(":",2);
args.add("(sAgentContractNO = '"+kv[0]+"' and nGoodsID = "+kv[1]+")");
args.add("(t.sAgentContractNO = '"+kv[0]+"' and t.nGoodsID = "+kv[1]+")");
}
Stringsql="select sAgentContractNO, nGoodsID, nStockQty, nRealSalePrice from V_OrgGoods where sOrgNO = '"+orgNo+"' "+StringUtil.join(" OR "," and (",")"," and (1 = 0) ",args);
Stringsql="select t.sAgentContractNO, t.nGoodsID, t.nStockQty, t.nRealSalePrice from V_OrgGoods t where t.sOrgNO = '"+orgNo+"' "+StringUtil.join(" OR "," and (",")"," and (1 = 0) ",args);
Stringsql1="select prg.sPromoPaperNO, sPromoActionTypeID, sPromoGroupNO from tPromoRuleGoods prg, tPromo p where prg.sPromoPaperNO = p.sPromoPaperNO and p.sOrgNO = '"+orgNo+"' "+StringUtil.join(" OR "," and (",")"," and (1 = 0) ",args)+" group by prg.sPromoPaperNO, sPromoActionTypeID, sPromoGroupNO";
Stringsql1="select t.sPromoPaperNO, t.sPromoActionTypeID, t.sPromoGroupNO from tPromoRuleGoods t, tPromo p where t.sPromoPaperNO = p.sPromoPaperNO and p.sOrgNO = '"+orgNo+"' "+StringUtil.join(" OR "," and (",")"," and (1 = 0) ",args)+" group by t.sPromoPaperNO, t.sPromoActionTypeID, t.sPromoGroupNO";