| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.xcong.excoin.modules.documentary.dao.FollowFollowerProfitDao"> |
| | | |
| | | |
| | | <select id="selectSumRewardAmountByMemberId" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | SUM(a.reward_amount) |
| | | FROM |
| | | contract_order a |
| | | LEFT JOIN follow_follower_order_relation b ON a.id = b.order_id |
| | | WHERE |
| | | a.member_id = #{memberId} |
| | | AND b.order_type = 2 |
| | | and b.trade_id = #{tradeId}; |
| | | </select> |
| | | |
| | | <select id="selectSumBondAmountBymemberId" resultType="java.math.BigDecimal"> |
| | | SELECT |
| | | SUM(a.bond_amount) |
| | | FROM |
| | | contract_order a |
| | | LEFT JOIN follow_follower_order_relation b ON a.id = b.order_id |
| | | WHERE |
| | | a.member_id = #{memberId} |
| | | AND b.order_type = 2 |
| | | and b.trade_id = #{tradeId}; |
| | | </select> |
| | | |
| | | <select id="selectByMemberIdandIsFollow" resultType="com.xcong.excoin.modules.documentary.entity.FollowFollowerProfitEntity"> |
| | | SELECT |
| | | * |
| | |
| | | member_id = #{memberId} |
| | | and contract_type = 2 |
| | | and order_type in (3,4) |
| | | and closing_type not in (4,5) |
| | | order by create_time desc |
| | | </select> |
| | | <select id="getMyFollowOrderNowRecords" resultType="com.xcong.excoin.modules.contract.entity.ContractHoldOrderEntity"> |
| | |
| | | |
| | | <select id="selectFollowerCntByTradeMemberId" resultType="java.lang.Integer"> |
| | | select count(1) from follow_follower_profit |
| | | where trade_member_id=#{tradeMemberId} |
| | | where trade_member_id=#{tradeMemberId} and is_follow = 1 |
| | | </select> |
| | | |
| | | <select id="selectAllFollowerProfit" resultType="java.math.BigDecimal"> |