mybatis-puls 模糊查询 大于小于 查询

1、模糊查询

contains('%',#{参数},'%')

2、大于小于

<if test="queryVo.minRent != null and queryVo.maxRent">
    and (ri.rent &gt;= #{queryVo.minRent} and ri.rent &lt;= #{queryVo.maxRent})
</if>

3、排序

@Schema(description = "价格排序方式", allowableValues = {"desc", "asc"})
private String orderType;
<if test="queryVo.orderType == 'desc' or queryVo.orderType == 'asc'">
    order by ri.rent ${queryVo.orderType}
</if>

 

posted @ 2025-05-17 20:56  市丸银  阅读(64)  评论(0)    收藏  举报