下面代码是用map接收结果,map中还含有list<map>,来保存这种一对多的关系
详细可见官方文档中的resultMap模块:
https://mybatis.org/mybatis-3/sqlmap-xml.html#Result_Maps
注意:javaType
<resultMap type="java.util.Map" id="table_field_resultMap">
<result column="P_MENU_NAME" property="p_menuName" jdbcType="VARCHAR"/>
<collection property="subMenus" ofType="java.util.Map" javaType="java.util.ArrayList" >
<result column="MENU_NAME" property="menuName" jdbcType="VARCHAR"/>
<result column="LAST_MENU_ID" property="lastMenuId" jdbcType="VARCHAR"/>
<result column="CODE" property="code" jdbcType="VARCHAR"/>
<result column=&#