Helius
2021-05-20 ab4f788aaba47910e3edf0fe1b001e56cdea26db
src/main/resources/mapper/otc/OtcEntrustOrderDao.xml
@@ -6,7 +6,7 @@
        select
            a.id,
            b.id mbId
            ,b.nikename nickname
            ,c.name nickname
            ,a.unit_price unitPrice
            ,a.remain_coin_amount amount
            ,a.limit_min_amount min
@@ -14,7 +14,8 @@
            ,b.total_order_cnt orderCnt
            ,b.finish_ratio finishRatio
        from otc_entrust_order a
        left join otc_market_bussiness b on a.mb_id=b.id
        left join otc_market_bussiness b on a.member_id=b.member_id
        left join member c on a.member_id=c.id
        <where>
            a.status=1
            <if test="record != null">
@@ -23,6 +24,7 @@
                </if>
            </if>
        </where>
        order by a.create_time desc
    </select>
    <select id="selectEntrustOrderByOrderType" resultType="com.xcong.excoin.modules.otc.entity.OtcEntrustOrder">
@@ -42,4 +44,29 @@
            </if>
        </where>
    </select>
    <select id="selectOwnEntrustListInPage" resultType="com.xcong.excoin.modules.otc.entity.OtcEntrustOrder">
        select * from otc_entrust_order
        <where>
            <if test="record.orderType != null and record.orderType != ''" >
                and order_type = #{record.orderType}
            </if>
            <if test="record.memberId != null">
                and member_id = #{record.memberId}
            </if>
            <if test="record.status != null and record.status == 3">
                and status != #{record.status}
            </if>
            <if test="record.status != null and record.status != 3">
                and status == #{record.status}
            </if>
        </where>
        order by create_time desc
    </select>
    <update id="updateRemainAmount">
        update otc_entrust_order
        set remain_coin_amount = remain_coin_amount + ${amount}
        where id=#{id}
    </update>
</mapper>