<resultMap type="xxx.xxx.xxx.xxx.实体类" id="xxxListTree">
<result column="id" property="id" javaType="java.lang.Long" />
<result column="xxx_name" property="xxxName" javaType="java.lang.String" />
<result column="parent_id" property="parentId" javaType="java.lang.Long" />
<result column="create_user" property="createUser" javaType="java.lang.Long" />
<!-- <collection column="{id=id,currentUserId=create_user}" property="xxxxListDtoList" ofType="com.cloud.datasynergy.model.xxxxListDto" javaType="java.util.ArrayList" select="selectXxxxXXXrenById"/>-->
<collection autoMapping="true" column="{id=id,currentUserId=create_user}" javaType="ArrayList" ofType="xxx.xxx.xxx.xxx.实体类" property="实体类里面的list集合,用于存储子节点数据" select="selectXxxxXxxxrenById">
</collection>
</resultMap>
<select id="selectXxxxList" resultMap="xxxListTree">
select * from t_Xxxx_list where parent_id = #{id} and create_user = #{currentUserId} and is_del = 0
</select>
<select id="selectXxxxXXXrenById" resultMap="xxxListTree">
select * from t_Xxxx_listwhere parent_id = #{id} and create_user = #{currentUserId} and is_del = 0
</select>
column="{id=id,currentUserId=create_user}"
> =左边代表 dao or mapper 中的参数,=右边代表数据库表中的字段