| | |
| | | package cc.mrbird.febs.mall.dto; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | @ApiModelProperty(value = "页码", example = "1") |
| | | private Integer pageNum; |
| | | |
| | | @ApiModelProperty(value = "类型 1-全部 2-支出 3-收入") |
| | | @ApiModelProperty(value = "类型 1-静态收益 2-动态收益 3-代理收益 4-排名收益 5-董事收益 6-社区点补 7-推荐人收益 8-提现 9-转增 10-支付 11-退款") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "类型 1-全部 2-支出 3-收入") |
| | | private Integer inOrOut; |
| | | |
| | | @ApiModelProperty(value = "流水类型 1-余额 2-赠送积分 3-竞猜积分") |
| | | private Integer flowType; |
| | | |
| | |
| | | member.setCreatedTime(new Date()); |
| | | IPage<MallMember> list = this.baseMapper.selectRankListInPage(page, member); |
| | | |
| | | List<MallMember> records = list.getRecords(); |
| | | if (CollUtil.isNotEmpty(records)) { |
| | | BigDecimal amount = records.get(records.size() - 1).getAmount(); |
| | | page.setSize(999); |
| | | member.setAmount(amount); |
| | | |
| | | IPage<MallMember> amountList = this.baseMapper.selectRankListInPage(page, member); |
| | | if (CollUtil.isNotEmpty(amountList.getRecords())) { |
| | | Map<Long, Object> map = new HashMap<>(); |
| | | for (MallMember record : records) { |
| | | map.put(record.getId(), record); |
| | | } |
| | | |
| | | for (MallMember record : amountList.getRecords()) { |
| | | if (map.get(record.getId()) == null) { |
| | | records.add(record); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return records; |
| | | return list.getRecords(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | <select id="selectRankListInPage" resultType="cc.mrbird.febs.mall.entity.MallMember"> |
| | | select * from ( |
| | | select a.id, a.name, a.invite_id, a.avatar, sum(b.amount) amount from mall_member a, mall_order_info b |
| | | select a.id, a.name, a.invite_id, a.avatar, sum(b.amount) amount,max(order_time) orderTime from mall_member a, mall_order_info b |
| | | where a.id=b.member_id and b.status = 4 |
| | | <!-- 日 --> |
| | | <if test="record.query == '1'"> |
| | |
| | | and amount = #{record.amount} |
| | | </if> |
| | | group by a.id |
| | | ) a order by amount desc, a.id |
| | | ) a order by amount desc, a.orderTime desc |
| | | </select> |
| | | </mapper> |
| | |
| | | left join mall_member b on a.rt_member_id=b.id |
| | | left join data_dictionary_custom c on b.level = c.code and c.type='AGENT_LEVEL' |
| | | <where> |
| | | <if test="record.type == 3"> |
| | | <if test="record.inOrOut == 3"> |
| | | and a.amount > 0 |
| | | </if> |
| | | <if test="record.type == 2"> |
| | | <if test="record.inOrOut == 2"> |
| | | and 0 > a.amount |
| | | </if> |
| | | <if test="record.memberId != null"> |
| | |
| | | <if test="record.flowType != null and record.flowType != ''"> |
| | | and a.flow_type=#{record.flowType} |
| | | </if> |
| | | <if test="record.type != null and record.type != ''"> |
| | | and a.type=#{record.type} |
| | | </if> |
| | | </where> |
| | | order by a.created_time desc |
| | | </select> |