码迷,mamicode.com
首页 > 其他好文 > 详细

mybatis 之 parameterType="list"

时间:2017-08-03 16:51:24      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:名称   mapper   lis   logs   log   dsr   bsp   select   index   

    <!-- 根据货品编号查找货品图片地址,货品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"

标签:名称   mapper   lis   logs   log   dsr   bsp   select   index   

原文地址:http://www.cnblogs.com/wangchuanfu/p/7280223.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!