public ServiceMessage<Map<String, String>> getGoodsStockNo( List<Map<String, String>> goodsList) { try { Map<String, String> map = new HashMap<String, String>(); for (Map m : goodsList) { HashMap map2 = iGoodsMapper.getGoodsStockNo((String) m .get("goodsNo")); if (null != map2) { map.put((m.get("goodsNo")).toString(), (String) map2.get("STOCK_NO")); } } return super.returnCorrectResult(map); } catch (Throwable e) { logger.error(e.getMessage(), e); return super.returnException(e); } }
/** * 根据商品编码查询商品所在的仓库 * * @param goodsNo * @return */ public HashMap getGoodsStockNo(String goodsNo);
<select id="getGoodsStockNo" parameterType="String" resultType="java.util.HashMap"> <if test="value!=null and value!='' "> select ss.stock_no from goods gg,STOCK ss where gg.is_delete = 'N' and ss.is_delete = 'N' and gg.stock_id = ss.stock_id and gg.goods_no = #{value} </if> </select>