Commit 445f36ef authored by 张永's avatar 张永

11

parent e2a74137
......@@ -447,7 +447,27 @@ public class GoodsServiceImpl implements GoodsService {
List<Map<String, Object>> datas = readJdbcTemplate.queryForList(sql);
Map<String, Map<String, Object>> mm = Util.listToMM(datas, ":", "sAgentContractNO", "nGoodsID");
String sql1 = "select t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO sPromoGroupNO from tYWPromoDtl t, tYWPromoMain p,tAgentContract a where t.sAgentContractNO = a.sAgentContractNO and a.nTag&3 = 2 and a.nAgentID = "+agentID+" and p.sPromoActionTypeID != '3' and t.sPromoPaperNO = p.sPromoPaperNO and p.nTag&3 = 2 and p.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args) + " group by t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO";
//String sql1 = "select t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO sPromoGroupNO from tYWPromoDtl t, tYWPromoMain p,tAgentContract a where t.sAgentContractNO = a.sAgentContractNO and a.nTag&3 = 2 and a.nAgentID = "+agentID+" and p.sPromoActionTypeID != '3' and t.sPromoPaperNO = p.sPromoPaperNO and p.nTag&3 = 2 and p.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args) + " group by t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO";
String sql1 = "select t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO sPromoGroupNO " +
" from tYWPromoDtl t, tYWPromoMain p, tPromoCustBWList bw, tAgentContract a " +
" where t.sPromoPaperNO = p.sPromoPaperNO " +
" and p.sPromoPaperNO = bw.sPromoPaperNO " +
" and t.sAgentContractNO = a.sAgentContractNO " +
" and p.sPromoPaperNORuleID = t.sPromoPaperNO + isnull(convert(varchar, t.nRuleID),'') " +
" and p.nTag&3 = 2 " +
" and t.nTag&1 = 0 " +
" and a.nTag&3 = 2 " +
" and p.sPromoActionTypeID != '3' " +
" and convert(varchar(10),getdate(),120) between convert(varchar(10),p.dPromoBeginDate,120) and convert(varchar(10),p.dPromoEndDate,120) " +
" and ((p.sPromoActionTypeID = '8' " +
" and convert(varchar(8),getdate(),108) between convert(varchar(8),p.dPromoBeginDate,108) and convert(varchar(8),p.dPromoEndDate,108)) " +
" or p.sPromoActionTypeID <> '8') " +
" and bw.sShopNO = '" + sCustTypeID + "' " +
" and a.nAgentID = " + agentID +
" and p.sOrgNO = '" + orgNo + "' " + StringUtil.join(" OR ", " and (", ")", " and (1 = 0) ", args) +
" group by t.sAgentContractNO, t.nGoodsID, p.sPromoTheme, p.sPromoName, p.sPromoPaperNO, p.sPromoActionTypeID, t.sGroupNO";
List<Map<String, Object>> plist = readJdbcTemplate.queryForList(sql1);
Map<String, List<Map<String, Object>>> pmm = Util.listToML(plist, ":", "sAgentContractNO", "nGoodsID");
for(String key : mm.keySet()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment