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>

浙公网安备 33010602011771号