MyBatis

collection

    <resultMap id="base_result" type="com.ithings.auth.entity.UserDto">
        <result property="id" column="ID"/>
        <result property="name" column="NAME"/>
        <collection property="accountList" ofType="com.ithings.auth.entity.Account">
            <id property="id" column="a_ID"/>
            <result property="balance" column="BALANCE"/>
        </collection> 
    </resultMap>
    
    <select id="getUserDtoList" resultMap="base_result">
        SELECT u.ID, u.NAME, a.ID a_ID, a.BALANCE from USERINFO u, ACCOUNT a WHERE u.id = a.user_id
    </select>

    <!-- dto结果集 -->
    <resultMap id="result_dto" type="com.ithings.hdmng.dto.GoodsDto" extends="result_base">
        <result property="ctgName" column="CTG_NAME"/>
        <result property="stateName" column="STATE_NAME"/>
        <collection property="glRalList" javaType="ArrayList"
                    column="{goodsId=ID}"
                    ofType="com.ithings.hdmng.entity.GoodsLabelRel" select="findGoodsLabelRelByGoodsId" />
    </resultMap>
    <select id="findGoodsLabelRelByGoodsId" parameterType="java.util.HashMap" resultMap="result_goods_label">
        SELECT obj.GOODS_ID, obj.LABEL_ID
        FROM hdm_goods_label_rel obj
        WHERE obj.GOODS_ID = #{goodsId}
        ORDER BY obj.LABEL_ID ASC
    </select>



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值