模糊查询实现

模糊查询
输入name的某个字
<where>
    <if test="name != null and name != ''">
        and (position(#{name} in name) > 0)
    </if>
    and deleted = 0
</where>


模糊查询
按照名字或者账号查询​​​​​​
where
<trim prefixOverrides="and">
    <if test="search != null and search != ''">
        (position(#{search} in a.name) > 0 or position(#{search} in a.login_name) > 0)
    </if>
    and a.deleted = 0
</trim>
上一篇:【C++】error: call-to-implicitly-deleted-default-constructor


下一篇:C# 获取时间差状态