mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、资金管理相关统计函数返回null处理,字段错误处理;2、软件购买记录入参赠送时长补充;
This commit is contained in:
+3
@@ -37,6 +37,9 @@ public class PurchaseRecordPageReqVO extends PageParam {
|
|||||||
@Schema(description = "购买时长")
|
@Schema(description = "购买时长")
|
||||||
private Integer purchaseDuration;
|
private Integer purchaseDuration;
|
||||||
|
|
||||||
|
@Schema(description = "赠送时长")
|
||||||
|
private Integer giftDuration;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "购买时间", example = "[2022-07-01 01:01:01 ,2022-07-01 01:01:01]")
|
@Schema(description = "购买时间", example = "[2022-07-01 01:01:01 ,2022-07-01 01:01:01]")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
|||||||
+1
@@ -47,6 +47,7 @@ public interface PurchaseRecordMapper extends BaseMapperX<PurchaseRecordDO> {
|
|||||||
.likeIfPresent(PurchaseRecordDO::getProductName, pageReqVO.getProductName())
|
.likeIfPresent(PurchaseRecordDO::getProductName, pageReqVO.getProductName())
|
||||||
.likeIfPresent(PurchaseRecordDO::getId, pageReqVO.getId())
|
.likeIfPresent(PurchaseRecordDO::getId, pageReqVO.getId())
|
||||||
.eqIfPresent(PurchaseRecordDO::getPurchaseDuration, pageReqVO.getPurchaseDuration())
|
.eqIfPresent(PurchaseRecordDO::getPurchaseDuration, pageReqVO.getPurchaseDuration())
|
||||||
|
.eqIfPresent(PurchaseRecordDO::getGiftDuration, pageReqVO.getGiftDuration())
|
||||||
.betweenIfPresent(PurchaseRecordDO::getCreateTime, pageReqVO.getCreateTime())
|
.betweenIfPresent(PurchaseRecordDO::getCreateTime, pageReqVO.getCreateTime())
|
||||||
.likeIfPresent(PurchaseRecordDO::getCreator, pageReqVO.getCreator())
|
.likeIfPresent(PurchaseRecordDO::getCreator, pageReqVO.getCreator())
|
||||||
.eqIfPresent(PurchaseRecordDO::getTotalAmount, pageReqVO.getProductPrice())
|
.eqIfPresent(PurchaseRecordDO::getTotalAmount, pageReqVO.getProductPrice())
|
||||||
|
|||||||
+2
-2
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<select id="selectOrganIncomeExpenseTrendGroupByCreateTime"
|
<select id="selectOrganIncomeExpenseTrendGroupByCreateTime"
|
||||||
resultType="com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO">
|
resultType="com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO">
|
||||||
select sum(amount) as amount
|
select COALESCE(sum(amount) ,0) as amount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from income_expense_details
|
from income_expense_details
|
||||||
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
<select id="selectTotalSalesTrendGroupByCreateTime"
|
<select id="selectTotalSalesTrendGroupByCreateTime"
|
||||||
resultType="com.cf.imes.module.system.dal.dataobject.funds.statistics.FundsTradeTypeGroupStatisticsDO">
|
resultType="com.cf.imes.module.system.dal.dataobject.funds.statistics.FundsTradeTypeGroupStatisticsDO">
|
||||||
select sum(amount) as amount
|
select COALESCE(sum(amount) ,0) as amount
|
||||||
<include refid="dateFormat"/>
|
<include refid="dateFormat"/>
|
||||||
from income_expense_details
|
from income_expense_details
|
||||||
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
||||||
|
|||||||
+3
-2
@@ -2,8 +2,9 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.cf.imes.module.system.dal.mysql.funds.invoice.InvoiceRecordsMapper">
|
<mapper namespace="com.cf.imes.module.system.dal.mysql.funds.invoice.InvoiceRecordsMapper">
|
||||||
<select id="getManageInvoiceAmountStatistics" resultType="com.cf.imes.module.system.controller.admin.funds.invoice.vo.InvoiceAmountRespVO">
|
<select id="getManageInvoiceAmountStatistics" resultType="com.cf.imes.module.system.controller.admin.funds.invoice.vo.InvoiceAmountRespVO">
|
||||||
select sum(case when status = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}' then invoice_amount else 0 end) as pendingInvoice,
|
select COALESCE(sum(case when status = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}' then invoice_amount else 0 end), 0) as pendingInvoice,
|
||||||
sum(case when status = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}' then invoice_amount else 0 end) as invoiced
|
COALESCE(sum(case when status = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}' then invoice_amount else 0 end), 0) as invoiced
|
||||||
from invoice_records
|
from invoice_records
|
||||||
|
where deleted = false
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.cf.imes.module.system.dal.mysql.pay.PayOrderMapper">
|
<mapper namespace="com.cf.imes.module.system.dal.mysql.pay.PayOrderMapper">
|
||||||
|
|
||||||
<select id="getRechargeTotalAmount" resultType="java.math.BigDecimal">
|
<select id="getRechargeTotalAmount" resultType="java.math.BigDecimal">
|
||||||
select sum(price) from pay_order
|
select COALESCE(sum(price) ,0) from pay_order
|
||||||
where status = '${@com.cf.imes.module.system.enums.pay.PayOrderStatusEnum@SUCCESS.status}' and deleted = false
|
where status = '${@com.cf.imes.module.system.enums.pay.PayOrderStatusEnum@SUCCESS.status}' and deleted = false
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
+10
-10
@@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="com.cf.imes.module.system.dal.mysql.funds.purchase.PurchaseRecordMapper">
|
<mapper namespace="com.cf.imes.module.system.dal.mysql.funds.purchase.PurchaseRecordMapper">
|
||||||
<select id="getInvoicingAmount" resultType="java.math.BigDecimal">
|
<select id="getInvoicingAmount" resultType="java.math.BigDecimal">
|
||||||
SELECT SUM(totalAmount) AS total_spent
|
SELECT COALESCE(SUM(total_amount) ,0) AS total_spent
|
||||||
FROM purchase_record
|
FROM purchase_record
|
||||||
where organ_id = #{organId} and is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}' and deleted = false and initial != true;
|
where organ_id = #{organId} and is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}' and deleted = false and initial != true;
|
||||||
</select>
|
</select>
|
||||||
@@ -10,35 +10,35 @@
|
|||||||
<!-- 查询机构下开票金额统计:可开票、开票中、已开票-->
|
<!-- 查询机构下开票金额统计:可开票、开票中、已开票-->
|
||||||
<select id="getOrgInvoiceAmountStatistics" resultType="com.cf.imes.module.system.controller.admin.funds.invoice.vo.InvoiceAmountRespVO">
|
<select id="getOrgInvoiceAmountStatistics" resultType="com.cf.imes.module.system.controller.admin.funds.invoice.vo.InvoiceAmountRespVO">
|
||||||
SELECT
|
SELECT
|
||||||
SUM(
|
COALESCE(SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
|
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
|
||||||
THEN external_spent
|
THEN external_spent
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) AS invocable,
|
) ,0) AS invocable,
|
||||||
|
|
||||||
SUM(
|
COALESCE(SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}'
|
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}'
|
||||||
THEN external_spent
|
THEN external_spent
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) AS inTheInvoice,
|
) ,0) AS inTheInvoice,
|
||||||
|
|
||||||
SUM(
|
COALESCE(SUM(
|
||||||
CASE
|
CASE
|
||||||
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}'
|
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}'
|
||||||
THEN external_spent
|
THEN external_spent
|
||||||
ELSE 0
|
ELSE 0
|
||||||
END
|
END
|
||||||
) AS invoiced
|
) ,0) AS invoiced
|
||||||
from purchase_record
|
from purchase_record
|
||||||
where organ_id = #{organId} and deleted = false and initial != true;
|
where organ_id = #{organId} and deleted = false and initial != true;
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getInvoicableAmount" resultType="java.math.BigDecimal">
|
<select id="getInvoicableAmount" resultType="java.math.BigDecimal">
|
||||||
select sum(external_spent) from purchase_record
|
select COALESCE(sum(external_spent) ,0) from purchase_record
|
||||||
where organ_id = #{organId} and is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
|
where organ_id = #{organId} and is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
|
||||||
and id in
|
and id in
|
||||||
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
<foreach collection="ids" item="id" open="(" close=")" separator=",">
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<select id="getTotalSales"
|
<select id="getTotalSales"
|
||||||
resultType="com.cf.imes.module.system.controller.admin.funds.organamount.vo.TotalSalesAmountRespVO">
|
resultType="com.cf.imes.module.system.controller.admin.funds.organamount.vo.TotalSalesAmountRespVO">
|
||||||
select
|
select
|
||||||
sum(total_amount) as amount
|
COALESCE(sum(total_amount) ,0) as amount
|
||||||
from purchase_record
|
from purchase_record
|
||||||
where deleted = false and initial != true;
|
where deleted = false and initial != true;
|
||||||
</select>
|
</select>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<select id="getTodaySales"
|
<select id="getTodaySales"
|
||||||
resultType="java.math.BigDecimal">
|
resultType="java.math.BigDecimal">
|
||||||
select
|
select
|
||||||
sum(total_amount) as amount
|
COALESCE(sum(total_amount) ,0) as amount
|
||||||
from purchase_record
|
from purchase_record
|
||||||
where deleted = false and initial != true
|
where deleted = false and initial != true
|
||||||
and create_time >= CURDATE()
|
and create_time >= CURDATE()
|
||||||
|
|||||||
Reference in New Issue
Block a user