MyBatisMapper.xml入参List使用in函数问题,
分享于 点击 44103 次 点评:283
MyBatisMapper.xml入参List使用in函数问题,
目录
- MyBatis Mapper.xml入参List使用in函数
- 解决方案
- 总结
MyBatis Mapper.xml入参List使用in函数
解决方案
正确使用in
函数。
一定要完整拷贝整个<if>...</if> 格式也一定要一样不然还是会报错
<select id="getFrontSeaList" resultType="com.xxx.common.vo.clue.ClueSeaListVo"> select c.id, c.oid, c.name, c.phone, c.customer_type, c.industry, c.source, c.create_time from clue c where 1=1 and c.sales_uid = 0 <if test="oidList != null"> and c.oid in <foreach collection="oidList" item="oidList" index="index" open="(" separator="," close=")"> #{oidList} </foreach> </if> and c.is_delete = 0 </select>
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持3672js教程。
您可能感兴趣的文章:- Mybatis mapper.xml使用全局变量的三种实现方法
- MyBatis Mapper.XML 标签使用小结
- mybatis-config.xml文件中的mappers标签使用
- Mybatis映射文件详解之mapper.xml文件
- 修改SpringBoot 中MyBatis的mapper.xml文件位置的过程详解
- Mybatis Mapper XML文件-插入,更新,删除详解(insert, update and delete)
用户点评