配置文件内容
<?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.zhou.dzyg.mapper.FloorMapper">
<resultMap id="FloorMap" type="com.zhou.dzyg.model.Floor">
<id column="id" property="id"></id>
<result column="name" property="name"></result>
<result column="img_url" property="imgUrl"></result>
<result column="keyword" property="keyword"></result>
<result column="pid" property="pid"></result>
</resultMap>
<select id="getAll" resultMap="FloorMap">
select * from floor
</select>
</mapper>
报错内容
Result Maps collection already contains value for com.zhou.dzyg.mapper.FloorMapper.FloorMap
报错原因
<resultMap id="FloorMap" type="com.zhou.dzyg.model.Floor">
中的id开头不能大写,具体原因我找不到,记得就好