KKSU
2024-07-01 c3ed9a07b0765834136afb6400d350d895584b51
src/main/resources/mapper/modules/MallProductBuyRecordMapper.xml
@@ -17,6 +17,63 @@
        left join mall_member b on a.member_id = b.id
        left join mall_member_payment c on a.member_id = c.member_id
        where a.buy_id = #{productBuyId}
        and a.state != 0
    </select>
    <select id="selectListByBuyId" resultType="cc.mrbird.febs.mall.entity.MallProductBuyRecord">
        select a.*
        from mall_product_buy_record a
        where a.buy_id = #{buyId}
          and a.state = #{state}
    </select>
    <select id="selectRecordListByBuyId" resultType="cc.mrbird.febs.mall.entity.MallProductBuyRecord">
        select a.*,
               b.account_login
        from mall_product_buy_record a
                 left join mall_member b on a.member_id = b.id
        where a.buy_id = #{buyId}
    </select>
    <select id="selectByState" resultType="cc.mrbird.febs.mall.entity.MallProductBuyRecord">
        select a.*
        from mall_product_buy_record a
        where a.state = #{state}
    </select>
    <select id="selectListInPage" resultType="cc.mrbird.febs.mall.vo.ApiOrderRecordListVo">
        select a.id,
               b.order_no,
               a.CREATED_TIME,
               a.pay_time,
               a.pick_nft_cnt as nftTotal,
               a.state,
               2 as orderType
        from mall_product_buy_record a
        left join mall_product_buy b on b.id = a.buy_id
        where b.state = 1
          and a.state != 0
          and a.state != 5
          and a.member_id = #{record.memberId}
        order by a.CREATED_TIME desc
    </select>
    <select id="selectByBuyRecordId" resultType="cc.mrbird.febs.mall.vo.ApiOrderBuyRecordInfoVo">
        select a.*,
               b.account_login,
               c.wx_qrcode,
               c.ali_qrcode,
               c.bank_name,
               c.phone,
               c.bank,
               c.bank_no,
               c.usdt_tongdao,
               c.usdt_address
        from mall_product_buy_record a
                 left join mall_member b on a.member_id = b.id
                 left join mall_member_payment c on a.member_id = c.member_id
        where a.id = #{id}
          and a.state != 0
    </select>
</mapper>