其他分享
首页 > 其他分享> > mybatis

mybatis

作者:互联网

判断list是否为空

<where>
            <if test="CodeList!=null and CodeList.size > 0">
                loc.eb_code in
                <foreach collection="locationCodeList" item="Code" open="(" separator="," close=")">
                    #{Code}
                </foreach>
            </if>
            <if test="queryVo.level != null  ">
                and loc.eb_level = #{queryVo.level}
            </if>
            and arg.is_deleted = 0
        </where>

 mybatis 写<where> 可以判断是否是第一个条件,不用写where 1=1 

标签:loc,level,deleted,list,eb,mybatis
来源: https://www.cnblogs.com/jingRegina/p/15932889.html