标签搜索

目 录CONTENT

文章目录

关于springboot xxxmapper.xml中 resultMap报错

胖头鱼
2022-10-01 / 0 评论 / 0 点赞 / 26 阅读 / 222 字 / 正在检测是否收录...

配置文件内容

<?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开头不能大写,具体原因我找不到,记得就好

0

评论区