常规示例:
<resultMap type="com.zxsl.air.business.entity.dto.PsControlo3noticeDto" id="psControlo3noticeDto">
<id column="id" property="id"/>
<collection property="fileInfoDtos" select="getFileInfoDtos" column="id"
ofType="com.zxsl.air.platform.upload.dto.FileInfoDto" javaType="java.util.ArrayList">
</collection >
<collection property="psControlo3industrys" select="getpsControlo3industrys" column="id"
ofType="com.zxsl.air.business.entity.dto.PsControlo3industryDto" javaType="java.util.ArrayList">
</collection >
</resultMap>
有些时候需要传递往collection、association 标签传递多参数,可通过如下方式:
修改column属性如column="{id=idvalue,industry=industryvalue,name=namevalue}"
<resultMap type="com.zxsl.air.business.entity.dto.PsControlo3noticeDto" id="psControlo3noticeDto">
<id column="id" property="id"/>
<collection property="fileInfoDtos" select="getFileInfoDtos" column="id"
ofType="com.zxsl.air.platform.upload.dto.FileInfoDto" javaType="java.util.ArrayList">
</collection >
<collection property="psControlo3industrys" select="getpsControlo3industrys" column="{id=id,industry=industry,name=name}"
ofType="com.zxsl.air.business.entity.dto.PsControlo3industryDto" javaType="java.util.ArrayList">
</collection >
</resultMap>
其中idvalue、industryvalue、namevalue可不声明<id column="id" property="id"/>,i但是idvalue、industryvalue、namevalue必须是sql查询的返回列,也可以是某些常量列。
<select id="getList" parameterType="com.zxsl.air.business.controller.param.QueryPsControlo3noticeParam" resultMap="psControlo3noticeDto">
select distinct pcn.*,pci.controlO3Notice_id,
queryPsControlo3noticeParam.industry as industry
from ps_controlo3notice pcn
<select>
本文笔记到此结束。
网友评论