Commit 7bfb02f7 authored by Quxl's avatar Quxl

x

parent e637d3cc
...@@ -399,17 +399,11 @@ public class GoodsServiceImpl implements GoodsService { ...@@ -399,17 +399,11 @@ public class GoodsServiceImpl implements GoodsService {
*/ */
public Map<String, List<Map<String, Object>>> goodsPicList(String goodsID,String agentContractNO ){ public Map<String, List<Map<String, Object>>> goodsPicList(String goodsID,String agentContractNO ){
String sql1 = "select agp.sURL, agp.nLength, agp.sPicTypeID from tAgentGoodsPic agp, tAgentContractGoods acg where agp.nAgentID = acg.nAgentID and agp.nGoodsID = acg.nGoodsID and acg.sAgentContractNO = ? and acg.nGoodsID = ?"; String sql1 = "select agp.sURL, agp.nLength, agp.sPicTypeID from tAgentGoodsPic agp, tAgentContractGoods acg where agp.nAgentID = acg.nAgentID and agp.nGoodsID = acg.nGoodsID and acg.sAgentContractNO = ? and acg.nGoodsID = ?";
String sql2 = "select gp.sURL, gp.nLength, gp.sPicTypeID from tGoodsPic gp where gp.nGoodsID = ?";
List<Map<String, Object>> picList1 = jdbcTemplate.queryForList(sql1, agentContractNO, goodsID); List<Map<String, Object>> picList1 = jdbcTemplate.queryForList(sql1, agentContractNO, goodsID);
List<Map<String, Object>> picList2 = jdbcTemplate.queryForList(sql2, goodsID);
Map<String, List<Map<String,Object>>> picML1 = Util.listToML(picList1, "sPicTypeID"); Map<String, List<Map<String,Object>>> picML1 = Util.listToML(picList1, "sPicTypeID");
Map<String, List<Map<String,Object>>> picML2 = Util.listToML(picList2, "sPicTypeID");
Map<String, List<Map<String, Object>>> pics = new HashMap<String, List<Map<String, Object>>>(); Map<String, List<Map<String, Object>>> pics = new HashMap<String, List<Map<String, Object>>>();
for(String sPicTypeID : new String[] {"1", "2", "3", "4"}) { for(String sPicTypeID : new String[] {"1", "2", "3", "4"}) {
List<Map<String, Object>> picList = picML1.get(sPicTypeID); List<Map<String, Object>> picList = picML1.get(sPicTypeID);
if(picList == null || picList.size() == 0) {
picList = picML2.get(sPicTypeID);
}
pics.put("ImgGroup_" + sPicTypeID, picList); pics.put("ImgGroup_" + sPicTypeID, picList);
} }
return pics; return pics;
......
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