首页 > 代码库 > mybatis 之 parameterType="list"
mybatis 之 parameterType="list"
<!-- 根据货品编号查找货品图片地址,货品ID,商品ID,货品名称 --> <select id="getGoodsInfoByGoodsNo" parameterType="list" resultMap="goodsResultImg"> select g.product_id,g.goods_id,g.goods_name,m.pro_image_url,g.goods_no,g.market_price from goods g inner join product t on t.product_id = g.product_id and g.is_delete = ‘N‘ inner join product_img m on m.product_id = t.product_id and m.image_type = ‘list‘ and m.image_order=1 where g.goods_no in <foreach collection="list" item="listItem" index="index" open="(" separator="," close=")"> #{listItem,jdbcType=VARCHAR} </foreach>
List<String> goodsNos = new ArrayList<String>(); for (int i = 0; i < templateGoodslist.size(); i++) { goodsNos.add(templateGoodslist.get(i).getGoodsNo()); } List<Goods> goodsImgAndPriceList =new ArrayList<Goods>(); if(!goodsNos.isEmpty()){ goodsImgAndPriceList = this.iGoodsMapper.getGoodsInfoByGoodsNo(goodsNos); }
mybatis 之 parameterType="list"
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。