Mybatis在springboot中的mapper.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.cjhstudy.mapper.I_HospitalMapper">
<insert id="updateHospital" parameterType="I_Hospital">
</insert>
</mapper>
其中:
updateHospital: mapper中的id命名
I_Hospital: 实体类名称
insert、update、delete 使用的是 parameterType
select 使用的是 resultType
namespace: 务必要写正确!!!