阿华_hello 2020-12-10 14:04 采纳率: 33.3%
浏览 10
已采纳

关于mybatis查询列获得结果集映射问题

我想把这4列的结果集分别映射到4个List里面,接收应该这样Map<String,List<String>>,

请问mybatis的mapper.xml怎么写?

 

  • 写回答

2条回答 默认 最新

  • 邕南居士 2020-12-10 15:25
    关注

    用collection

    <resultMap type="user" id="usersOrdersResultMap">
        <collection property="cityList" javaType="List" ofType="Integer">
            <id column="city_code" property="number"/>
        </collection>

    </resultMap>

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?