首页 > 其他 > 详细

xml文件的一对多查询

时间:2021-09-03 18:57:51      阅读:23      评论:0      收藏:0      [点我收藏+]
    <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文件的一对多查询

原文:https://www.cnblogs.com/sehnen/p/15221292.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!