Compare commits
2 Commits
6de8507f30
...
02beddf5ee
| Author | SHA1 | Date |
|---|---|---|
|
|
02beddf5ee | |
|
|
6149dc5c6b |
|
|
@ -2,15 +2,9 @@ package com.bonus.canteen.core.report.statistics.account.controller;
|
||||||
|
|
||||||
import com.bonus.canteen.core.common.page.PageDTO;
|
import com.bonus.canteen.core.common.page.PageDTO;
|
||||||
import com.bonus.canteen.core.data.dataset.Executors;
|
import com.bonus.canteen.core.data.dataset.Executors;
|
||||||
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountConsumeCustParam;
|
import com.bonus.canteen.core.report.statistics.account.param.*;
|
||||||
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountFlowParam;
|
import com.bonus.canteen.core.report.statistics.account.service.*;
|
||||||
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountWalletConsumeParam;
|
import com.bonus.canteen.core.report.statistics.account.vo.*;
|
||||||
import com.bonus.canteen.core.report.statistics.account.service.ReportAccountConsumeSummaryService;
|
|
||||||
import com.bonus.canteen.core.report.statistics.account.service.ReportAccountFlowService;
|
|
||||||
import com.bonus.canteen.core.report.statistics.account.service.ReportAccountWalletConsumeService;
|
|
||||||
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeCustVO;
|
|
||||||
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountFlowVO;
|
|
||||||
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeVO;
|
|
||||||
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
||||||
import com.bonus.canteen.core.report.vo.ReportBaseTotalVO;
|
import com.bonus.canteen.core.report.vo.ReportBaseTotalVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
|
@ -42,10 +36,10 @@ public class ReportAccountController {
|
||||||
// private ReportAccountOperatorService reportAccountOperatorService;
|
// private ReportAccountOperatorService reportAccountOperatorService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private ReportAccountFixService reportAccountFixService;
|
// private ReportAccountFixService reportAccountFixService;
|
||||||
// @Autowired
|
@Autowired
|
||||||
// private ReportAccountConsumeSumTypeService reportAccountConsumeSumTypeService;
|
private ReportAccountConsumeSumTypeService reportAccountConsumeSumTypeService;
|
||||||
// @Autowired
|
@Autowired
|
||||||
// private ReportAccountConsumeSumOrgService reportAccountConsumeSumOrgService;
|
private ReportAccountConsumeSumOrgService reportAccountConsumeSumOrgService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReportAccountConsumeSummaryService reportAccountConsumeSummaryService;
|
private ReportAccountConsumeSummaryService reportAccountConsumeSummaryService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -99,20 +93,18 @@ public class ReportAccountController {
|
||||||
public ReportBaseTotalVO<ReportAccountConsumeCustVO> pageConsumeCustSummary(@RequestBody ReportAccountConsumeCustParam param) {
|
public ReportBaseTotalVO<ReportAccountConsumeCustVO> pageConsumeCustSummary(@RequestBody ReportAccountConsumeCustParam param) {
|
||||||
return this.reportAccountConsumeSummaryService.pageCustSummary(param);
|
return this.reportAccountConsumeSummaryService.pageCustSummary(param);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// @ApiOperation("消费汇总-用户类别汇总表")
|
@ApiOperation("消费汇总-用户类别汇总表")
|
||||||
// @PostMapping({"/consume/psn/page"})
|
@PostMapping({"/consume/psn/page"})
|
||||||
// public ReportBaseTotalVO<ReportAccountConsumeTypeVO> pageConsumeTypeSummary(@RequestBody LeRequest<ReportAccountConsumeTypeParam> request) {
|
public ReportBaseTotalVO<ReportAccountConsumeTypeVO> pageConsumeTypeSummary(@RequestBody ReportAccountConsumeTypeParam param) {
|
||||||
// ReportAccountConsumeTypeParam param = (ReportAccountConsumeTypeParam)request.getContent();
|
return this.reportAccountConsumeSumTypeService.pageTypeSummary(param);
|
||||||
// return this.reportAccountConsumeSumTypeService.pageTypeSummary(param);
|
}
|
||||||
// }
|
|
||||||
//
|
@ApiOperation("消费汇总-组织汇总表")
|
||||||
// @ApiOperation("消费汇总-组织汇总表")
|
@PostMapping({"/consume/organization/page"})
|
||||||
// @PostMapping({"/consume/organization/page"})
|
public ReportBaseTotalVO<ReportAccountConsumeOrganizationVO> pageConsumeOrganizationSummary(@RequestBody @Valid ReportAccountConsumeOrganizationParam param) {
|
||||||
// public ReportBaseTotalVO<ReportAccountConsumeOrganizationVO> pageConsumeOrganizationSummary(@RequestBody @Valid LeRequest<ReportAccountConsumeOrganizationParam> request) {
|
return this.reportAccountConsumeSumOrgService.pageOrganizationSummary(param);
|
||||||
// ReportAccountConsumeOrganizationParam param = (ReportAccountConsumeOrganizationParam)request.getContent();
|
}
|
||||||
// return this.reportAccountConsumeSumOrgService.pageOrganizationSummary(param);
|
|
||||||
// }
|
|
||||||
//
|
//
|
||||||
// @ApiOperation("充值渠道汇总")
|
// @ApiOperation("充值渠道汇总")
|
||||||
// @PostMapping({"/recharge/channel/page"})
|
// @PostMapping({"/recharge/channel/page"})
|
||||||
|
|
@ -185,18 +177,16 @@ public class ReportAccountController {
|
||||||
// ReportAccountWalletConsumeParam param = (ReportAccountWalletConsumeParam)request.getContent();
|
// ReportAccountWalletConsumeParam param = (ReportAccountWalletConsumeParam)request.getContent();
|
||||||
// return this.reportAccountWalletConsumeService.pageWalletSummary(param);
|
// return this.reportAccountWalletConsumeService.pageWalletSummary(param);
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// @ApiOperation("用户类别消费钱包汇总")
|
@ApiOperation("用户类别消费钱包汇总")
|
||||||
// @PostMapping({"/wallet/consume/type/page"})
|
@PostMapping({"/wallet/consume/type/page"})
|
||||||
// public ReportBaseTotalVO<ReportAccountWalletConsumeTypeVO> pageConsumeWalletTypeSummary(@RequestBody LeRequest<ReportAccountWalletConsumeParam> request) {
|
public ReportBaseTotalVO<ReportAccountWalletConsumeTypeVO> pageConsumeWalletTypeSummary(@RequestBody ReportAccountWalletConsumeParam param) {
|
||||||
// ReportAccountWalletConsumeParam param = (ReportAccountWalletConsumeParam)request.getContent();
|
return this.reportAccountWalletConsumeService.pageConsumeWalletTypeSummary(param);
|
||||||
// return this.reportAccountWalletConsumeService.pageConsumeWalletTypeSummary(param);
|
}
|
||||||
// }
|
|
||||||
//
|
@ApiOperation("用户组织消费钱包汇总")
|
||||||
// @ApiOperation("用户组织消费钱包汇总")
|
@PostMapping({"/wallet/consume/org/page"})
|
||||||
// @PostMapping({"/wallet/consume/org/page"})
|
public ReportBaseTotalVO<ReportAccountWalletConsumeOrganizationVO> pageConsumeWalletOrgSummary(@RequestBody ReportAccountWalletConsumeParam param) {
|
||||||
// public ReportBaseTotalVO<ReportAccountWalletConsumeOrganizationVO> pageConsumeWalletOrgSummary(@RequestBody LeRequest<ReportAccountWalletConsumeParam> request) {
|
return this.reportAccountWalletConsumeService.pageConsumeWalletOrgSummary(param);
|
||||||
// ReportAccountWalletConsumeParam param = (ReportAccountWalletConsumeParam)request.getContent();
|
}
|
||||||
// return this.reportAccountWalletConsumeService.pageConsumeWalletOrgSummary(param);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountConsumeSumOrg;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountConsumeOrganizationParam;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeOrganizationVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ReportAccountConsumeSumOrgMapper extends BaseMapper<ReportAccountConsumeSumOrg> {
|
||||||
|
List<ReportAccountConsumeOrganizationVO> listOrganizationSummary(@Param("param") ReportAccountConsumeOrganizationParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
|
|
||||||
|
List<ReportAccountConsumeOrganizationVO> listOrganizationSummaryByDay(@Param("param") ReportAccountConsumeOrganizationParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
|
|
||||||
|
ReportAccountConsumeOrganizationVO getOrganizationSummaryTotal(@Param("param") ReportAccountConsumeOrganizationParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
|
|
||||||
|
void initByPayTime(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountConsumeSumType;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountConsumeTypeParam;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeTypeVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ReportAccountConsumeSumTypeMapper extends BaseMapper<ReportAccountConsumeSumType> {
|
||||||
|
List<ReportAccountConsumeTypeVO> listTypeSummary(@Param("param") ReportAccountConsumeTypeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
|
|
||||||
|
List<ReportAccountConsumeTypeVO> listTypeSummaryByDay(@Param("param") ReportAccountConsumeTypeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
|
|
||||||
|
ReportAccountConsumeTypeVO getTypeSummaryTotal(@Param("param") ReportAccountConsumeTypeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
|
|
||||||
|
void initByPayTime(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
|
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
|
||||||
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountWalletConsume;
|
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountWalletConsume;
|
||||||
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountWalletConsumeParam;
|
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountWalletConsumeParam;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeTypeVO;
|
||||||
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeVO;
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
@ -26,10 +28,10 @@ public interface ReportAccountWalletConsumeMapper extends BaseMapper<ReportAccou
|
||||||
// List<ReportAccountWalletSummaryVO> listWalletSummary(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
// List<ReportAccountWalletSummaryVO> listWalletSummary(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
//
|
//
|
||||||
// ReportAccountWalletSummaryVO getWalletSummaryTotal(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
// ReportAccountWalletSummaryVO getWalletSummaryTotal(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
//
|
|
||||||
// List<ReportAccountWalletConsumeTypeVO> listTypeSummary(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
List<ReportAccountWalletConsumeTypeVO> listTypeSummary(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
//
|
|
||||||
// List<ReportAccountWalletConsumeOrganizationVO> listOrgSummary(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
List<ReportAccountWalletConsumeOrganizationVO> listOrgSummary(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
//
|
|
||||||
// ReportAccountWalletConsumeOrganizationVO getWalletOrgSummaryTotal(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
ReportAccountWalletConsumeOrganizationVO getWalletOrgSummaryTotal(@Param("param") ReportAccountWalletConsumeParam param, @Param("authPO") MgrUserAuthPO authPO);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,130 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@TableName("report_account_consume_sum_org")
|
||||||
|
@ApiModel("消费汇总-按组织汇总")
|
||||||
|
public class ReportAccountConsumeSumOrg {
|
||||||
|
@ApiModelProperty("统计日期")
|
||||||
|
private LocalDate statisticDate;
|
||||||
|
@ApiModelProperty("组织id")
|
||||||
|
private Long orgId;
|
||||||
|
@ApiModelProperty("消费次数")
|
||||||
|
private Integer consumeNum = 0;
|
||||||
|
@ApiModelProperty("消费金额")
|
||||||
|
private BigDecimal consumeAmount;
|
||||||
|
@ApiModelProperty("消费补扣次数")
|
||||||
|
private Integer consumeRepairNum;
|
||||||
|
@ApiModelProperty("消费补扣金额")
|
||||||
|
private BigDecimal consumeRepairAmount;
|
||||||
|
@ApiModelProperty("消费退款次数")
|
||||||
|
private Integer consumeRefundNum;
|
||||||
|
@ApiModelProperty("消费退款金额")
|
||||||
|
private BigDecimal consumeRefundAmount;
|
||||||
|
|
||||||
|
public LocalDate getStatisticDate() {
|
||||||
|
return this.statisticDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return this.orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeNum() {
|
||||||
|
return this.consumeNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeAmount() {
|
||||||
|
return this.consumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRepairNum() {
|
||||||
|
return this.consumeRepairNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRepairAmount() {
|
||||||
|
return this.consumeRepairAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRefundNum() {
|
||||||
|
return this.consumeRefundNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRefundAmount() {
|
||||||
|
return this.consumeRefundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setStatisticDate(final LocalDate statisticDate) {
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setOrgId(final Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setConsumeNum(final Integer consumeNum) {
|
||||||
|
this.consumeNum = consumeNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setConsumeAmount(final BigDecimal consumeAmount) {
|
||||||
|
this.consumeAmount = consumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setConsumeRepairNum(final Integer consumeRepairNum) {
|
||||||
|
this.consumeRepairNum = consumeRepairNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setConsumeRepairAmount(final BigDecimal consumeRepairAmount) {
|
||||||
|
this.consumeRepairAmount = consumeRepairAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setConsumeRefundNum(final Integer consumeRefundNum) {
|
||||||
|
this.consumeRefundNum = consumeRefundNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg setConsumeRefundAmount(final BigDecimal consumeRefundAmount) {
|
||||||
|
this.consumeRefundAmount = consumeRefundAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String var10000 = String.valueOf(this.getStatisticDate());
|
||||||
|
return "ReportAccountConsumeSumOrg(statisticDate=" + var10000 + ", orgId=" + this.getOrgId() + ", consumeNum=" + this.getConsumeNum() + ", consumeAmount=" + String.valueOf(this.getConsumeAmount()) + ", consumeRepairNum=" + this.getConsumeRepairNum() + ", consumeRepairAmount=" + String.valueOf(this.getConsumeRepairAmount()) + ", consumeRefundNum=" + this.getConsumeRefundNum() + ", consumeRefundAmount=" + String.valueOf(this.getConsumeRefundAmount()) + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg(final LocalDate statisticDate, final Long orgId, final Integer consumeNum, final BigDecimal consumeAmount, final Integer consumeRepairNum, final BigDecimal consumeRepairAmount, final Integer consumeRefundNum, final BigDecimal consumeRefundAmount) {
|
||||||
|
this.consumeAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRepairNum = 0;
|
||||||
|
this.consumeRepairAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRefundNum = 0;
|
||||||
|
this.consumeRefundAmount = BigDecimal.ZERO;
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
this.orgId = orgId;
|
||||||
|
this.consumeNum = consumeNum;
|
||||||
|
this.consumeAmount = consumeAmount;
|
||||||
|
this.consumeRepairNum = consumeRepairNum;
|
||||||
|
this.consumeRepairAmount = consumeRepairAmount;
|
||||||
|
this.consumeRefundNum = consumeRefundNum;
|
||||||
|
this.consumeRefundAmount = consumeRefundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumOrg() {
|
||||||
|
this.consumeAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRepairNum = 0;
|
||||||
|
this.consumeRepairAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRefundNum = 0;
|
||||||
|
this.consumeRefundAmount = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,142 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.model;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@TableName("report_account_consume_sum_type")
|
||||||
|
@ApiModel("消费汇总-按人员类别汇总")
|
||||||
|
public class ReportAccountConsumeSumType {
|
||||||
|
@ApiModelProperty("统计日期")
|
||||||
|
private LocalDate statisticDate;
|
||||||
|
@ApiModelProperty("组织id")
|
||||||
|
private Long orgId;
|
||||||
|
@ApiModelProperty("人员类别")
|
||||||
|
private Integer psnType;
|
||||||
|
@ApiModelProperty("消费次数")
|
||||||
|
private Integer consumeNum = 0;
|
||||||
|
@ApiModelProperty("消费金额")
|
||||||
|
private BigDecimal consumeAmount;
|
||||||
|
@ApiModelProperty("消费补扣次数")
|
||||||
|
private Integer consumeRepairNum;
|
||||||
|
@ApiModelProperty("消费补扣金额")
|
||||||
|
private BigDecimal consumeRepairAmount;
|
||||||
|
@ApiModelProperty("消费退款次数")
|
||||||
|
private Integer consumeRefundNum;
|
||||||
|
@ApiModelProperty("消费退款金额")
|
||||||
|
private BigDecimal consumeRefundAmount;
|
||||||
|
|
||||||
|
public LocalDate getStatisticDate() {
|
||||||
|
return this.statisticDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return this.orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPsnType() {
|
||||||
|
return this.psnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeNum() {
|
||||||
|
return this.consumeNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeAmount() {
|
||||||
|
return this.consumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRepairNum() {
|
||||||
|
return this.consumeRepairNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRepairAmount() {
|
||||||
|
return this.consumeRepairAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRefundNum() {
|
||||||
|
return this.consumeRefundNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRefundAmount() {
|
||||||
|
return this.consumeRefundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setStatisticDate(final LocalDate statisticDate) {
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setOrgId(final Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setPsnType(final Integer psnType) {
|
||||||
|
this.psnType = psnType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setConsumeNum(final Integer consumeNum) {
|
||||||
|
this.consumeNum = consumeNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setConsumeAmount(final BigDecimal consumeAmount) {
|
||||||
|
this.consumeAmount = consumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setConsumeRepairNum(final Integer consumeRepairNum) {
|
||||||
|
this.consumeRepairNum = consumeRepairNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setConsumeRepairAmount(final BigDecimal consumeRepairAmount) {
|
||||||
|
this.consumeRepairAmount = consumeRepairAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setConsumeRefundNum(final Integer consumeRefundNum) {
|
||||||
|
this.consumeRefundNum = consumeRefundNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType setConsumeRefundAmount(final BigDecimal consumeRefundAmount) {
|
||||||
|
this.consumeRefundAmount = consumeRefundAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String var10000 = String.valueOf(this.getStatisticDate());
|
||||||
|
return "ReportAccountConsumeSumType(statisticDate=" + var10000 + ", orgId=" + this.getOrgId() + ", psnType=" + this.getPsnType() + ", consumeNum=" + this.getConsumeNum() + ", consumeAmount=" + String.valueOf(this.getConsumeAmount()) + ", consumeRepairNum=" + this.getConsumeRepairNum() + ", consumeRepairAmount=" + String.valueOf(this.getConsumeRepairAmount()) + ", consumeRefundNum=" + this.getConsumeRefundNum() + ", consumeRefundAmount=" + String.valueOf(this.getConsumeRefundAmount()) + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType(final LocalDate statisticDate, final Long orgId, final Integer psnType, final Integer consumeNum, final BigDecimal consumeAmount, final Integer consumeRepairNum, final BigDecimal consumeRepairAmount, final Integer consumeRefundNum, final BigDecimal consumeRefundAmount) {
|
||||||
|
this.consumeAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRepairNum = 0;
|
||||||
|
this.consumeRepairAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRefundNum = 0;
|
||||||
|
this.consumeRefundAmount = BigDecimal.ZERO;
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
this.orgId = orgId;
|
||||||
|
this.psnType = psnType;
|
||||||
|
this.consumeNum = consumeNum;
|
||||||
|
this.consumeAmount = consumeAmount;
|
||||||
|
this.consumeRepairNum = consumeRepairNum;
|
||||||
|
this.consumeRepairAmount = consumeRepairAmount;
|
||||||
|
this.consumeRefundNum = consumeRefundNum;
|
||||||
|
this.consumeRefundAmount = consumeRefundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeSumType() {
|
||||||
|
this.consumeAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRepairNum = 0;
|
||||||
|
this.consumeRepairAmount = BigDecimal.ZERO;
|
||||||
|
this.consumeRefundNum = 0;
|
||||||
|
this.consumeRefundAmount = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.param;
|
||||||
|
|
||||||
|
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@ApiModel("消费汇总-组织汇总入参")
|
||||||
|
public class ReportAccountConsumeOrganizationParam extends ReportBaseParam {
|
||||||
|
@ApiModelProperty("组织")
|
||||||
|
private @NotEmpty(
|
||||||
|
message = "组织不能为空"
|
||||||
|
) List<Long> orgIdList;
|
||||||
|
@ApiModelProperty("组织层级")
|
||||||
|
private @NotNull(
|
||||||
|
message = "组织层级不能为空"
|
||||||
|
) Integer orgLevel;
|
||||||
|
|
||||||
|
public List<Long> getOrgIdList() {
|
||||||
|
return this.orgIdList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOrgLevel() {
|
||||||
|
return this.orgLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationParam setOrgIdList(final List<Long> orgIdList) {
|
||||||
|
this.orgIdList = orgIdList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationParam setOrgLevel(final Integer orgLevel) {
|
||||||
|
this.orgLevel = orgLevel;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String var10000 = String.valueOf(this.getOrgIdList());
|
||||||
|
return "ReportAccountConsumeOrganizationParam(orgIdList=" + var10000 + ", orgLevel=" + this.getOrgLevel() + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationParam(final List<Long> orgIdList, final Integer orgLevel) {
|
||||||
|
this.orgIdList = orgIdList;
|
||||||
|
this.orgLevel = orgLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationParam() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.param;
|
||||||
|
|
||||||
|
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@ApiModel("消费汇总-人员类别汇总入参")
|
||||||
|
public class ReportAccountConsumeTypeParam extends ReportBaseParam {
|
||||||
|
@ApiModelProperty("人员类别集合")
|
||||||
|
private List<Integer> psnTypeList;
|
||||||
|
|
||||||
|
public List<Integer> getPsnTypeList() {
|
||||||
|
return this.psnTypeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeParam setPsnTypeList(final List<Integer> psnTypeList) {
|
||||||
|
this.psnTypeList = psnTypeList;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return "ReportAccountConsumeTypeParam(psnTypeList=" + String.valueOf(this.getPsnTypeList()) + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeParam(final List<Integer> psnTypeList) {
|
||||||
|
this.psnTypeList = psnTypeList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeParam() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.bonus.canteen.core.account.v3.mq.send.model.RepAccMqModel;
|
||||||
|
import com.bonus.canteen.core.auth.api.MgrAuthApi;
|
||||||
|
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
|
||||||
|
import com.bonus.canteen.core.common.page.PageVO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.mapper.ReportAccountConsumeSumOrgMapper;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountConsumeSumOrg;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountConsumeOrganizationParam;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeOrganizationVO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.config.mq.ReportAccountConsumeService;
|
||||||
|
import com.bonus.canteen.core.report.statistics.constants.ReportSumTypeEnum;
|
||||||
|
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
||||||
|
import com.bonus.canteen.core.report.vo.ReportBaseTotalVO;
|
||||||
|
import com.github.pagehelper.page.PageMethod;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.invoke.SerializedLambda;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ReportAccountConsumeSumOrgService extends ServiceImpl<ReportAccountConsumeSumOrgMapper, ReportAccountConsumeSumOrg> implements ReportAccountConsumeService {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(ReportAccountConsumeSumOrgService.class);
|
||||||
|
private static final int ORDER = 16;
|
||||||
|
@Autowired
|
||||||
|
private MgrAuthApi mgrAuthApi;
|
||||||
|
|
||||||
|
public int getOrder() {
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportBaseTotalVO<ReportAccountConsumeOrganizationVO> pageOrganizationSummary(ReportAccountConsumeOrganizationParam param) {
|
||||||
|
MgrUserAuthPO authPO = this.mgrAuthApi.getUserAuthPO();
|
||||||
|
PageMethod.startPage(param.getPage());
|
||||||
|
List<ReportAccountConsumeOrganizationVO> list = Objects.equals(param.getSumType(), ReportSumTypeEnum.PRE_TIME_DAY.key()) ? ((ReportAccountConsumeSumOrgMapper)this.baseMapper).listOrganizationSummaryByDay(param, authPO) : ((ReportAccountConsumeSumOrgMapper)this.baseMapper).listOrganizationSummary(param, authPO);
|
||||||
|
ReportAccountConsumeOrganizationVO total = this.getReportAccountConsumeOrganizationVO(param, authPO);
|
||||||
|
return (new ReportBaseTotalVO()).setResultPage(PageVO.of(list)).setTotalLine(total);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO getReportAccountConsumeOrganizationVO(ReportAccountConsumeOrganizationParam param, MgrUserAuthPO authPO) {
|
||||||
|
if (Objects.isNull(authPO)) {
|
||||||
|
authPO = this.mgrAuthApi.getUserAuthPO();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ReportAccountConsumeOrganizationVO)Optional.ofNullable(((ReportAccountConsumeSumOrgMapper)this.baseMapper).getOrganizationSummaryTotal(param, authPO)).orElse(new ReportAccountConsumeOrganizationVO());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void consume(RepAccMqModel payload) {
|
||||||
|
log.info("【报表-账户】报表MQ消费-消费汇总表-按组织:开始");
|
||||||
|
log.info("【报表-账户】报表MQ消费-消费汇总表-按组织:结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fix(ReportBaseParam param) {
|
||||||
|
log.info("【报表-账户-修复】报表MQ消费-消费汇总表-按组织:开始");
|
||||||
|
LocalDateTime startTime = param.getStartDate().atStartOfDay();
|
||||||
|
LocalDateTime endTime = param.getEndDate().atTime(23, 59, 59);
|
||||||
|
this.remove(Wrappers.lambdaQuery(ReportAccountConsumeSumOrg.class).between(ReportAccountConsumeSumOrg::getStatisticDate, param.getStartDate(), param.getEndDate()));
|
||||||
|
((ReportAccountConsumeSumOrgMapper)this.baseMapper).initByPayTime(startTime, endTime);
|
||||||
|
log.info("【报表-账户-修复】报表MQ消费-消费汇总表-按组织:结束");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.bonus.canteen.core.account.v3.mq.send.model.RepAccMqModel;
|
||||||
|
import com.bonus.canteen.core.auth.api.MgrAuthApi;
|
||||||
|
import com.bonus.canteen.core.auth.po.MgrUserAuthPO;
|
||||||
|
import com.bonus.canteen.core.common.page.PageVO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.mapper.ReportAccountConsumeSumTypeMapper;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountConsumeSumType;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountConsumeTypeParam;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeTypeVO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.config.mq.ReportAccountConsumeService;
|
||||||
|
import com.bonus.canteen.core.report.statistics.constants.ReportSumTypeEnum;
|
||||||
|
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
||||||
|
import com.bonus.canteen.core.report.vo.ReportBaseTotalVO;
|
||||||
|
import com.github.pagehelper.page.PageMethod;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.lang.invoke.SerializedLambda;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ReportAccountConsumeSumTypeService extends ServiceImpl<ReportAccountConsumeSumTypeMapper, ReportAccountConsumeSumType> implements ReportAccountConsumeService {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(ReportAccountConsumeSumTypeService.class);
|
||||||
|
private static final int ORDER = 17;
|
||||||
|
@Autowired
|
||||||
|
private MgrAuthApi mgrAuthApi;
|
||||||
|
|
||||||
|
public int getOrder() {
|
||||||
|
return 17;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportBaseTotalVO<ReportAccountConsumeTypeVO> pageTypeSummary(ReportAccountConsumeTypeParam param) {
|
||||||
|
MgrUserAuthPO authPO = this.mgrAuthApi.getUserAuthPO();
|
||||||
|
PageMethod.startPage(param.getPage());
|
||||||
|
List<ReportAccountConsumeTypeVO> list = Objects.equals(param.getSumType(), ReportSumTypeEnum.PRE_TIME_DAY.key()) ? ((ReportAccountConsumeSumTypeMapper)this.baseMapper).listTypeSummaryByDay(param, authPO) : ((ReportAccountConsumeSumTypeMapper)this.baseMapper).listTypeSummary(param, authPO);
|
||||||
|
ReportAccountConsumeTypeVO total = this.getReportAccountConsumeTypeVO(param, authPO);
|
||||||
|
return (new ReportBaseTotalVO()).setResultPage(PageVO.of(list)).setTotalLine(total);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO getReportAccountConsumeTypeVO(ReportAccountConsumeTypeParam param, MgrUserAuthPO authPO) {
|
||||||
|
if (Objects.isNull(authPO)) {
|
||||||
|
authPO = this.mgrAuthApi.getUserAuthPO();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ReportAccountConsumeTypeVO)Optional.ofNullable(((ReportAccountConsumeSumTypeMapper)this.baseMapper).getTypeSummaryTotal(param, authPO)).orElse(new ReportAccountConsumeTypeVO());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void consume(RepAccMqModel payload) {
|
||||||
|
log.info("【报表-账户】报表MQ消费-消费汇总表-按人员类别:开始");
|
||||||
|
log.info("【报表-账户】报表MQ消费-消费汇总表-按人员类别:结束");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void fix(ReportBaseParam param) {
|
||||||
|
log.info("【报表-账户-修复】报表MQ消费-消费汇总表-按人员类别:开始");
|
||||||
|
LocalDateTime startTime = param.getStartDate().atStartOfDay();
|
||||||
|
LocalDateTime endTime = param.getEndDate().atTime(23, 59, 59);
|
||||||
|
this.remove(Wrappers.lambdaQuery(ReportAccountConsumeSumType.class).between(ReportAccountConsumeSumType::getStatisticDate, param.getStartDate(), param.getEndDate()));
|
||||||
|
((ReportAccountConsumeSumTypeMapper)this.baseMapper).initByPayTime(startTime, endTime);
|
||||||
|
log.info("【报表-账户-修复】报表MQ消费-消费汇总表-按人员类别:结束");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,6 +14,8 @@ import com.bonus.canteen.core.common.page.PageVO;
|
||||||
import com.bonus.canteen.core.report.statistics.account.mapper.ReportAccountWalletConsumeMapper;
|
import com.bonus.canteen.core.report.statistics.account.mapper.ReportAccountWalletConsumeMapper;
|
||||||
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountWalletConsume;
|
import com.bonus.canteen.core.report.statistics.account.model.ReportAccountWalletConsume;
|
||||||
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountWalletConsumeParam;
|
import com.bonus.canteen.core.report.statistics.account.param.ReportAccountWalletConsumeParam;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO;
|
||||||
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeTypeVO;
|
||||||
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeVO;
|
import com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeVO;
|
||||||
import com.bonus.canteen.core.report.statistics.config.mq.ReportAccountConsumeService;
|
import com.bonus.canteen.core.report.statistics.config.mq.ReportAccountConsumeService;
|
||||||
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
import com.bonus.canteen.core.report.statistics.param.ReportBaseParam;
|
||||||
|
|
@ -129,29 +131,29 @@ public class ReportAccountWalletConsumeService extends ServiceImpl<ReportAccount
|
||||||
//
|
//
|
||||||
// return (ReportAccountWalletSummaryVO)Optional.ofNullable(((ReportAccountWalletConsumeMapper)this.baseMapper).getWalletSummaryTotal(param, authPO)).orElse(new ReportAccountWalletSummaryVO());
|
// return (ReportAccountWalletSummaryVO)Optional.ofNullable(((ReportAccountWalletConsumeMapper)this.baseMapper).getWalletSummaryTotal(param, authPO)).orElse(new ReportAccountWalletSummaryVO());
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// public ReportBaseTotalVO<ReportAccountWalletConsumeTypeVO> pageConsumeWalletTypeSummary(ReportAccountWalletConsumeParam param) {
|
public ReportBaseTotalVO<ReportAccountWalletConsumeTypeVO> pageConsumeWalletTypeSummary(ReportAccountWalletConsumeParam param) {
|
||||||
// MgrUserAuthPO authPO = this.mgrAuthApi.getUserAuthPO();
|
MgrUserAuthPO authPO = this.mgrAuthApi.getUserAuthPO();
|
||||||
// PageMethod.startPage(param.getPage());
|
PageMethod.startPage(param.getPage());
|
||||||
// List<ReportAccountWalletConsumeTypeVO> list = ((ReportAccountWalletConsumeMapper)this.baseMapper).listTypeSummary(param, authPO);
|
List<ReportAccountWalletConsumeTypeVO> list = ((ReportAccountWalletConsumeMapper)this.baseMapper).listTypeSummary(param, authPO);
|
||||||
// ReportAccountWalletConsumeVO total = this.getReportAccountWalletConsumeVO(param, authPO);
|
ReportAccountWalletConsumeVO total = this.getReportAccountWalletConsumeVO(param, authPO);
|
||||||
// ReportAccountWalletConsumeTypeVO typeTotal = (ReportAccountWalletConsumeTypeVO) LeBeanUtil.copyCreateProperties(total, ReportAccountWalletConsumeTypeVO.class);
|
ReportAccountWalletConsumeTypeVO typeTotal = (ReportAccountWalletConsumeTypeVO) LeBeanUtil.copyCreateProperties(total, ReportAccountWalletConsumeTypeVO.class);
|
||||||
// return (new ReportBaseTotalVO()).setResultPage(PageVO.of(list)).setTotalLine(typeTotal);
|
return (new ReportBaseTotalVO()).setResultPage(PageVO.of(list)).setTotalLine(typeTotal);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public ReportBaseTotalVO<ReportAccountWalletConsumeOrganizationVO> pageConsumeWalletOrgSummary(ReportAccountWalletConsumeParam param) {
|
public ReportBaseTotalVO<ReportAccountWalletConsumeOrganizationVO> pageConsumeWalletOrgSummary(ReportAccountWalletConsumeParam param) {
|
||||||
// MgrUserAuthPO authPO = this.mgrAuthApi.getUserAuthPO();
|
MgrUserAuthPO authPO = this.mgrAuthApi.getUserAuthPO();
|
||||||
// PageMethod.startPage(param.getPage());
|
PageMethod.startPage(param.getPage());
|
||||||
// List<ReportAccountWalletConsumeOrganizationVO> list = ((ReportAccountWalletConsumeMapper)this.baseMapper).listOrgSummary(param, authPO);
|
List<ReportAccountWalletConsumeOrganizationVO> list = ((ReportAccountWalletConsumeMapper)this.baseMapper).listOrgSummary(param, authPO);
|
||||||
// ReportAccountWalletConsumeOrganizationVO total = this.getReportAccountWalletOrgConsumeVO(param, authPO);
|
ReportAccountWalletConsumeOrganizationVO total = this.getReportAccountWalletOrgConsumeVO(param, authPO);
|
||||||
// return (new ReportBaseTotalVO()).setResultPage(PageVO.of(list)).setTotalLine(total);
|
return (new ReportBaseTotalVO()).setResultPage(PageVO.of(list)).setTotalLine(total);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public ReportAccountWalletConsumeOrganizationVO getReportAccountWalletOrgConsumeVO(ReportAccountWalletConsumeParam param, MgrUserAuthPO authPO) {
|
public ReportAccountWalletConsumeOrganizationVO getReportAccountWalletOrgConsumeVO(ReportAccountWalletConsumeParam param, MgrUserAuthPO authPO) {
|
||||||
// if (ObjectUtil.isEmpty(authPO)) {
|
if (ObjectUtil.isEmpty(authPO)) {
|
||||||
// authPO = this.mgrAuthApi.getUserAuthPO();
|
authPO = this.mgrAuthApi.getUserAuthPO();
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// return (ReportAccountWalletConsumeOrganizationVO)Optional.ofNullable(((ReportAccountWalletConsumeMapper)this.baseMapper).getWalletOrgSummaryTotal(param, authPO)).orElse(new ReportAccountWalletConsumeOrganizationVO());
|
return (ReportAccountWalletConsumeOrganizationVO)Optional.ofNullable(((ReportAccountWalletConsumeMapper)this.baseMapper).getWalletOrgSummaryTotal(param, authPO)).orElse(new ReportAccountWalletConsumeOrganizationVO());
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,200 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||||
|
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||||
|
import com.bonus.canteen.core.common.utils.CustomNumberConverter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@ContentRowHeight(25)
|
||||||
|
@HeadRowHeight(25)
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ApiModel("消费汇总-组织汇总表")
|
||||||
|
public class ReportAccountConsumeOrganizationVO {
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"统计日期"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("统计日期")
|
||||||
|
private LocalDate statisticDate;
|
||||||
|
@ApiModelProperty("组织id")
|
||||||
|
private Long orgId;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"组织名称"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("组织名称")
|
||||||
|
private String orgName;
|
||||||
|
// @ExcelProperty(
|
||||||
|
// value = {"组织全称"},
|
||||||
|
// order = 2
|
||||||
|
// )
|
||||||
|
// @ApiModelProperty("组织全称")
|
||||||
|
// private String orgFullName;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费", "次数"},
|
||||||
|
order = 3
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费次数")
|
||||||
|
private Integer consumeNum;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费", "金额"},
|
||||||
|
order = 4,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费金额")
|
||||||
|
private BigDecimal consumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费补扣", "次数"},
|
||||||
|
order = 5
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费补扣次数")
|
||||||
|
private Integer consumeRepairNum;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费补扣", "金额"},
|
||||||
|
order = 6,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费补扣金额")
|
||||||
|
private BigDecimal consumeRepairAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费退款", "次数"},
|
||||||
|
order = 7
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费退款次数")
|
||||||
|
private Integer consumeRefundNum;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费退款", "金额"},
|
||||||
|
order = 8,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费退款金额")
|
||||||
|
private BigDecimal consumeRefundAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"合计消费金额"},
|
||||||
|
order = 9,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("合计消费金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
@ApiModelProperty("查询时间段内,是否有变化数据")
|
||||||
|
private Integer changeFlag;
|
||||||
|
|
||||||
|
public LocalDate getStatisticDate() {
|
||||||
|
return this.statisticDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return this.orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrgName() {
|
||||||
|
return this.orgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// public String getOrgFullName() {
|
||||||
|
// return this.orgFullName;
|
||||||
|
// }
|
||||||
|
|
||||||
|
public Integer getConsumeNum() {
|
||||||
|
return this.consumeNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeAmount() {
|
||||||
|
return this.consumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRepairNum() {
|
||||||
|
return this.consumeRepairNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRepairAmount() {
|
||||||
|
return this.consumeRepairAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRefundNum() {
|
||||||
|
return this.consumeRefundNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRefundAmount() {
|
||||||
|
return this.consumeRefundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalAmount() {
|
||||||
|
return this.totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getChangeFlag() {
|
||||||
|
return this.changeFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setStatisticDate(final LocalDate statisticDate) {
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setOrgId(final Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setOrgName(final String orgName) {
|
||||||
|
this.orgName = orgName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// public ReportAccountConsumeOrganizationVO setOrgFullName(final String orgFullName) {
|
||||||
|
// this.orgFullName = orgFullName;
|
||||||
|
// return this;
|
||||||
|
// }
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setConsumeNum(final Integer consumeNum) {
|
||||||
|
this.consumeNum = consumeNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setConsumeAmount(final BigDecimal consumeAmount) {
|
||||||
|
this.consumeAmount = consumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setConsumeRepairNum(final Integer consumeRepairNum) {
|
||||||
|
this.consumeRepairNum = consumeRepairNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setConsumeRepairAmount(final BigDecimal consumeRepairAmount) {
|
||||||
|
this.consumeRepairAmount = consumeRepairAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setConsumeRefundNum(final Integer consumeRefundNum) {
|
||||||
|
this.consumeRefundNum = consumeRefundNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setConsumeRefundAmount(final BigDecimal consumeRefundAmount) {
|
||||||
|
this.consumeRefundAmount = consumeRefundAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setTotalAmount(final BigDecimal totalAmount) {
|
||||||
|
this.totalAmount = totalAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeOrganizationVO setChangeFlag(final Integer changeFlag) {
|
||||||
|
this.changeFlag = changeFlag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String var10000 = String.valueOf(this.getStatisticDate());
|
||||||
|
return "ReportAccountConsumeOrganizationVO(statisticDate=" + var10000 + ", orgId=" + this.getOrgId() + ", orgName=" + this.getOrgName() + ", consumeNum=" + this.getConsumeNum() + ", consumeAmount=" + String.valueOf(this.getConsumeAmount()) + ", consumeRepairNum=" + this.getConsumeRepairNum() + ", consumeRepairAmount=" + String.valueOf(this.getConsumeRepairAmount()) + ", consumeRefundNum=" + this.getConsumeRefundNum() + ", consumeRefundAmount=" + String.valueOf(this.getConsumeRefundAmount()) + ", totalAmount=" + String.valueOf(this.getTotalAmount()) + ", changeFlag=" + this.getChangeFlag() + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,185 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||||
|
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||||
|
import com.bonus.canteen.core.common.utils.CustomNumberConverter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@ContentRowHeight(25)
|
||||||
|
@HeadRowHeight(25)
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ApiModel("消费汇总-人员类别汇总表")
|
||||||
|
public class ReportAccountConsumeTypeVO {
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"统计日期"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("统计日期")
|
||||||
|
private LocalDate statisticDate;
|
||||||
|
@ApiModelProperty("人员类别")
|
||||||
|
private Integer psnType;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"用户类别"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("人员类别名称")
|
||||||
|
private String psnTypeName;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费", "次数"},
|
||||||
|
order = 2
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费次数")
|
||||||
|
private Integer consumeNum;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费", "金额"},
|
||||||
|
order = 3,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费金额")
|
||||||
|
private BigDecimal consumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费补扣", "次数"},
|
||||||
|
order = 4
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费补扣次数")
|
||||||
|
private Integer consumeRepairNum;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费补扣", "金额"},
|
||||||
|
order = 5,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费补扣金额")
|
||||||
|
private BigDecimal consumeRepairAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费退款", "次数"},
|
||||||
|
order = 6
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费退款次数")
|
||||||
|
private Integer consumeRefundNum;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"消费退款", "金额"},
|
||||||
|
order = 7,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("消费退款金额")
|
||||||
|
private BigDecimal consumeRefundAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"合计消费金额"},
|
||||||
|
order = 8,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("合计消费金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
@ApiModelProperty("查询时间段内,是否有变化数据")
|
||||||
|
private Integer changeFlag;
|
||||||
|
|
||||||
|
public LocalDate getStatisticDate() {
|
||||||
|
return this.statisticDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPsnType() {
|
||||||
|
return this.psnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPsnTypeName() {
|
||||||
|
return this.psnTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeNum() {
|
||||||
|
return this.consumeNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeAmount() {
|
||||||
|
return this.consumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRepairNum() {
|
||||||
|
return this.consumeRepairNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRepairAmount() {
|
||||||
|
return this.consumeRepairAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getConsumeRefundNum() {
|
||||||
|
return this.consumeRefundNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getConsumeRefundAmount() {
|
||||||
|
return this.consumeRefundAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalAmount() {
|
||||||
|
return this.totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getChangeFlag() {
|
||||||
|
return this.changeFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setStatisticDate(final LocalDate statisticDate) {
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setPsnType(final Integer psnType) {
|
||||||
|
this.psnType = psnType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setPsnTypeName(final String psnTypeName) {
|
||||||
|
this.psnTypeName = psnTypeName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setConsumeNum(final Integer consumeNum) {
|
||||||
|
this.consumeNum = consumeNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setConsumeAmount(final BigDecimal consumeAmount) {
|
||||||
|
this.consumeAmount = consumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setConsumeRepairNum(final Integer consumeRepairNum) {
|
||||||
|
this.consumeRepairNum = consumeRepairNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setConsumeRepairAmount(final BigDecimal consumeRepairAmount) {
|
||||||
|
this.consumeRepairAmount = consumeRepairAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setConsumeRefundNum(final Integer consumeRefundNum) {
|
||||||
|
this.consumeRefundNum = consumeRefundNum;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setConsumeRefundAmount(final BigDecimal consumeRefundAmount) {
|
||||||
|
this.consumeRefundAmount = consumeRefundAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setTotalAmount(final BigDecimal totalAmount) {
|
||||||
|
this.totalAmount = totalAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountConsumeTypeVO setChangeFlag(final Integer changeFlag) {
|
||||||
|
this.changeFlag = changeFlag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String var10000 = String.valueOf(this.getStatisticDate());
|
||||||
|
return "ReportAccountConsumeTypeVO(statisticDate=" + var10000 + ", psnType=" + this.getPsnType() + ", psnTypeName=" + this.getPsnTypeName() + ", consumeNum=" + this.getConsumeNum() + ", consumeAmount=" + String.valueOf(this.getConsumeAmount()) + ", consumeRepairNum=" + this.getConsumeRepairNum() + ", consumeRepairAmount=" + String.valueOf(this.getConsumeRepairAmount()) + ", consumeRefundNum=" + this.getConsumeRefundNum() + ", consumeRefundAmount=" + String.valueOf(this.getConsumeRefundAmount()) + ", totalAmount=" + String.valueOf(this.getTotalAmount()) + ", changeFlag=" + this.getChangeFlag() + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,144 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||||
|
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||||
|
import com.bonus.canteen.core.common.utils.CustomNumberConverter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@ContentRowHeight(25)
|
||||||
|
@HeadRowHeight(25)
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ApiModel("消费汇总-用户组织钱包消费汇总")
|
||||||
|
public class ReportAccountWalletConsumeOrganizationVO {
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"统计日期"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("统计日期")
|
||||||
|
private LocalDate statisticDate;
|
||||||
|
@ApiModelProperty("组织id")
|
||||||
|
private Long orgId;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"组织名称"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("组织名称")
|
||||||
|
private String orgName;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"组织全称"},
|
||||||
|
order = 2
|
||||||
|
)
|
||||||
|
@ApiModelProperty("组织全称")
|
||||||
|
private String orgFullName;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"个人钱包消费金额"},
|
||||||
|
order = 7,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("个人钱包消费金额")
|
||||||
|
private BigDecimal walletConsumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"补贴钱包消费金额"},
|
||||||
|
order = 8,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("个人钱包消费金额")
|
||||||
|
private BigDecimal subsidyConsumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"红包消费金额"},
|
||||||
|
order = 9,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("个人钱包消费金额")
|
||||||
|
private BigDecimal luckConsumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"合计金额"},
|
||||||
|
order = 10,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("合计金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
public LocalDate getStatisticDate() {
|
||||||
|
return this.statisticDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getOrgId() {
|
||||||
|
return this.orgId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrgName() {
|
||||||
|
return this.orgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrgFullName() {
|
||||||
|
return this.orgFullName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getWalletConsumeAmount() {
|
||||||
|
return this.walletConsumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getSubsidyConsumeAmount() {
|
||||||
|
return this.subsidyConsumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getLuckConsumeAmount() {
|
||||||
|
return this.luckConsumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalAmount() {
|
||||||
|
return this.totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setStatisticDate(final LocalDate statisticDate) {
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setOrgId(final Long orgId) {
|
||||||
|
this.orgId = orgId;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setOrgName(final String orgName) {
|
||||||
|
this.orgName = orgName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setOrgFullName(final String orgFullName) {
|
||||||
|
this.orgFullName = orgFullName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setWalletConsumeAmount(final BigDecimal walletConsumeAmount) {
|
||||||
|
this.walletConsumeAmount = walletConsumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setSubsidyConsumeAmount(final BigDecimal subsidyConsumeAmount) {
|
||||||
|
this.subsidyConsumeAmount = subsidyConsumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setLuckConsumeAmount(final BigDecimal luckConsumeAmount) {
|
||||||
|
this.luckConsumeAmount = luckConsumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeOrganizationVO setTotalAmount(final BigDecimal totalAmount) {
|
||||||
|
this.totalAmount = totalAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String var10000 = String.valueOf(this.getStatisticDate());
|
||||||
|
return "ReportAccountWalletConsumeOrganizationVO(statisticDate=" + var10000 + ", orgId=" + this.getOrgId() + ", orgName=" + this.getOrgName() + ", orgFullName=" + this.getOrgFullName() + ", walletConsumeAmount=" + String.valueOf(this.getWalletConsumeAmount()) + ", subsidyConsumeAmount=" + String.valueOf(this.getSubsidyConsumeAmount()) + ", luckConsumeAmount=" + String.valueOf(this.getLuckConsumeAmount()) + ", totalAmount=" + String.valueOf(this.getTotalAmount()) + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.bonus.canteen.core.report.statistics.account.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||||
|
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||||
|
import com.bonus.canteen.core.common.utils.CustomNumberConverter;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
@ContentRowHeight(25)
|
||||||
|
@HeadRowHeight(25)
|
||||||
|
@ColumnWidth(25)
|
||||||
|
@ApiModel("消费汇总-用户类别钱包消费汇总")
|
||||||
|
public class ReportAccountWalletConsumeTypeVO {
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"统计日期"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("统计日期")
|
||||||
|
private LocalDate statisticDate;
|
||||||
|
@ApiModelProperty("人员类别")
|
||||||
|
private Integer psnType;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"用户类别"},
|
||||||
|
order = 1
|
||||||
|
)
|
||||||
|
@ApiModelProperty("人员类别名称")
|
||||||
|
private String psnTypeName;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"个人钱包消费金额"},
|
||||||
|
order = 7,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("个人钱包消费金额")
|
||||||
|
private BigDecimal walletConsumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"补贴钱包消费金额"},
|
||||||
|
order = 8,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("个人钱包消费金额")
|
||||||
|
private BigDecimal subsidyConsumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"红包消费金额"},
|
||||||
|
order = 9,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("个人钱包消费金额")
|
||||||
|
private BigDecimal luckConsumeAmount;
|
||||||
|
@ExcelProperty(
|
||||||
|
value = {"合计金额"},
|
||||||
|
order = 10,
|
||||||
|
converter = CustomNumberConverter.class
|
||||||
|
)
|
||||||
|
@ApiModelProperty("合计金额")
|
||||||
|
private BigDecimal totalAmount;
|
||||||
|
|
||||||
|
public LocalDate getStatisticDate() {
|
||||||
|
return this.statisticDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPsnType() {
|
||||||
|
return this.psnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPsnTypeName() {
|
||||||
|
return this.psnTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getWalletConsumeAmount() {
|
||||||
|
return this.walletConsumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getSubsidyConsumeAmount() {
|
||||||
|
return this.subsidyConsumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getLuckConsumeAmount() {
|
||||||
|
return this.luckConsumeAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getTotalAmount() {
|
||||||
|
return this.totalAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeTypeVO setStatisticDate(final LocalDate statisticDate) {
|
||||||
|
this.statisticDate = statisticDate;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeTypeVO setPsnType(final Integer psnType) {
|
||||||
|
this.psnType = psnType;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeTypeVO setPsnTypeName(final String psnTypeName) {
|
||||||
|
this.psnTypeName = psnTypeName;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeTypeVO setWalletConsumeAmount(final BigDecimal walletConsumeAmount) {
|
||||||
|
this.walletConsumeAmount = walletConsumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeTypeVO setSubsidyConsumeAmount(final BigDecimal subsidyConsumeAmount) {
|
||||||
|
this.subsidyConsumeAmount = subsidyConsumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeTypeVO setLuckConsumeAmount(final BigDecimal luckConsumeAmount) {
|
||||||
|
this.luckConsumeAmount = luckConsumeAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReportAccountWalletConsumeTypeVO setTotalAmount(final BigDecimal totalAmount) {
|
||||||
|
this.totalAmount = totalAmount;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
String var10000 = String.valueOf(this.getStatisticDate());
|
||||||
|
return "ReportAccountWalletConsumeTypeVO(statisticDate=" + var10000 + ", psnType=" + this.getPsnType() + ", psnTypeName=" + this.getPsnTypeName() + ", walletConsumeAmount=" + String.valueOf(this.getWalletConsumeAmount()) + ", subsidyConsumeAmount=" + String.valueOf(this.getSubsidyConsumeAmount()) + ", luckConsumeAmount=" + String.valueOf(this.getLuckConsumeAmount()) + ", totalAmount=" + String.valueOf(this.getTotalAmount()) + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -294,37 +294,37 @@
|
||||||
<!-- </select>-->
|
<!-- </select>-->
|
||||||
|
|
||||||
|
|
||||||
<!-- <select id="listTypeSummary"-->
|
<select id="listTypeSummary"
|
||||||
<!-- resultType="net.xnzn.core.report.statistics.account.vo.ReportAccountWalletConsumeTypeVO">-->
|
resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeTypeVO">
|
||||||
<!-- <if test="param.sumType == 2">-->
|
<if test="param.sumType == 2">
|
||||||
<!-- SELECT-->
|
SELECT
|
||||||
<!-- daydate.statistic_date AS statistic_date,-->
|
daydate.statistic_date AS statistic_date,
|
||||||
<!-- IFNULL(t.psn_type_name,'—') psn_type_name,-->
|
IFNULL(t.psn_type_name,'—') psn_type_name,
|
||||||
<!-- IFNULL( t.wallet_consume_amount, 0 ) AS wallet_consume_amount,-->
|
IFNULL( t.wallet_consume_amount, 0 ) AS wallet_consume_amount,
|
||||||
<!-- IFNULL( t.subsidy_consume_amount, 0 ) AS subsidy_consume_amount,-->
|
IFNULL( t.subsidy_consume_amount, 0 ) AS subsidy_consume_amount,
|
||||||
<!-- IFNULL( t.luck_consume_amount, 0 ) AS luck_consume_amount,-->
|
IFNULL( t.luck_consume_amount, 0 ) AS luck_consume_amount,
|
||||||
<!-- IFNULL( t.total_amount, 0 ) AS total_amount-->
|
IFNULL( t.total_amount, 0 ) AS total_amount
|
||||||
<!-- FROM-->
|
FROM
|
||||||
<!-- (-->
|
(
|
||||||
<!-- </if>-->
|
</if>
|
||||||
|
|
||||||
<!-- <include refid="baseTypeSummary"></include>-->
|
<include refid="baseTypeSummary"></include>
|
||||||
|
|
||||||
<!-- <if test="param.sumType == 2">-->
|
<if test="param.sumType == 2">
|
||||||
<!-- ) t-->
|
) t
|
||||||
<!-- RIGHT JOIN (-->
|
RIGHT JOIN (
|
||||||
<!-- SELECT-->
|
SELECT
|
||||||
<!-- date_add( date_sub( #{param.startDate}, INTERVAL 1 DAY ), INTERVAL (CAST(custom_id AS signed INTEGER)) DAY) statistic_date-->
|
date_add( date_sub( #{param.startDate}, INTERVAL 1 DAY ), INTERVAL (CAST(custom_id AS signed INTEGER)) DAY) statistic_date
|
||||||
<!-- FROM-->
|
FROM
|
||||||
<!-- menu_custom_dict-->
|
menu_custom_dict
|
||||||
<!-- WHERE-->
|
WHERE
|
||||||
<!-- custom_id <![CDATA[ <= ]]> DATEDIFF(-->
|
custom_id <![CDATA[ <= ]]> DATEDIFF(
|
||||||
<!-- #{param.endDate},-->
|
#{param.endDate},
|
||||||
<!-- date_sub( #{param.startDate}, INTERVAL 1 DAY ))-->
|
date_sub( #{param.startDate}, INTERVAL 1 DAY ))
|
||||||
<!-- ) daydate ON daydate.statistic_date = t.statistic_date-->
|
) daydate ON daydate.statistic_date = t.statistic_date
|
||||||
<!-- ORDER BY daydate.statistic_date DESC-->
|
ORDER BY daydate.statistic_date DESC
|
||||||
<!-- </if>-->
|
</if>
|
||||||
<!-- </select>-->
|
</select>
|
||||||
|
|
||||||
<!-- <select id="listTypeSummary"-->
|
<!-- <select id="listTypeSummary"-->
|
||||||
<!-- resultType="net.xnzn.core.report.statistics.account.vo.ReportAccountWalletConsumeTypeVO" databaseId="kb">-->
|
<!-- resultType="net.xnzn.core.report.statistics.account.vo.ReportAccountWalletConsumeTypeVO" databaseId="kb">-->
|
||||||
|
|
@ -423,37 +423,37 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <select id="listOrgSummary"-->
|
<select id="listOrgSummary"
|
||||||
<!-- resultType="net.xnzn.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO">-->
|
resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO">
|
||||||
<!-- <if test="param.sumType == 2">-->
|
<if test="param.sumType == 2">
|
||||||
<!-- SELECT-->
|
SELECT
|
||||||
<!-- daydate.statistic_date AS statistic_date,-->
|
daydate.statistic_date AS statistic_date,
|
||||||
<!-- t.org_id, t.org_name, t.org_full_name,-->
|
t.org_id, t.org_name, t.org_full_name,
|
||||||
<!-- IFNULL( t.wallet_consume_amount, 0 ) AS wallet_consume_amount,-->
|
IFNULL( t.wallet_consume_amount, 0 ) AS wallet_consume_amount,
|
||||||
<!-- IFNULL( t.subsidy_consume_amount, 0 ) AS subsidy_consume_amount,-->
|
IFNULL( t.subsidy_consume_amount, 0 ) AS subsidy_consume_amount,
|
||||||
<!-- IFNULL( t.luck_consume_amount, 0 ) AS luck_consume_amount,-->
|
IFNULL( t.luck_consume_amount, 0 ) AS luck_consume_amount,
|
||||||
<!-- IFNULL( t.total_amount, 0 ) AS total_amount-->
|
IFNULL( t.total_amount, 0 ) AS total_amount
|
||||||
<!-- FROM-->
|
FROM
|
||||||
<!-- (-->
|
(
|
||||||
<!-- </if>-->
|
</if>
|
||||||
|
|
||||||
<!-- <include refid="baseOrgSummary"></include>-->
|
<include refid="baseOrgSummary"></include>
|
||||||
|
|
||||||
<!-- <if test="param.sumType == 2">-->
|
<if test="param.sumType == 2">
|
||||||
<!-- ) t-->
|
) t
|
||||||
<!-- RIGHT JOIN (-->
|
RIGHT JOIN (
|
||||||
<!-- SELECT-->
|
SELECT
|
||||||
<!-- date_add( date_sub( #{param.startDate}, INTERVAL 1 DAY ), INTERVAL (CAST(custom_id AS signed INTEGER)) DAY) statistic_date-->
|
date_add( date_sub( #{param.startDate}, INTERVAL 1 DAY ), INTERVAL (CAST(custom_id AS signed INTEGER)) DAY) statistic_date
|
||||||
<!-- FROM-->
|
FROM
|
||||||
<!-- menu_custom_dict-->
|
menu_custom_dict
|
||||||
<!-- WHERE-->
|
WHERE
|
||||||
<!-- custom_id <![CDATA[ <= ]]> DATEDIFF(-->
|
custom_id <![CDATA[ <= ]]> DATEDIFF(
|
||||||
<!-- #{param.endDate},-->
|
#{param.endDate},
|
||||||
<!-- date_sub( #{param.startDate}, INTERVAL 1 DAY ))-->
|
date_sub( #{param.startDate}, INTERVAL 1 DAY ))
|
||||||
<!-- ) daydate ON daydate.statistic_date = t.statistic_date-->
|
) daydate ON daydate.statistic_date = t.statistic_date
|
||||||
<!-- ORDER BY daydate.statistic_date DESC-->
|
ORDER BY daydate.statistic_date DESC
|
||||||
<!-- </if>-->
|
</if>
|
||||||
<!-- </select>-->
|
</select>
|
||||||
|
|
||||||
<!-- <select id="listOrgSummary"-->
|
<!-- <select id="listOrgSummary"-->
|
||||||
<!-- resultType="net.xnzn.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO" databaseId="kb">-->
|
<!-- resultType="net.xnzn.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO" databaseId="kb">-->
|
||||||
|
|
@ -487,102 +487,105 @@
|
||||||
<!-- </select>-->
|
<!-- </select>-->
|
||||||
|
|
||||||
|
|
||||||
<!-- <select id="getWalletOrgSummaryTotal"-->
|
<select id="getWalletOrgSummaryTotal"
|
||||||
<!-- resultType="net.xnzn.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO">-->
|
resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountWalletConsumeOrganizationVO">
|
||||||
<!-- SELECT-->
|
SELECT
|
||||||
<!-- SUM( wallet_consume_amount ) wallet_consume_amount,-->
|
SUM( wallet_consume_amount ) wallet_consume_amount,
|
||||||
<!-- SUM( subsidy_consume_amount ) subsidy_consume_amount,-->
|
SUM( subsidy_consume_amount ) subsidy_consume_amount,
|
||||||
<!-- SUM( subsidy_consume_amount ) subsidy_consume_amount,-->
|
SUM( subsidy_consume_amount ) subsidy_consume_amount,
|
||||||
<!-- SUM( luck_consume_amount ) luck_consume_amount,-->
|
SUM( luck_consume_amount ) luck_consume_amount,
|
||||||
<!-- SUM( total_amount ) total_amount-->
|
SUM( total_amount ) total_amount
|
||||||
<!-- FROM(-->
|
FROM(
|
||||||
<!-- <include refid="baseOrgSummary"></include>-->
|
<include refid="baseOrgSummary"></include>
|
||||||
<!-- ) t-->
|
) t
|
||||||
<!-- </select>-->
|
</select>
|
||||||
|
|
||||||
<!-- <sql id="baseOrgSummary">-->
|
<sql id="baseOrgSummary">
|
||||||
<!-- SELECT-->
|
SELECT
|
||||||
<!-- <if test="param.sumType == 2">-->
|
<if test="param.sumType == 2">
|
||||||
<!-- t.statistic_date,-->
|
t.statistic_date,
|
||||||
<!-- </if>-->
|
</if>
|
||||||
<!-- g.org_id, g.org_name, g.org_full_name,-->
|
g.dept_id as org_id, g.dept_name as org_name,
|
||||||
<!-- ifnull( t.wallet_consume_amount, 0 ) AS wallet_consume_amount,-->
|
<!-- g.org_full_name, -->
|
||||||
<!-- ifnull( t.subsidy_consume_amount, 0 ) AS subsidy_consume_amount,-->
|
ifnull( t.wallet_consume_amount, 0 ) AS wallet_consume_amount,
|
||||||
<!-- ifnull( t.luck_consume_amount, 0 ) AS luck_consume_amount,-->
|
ifnull( t.subsidy_consume_amount, 0 ) AS subsidy_consume_amount,
|
||||||
<!-- ifnull( t.total_amount, 0 ) AS total_amount-->
|
ifnull( t.luck_consume_amount, 0 ) AS luck_consume_amount,
|
||||||
<!-- FROM-->
|
ifnull( t.total_amount, 0 ) AS total_amount
|
||||||
<!-- cust_org g-->
|
FROM
|
||||||
<!-- LEFT JOIN (-->
|
sys_dept g
|
||||||
<!-- SELECT-->
|
LEFT JOIN (
|
||||||
<!-- <if test="param.sumType == 2">-->
|
SELECT
|
||||||
<!-- a.statistic_date,-->
|
<if test="param.sumType == 2">
|
||||||
<!-- </if>-->
|
a.statistic_date,
|
||||||
<!-- SUBSTRING_INDEX(SUBSTRING_INDEX(g.org_full_id,'/', #{param.orgLevel} + 1), '/', -1) as a_org_id,-->
|
</if>
|
||||||
<!-- SUM(IF(a.wallet_id = 1 ,consume_amount + repair_amount - refund_amount,0)) wallet_consume_amount,-->
|
SUBSTRING_INDEX(SUBSTRING_INDEX(g.ancestors,',', #{param.orgLevel}), ',', -1) as a_org_id,
|
||||||
<!-- SUM(IF(a.wallet_id = 2 ,consume_amount + repair_amount - refund_amount,0)) subsidy_consume_amount,-->
|
SUM(IF(a.wallet_id = 1 ,consume_amount + repair_amount - refund_amount,0)) wallet_consume_amount,
|
||||||
<!-- SUM(IF(a.wallet_id = 4 ,consume_amount + repair_amount - refund_amount,0)) luck_consume_amount,-->
|
SUM(IF(a.wallet_id = 2 ,consume_amount + repair_amount - refund_amount,0)) subsidy_consume_amount,
|
||||||
<!-- SUM( consume_amount + repair_amount - refund_amount) total_amount-->
|
SUM(IF(a.wallet_id = 4 ,consume_amount + repair_amount - refund_amount,0)) luck_consume_amount,
|
||||||
<!-- FROM-->
|
SUM( consume_amount + repair_amount - refund_amount) total_amount
|
||||||
<!-- report_account_wallet_consume a-->
|
FROM
|
||||||
<!-- LEFT JOIN cust_info c ON a.cust_id = c.cust_id-->
|
report_account_wallet_consume a
|
||||||
<!-- LEFT JOIN cust_org g on g.org_id = c.org_id-->
|
LEFT JOIN sys_user c ON a.cust_id = c.cust_id
|
||||||
<!-- WHERE a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}-->
|
LEFT JOIN sys_dept g on g.dept_id = c.dept_id
|
||||||
<!-- <if test="param.orgIdList != null and param.orgIdList.size() > 0">-->
|
WHERE a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
|
||||||
<!-- and (-->
|
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
|
||||||
<!-- <foreach collection="param.orgIdList" item="orgId" separator=" or " open=""-->
|
and (
|
||||||
<!-- close="">-->
|
<foreach collection="param.orgIdList" item="orgId" separator=" or " open=""
|
||||||
<!-- g.org_full_id like concat('%/',#{orgId},'/%')-->
|
close="">
|
||||||
<!-- </foreach>-->
|
g.ancestors like concat('', #{orgId}, ',%')
|
||||||
<!-- )-->
|
or g.ancestors like concat('%,', #{orgId}, ',%')
|
||||||
<!-- </if>-->
|
or g.ancestors like concat('%,', #{orgId}, '')
|
||||||
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
|
</foreach>
|
||||||
<!-- and EXISTS (-->
|
)
|
||||||
<!-- SELECT null-->
|
</if>
|
||||||
<!-- FROM mgr_role_org it1-->
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
<!-- LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
|
and EXISTS (
|
||||||
<!-- LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
|
SELECT null
|
||||||
<!-- WHERE it2.del_flag = 2-->
|
FROM sys_role_dept it1
|
||||||
<!-- AND it2.role_code = #{authPO.roleCode}-->
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
<!-- AND it1.half_select = 1-->
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
<!-- AND it3.user_id = #{authPO.userId}-->
|
WHERE it2.del_flag = 2
|
||||||
<!-- AND it1.org_id = c.org_id-->
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
<!-- )-->
|
<!-- AND it1.half_select = 1 -->
|
||||||
<!-- </if>-->
|
AND it3.user_id = #{authPO.userId}
|
||||||
<!-- GROUP BY-->
|
AND it1.dept_id = c.dept_id
|
||||||
<!-- <if test="param.sumType == 2">-->
|
)
|
||||||
<!-- a.statistic_date,-->
|
</if>
|
||||||
<!-- </if>-->
|
GROUP BY
|
||||||
<!-- a_org_id-->
|
<if test="param.sumType == 2">
|
||||||
<!-- ) t-->
|
a.statistic_date,
|
||||||
<!-- ON t.a_org_id = g.org_id-->
|
</if>
|
||||||
<!-- <where>-->
|
a_org_id
|
||||||
<!-- <if test="param.orgIdList != null and param.orgIdList.size() > 0">-->
|
) t
|
||||||
<!-- and g.org_id in-->
|
ON t.a_org_id = g.dept_id
|
||||||
<!-- <foreach collection="param.orgIdList" item="orgId" separator="," open="("-->
|
<where>
|
||||||
<!-- close=")">-->
|
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
|
||||||
<!-- #{orgId}-->
|
and g.dept_id in
|
||||||
<!-- </foreach>-->
|
<foreach collection="param.orgIdList" item="orgId" separator="," open="("
|
||||||
<!-- </if>-->
|
close=")">
|
||||||
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
|
#{orgId}
|
||||||
<!-- and EXISTS (-->
|
</foreach>
|
||||||
<!-- SELECT null-->
|
</if>
|
||||||
<!-- FROM mgr_role_org it1-->
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
<!-- LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
|
and EXISTS (
|
||||||
<!-- LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
|
SELECT null
|
||||||
<!-- WHERE it2.del_flag = 2-->
|
FROM sys_role_dept it1
|
||||||
<!-- AND it2.role_code = #{authPO.roleCode}-->
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
<!-- AND it1.half_select = 1-->
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
<!-- AND it3.user_id = #{authPO.userId}-->
|
WHERE it2.del_flag = 2
|
||||||
<!-- AND it1.org_id = g.org_id-->
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
<!-- )-->
|
<!-- AND it1.half_select = 1 -->
|
||||||
<!-- </if>-->
|
AND it3.user_id = #{authPO.userId}
|
||||||
<!-- </where>-->
|
AND it1.dept_id = g.dept_id
|
||||||
<!-- ORDER BY-->
|
)
|
||||||
<!-- <if test="param.sumType == 2">-->
|
</if>
|
||||||
<!-- t.statistic_date desc,-->
|
</where>
|
||||||
<!-- </if>-->
|
ORDER BY
|
||||||
<!-- total_amount DESC, g.org_full_id-->
|
<if test="param.sumType == 2">
|
||||||
<!-- </sql>-->
|
t.statistic_date desc,
|
||||||
|
</if>
|
||||||
|
total_amount DESC, g.ancestors
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
<!-- <sql id="baseQuery">-->
|
<!-- <sql id="baseQuery">-->
|
||||||
|
|
|
||||||
|
|
@ -57,121 +57,121 @@
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="getCustNumParam">
|
<!-- <sql id="getCustNumParam">-->
|
||||||
<where>
|
<!-- <where>-->
|
||||||
<if test="param.startDate != null">
|
<!-- <if test="param.startDate != null">-->
|
||||||
<![CDATA[AND o.pay_time >= concat(#{param.startDate},' 00:00:00')]]>
|
<!-- <![CDATA[AND o.pay_time >= concat(#{param.startDate},' 00:00:00')]]>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.endDate != null">
|
<!-- <if test="param.endDate != null">-->
|
||||||
<![CDATA[AND o.pay_time <= concat(#{param.endDate},' 23:59:59')]]>
|
<!-- <![CDATA[AND o.pay_time <= concat(#{param.endDate},' 23:59:59')]]>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.ageTypes != null and param.ageTypes.size() > 0">
|
<!-- <if test="param.ageTypes != null and param.ageTypes.size() > 0">-->
|
||||||
AND o.age_type IN
|
<!-- AND o.age_type IN-->
|
||||||
<foreach collection="param.ageTypes" item="ageType" separator="," open="(" close=")">
|
<!-- <foreach collection="param.ageTypes" item="ageType" separator="," open="(" close=")">-->
|
||||||
#{ageType}
|
<!-- #{ageType}-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.canteenStallIds != null and param.canteenStallIds.size() > 0">
|
<!-- <if test="param.canteenStallIds != null and param.canteenStallIds.size() > 0">-->
|
||||||
<if test="param.treeType == 1">
|
<!-- <if test="param.treeType == 1">-->
|
||||||
AND o.canteen_id IN
|
<!-- AND o.canteen_id IN-->
|
||||||
<foreach collection="param.canteenStallIds" item="canteenStallId" separator="," open="(" close=")">
|
<!-- <foreach collection="param.canteenStallIds" item="canteenStallId" separator="," open="(" close=")">-->
|
||||||
#{canteenStallId}
|
<!-- #{canteenStallId}-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.treeType == 2">
|
<!-- <if test="param.treeType == 2">-->
|
||||||
AND o.stall_id IN
|
<!-- AND o.stall_id IN-->
|
||||||
<foreach collection="param.canteenStallIds" item="canteenStallId" separator="," open="(" close=")">
|
<!-- <foreach collection="param.canteenStallIds" item="canteenStallId" separator="," open="(" close=")">-->
|
||||||
#{canteenStallId}
|
<!-- #{canteenStallId}-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.orgId != null">
|
<!-- <if test="param.orgId != null">-->
|
||||||
AND o.org_id = #{param.orgId}
|
<!-- AND o.org_id = #{param.orgId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.orgIds != null and param.orgIds.size() > 0">
|
<!-- <if test="param.orgIds != null and param.orgIds.size() > 0">-->
|
||||||
and (
|
<!-- and (-->
|
||||||
<foreach collection="param.orgIds" item="orgId" separator=" or " open=""
|
<!-- <foreach collection="param.orgIds" item="orgId" separator=" or " open=""-->
|
||||||
close="">
|
<!-- close="">-->
|
||||||
g.org_full_id like concat('%/',#{orgId},'/%')
|
<!-- g.org_full_id like concat('%/',#{orgId},'/%')-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
)
|
<!-- )-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.holidayTypeList != null and param.holidayTypeList.size() > 0">
|
<!-- <if test="param.holidayTypeList != null and param.holidayTypeList.size() > 0">-->
|
||||||
and EXISTS (
|
<!-- and EXISTS (-->
|
||||||
SELECT
|
<!-- SELECT-->
|
||||||
1
|
<!-- 1-->
|
||||||
FROM
|
<!-- FROM-->
|
||||||
mkt_holiday h
|
<!-- mkt_holiday h-->
|
||||||
WHERE
|
<!-- WHERE-->
|
||||||
DATE_FORMAT(o.pay_time,'%Y-%m-%d') = h.hol_date
|
<!-- DATE_FORMAT(o.pay_time,'%Y-%m-%d') = h.hol_date-->
|
||||||
AND h.hol_type in
|
<!-- AND h.hol_type in-->
|
||||||
<foreach collection="param.holidayTypeList" item="holidayType" separator="," open="(" close=")">
|
<!-- <foreach collection="param.holidayTypeList" item="holidayType" separator="," open="(" close=")">-->
|
||||||
#{holidayType}
|
<!-- #{holidayType}-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
)
|
<!-- )-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="'2'.toString() == authPO.roleType.toString()">
|
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
|
||||||
and EXISTS (
|
<!-- and EXISTS (-->
|
||||||
SELECT null
|
<!-- SELECT null-->
|
||||||
FROM sys_role_dept it1
|
<!-- FROM sys_role_dept it1-->
|
||||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
<!-- LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id-->
|
||||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
<!-- LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
WHERE it2.del_flag = 0
|
<!-- WHERE it2.del_flag = 0-->
|
||||||
AND it2.role_key = #{authPO.roleCode}
|
<!-- AND it2.role_key = #{authPO.roleCode}-->
|
||||||
<!-- AND it1.half_select = 1 -->
|
<!-- <!– AND it1.half_select = 1 –>-->
|
||||||
AND it3.user_id = #{authPO.userId}
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
AND o.org_id = it1.dept_id
|
<!-- AND o.org_id = it1.dept_id-->
|
||||||
)
|
<!-- )-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="'3'.toString() == authPO.roleType.toString()">
|
<!-- <if test="'3'.toString() == authPO.roleType.toString()">-->
|
||||||
AND (
|
<!-- AND (-->
|
||||||
EXISTS(
|
<!-- EXISTS(-->
|
||||||
SELECT NULL
|
<!-- SELECT NULL-->
|
||||||
FROM sys_role_canteen it1
|
<!-- FROM sys_role_canteen it1-->
|
||||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
<!-- LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id-->
|
||||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
<!-- LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
WHERE it2.del_flag = 0
|
<!-- WHERE it2.del_flag = 0-->
|
||||||
AND it2.role_key = #{authPO.roleCode}
|
<!-- AND it2.role_key = #{authPO.roleCode}-->
|
||||||
<!-- AND it1.half_select = 1 -->
|
<!-- <!– AND it1.half_select = 1 –>-->
|
||||||
AND it3.user_id = #{authPO.userId}
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
AND (o.canteen_id = it1.data_id)
|
<!-- AND (o.canteen_id = it1.data_id)-->
|
||||||
)
|
<!-- )-->
|
||||||
OR EXISTS (
|
<!-- OR EXISTS (-->
|
||||||
SELECT NULL
|
<!-- SELECT NULL-->
|
||||||
FROM sys_role_canteen it1
|
<!-- FROM sys_role_canteen it1-->
|
||||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
<!-- LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id-->
|
||||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
<!-- LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
WHERE it2.del_flag = 0
|
<!-- WHERE it2.del_flag = 0-->
|
||||||
AND it2.role_key = #{authPO.roleCode}
|
<!-- AND it2.role_key = #{authPO.roleCode}-->
|
||||||
<!-- AND it1.half_select = 1 -->
|
<!-- <!– AND it1.half_select = 1 –>-->
|
||||||
AND it3.user_id = #{authPO.userId}
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
AND (o.stall_id = it1.data_id)
|
<!-- AND (o.stall_id = it1.data_id)-->
|
||||||
)
|
<!-- )-->
|
||||||
)
|
<!-- )-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="param.areaIdList != null and param.areaIdList.size() > 0">
|
<!-- <if test="param.areaIdList != null and param.areaIdList.size() > 0">-->
|
||||||
AND c.area_id in
|
<!-- AND c.area_id in-->
|
||||||
<foreach collection="param.areaIdList" item="item" open="(" close=")" separator=",">
|
<!-- <foreach collection="param.areaIdList" item="item" open="(" close=")" separator=",">-->
|
||||||
#{item}
|
<!-- #{item}-->
|
||||||
</foreach>
|
<!-- </foreach>-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="'2'.toString() == authPO.roleType.toString() or '1'.toString() == authPO.roleType.toString()">
|
<!-- <if test="'2'.toString() == authPO.roleType.toString() or '1'.toString() == authPO.roleType.toString()">-->
|
||||||
and EXISTS (
|
<!-- and EXISTS (-->
|
||||||
SELECT null
|
<!-- SELECT null-->
|
||||||
FROM sys_role_area it1
|
<!-- FROM sys_role_area it1-->
|
||||||
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
<!-- LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id-->
|
||||||
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
<!-- LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
WHERE it2.del_flag = 0
|
<!-- WHERE it2.del_flag = 0-->
|
||||||
AND it2.role_key = #{authPO.roleCode}
|
<!-- AND it2.role_key = #{authPO.roleCode}-->
|
||||||
<!-- AND it1.half_select = 1 -->
|
<!-- <!– AND it1.half_select = 1 –>-->
|
||||||
AND it3.user_id = #{authPO.userId}
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
AND c.area_id = it1.area_id
|
<!-- AND c.area_id = it1.area_id-->
|
||||||
)
|
<!-- )-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
</where>
|
<!-- </where>-->
|
||||||
|
|
||||||
</sql>
|
<!-- </sql>-->
|
||||||
|
|
||||||
<!-- <select id="listSummaryMealtime_COUNT" resultType="long">-->
|
<!-- <select id="listSummaryMealtime_COUNT" resultType="long">-->
|
||||||
<!-- SELECT count(*) FROM-->
|
<!-- SELECT count(*) FROM-->
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,340 @@
|
||||||
|
<?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.bonus.canteen.core.report.statistics.account.mapper.ReportAccountConsumeSumOrgMapper">
|
||||||
|
|
||||||
|
<select id="listOrganizationSummary" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeOrganizationVO">
|
||||||
|
SELECT
|
||||||
|
g.dept_id as org_id, g.dept_name as org_name
|
||||||
|
<!-- , g.org_full_name, -->
|
||||||
|
ifnull( t.consume_num, 0 ) AS consume_num,
|
||||||
|
ifnull( t.consume_amount, 0 ) AS consume_amount,
|
||||||
|
ifnull( t.consume_repair_num, 0 ) AS consume_repair_num,
|
||||||
|
ifnull( t.consume_repair_amount, 0 ) AS consume_repair_amount,
|
||||||
|
ifnull( t.consume_refund_num, 0 ) AS consume_refund_num,
|
||||||
|
ifnull( t.consume_refund_amount, 0 ) AS consume_refund_amount,
|
||||||
|
ifnull( t.consume_amount, 0 ) + ifnull( t.consume_repair_amount, 0 ) - ifnull( t.consume_refund_amount, 0 ) AS total_amount,
|
||||||
|
t.change_flag
|
||||||
|
FROM
|
||||||
|
sys_dept g
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(g.ancestors,',', #{param.orgLevel}), ',', -1) as SIGNED) as a_org_id,
|
||||||
|
sum( consume_num ) AS consume_num,
|
||||||
|
sum( consume_amount ) AS consume_amount,
|
||||||
|
sum( consume_repair_num ) AS consume_repair_num,
|
||||||
|
sum( consume_repair_amount ) AS consume_repair_amount,
|
||||||
|
sum( consume_refund_num ) AS consume_refund_num,
|
||||||
|
sum( consume_refund_amount ) AS consume_refund_amount,
|
||||||
|
1 AS change_flag
|
||||||
|
FROM
|
||||||
|
report_account_consume_sum_org a
|
||||||
|
LEFT JOIN sys_dept g on g.dept_id = a.org_id
|
||||||
|
<where>
|
||||||
|
AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
|
||||||
|
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
|
||||||
|
and (
|
||||||
|
<foreach collection="param.orgIdList" item="orgId" separator=" or " open=""
|
||||||
|
close="">
|
||||||
|
g.ancestors like concat('', #{orgId}, ',%')
|
||||||
|
or g.ancestors like concat('%,', #{orgId}, ',%')
|
||||||
|
or g.ancestors like concat('%,', #{orgId}, '')
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 0
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = a.org_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY a_org_id
|
||||||
|
) t ON t.a_org_id = g.dept_id
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
|
||||||
|
and g.dept_id in
|
||||||
|
<foreach collection="param.orgIdList" item="orgId" separator="," open="("
|
||||||
|
close=")">
|
||||||
|
#{orgId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 0
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = g.dept_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
ORDER BY change_flag IS NULL, total_amount DESC, g.ancestors
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="listOrganizationSummaryByDay" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeOrganizationVO">
|
||||||
|
SELECT
|
||||||
|
d.statistic_date,
|
||||||
|
d.org_id, d.org_name,
|
||||||
|
<!-- d.org_full_name, -->
|
||||||
|
ifnull( t.consume_num, 0 ) AS consume_num,
|
||||||
|
ifnull( t.consume_amount, 0 ) AS consume_amount,
|
||||||
|
ifnull( t.consume_repair_num, 0 ) AS consume_repair_num,
|
||||||
|
ifnull( t.consume_repair_amount, 0 ) AS consume_repair_amount,
|
||||||
|
ifnull( t.consume_refund_num, 0 ) AS consume_refund_num,
|
||||||
|
ifnull( t.consume_refund_amount, 0 ) AS consume_refund_amount,
|
||||||
|
ifnull( t.consume_amount, 0 ) + ifnull( t.consume_repair_amount, 0 ) - ifnull( t.consume_refund_amount, 0 ) AS total_amount,
|
||||||
|
t.change_flag
|
||||||
|
FROM (
|
||||||
|
SELECT g.dept_id as org_id, g.dept_name as org_name,
|
||||||
|
<!-- g.org_full_name, -->
|
||||||
|
g.ancestors as org_full_id,
|
||||||
|
0 as idno, e.statistic_date FROM sys_dept g LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
date_add( date_sub( #{param.startDate}, INTERVAL 1 DAY ), INTERVAL (CAST(custom_id AS signed INTEGER)) DAY) statistic_date,
|
||||||
|
0 as idno
|
||||||
|
FROM
|
||||||
|
menu_custom_dict
|
||||||
|
WHERE
|
||||||
|
custom_id <![CDATA[ <= ]]> DATEDIFF(#{param.endDate}, date_sub( #{param.startDate}, INTERVAL 1 DAY ))
|
||||||
|
) e on e.idno = idno
|
||||||
|
|
||||||
|
|
||||||
|
) d LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
statistic_date,
|
||||||
|
CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(g.ancestors,',', #{param.orgLevel}), ',', -1) as SIGNED) as a_org_id,
|
||||||
|
sum( consume_num ) AS consume_num,
|
||||||
|
sum( consume_amount ) AS consume_amount,
|
||||||
|
sum( consume_repair_num ) AS consume_repair_num,
|
||||||
|
sum( consume_repair_amount ) AS consume_repair_amount,
|
||||||
|
sum( consume_refund_num ) AS consume_refund_num,
|
||||||
|
sum( consume_refund_amount ) AS consume_refund_amount,
|
||||||
|
1 AS change_flag
|
||||||
|
FROM
|
||||||
|
report_account_consume_sum_org a
|
||||||
|
LEFT JOIN sys_dept g on g.dept_id = a.org_id
|
||||||
|
<where>
|
||||||
|
AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
|
||||||
|
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
|
||||||
|
and (
|
||||||
|
<foreach collection="param.orgIdList" item="orgId" separator=" or " open=""
|
||||||
|
close="">
|
||||||
|
g.ancestors like concat('', #{orgId}, ',%')
|
||||||
|
or g.ancestors like concat('%,', #{orgId}, ',%')
|
||||||
|
or g.ancestors like concat('%,', #{orgId}, '')
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 2
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = a.org_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
a.statistic_date, a_org_id
|
||||||
|
) t ON t.a_org_id = d.org_id and t.statistic_date = d.statistic_date
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
|
||||||
|
and d.org_id in
|
||||||
|
<foreach collection="param.orgIdList" item="orgId" separator="," open="("
|
||||||
|
close=")">
|
||||||
|
#{orgId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 2
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = d.org_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
ORDER BY d.statistic_date DESC, t.change_flag IS NULL, total_amount DESC, d.org_full_id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- <select id="listOrganizationSummaryByDay" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeOrganizationVO" databaseId="kb">-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- d.statistic_date,-->
|
||||||
|
<!-- d.org_id, d.org_name, d.org_full_name,-->
|
||||||
|
<!-- ifnull( t.consume_num, 0 ) AS consume_num,-->
|
||||||
|
<!-- ifnull( t.consume_amount, 0 ) AS consume_amount,-->
|
||||||
|
<!-- ifnull( t.consume_repair_num, 0 ) AS consume_repair_num,-->
|
||||||
|
<!-- ifnull( t.consume_repair_amount, 0 ) AS consume_repair_amount,-->
|
||||||
|
<!-- ifnull( t.consume_refund_num, 0 ) AS consume_refund_num,-->
|
||||||
|
<!-- ifnull( t.consume_refund_amount, 0 ) AS consume_refund_amount,-->
|
||||||
|
<!-- ifnull( t.consume_amount, 0 ) + ifnull( t.consume_repair_amount, 0 ) - ifnull( t.consume_refund_amount, 0 ) AS total_amount,-->
|
||||||
|
<!-- t.change_flag-->
|
||||||
|
<!-- FROM (-->
|
||||||
|
<!-- SELECT g.org_id, g.org_name, g.org_full_name, g.org_full_id,0 as idno, e.statistic_date FROM cust_org g LEFT JOIN (-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- (TO_DATE(#{param.startDate}, 'YYYY-MM-DD') + ROWNUM - 1) as statistic_date,-->
|
||||||
|
<!-- 0 as idno-->
|
||||||
|
<!-- FROM-->
|
||||||
|
<!-- DUAL-->
|
||||||
|
<!-- CONNECT BY-->
|
||||||
|
<!-- ROWNUM <![CDATA[<=]]> TO_DATE(#{param.endDate}, 'YYYY-MM-DD') - TO_DATE(#{param.startDate}, 'YYYY-MM-DD') + 1-->
|
||||||
|
<!-- ) e on e.idno = idno-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ) d LEFT JOIN (-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- statistic_date,-->
|
||||||
|
<!-- CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(g.org_full_id,'/', #{param.orgLevel} + 1), '/', -1) as SIGNED) as a_org_id,-->
|
||||||
|
<!-- sum( consume_num ) AS consume_num,-->
|
||||||
|
<!-- sum( consume_amount ) AS consume_amount,-->
|
||||||
|
<!-- sum( consume_repair_num ) AS consume_repair_num,-->
|
||||||
|
<!-- sum( consume_repair_amount ) AS consume_repair_amount,-->
|
||||||
|
<!-- sum( consume_refund_num ) AS consume_refund_num,-->
|
||||||
|
<!-- sum( consume_refund_amount ) AS consume_refund_amount,-->
|
||||||
|
<!-- 1 AS change_flag-->
|
||||||
|
<!-- FROM-->
|
||||||
|
<!-- report_account_consume_sum_org a-->
|
||||||
|
<!-- LEFT JOIN cust_org g on g.org_id = a.org_id-->
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}-->
|
||||||
|
<!-- <if test="param.orgIdList != null and param.orgIdList.size() > 0">-->
|
||||||
|
<!-- and (-->
|
||||||
|
<!-- <foreach collection="param.orgIdList" item="orgId" separator=" or " open=""-->
|
||||||
|
<!-- close="">-->
|
||||||
|
<!-- g.org_full_id like concat('%/',#{orgId},'/%')-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- )-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
|
||||||
|
<!-- and EXISTS (-->
|
||||||
|
<!-- SELECT null-->
|
||||||
|
<!-- FROM mgr_role_org it1-->
|
||||||
|
<!-- LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
|
||||||
|
<!-- LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
|
<!-- WHERE it2.del_flag = 2-->
|
||||||
|
<!-- AND it2.role_code = #{authPO.roleCode}-->
|
||||||
|
<!-- AND it1.half_select = 1-->
|
||||||
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
|
<!-- AND it1.org_id = a.org_id-->
|
||||||
|
<!-- )-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </where>-->
|
||||||
|
<!-- GROUP BY-->
|
||||||
|
<!-- a.statistic_date, a_org_id-->
|
||||||
|
<!-- ) t ON t.a_org_id = d.org_id and t.statistic_date = d.statistic_date-->
|
||||||
|
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- <if test="param.orgIdList != null and param.orgIdList.size() > 0">-->
|
||||||
|
<!-- and d.org_id in-->
|
||||||
|
<!-- <foreach collection="param.orgIdList" item="orgId" separator="," open="("-->
|
||||||
|
<!-- close=")">-->
|
||||||
|
<!-- #{orgId}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
|
||||||
|
<!-- and EXISTS (-->
|
||||||
|
<!-- SELECT null-->
|
||||||
|
<!-- FROM mgr_role_org it1-->
|
||||||
|
<!-- LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
|
||||||
|
<!-- LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
|
<!-- WHERE it2.del_flag = 2-->
|
||||||
|
<!-- AND it2.role_code = #{authPO.roleCode}-->
|
||||||
|
<!-- AND it1.half_select = 1-->
|
||||||
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
|
<!-- AND it1.org_id = d.org_id-->
|
||||||
|
<!-- )-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </where>-->
|
||||||
|
|
||||||
|
<!-- ORDER BY d.statistic_date DESC, t.change_flag IS NULL, total_amount DESC, d.org_full_name-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<select id="getOrganizationSummaryTotal" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeOrganizationVO">
|
||||||
|
SELECT
|
||||||
|
sum(ifnull( a.consume_num, 0 )) AS consume_num,
|
||||||
|
sum(ifnull( a.consume_amount, 0 )) AS consume_amount,
|
||||||
|
sum(ifnull( a.consume_repair_num, 0 )) AS consume_repair_num,
|
||||||
|
sum(ifnull( a.consume_repair_amount, 0 )) AS consume_repair_amount,
|
||||||
|
sum(ifnull( a.consume_refund_num, 0 )) AS consume_refund_num,
|
||||||
|
sum(ifnull( a.consume_refund_amount, 0 )) AS consume_refund_amount,
|
||||||
|
sum(ifnull( a.consume_amount, 0 ) + ifnull( a.consume_repair_amount, 0 ) - ifnull( a.consume_refund_amount, 0 )) AS total_amount
|
||||||
|
FROM
|
||||||
|
report_account_consume_sum_org a
|
||||||
|
LEFT JOIN sys_dept g on g.dept_id = a.org_id
|
||||||
|
<where>
|
||||||
|
AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
|
||||||
|
<if test="param.orgIdList != null and param.orgIdList.size() > 0">
|
||||||
|
and (
|
||||||
|
<foreach collection="param.orgIdList" item="orgId" separator=" or " open=""
|
||||||
|
close="">
|
||||||
|
g.ancestors like concat('', #{orgId}, ',%')
|
||||||
|
or g.ancestors like concat('%,', #{orgId}, ',%')
|
||||||
|
or g.ancestors like concat('%,', #{orgId}, '')
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 0
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = a.org_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="initByPayTime">
|
||||||
|
insert into report_account_consume_sum_org
|
||||||
|
(statistic_date,
|
||||||
|
org_id,
|
||||||
|
consume_num,
|
||||||
|
consume_amount,
|
||||||
|
consume_repair_num,
|
||||||
|
consume_repair_amount,
|
||||||
|
consume_refund_num,
|
||||||
|
consume_refund_amount)
|
||||||
|
select DATE_FORMAT(a.pay_time,'%Y-%m-%d') statistic_date,
|
||||||
|
s.org_id,
|
||||||
|
sum(if(a.flow_type = 110, 1, 0)),
|
||||||
|
abs(sum(if(a.flow_type = 110, a.flow_real_amount, 0))),
|
||||||
|
sum(if(a.flow_type = 120, 1, 0)),
|
||||||
|
abs(sum(if(a.flow_type = 120, a.flow_real_amount, 0))),
|
||||||
|
sum(if(a.flow_type = 130, 1, 0)),
|
||||||
|
abs(sum(if(a.flow_type = 130, a.flow_real_amount, 0)))
|
||||||
|
from report_account_flow a
|
||||||
|
LEFT JOIN report_account_flow_snapshot s ON a.flow_id = s.flow_id
|
||||||
|
where a.flow_type in (110, 120, 130) AND a.pay_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
group by statistic_date, s.org_id
|
||||||
|
</insert>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,331 @@
|
||||||
|
<?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.bonus.canteen.core.report.statistics.account.mapper.ReportAccountConsumeSumTypeMapper">
|
||||||
|
|
||||||
|
<select id="listTypeSummary" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeTypeVO">
|
||||||
|
SELECT
|
||||||
|
p.psn_type,
|
||||||
|
p.psn_type_name,
|
||||||
|
ifnull( t.consume_num, 0 ) AS consume_num,
|
||||||
|
ifnull( t.consume_amount, 0 ) AS consume_amount,
|
||||||
|
ifnull( t.consume_repair_num, 0 ) AS consume_repair_num,
|
||||||
|
ifnull( t.consume_repair_amount, 0 ) AS consume_repair_amount,
|
||||||
|
ifnull( t.consume_refund_num, 0 ) AS consume_refund_num,
|
||||||
|
ifnull( t.consume_refund_amount, 0 ) AS consume_refund_amount,
|
||||||
|
ifnull( t.consume_amount, 0 ) + ifnull( t.consume_repair_amount, 0 ) - ifnull( t.consume_refund_amount, 0 ) AS total_amount,
|
||||||
|
t.change_flag
|
||||||
|
FROM
|
||||||
|
( SELECT psn_type_name, psn_type FROM cust_psn_type UNION ALL SELECT '—' AS psn_type_name, - 1 AS psn_type ) p
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
ifnull( a.psn_type, - 1 ) AS psn_type,
|
||||||
|
sum( consume_num ) AS consume_num,
|
||||||
|
sum( consume_amount ) AS consume_amount,
|
||||||
|
sum( consume_repair_num ) AS consume_repair_num,
|
||||||
|
sum( consume_repair_amount ) AS consume_repair_amount,
|
||||||
|
sum( consume_refund_num ) AS consume_refund_num,
|
||||||
|
sum( consume_refund_amount ) AS consume_refund_amount,
|
||||||
|
1 AS change_flag
|
||||||
|
FROM
|
||||||
|
report_account_consume_sum_type a
|
||||||
|
<where>
|
||||||
|
AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 0
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = a.org_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
a.psn_type
|
||||||
|
) t ON t.psn_type = p.psn_type
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<if test="param.psnTypeList != null and param.psnTypeList.size() > 0">
|
||||||
|
and p.psn_type in
|
||||||
|
<foreach collection="param.psnTypeList" item="psnType" separator="," open="("
|
||||||
|
close=")">
|
||||||
|
#{psnType}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
ORDER BY change_flag IS NULL, total_amount DESC, FIELD(p.psn_type,- 1)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <select id="listTypeSummary" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeTypeVO" databaseId="kb">-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- IFNULL(p.psn_type,-1),-->
|
||||||
|
<!-- p.psn_type_name,-->
|
||||||
|
<!-- ifnull( t.consume_num, 0 ) AS consume_num,-->
|
||||||
|
<!-- ifnull( t.consume_amount, 0 ) AS consume_amount,-->
|
||||||
|
<!-- ifnull( t.consume_repair_num, 0 ) AS consume_repair_num,-->
|
||||||
|
<!-- ifnull( t.consume_repair_amount, 0 ) AS consume_repair_amount,-->
|
||||||
|
<!-- ifnull( t.consume_refund_num, 0 ) AS consume_refund_num,-->
|
||||||
|
<!-- ifnull( t.consume_refund_amount, 0 ) AS consume_refund_amount,-->
|
||||||
|
<!-- ifnull( t.consume_amount, 0 ) + ifnull( t.consume_repair_amount, 0 ) - ifnull( t.consume_refund_amount, 0 ) AS total_amount,-->
|
||||||
|
<!-- t.change_flag-->
|
||||||
|
<!-- FROM-->
|
||||||
|
<!-- ( SELECT psn_type_name, psn_type FROM cust_psn_type UNION ALL SELECT '—' AS psn_type_name, null AS psn_type ) p-->
|
||||||
|
<!-- LEFT JOIN (-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- a.psn_type,-->
|
||||||
|
<!-- sum( consume_num ) AS consume_num,-->
|
||||||
|
<!-- sum( consume_amount ) AS consume_amount,-->
|
||||||
|
<!-- sum( consume_repair_num ) AS consume_repair_num,-->
|
||||||
|
<!-- sum( consume_repair_amount ) AS consume_repair_amount,-->
|
||||||
|
<!-- sum( consume_refund_num ) AS consume_refund_num,-->
|
||||||
|
<!-- sum( consume_refund_amount ) AS consume_refund_amount,-->
|
||||||
|
<!-- 1 AS change_flag-->
|
||||||
|
<!-- FROM-->
|
||||||
|
<!-- report_account_consume_sum_type a-->
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}-->
|
||||||
|
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
|
||||||
|
<!-- and EXISTS (-->
|
||||||
|
<!-- SELECT null-->
|
||||||
|
<!-- FROM mgr_role_org it1-->
|
||||||
|
<!-- LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
|
||||||
|
<!-- LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
|
<!-- WHERE it2.del_flag = 2-->
|
||||||
|
<!-- AND it2.role_code = #{authPO.roleCode}-->
|
||||||
|
<!-- AND it1.half_select = 1-->
|
||||||
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
|
<!-- AND it1.org_id = a.org_id-->
|
||||||
|
<!-- )-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </where>-->
|
||||||
|
<!-- GROUP BY-->
|
||||||
|
<!-- a.psn_type-->
|
||||||
|
<!-- ) t ON t.psn_type = p.psn_type-->
|
||||||
|
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- <if test="param.psnTypeList != null and param.psnTypeList.size() > 0">-->
|
||||||
|
<!-- and p.psn_type in-->
|
||||||
|
<!-- <foreach collection="param.psnTypeList" item="psnType" separator="," open="("-->
|
||||||
|
<!-- close=")">-->
|
||||||
|
<!-- #{psnType}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </where>-->
|
||||||
|
|
||||||
|
<!-- ORDER BY change_flag IS NULL, total_amount DESC, p.psn_type nulls LAST-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<select id="listTypeSummaryByDay" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeTypeVO">
|
||||||
|
SELECT
|
||||||
|
d.statistic_date,
|
||||||
|
d.psn_type,
|
||||||
|
d.psn_type_name,
|
||||||
|
ifnull( t.consume_num, 0 ) AS consume_num,
|
||||||
|
ifnull( t.consume_amount, 0 ) AS consume_amount,
|
||||||
|
ifnull( t.consume_repair_num, 0 ) AS consume_repair_num,
|
||||||
|
ifnull( t.consume_repair_amount, 0 ) AS consume_repair_amount,
|
||||||
|
ifnull( t.consume_refund_num, 0 ) AS consume_refund_num,
|
||||||
|
ifnull( t.consume_refund_amount, 0 ) AS consume_refund_amount,
|
||||||
|
ifnull( t.consume_amount, 0 ) + ifnull( t.consume_repair_amount, 0 ) - ifnull( t.consume_refund_amount, 0 ) AS
|
||||||
|
total_amount,
|
||||||
|
t.change_flag
|
||||||
|
FROM (
|
||||||
|
SELECT p.*, e.statistic_date FROM ( SELECT psn_type_name, psn_type, 0 as idno FROM cust_psn_type UNION ALL SELECT '—' AS
|
||||||
|
psn_type_name, - 1 AS psn_type, 0 as idno ) p
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
date_add( date_sub( #{param.startDate}, INTERVAL 1 DAY ), INTERVAL (CAST(custom_id AS signed INTEGER)) DAY) statistic_date, 0 as idno
|
||||||
|
FROM
|
||||||
|
menu_custom_dict
|
||||||
|
WHERE
|
||||||
|
custom_id <![CDATA[ <= ]]> DATEDIFF(#{param.endDate}, date_sub( #{param.startDate}, INTERVAL 1 DAY ))
|
||||||
|
) e on e.idno = p.idno
|
||||||
|
) d LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
statistic_date,
|
||||||
|
ifnull( a.psn_type, - 1 ) AS psn_type,
|
||||||
|
sum( consume_num ) AS consume_num,
|
||||||
|
sum( consume_amount ) AS consume_amount,
|
||||||
|
sum( consume_repair_num ) AS consume_repair_num,
|
||||||
|
sum( consume_repair_amount ) AS consume_repair_amount,
|
||||||
|
sum( consume_refund_num ) AS consume_refund_num,
|
||||||
|
sum( consume_refund_amount ) AS consume_refund_amount,
|
||||||
|
1 AS change_flag
|
||||||
|
FROM
|
||||||
|
report_account_consume_sum_type a
|
||||||
|
<where>
|
||||||
|
AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 0
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = a.org_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
GROUP BY
|
||||||
|
a.statistic_date,
|
||||||
|
a.psn_type
|
||||||
|
) t ON t.psn_type = d.psn_type and t.statistic_date = d.statistic_date
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<if test="param.psnTypeList != null and param.psnTypeList.size() > 0">
|
||||||
|
and d.psn_type in
|
||||||
|
<foreach collection="param.psnTypeList" item="psnType" separator="," open="("
|
||||||
|
close=")">
|
||||||
|
#{psnType}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
|
ORDER BY d.statistic_date DESC, t.change_flag IS NULL, total_amount DESC, -t.psn_type
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- <select id="listTypeSummaryByDay" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeTypeVO" databaseId="kb">-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- d.statistic_date,-->
|
||||||
|
<!-- d.psn_type,-->
|
||||||
|
<!-- d.psn_type_name,-->
|
||||||
|
<!-- ifnull( t.consume_num, 0 ) AS consume_num,-->
|
||||||
|
<!-- ifnull( t.consume_amount, 0 ) AS consume_amount,-->
|
||||||
|
<!-- ifnull( t.consume_repair_num, 0 ) AS consume_repair_num,-->
|
||||||
|
<!-- ifnull( t.consume_repair_amount, 0 ) AS consume_repair_amount,-->
|
||||||
|
<!-- ifnull( t.consume_refund_num, 0 ) AS consume_refund_num,-->
|
||||||
|
<!-- ifnull( t.consume_refund_amount, 0 ) AS consume_refund_amount,-->
|
||||||
|
<!-- ifnull( t.consume_amount, 0 ) + ifnull( t.consume_repair_amount, 0 ) - ifnull( t.consume_refund_amount, 0 ) AS-->
|
||||||
|
<!-- total_amount,-->
|
||||||
|
<!-- t.change_flag-->
|
||||||
|
<!-- FROM (-->
|
||||||
|
<!-- SELECT p.*, e.statistic_date FROM ( SELECT psn_type_name, psn_type, 0 as idno FROM cust_psn_type UNION ALL SELECT '—' AS-->
|
||||||
|
<!-- psn_type_name, - 1 AS psn_type, 0 as idno ) p-->
|
||||||
|
<!-- LEFT JOIN (-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- (TO_DATE(#{param.startDate}, 'YYYY-MM-DD') + ROWNUM - 1) as statistic_date,-->
|
||||||
|
<!-- 0 as idno-->
|
||||||
|
<!-- FROM-->
|
||||||
|
<!-- DUAL-->
|
||||||
|
<!-- CONNECT BY-->
|
||||||
|
<!-- ROWNUM <![CDATA[<=]]> TO_DATE(#{param.endDate}, 'YYYY-MM-DD') - TO_DATE(#{param.startDate}, 'YYYY-MM-DD') + 1-->
|
||||||
|
<!-- ) e on e.idno = p.idno-->
|
||||||
|
<!-- ) d LEFT JOIN (-->
|
||||||
|
<!-- SELECT-->
|
||||||
|
<!-- statistic_date,-->
|
||||||
|
<!-- ifnull( a.psn_type, - 1 ) AS psn_type,-->
|
||||||
|
<!-- sum( consume_num ) AS consume_num,-->
|
||||||
|
<!-- sum( consume_amount ) AS consume_amount,-->
|
||||||
|
<!-- sum( consume_repair_num ) AS consume_repair_num,-->
|
||||||
|
<!-- sum( consume_repair_amount ) AS consume_repair_amount,-->
|
||||||
|
<!-- sum( consume_refund_num ) AS consume_refund_num,-->
|
||||||
|
<!-- sum( consume_refund_amount ) AS consume_refund_amount,-->
|
||||||
|
<!-- 1 AS change_flag-->
|
||||||
|
<!-- FROM-->
|
||||||
|
<!-- report_account_consume_sum_type a-->
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}-->
|
||||||
|
<!-- <if test="'2'.toString() == authPO.roleType.toString()">-->
|
||||||
|
<!-- and EXISTS (-->
|
||||||
|
<!-- SELECT null-->
|
||||||
|
<!-- FROM mgr_role_org it1-->
|
||||||
|
<!-- LEFT JOIN mgr_role it2 ON it2.role_id = it1.role_id-->
|
||||||
|
<!-- LEFT JOIN mgr_user_role it3 ON it1.role_id = it3.role_id-->
|
||||||
|
<!-- WHERE it2.del_flag = 2-->
|
||||||
|
<!-- AND it2.role_code = #{authPO.roleCode}-->
|
||||||
|
<!-- AND it1.half_select = 1-->
|
||||||
|
<!-- AND it3.user_id = #{authPO.userId}-->
|
||||||
|
<!-- AND it1.org_id = a.org_id-->
|
||||||
|
<!-- )-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </where>-->
|
||||||
|
<!-- GROUP BY-->
|
||||||
|
<!-- a.statistic_date,-->
|
||||||
|
<!-- a.psn_type-->
|
||||||
|
<!-- ) t ON t.psn_type = d.psn_type and t.statistic_date = d.statistic_date-->
|
||||||
|
|
||||||
|
<!-- <where>-->
|
||||||
|
<!-- <if test="param.psnTypeList != null and param.psnTypeList.size() > 0">-->
|
||||||
|
<!-- and d.psn_type in-->
|
||||||
|
<!-- <foreach collection="param.psnTypeList" item="psnType" separator="," open="("-->
|
||||||
|
<!-- close=")">-->
|
||||||
|
<!-- #{psnType}-->
|
||||||
|
<!-- </foreach>-->
|
||||||
|
<!-- </if>-->
|
||||||
|
<!-- </where>-->
|
||||||
|
|
||||||
|
<!-- ORDER BY d.statistic_date DESC, t.change_flag IS NULL, total_amount DESC, -t.psn_type-->
|
||||||
|
<!-- </select>-->
|
||||||
|
|
||||||
|
<select id="getTypeSummaryTotal" resultType="com.bonus.canteen.core.report.statistics.account.vo.ReportAccountConsumeTypeVO">
|
||||||
|
SELECT
|
||||||
|
sum(ifnull( a.consume_num, 0 )) AS consume_num,
|
||||||
|
sum(ifnull( a.consume_amount, 0 )) AS consume_amount,
|
||||||
|
sum(ifnull( a.consume_repair_num, 0 )) AS consume_repair_num,
|
||||||
|
sum(ifnull( a.consume_repair_amount, 0 )) AS consume_repair_amount,
|
||||||
|
sum(ifnull( a.consume_refund_num, 0 )) AS consume_refund_num,
|
||||||
|
sum(ifnull( a.consume_refund_amount, 0 )) AS consume_refund_amount,
|
||||||
|
sum(ifnull( a.consume_amount, 0 ) + ifnull( a.consume_repair_amount, 0 ) - ifnull( a.consume_refund_amount, 0 )) AS total_amount
|
||||||
|
FROM
|
||||||
|
report_account_consume_sum_type a
|
||||||
|
<where>
|
||||||
|
AND a.statistic_date BETWEEN #{param.startDate} AND #{param.endDate}
|
||||||
|
<if test="param.psnTypeList != null and param.psnTypeList.size() > 0">
|
||||||
|
and a.psn_type in
|
||||||
|
<foreach collection="param.psnTypeList" item="psnType" separator="," open="("
|
||||||
|
close=")">
|
||||||
|
#{psnType}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="'2'.toString() == authPO.roleType.toString()">
|
||||||
|
and EXISTS (
|
||||||
|
SELECT null
|
||||||
|
FROM sys_role_dept it1
|
||||||
|
LEFT JOIN sys_role it2 ON it2.role_id = it1.role_id
|
||||||
|
LEFT JOIN sys_user_role it3 ON it1.role_id = it3.role_id
|
||||||
|
WHERE it2.del_flag = 0
|
||||||
|
AND it2.role_key = #{authPO.roleCode}
|
||||||
|
<!-- AND it1.half_select = 1 -->
|
||||||
|
AND it3.user_id = #{authPO.userId}
|
||||||
|
AND it1.dept_id = a.org_id
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="initByPayTime">
|
||||||
|
insert into report_account_consume_sum_type
|
||||||
|
(statistic_date,
|
||||||
|
org_id,
|
||||||
|
psn_type,
|
||||||
|
consume_num,
|
||||||
|
consume_amount,
|
||||||
|
consume_repair_num,
|
||||||
|
consume_repair_amount,
|
||||||
|
consume_refund_num,
|
||||||
|
consume_refund_amount)
|
||||||
|
select DATE_FORMAT(a.pay_time,'%Y-%m-%d') statistic_date,
|
||||||
|
s.org_id,
|
||||||
|
ifnull(s.psn_type, -1) as psn_type,
|
||||||
|
sum(if(a.flow_type = 110, 1, 0)),
|
||||||
|
abs(sum(if(a.flow_type = 110, a.flow_real_amount, 0))),
|
||||||
|
sum(if(a.flow_type = 120, 1, 0)),
|
||||||
|
abs(sum(if(a.flow_type = 120, a.flow_real_amount, 0))),
|
||||||
|
sum(if(a.flow_type = 130, 1, 0)),
|
||||||
|
abs(sum(if(a.flow_type = 130, a.flow_real_amount, 0)))
|
||||||
|
from report_account_flow a
|
||||||
|
LEFT JOIN report_account_flow_snapshot s ON a.flow_id = s.flow_id
|
||||||
|
where a.flow_type in (110, 120, 130) AND a.pay_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
group by statistic_date, s.org_id, s.psn_type
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue