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>
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
发表评论