| | |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <select id="selectTeamPage" resultType="cc.mrbird.febs.mall.vo.sale.ApiTeamListInfoVo"> |
| | | |
| | | SELECT |
| | | a.name memberName, |
| | | a.CREATED_TIME createdTime, |
| | | ( |
| | | SELECT |
| | | count(c.id) |
| | | FROM |
| | | mall_order_info c |
| | | where a.id = c.member_id |
| | | AND c.STATUS = 4 |
| | | ) orderCnt, |
| | | ifnull( |
| | | ( |
| | | SELECT |
| | | sum(b.amount) |
| | | FROM |
| | | mall_order_info b |
| | | where a.id = b.member_id |
| | | AND b.STATUS = 4 |
| | | ), |
| | | 0) amount |
| | | FROM mall_member a |
| | | <where> |
| | | and find_in_set(#{record.inviteId}, a.referrer_ids) |
| | | <if test="record != null" > |
| | | <if test="record.startTime != null and record.startTime != ''"> |
| | | and a.CREATED_TIME >= #{record.startTime} |
| | | </if> |
| | | <if test="record.endTime != null and record.endTime != ''"> |
| | | and a.CREATED_TIME <= #{record.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectSalePage" resultType="cc.mrbird.febs.mall.vo.sale.ApiSaleListInfoVo"> |
| | | SELECT |
| | | ( |
| | | SELECT |
| | | c.order_no |
| | | FROM |
| | | mall_order_info c |
| | | where a.order_id = c.id |
| | | ) orderNo, |
| | | a.CREATED_TIME createdTime, |
| | | a.cost_amount costAmount, |
| | | a.amount amount |
| | | FROM mall_achieve_record a |
| | | <where> |
| | | and a.member_id = #{record.memberId} |
| | | <if test="record != null" > |
| | | <if test="record.startTime != null and record.startTime != ''"> |
| | | and a.CREATED_TIME >= #{record.startTime} |
| | | </if> |
| | | <if test="record.endTime != null and record.endTime != ''"> |
| | | and a.CREATED_TIME <= #{record.endTime} |
| | | </if> |
| | | </if> |
| | | </where> |
| | | order by a.CREATED_TIME desc |
| | | </select> |
| | | |
| | | </mapper> |