springboot的mybatis使用CONCAT模糊查询

springboot的mybatis使用CONCAT模糊查询

在mysql中like 可以直接使用字符串拼接,在xml中需要使用CONCAT来连接变量。

xml 复制代码
<mapper namespace="com.geofly.ynygzx.iscp.api.mapper.AppUpdateRecordMapper">
    <select id="getList" resultType="com.geofly.ynygzx.iscp.api.entity.AppUpdateRecord">
        select * from app_update_record where 1 = 1
        <if test="params.status != null and params.status != ''">
            and status = #{params.status}
        </if>
        <if test="params.version != null and params.version != ''">
            and version like CONCAT('%', #{params.version}, '%')
        </if>
        ORDER BY version desc, create_time desc
    </select>
</mapper>
相关推荐
卷无止境20 分钟前
便宜模型和贵模型到底差在哪儿?一份关于Claude与GPT分级体系的深度梳理
后端·python
阿狗童鞋1 小时前
SpringBoot微服务实战指南
spring boot·后端·微服务
FfHUCisI1 小时前
sync.Once 与 sync.Cond 源码与并发控制陷阱
服务器·开发语言·后端·golang
montEvergreen1 小时前
位运算不是魔法——AV1 配置解析实战
后端
程序猿乐锅1 小时前
【黑马点评 | 第九篇】秒杀优化-异步实现
java·spring boot·redis·后端·spring·中间件·mybatis
Wx-bishekaifayuan1 小时前
springboot户外登山社交小程序19787-计算机课程设计、毕业设计
spring boot·后端·python·spring·elasticsearch·django·课程设计
+VX:Fegn08951 小时前
计算机毕业设计|基于springboot + vue外卖点餐系统(源码+数据库+文档)
数据库·vue.js·spring boot·后端·课程设计
FYKJ_20101 小时前
springboot刑事案件管理系统03047-计算机课程设计、毕业设计
vue.js·spring boot·python·mysql·typescript·spark·django
小辰爱喝汤2 小时前
新闻管理系统|SpringBoot + Vue 毕业设计完整方案
spring boot·毕业设计·课程设计
FYKJ_20103 小时前
springboot助农产品销售商城05829-计算机课程设计、毕业设计
java·spring boot·python·mysql·spark·django