zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml | ●●●●● patch | view | raw | blame | history |
zq-erp/src/main/java/com/matrix/system/app/vo/BusinessesDataShowVo.java
New file @@ -0,0 +1,111 @@ package com.matrix.system.app.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; /** * @author wzy * @date 2020-12-29 **/ @ApiModel(value = "BusinessDataShowVo", description = "经营报表返回参数类") public class BusinessesDataShowVo { @ApiModelProperty(value = "时间") private String time; @ApiModelProperty(value = "营业收入") private String totalPay; @ApiModelProperty(value = "现金收入") private String cashPay; @ApiModelProperty(value = "余额划扣") private String cardPay; @ApiModelProperty(value = "欠款") private String arrearsPay; @ApiModelProperty(value = "赠送消耗") private String freeConsumePay; @ApiModelProperty(value = "本金消耗") private String consumePay; @ApiModelProperty(value = "现金退款") private String refundCashPay; @ApiModelProperty(value = "卡项退款") private String refundCardPay; public String getTime() { return time; } public void setTime(String time) { this.time = time; } public String getTotalPay() { return totalPay; } public void setTotalPay(String totalPay) { this.totalPay = totalPay; } public String getCashPay() { return cashPay; } public void setCashPay(String cashPay) { this.cashPay = cashPay; } public String getCardPay() { return cardPay; } public void setCardPay(String cardPay) { this.cardPay = cardPay; } public String getArrearsPay() { return arrearsPay; } public void setArrearsPay(String arrearsPay) { this.arrearsPay = arrearsPay; } public String getFreeConsumePay() { return freeConsumePay; } public void setFreeConsumePay(String freeConsumePay) { this.freeConsumePay = freeConsumePay; } public String getConsumePay() { return consumePay; } public void setConsumePay(String consumePay) { this.consumePay = consumePay; } public String getRefundCashPay() { return refundCashPay; } public void setRefundCashPay(String refundCashPay) { this.refundCashPay = refundCashPay; } public String getRefundCardPay() { return refundCardPay; } public void setRefundCardPay(String refundCardPay) { this.refundCardPay = refundCardPay; } } zq-erp/src/main/java/com/matrix/system/hive/dao/SysBusinessDataDao.java
@@ -1,6 +1,7 @@ package com.matrix.system.hive.dao; import com.matrix.core.pojo.PaginationVO; import com.matrix.system.app.vo.BusinessesDataShowVo; import com.matrix.system.hive.bean.SysBusinessData; import com.matrix.system.hive.statistics.BusinessDataShowVo; import org.apache.ibatis.annotations.Param; @@ -44,5 +45,7 @@ public SysBusinessData selectById(Integer id); public SysBusinessData selectForUpdate(Integer id); List<BusinessesDataShowVo> selectApiBusinessDataInPage(SysBusinessData data, PaginationVO pageVo); } zq-erp/src/main/resources/mybatis/mapper/hive/SysBusinessDataDao.xml
@@ -533,6 +533,42 @@ ) t </select> <select id="selectApiBusinessDataInPage" resultType="com.matrix.system.app.vo.BusinessesDataShowVo"> select date_format(a.time, #{record.t1}), sum(cashPay + cardPay + arrearsPay) totalPay, sum(cashPay) cashPay, sum(cardPay) cardPay, sum(arrearsPay) arrearsPay, sum(freeConsumePay) freeConsumePay, sum(consumePay) consumePay, sum(refundCardPay) refundCardPay, sum(refundCashPay) refundCashPay from ( select company_id, shop_id, a.time, MAX(CASE code WHEN 'cashPay' THEN value ELSE 0 END) cashPay, MAX(CASE code WHEN 'cardPay' THEN value ELSE 0 END) cardPay, MAX(CASE code WHEN 'arrearsPay' THEN value ELSE 0 END) arrearsPay, MAX(CASE code WHEN 'freeConsumePay' THEN value ELSE 0 END) freeConsumePay, MAX(CASE code WHEN 'consumePay' THEN value ELSE 0 END) consumePay, MAX(CASE code WHEN 'refundCashPay' THEN ABS(value) ELSE 0 END) refundCashPay, MAX(CASE code WHEN 'refundCardPay' THEN ABS(value) ELSE 0 END) refundCardPay from sys_business_data a group by a.time, company_id, shop_id ) a <where> <if test="record.companyId != null"> and a.company_id=#{record.companyId} </if> <if test="record.shopId != null"> and a.shop_id=#{record.shopId} </if> </where> group by date_format(a.time, #{record.t1}) order by a.time desc </select> </mapper>