mybatis if test 不为空字符串或null

<select id="findIndexConfigList" parameterType="Map" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tb_newbee_mall_index_config
        <where>
            <if test="configType!=null and configType!=''">
                and config_type = #{configType}
            </if>
            and is_deleted = 0
        </where>
        order by config_rank desc
        <if test="start!=null and limit!=null">
            limit #{start},#{limit}
        </if>
 </select>
posted @ 2020-12-30 10:14  Cherish°  阅读(4214)  评论(0编辑  收藏  举报