mybatis中使用in

 

        <if test="areaCode != null and areaCode !=''">
            and AREACODE in (${areaCode})
        </if>

 

如果直接传入拼接好的where in 条件, 比如('111','222','333'),则需要使用${areaCode}传参,即绝对引用,而不能使用#
, 如果使用#传参会被mybatis当成字符串再添加一层''引号,导致错误。

posted on 2023-09-25 14:15  五官一体即忢  阅读(46)  评论(0)    收藏  举报

导航