其他分享
首页 > 其他分享> > xml文件的一对多查询

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: 属性类型

标签:xml,target,查询,attachment,guide,一对,id,select,name
来源: https://www.cnblogs.com/sehnen/p/15221292.html