1、勾选 mybatis、devtools
2、创建实体类
3、编写mapper
4、编写mappe.xml
<?xml version="1.0" encoding="UTF-8"
?>
<!DOCTYPE mapper (View Source for full doctype...)>
<id column="id" property="id" jdbcType="INTEGER"
/>
<result column="girl_name" property="name"
jdbcType="VARCHAR" />
<result column="girl_birthday" property="birthday"
jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Base_Column_List">id, girl_name, girl_birthday</sql>
select
<include refid="Base_Column_List" />
from girl where id = #{id,jdbcType=INTEGER}
</select>
<insert id="insert" parameterType="com.hint.domain.Girl">insert
into girl (id, girl_name, girl_birthday) values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{birthday,jdbcType=TIMESTAMP})</insert>
</mapper>
5、配置
1)创建mybatis
2)配置
应该是 = 而不是 :
6、测试