##父集合 id在resultMap中,name在父查询的parameterType中
<resultMap type="cn.xxxVO" id="fatherResult">
<result property="id" column="id" />
<collection property="xxxList" ofType="cn.xxxResVO" javaType="java.util.List" column="{id, name}" select="selectResResult" />
</resultMap>
##父查询
<select id="selectFatherResResult" resultMap="fatherResult" parameterType="cn.xxxDTO">
select id from AAA
</select>
##子查询
<select id="selectSonResResult" resultMap="sonResResult" parameterType="java.util.Map">
select a,b,c from xxx
<where>
<if test="id!= null and id!= ''">
and xxx.id = #{id}
</if>
<if test="name!= null and name!= ''">
and xxx.name like concat('%', #{name}, '%')
</if>
</where>
</select>
##查询报错
nested exception is org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'name' from result set. Cause: org.apache.ibatis.executor.result.ResultMapException: Error attempting to get column 'name' from result set. Cause: java.sql.SQLException: Column 'name' not found.