mybatis中dao中对应的Mapper.xml编写

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.fu.dao.UserMapper">
<!-- 开启缓存-->
<cache
eviction="FIFO"
flushInterval="60000"
size="512"
readOnly="true"/>

<select id="getUser" resultType="user" parameterType="int">
select * from user where id = #{id}
</select>

</mapper>
posted @ 2022-02-25 20:40  Fu_Zhang  阅读(85)  评论(0)    收藏  举报