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 

上一篇:oppoAndroid面试!Android程序员面试必备的知识点,万字长文!


下一篇:fidler 抓android包