daily 2017 8 10 mybatis动态sql之集合类型的test判断 - wtdig/study GitHub Wiki

mybatis动态sql案例:jobId为AarrayList集合类型

select

*

from student

where status = 'NEW'

and is_deleted = 'n'

<if test="null != jobIds and jobIds.size > 0">

and id not in

<foreach collection="jobIds" open="(" close=")" separator="," item="ids">

#{ids,jdbcType=BIGINT}

</foreach>

</if>

⚠️ **GitHub.com Fallback** ⚠️