mybatis使用xml形式配置

以这个注解形式的查询代码为例

java 复制代码
   @Select("select * from emp where name like concat('%',#{name},'%') and gender =#{gender} and entrydate between #{begin} and #{end} order by  update_time desc ")
    public List<Emp> list(String name, Short gender, LocalDate begin,LocalDate end);

mybatis官网复制xml结构

这样就行了

相关推荐
Warren985 小时前
Java Record 类 — 简化不可变对象的写法
java·开发语言·jvm·分布式·算法·mybatis·dubbo
真实的菜21 小时前
MyBatis高级特性与性能优化:从入门到精通的实战指南
性能优化·mybatis
尘心不灭1 天前
MyBatis 缓存与 Spring 事务相关笔记
java·spring·mybatis
写bug写bug1 天前
搞懂MyBatis拦截器的工作原理
java·后端·mybatis
四七伵1 天前
MyBatis #{} 与 ${} 有什么区别?为什么预编译能防止SQL注入?
前端·sql·mybatis
要开心吖ZSH2 天前
大数据量下分页查询性能优化实践(SpringBoot+MyBatis-Plus)
spring boot·性能优化·mybatis
PP东2 天前
Mybatis学习之动态SQL(八)
mybatis
灰原喜欢柯南3 天前
实战:MyBatis 中 db.properties 的正确配置与最佳实践
java·数据库·mybatis
tanxiaomi3 天前
✨ 基于 JsonSerialize 实现接口返回数据的智能枚举转换(优雅告别前端硬编码!)
java·前端·spring·spring cloud·mybatis