<select id="findDataByCodes" resultMap="BaseResultMap" >
select
<include refid="this_list" />
from EDIIS_BLACK_LIST_UNIT t
where 1=1
<if test="array !=null and array.length > 0">
and t.code in
<foreach collection="array" item = "code" open="(" separator="," close=")" index="index">
#{code}
</foreach>
</if>
</select>
切记,上面一个小问题搞了我几个小时,当用数组作为参数时候,参数名必须为“array”
最后
以上就是聪明乌冬面最近收集整理的关于MyBatis 使用数组作为参数的全部内容,更多相关MyBatis内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复