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'
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"的更多相关文章
- mybatis中parameterType可以写的别名
mybatis中parameterType可以写的别名 https://blog.csdn.net/sdzhangshulong/article/details/51749807 _byte byte ...
- mybatis的parameterType使用map实现真正的sql随意写
在dao层给map赋值 纠正一下应该把dd作为传入而不是sbiId; sqlMap中的parameterType="java.util.Map", 就 OK package com ...
- 【JAVA - SSM】之MyBatis的ParameterType的使用
在MyBatis的Mapper.xml文件中,参数的表示方法有两种:一种是使用 "#{XXX}" 的方式表示的,另一种是使用 "${XXX}" 的方式表示的.今 ...
- MyBatis mapper parameterType
1. 传入简单类型 JAVA代码: public User get(Long id) { return (User) getSqlSession().selectOne("com.liu ...
- Mybatis中parameterType、resultMap、statementType等等配置详解(标签中基本配置详解)
一.(转自:https://blog.csdn.net/majinggogogo/article/details/72123185) 映射文件是以<mapper>作为根节点,在根节点中支持 ...
- mybatis之parameterType传递多个参数
当在查询的时候需要传入多个参数的时候该怎么办呢: 1,封装成一个Model对象,底层HashMap还是一个 User user=new User(); user.setUserName("z ...
- MyBatis的parameterType传入参数类型
在mybatis映射接口的配置中,有select,insert,update,delete等元素都提到了parameterType的用法,parameterType为输入参数,在配置的时候,配置相应的 ...
- 【JavaEE】之MyBatis的ParameterType的使用
在MyBatis的Mapper.xml文件中,参数的表示方法有两种:一种是使用 “#{XXX}” 的方式表示的,另一种是使用 “${XXX}” 的方式表示的.今天来介绍以下这两种方式的不同之处. 1. ...
- Mybatis的parameterType传入多个参数
如果查询的条件有多个的时候,mybatis有三种传入方式: 1.通过注解传入 例如: public interface Mapper(){ public User login(@Param(" ...
- mybatis 之 parameterType="String" resultType="java.util.HashMap">
public ServiceMessage<Map<String, String>> getGoodsStockNo( List<Map<String, Strin ...
随机推荐
- USB2.0学习笔记连载(十七):keil实现寄存器的配置及相关函数讲解(一)
首先要实现对寄存器的配置,可以参考手册<Development kit User Guide>,如下图所示: 此文件包含在 文件中.上述的应用文档详细介绍了如何利用KEIL实现对固件程序 ...
- MyBatis错误:Result Maps collection already contains value for novel.storage.mapper.NovelMapper.BaseResultMap
今天在写项目的时候遇到一个问题如下: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ...
- (原创)Linux下一定要4字节地址对齐操作
Linux下一定要4字节地址对齐操作:“血”的教训,一定不要忘记!!! 当然不仅仅是Linux下,所有的32位机都应该如此!!!
- matlab中常用的函数
find()函数: 功能:用于返回矩阵中想要的元素的索引值: 用法: index = find(X), 当X为一个矩阵时,返回的index是一个列向量,表示矩阵X中非零值的索引值,这个索引值吧,是按把 ...
- redis实现区间查询
###redis实现区间查询 在实际开发中经常遇到这样需求:服务端对于客户端不同的版本区间会做些不同的配置,那么客户端一个版本过来怎么快速的定位是属于哪个版本区间呢?可以利用`Sorted Sets` ...
- e801. 创建一个JProgressBar组件
A progress bar is used to visually indicate how much a task has been progressed. A progress bar can ...
- Asp.net webapi Owin Get request form data
var formData = await context.Request.ReadFormAsync() as IEnumerable<KeyValuePair<string, strin ...
- C#跳转网页7种方法
1.Response.Redirect(http://www.baidu.com,false); 目标页面和原页面可以在2个服务器上,可输入网址或相对路径.后面的bool值为是否停止执行当前页. 跳转 ...
- #HTTP协议学习# (八)状态码详解
可直接参考:http://www.cnblogs.com/TankXiao/archive/2013/01/08/2818542.html
- MQ遇到的错误(2035 或 2013认证错误)
java 连接 IBM MQ时出现 2035 或 2013认证错误的解决 com.ibm.msg.client.jms.DetailedJMSSecurityException: JMSWMQ2013 ...