xiaoyong931011
2021-11-24 35d0c67bb3391d69a8333e5fad664a88a8ccfd0e
src/main/resources/mapper/walletCoinOrder/OrderCoinsDao.xml
@@ -8,11 +8,12 @@
   </select>
   
   <select id="findCoinOrderListByMemberIdAndSysmbol" resultType="com.xcong.excoin.modules.coin.entity.OrderCoinsEntity">
      SELECT * FROM coins_order a where a.member_id= #{memberId} and a.order_status = #{status}
      SELECT (select sum(symbol_cnt) from coins_order_deal where order_id = a.id) as deal_cnt, a.create_by,a.create_time,   a.update_by,   a.update_time,   a.version,a.id,   a.member_id,   a.order_no,   a.order_type,   a.symbol,   a.mark_price,   a.entrust_cnt,   a.entrust_price,   a.deal_price,   a.deal_amount,   a.order_status,   a.trade_type,   a.fee_amount,   a.entrust_amount
      FROM coins_order a where a.member_id= #{memberId} and a.order_status = #{status}
         <if test="symbol != null and symbol !=''">
             and a.symbol = #{symbol}
         </if>
         order by create_time desc
         order by a.create_time desc
   </select>
   
   <select id="findWalletCoinOrderByOrderNo" resultType="com.xcong.excoin.modules.coin.entity.OrderCoinsEntity">
@@ -25,5 +26,68 @@
      select *
      from coins_order
      where order_status=1
      <if test="list != null">
         and symbol not in
         <foreach collection="list" separator="," item="item" open="(" close=")">
            #{item}
         </foreach>
      </if>
   </select>
   <select id="selectCoinOrderOnTrade" resultType="com.xcong.excoin.modules.coin.entity.OrderCoinsEntity">
      select a.id,
      a.deal_price,
      a.entrust_amount,
      a.fee_amount,
      a.entrust_cnt,
      a.mark_price,
      a.member_id,
      a.order_no,
      a.order_status,
      a.order_type,
      a.symbol,
      a.trade_type,
      a.version,
      a.create_by,
      a.create_time,
      a.update_by,
      a.update_time,
      a.entrust_price,
      (select sum(symbol_cnt) from coins_order_deal where order_id = a.id) as deal_cnt,
      (select sum(deal_amount) from coins_order_deal where order_id = a.id) as deal_amount
      from coins_order a
      where a.order_status=1
      <if test="list != null">
         and a.symbol in
         <foreach collection="list" separator="," item="item" open="(" close=")">
            #{item}
         </foreach>
      </if>
   </select>
   <update id="updateDeal" parameterType="map">
      update coins_order
      <set>
         <if test="dealCnt!=null">
            deal_cnt = deal_cnt+#{dealCnt},
         </if>
         <if test="dealAmount!=null">
            deal_amount = deal_amount+#{dealAmount},
         </if>
      </set>
      where id = #{id}
   </update>
   <update id="batchUpdateStatus" parameterType="map">
      update coins_order set order_status = #{status}
      where id in
      <foreach collection="list" item="item" separator="," open="(" close=")">
         #{item}
      </foreach>
   </update>
   <update id="updateStatus" parameterType="map">
      update coins_order set order_status = #{status}
      where id =#{id}
   </update>
</mapper>