<?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.yunding.mapper.BasicSettingMapper">
|
|
|
<select id="getOrderList" resultType="com.xcong.excoin.modules.yunding.entity.YdOrderEntity">
|
SELECT
|
*
|
FROM
|
yd_order a
|
left join yd_product b on b.id = a.product_id
|
left join member c on c.id = a.member_id
|
<if test="record != null">
|
<where>
|
and a.type=1
|
<if test="record.state != null" >
|
and a.state=#{record.state}
|
</if>
|
<if test="record.account!=null and record.account!=''">
|
and (c.phone = #{record.account} or c.email = #{record.account} or c.invite_id=#{record.account})
|
</if>
|
</where>
|
</if>
|
ORDER BY a.create_time DESC
|
</select>
|
|
<select id="getAgentOrderList" resultType="com.xcong.excoin.modules.yunding.vo.YdAgentOrderVo">
|
SELECT
|
*
|
FROM
|
yd_order a
|
left join yd_basic_level_setting b on b.id = a.product_id
|
left join member c on c.id = a.member_id
|
<if test="record != null">
|
<where>
|
and a.type=2
|
<if test="record.account!=null and record.account!=''">
|
and (c.phone = #{record.account} or c.email = #{record.account} or c.invite_id=#{record.account})
|
</if>
|
</where>
|
</if>
|
ORDER BY a.create_time DESC
|
</select>
|
|
<select id="getYdProductList" resultType="com.xcong.excoin.modules.yunding.entity.YdProductEntity">
|
SELECT
|
*
|
FROM
|
yd_product a
|
</select>
|
|
<select id="getYdMemberList" resultType="com.xcong.excoin.modules.yunding.vo.YdMemberVo">
|
SELECT
|
*
|
FROM
|
member c
|
<if test="record != null">
|
<where>
|
<if test="record.account!=null and record.account!=''">
|
and (c.phone = #{record.account} or c.email = #{record.account} or c.invite_id=#{record.account})
|
</if>
|
</where>
|
</if>
|
ORDER BY c.create_time DESC
|
</select>
|
|
<select id="selectPowerByMemberIdAndState" resultType="java.lang.Integer">
|
SELECT
|
IFNULL(sum(quantity),0)
|
FROM
|
yd_order a
|
where a.member_id = #{memberId}
|
and a.state = #{state}
|
</select>
|
|
<select id="selectAmountByMemberId" resultType="java.math.BigDecimal">
|
SELECT
|
IFNULL(sum(amount),0)
|
FROM
|
yd_order a
|
where a.member_id = #{memberId}
|
and type = #{type}
|
</select>
|
|
|
<select id="selectChargeAmountByMemberIdAndStatus" resultType="java.math.BigDecimal">
|
SELECT
|
IFNULL(sum(amount),0)
|
FROM
|
member_coin_charge a
|
where a.member_id = #{memberId}
|
and a.status = #{status}
|
</select>
|
|
<select id="selectWithdrawAmountByMemberIdAndStatusAndIsInside" resultType="java.math.BigDecimal">
|
SELECT
|
IFNULL(sum(amount),0)
|
FROM
|
member_coin_withdraw a
|
where a.member_id = #{memberId}
|
and a.status = #{status}
|
and a.is_inside = #{isInside}
|
</select>
|
|
|
|
<select id="selectAgentReturnByMemberId" resultType="java.math.BigDecimal">
|
SELECT
|
IFNULL(sum(amount),0)
|
FROM
|
member_account_money_change
|
WHERE
|
member_id = #{memberId}
|
AND type = 6
|
AND status = 1
|
</select>
|
|
<select id="seeAgentReturn" resultType="com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity">
|
SELECT
|
b.phone phoneTo,
|
a.content content,
|
a.amount amount,
|
a.symbol symbol,
|
a.status status,
|
c.phone phoneFrom,
|
d.amount amountOrder,
|
d.type typeOrder
|
FROM
|
member_account_money_change a
|
left join member b on b.id = a.member_id
|
left join member c on c.id = (
|
select member_id from yd_order where id = a.withdraw_id
|
)
|
left join yd_order d on d.id = a.withdraw_id
|
where a.type=6
|
and a.member_id = #{record.id}
|
ORDER BY a.create_time DESC
|
</select>
|
|
<select id="selectTotalProfitByMemberIdAndType" resultType="java.math.BigDecimal">
|
SELECT
|
IFNULL(sum(total_profit),0)
|
FROM
|
yd_order a
|
where a.member_id = #{memberId}
|
and a.type = #{type}
|
</select>
|
|
<select id="seeReturn" resultType="com.xcong.excoin.modules.member.entity.MemberAccountMoneyChangeEntity">
|
SELECT
|
a.content content,
|
a.amount amount,
|
a.symbol symbol,
|
a.status status,
|
b.phone phoneFrom,
|
d.quantity quantityOrder,
|
e.name name
|
FROM
|
member_account_money_change a
|
left join member b on b.id = a.member_id
|
left join yd_order d on d.id = a.withdraw_id
|
left join yd_product e on e.id = d.product_id
|
where a.type=4
|
and a.member_id = #{record.id}
|
ORDER BY a.create_time DESC
|
</select>
|
|
<select id="seeOrder" resultType="com.xcong.excoin.modules.yunding.entity.YdOrderEntity">
|
SELECT
|
*
|
FROM
|
yd_order a
|
left join yd_product e on e.id = a.product_id
|
where a.member_id = #{record.id}
|
and a.type = 1
|
ORDER BY a.buy_time DESC
|
</select>
|
|
|
</mapper>
|