mybatis的in的两种用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/bestxianfeng163/article/details/89710340

<if test="record.aalSts != null and record.aalSts != ''">
            and AAL_STS in (${record.aalSts})
                
</if>

()这个特别重要

<if test="record.aalSts != null and record.aalSts != ''">
            and AAL_STS in
                <foreach collection="record.aalStsList" index="index" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
</if>

 第二种就是把aalSts转成数组进行传输

猜你喜欢

转载自blog.csdn.net/bestxianfeng163/article/details/89710340