mybatis中XML映射
相关概念
xml
文件的配置,即搜索的小案例查看代码
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.itheima.mapper.EmpMapper">
<select id="ifsearch" resultType="com.itheima.pojo.Emp">
select * from tb_emp where name like concat('%',#{name},'%') and gender=#{gender} and p_date between #{begin} and #{end}
</select>
</mapper>