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结构

这样就行了

相关推荐
老毛肚4 小时前
MyBatis插件原理及Spring集成
java·spring·mybatis
马尔代夫哈哈哈9 小时前
MyBatis 入门与实战:从配置到CRUD一站式指南
mybatis
Jul1en_10 小时前
【MyBatis/plus】核心配置、插件与 MyBatis-Plus 构造器 Wrapper
mybatis
LiZhen79812 小时前
SpringBoot 实现动态切换数据源
java·spring boot·mybatis
我是Superman丶13 小时前
在 PostgreSQL 中使用 JSONB 类型并结合 MyBatis-Plus 实现自动注入,主要有以下几种方案
数据库·postgresql·mybatis
Pluto_CSND14 小时前
基于mybatis-generator插件生成指定数据表的实体类、xml文件和dao层接口
mybatis
indexsunny16 小时前
互联网大厂Java面试实战:微服务与Spring生态技术解析
java·spring boot·redis·kafka·mybatis·hibernate·microservices
手握风云-17 小时前
JavaEE 进阶第十六期:MyBatis,查询请求的生命周期全景图(一)
java·java-ee·mybatis
独断万古他化18 小时前
【SSM开发实战:博客系统】(二)JWT 登录流程、拦截器实现和用户信息接口落地
spring boot·spring·mybatis·博客系统·项目
Pluto_CSND19 小时前
MyBatis 的 XML 文件中特殊字符的处理
mybatis