@Test public void testSelectByCommodityId() throws Exception { List<Map<String, Object>> list = service.selectByCommodityId(26l); for(Map<String, Object> map : list){ System.out.println(map.get("id")); System.out.println(map.get("exchangeWay")); System.out.println(map.get("url")); System.out.println(map.get("quota")); } }
@Override public List<Map<String, Object>> selectByCommodityId(Long commId) { List<CommodityExchange> exchangeList = ceMapper.selectExcInfoByCommodityId(commId); List<Map<String, Object>> mapList = new ArrayList<>(); for (CommodityExchange commExc : exchangeList) { Map<String, Object> map = new HashMap<>(); map.put("id", commExc.getExchangeWayId()); map.put("exchangeWay", commExc.getEwName()); map.put("url", Settings.SERVER_URL_PATH + commExc.getEwUrl()); map.put("quota", 0); mapList.add(map); } return mapList; }
CommodityExchangeServiceImpl implements ICommodityExchangeService { @Override public List<Map<String, Object>> selectByCommodityId(Long commId) { List<CommodityExchange> exchangeList = ceMapper.selectExcInfoByCommodityId(commId); List<Map<String, Object>> mapList = new ArrayList<>(); for (CommodityExchange commExc : exchangeList) { Map<String, Object> map = new HashMap<>(); map.put("id", commExc.getExchangeWayId()); map.put("exchangeWay", commExc.getEwName()); map.put("url", Settings.SERVER_URL_PATH + commExc.getEwUrl()); map.put("quota", 0); mapList.add(map); } return mapList; } }
CommodityExchangeServiceImpl implements ICommodityExchangeService { @Override public List<Map<String, Object>> selectByCommodityId(Long commId) { List<CommodityExchange> exchangeList = ceMapper.selectExcInfoByCommodityId(commId); List<Map<String, Object>> mapList = new ArrayList<>(); for (CommodityExchange commExc : exchangeList) { Map<String, Object> map = new HashMap<>(); map.put("id", commExc.getExchangeWayId()); map.put("exchangeWay", commExc.getEwName()); map.put("url", Settings.SERVER_URL_PATH + commExc.getEwUrl()); map.put("quota", 0); mapList.add(map); } return mapList; }  }
CommodityExchangeServiceImpl implements ICommodityExchangeService { @Override public List<Map<String, Object>> selectByCommodityId(Long commId) { List<CommodityExchange> exchangeList = ceMapper.selectExcInfoByCommodityId(commId); List<Map<String, Object>> mapList = new ArrayList<>(); for (CommodityExchange commExc : exchangeList) { Map<String, Object> map = new HashMap<>(); map.put("id", commExc.getExchangeWayId()); map.put("exchangeWay", commExc.getEwName()); map.put("url", Settings.SERVER_URL_PATH + commExc.getEwUrl()); map.put("quota", 0); mapList.add(map); } return mapList; }  @Override boolean addExchange(CommodityExchange exchange); @Override boolean deleteExchange(CommodityExchange exchange); @Override boolean updateExchange(CommodityExchange exchange); @Override List<Map<String, Object>> selectByCommodityId(Long commId); }
CommodityExchangeServiceImpl implements ICommodityExchangeService { @Override public List<Map<String, Object>> selectByCommodityId(Long commId) { List<CommodityExchange> exchangeList = ceMapper.selectExcInfoByCommodityId(commId); List<Map<String, Object>> mapList = new ArrayList<>(); for (CommodityExchange commExc : exchangeList) { Map<String, Object> map = new HashMap<>(); map.put("id", commExc.getExchangeWayId()); map.put("exchangeWay", commExc.getEwName()); map.put("url", Settings.SERVER_URL_PATH + commExc.getEwUrl()); map.put("quota", 0); mapList.add(map); } return mapList; }  @Override boolean addExchange(CommodityExchange exchange); @Override boolean deleteExchange(CommodityExchange exchange); @Override boolean updateExchange(CommodityExchange exchange); @Override List<Map<String, Object>> selectByCommodityId(Long commId);  }