<?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>
|
<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="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}
|
</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>
|
|
|
</mapper>
|