xml文件的一对多查询

    <resultMap type="com.medaxis.hpams.target.domain.AO.MpTargetAO" id="MpTargetResult">
        <result property="id"    column="id"    />
        <result property="targetNum"    column="target_num"    />
        <collection property="files" column="attachment"  javaType="ArrayList" ofType="string" select="getFileList"/>
    </resultMap>

    <sql id="selectMpTargetVo">
        select id, target_num, target_name, target_property, unit, recognition_degree, target_guide, hope_guide, display_form, compute_type, target_definition, target_meaning, attachment, delete_flag from mp_target
    </sql>

    <select id="getFileList" resultType="string" parameterType="int">
        select name  from mp_file_info  where common_id=#{attachment}
    </select>

oftype:List的实体类
javaType: 属性类型

上一篇:常用英文搜索关键词


下一篇:一些C/C++编译器的语言标准兼容性