1、管理端分析页账户资金统计改为只展示销售额;2、移除组织资金相关;

This commit is contained in:
gaoqr
2025-11-07 10:24:22 +08:00
parent 55a75f8d3c
commit 3ff8a544b0
13 changed files with 75 additions and 226 deletions
@@ -1,32 +0,0 @@
<?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.cf.imes.module.system.dal.mysql.funds.organamount.OrganAmountMapper">
<sql id="dateFormat">
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
,CONCAT(YEAR(create_time), '-', QUARTER(create_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', WEEK(create_time, 1)) AS date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', DAY(create_time)) as date
</if>
</sql>
<select id="selectOrganIncomeExpenseTrendGroupByCreateTime"
resultType="com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO">
select sum(cash_amount_change) as amount
<include refid="dateFormat"/>
from income_expense_details
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
<if test="organId != null">
and organ_id = #{organId}
</if>
GROUP BY date
</select>
</mapper>
@@ -1,4 +1,41 @@
<?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.cf.imes.module.system.dal.mysql.incomeandexpense.IncomeExpenseDetailsMapper">
<sql id="dateFormat">
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
,CONCAT(YEAR(create_time), '-', QUARTER(create_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', WEEK(create_time, 1)) AS date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
,CONCAT(YEAR(create_time), '-', MONTH(create_time), '-', DAY(create_time)) as date
</if>
</sql>
<select id="selectOrganIncomeExpenseTrendGroupByCreateTime"
resultType="com.cf.imes.module.system.controller.admin.funds.organamount.vo.OrganAmountGroupByCreateTimeRespVO">
select sum(amount) as amount
<include refid="dateFormat"/>
from income_expense_details
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
and deleted = false
<if test="organId != null">
and organ_id = #{organId}
</if>
GROUP BY date
</select>
<select id="selectTotalSalesTrendGroupByCreateTime"
resultType="com.cf.imes.module.system.dal.dataobject.funds.statistics.FundsTradeTypeGroupStatisticsDO">
select sum(amount) as amount
<include refid="dateFormat"/>
from income_expense_details
where create_time between #{req.createTime[0]} and #{req.createTime[1]}
and deleted = false
GROUP BY date
</select>
</mapper>
@@ -6,32 +6,4 @@
select sum(price) from pay_order
where status = '${@com.cf.imes.module.system.enums.pay.PayOrderStatusEnum@SUCCESS.status}' and deleted = false
</select>
<sql id="dateCreate">
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@QUARTER.getValue()">
,CONCAT(YEAR(o.notify_time), '-', QUARTER(o.notify_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@MONTH.getValue()">
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time)) as date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@WEEK.getValue()">
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time), '-', FLOOR((DayOfMonth(o.notify_time)-1)/7)+1) AS
date
</if>
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.StatisticsUnit@DAY.getValue()">
,CONCAT(YEAR(o.notify_time), '-', MONTH(o.notify_time), '-', DAY(o.notify_time)) as date
</if>
</sql>
<select id="getRechargeGroupStatistics"
resultType="com.cf.imes.module.system.dal.dataobject.funds.statistics.FundsTradeTypeGroupStatisticsDO">
select sum(o.price) as amount
<include refid="dateCreate"/>
from pay_order o
where o.deleted = false
and o.status = '${@com.cf.imes.module.system.enums.pay.PayOrderStatusEnum@SUCCESS.status}'
and o.trade_type = '${@com.cf.imes.module.system.enums.pay.TradeTypeEnum@RECHARGE.code}'
and o.notify_time between #{req.createTime[0]} and #{req.createTime[1]}
group by date;
</select>
</mapper>
@@ -2,12 +2,7 @@
<!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">
<select id="getInvoicingAmount" resultType="java.math.BigDecimal">
SELECT SUM(
CASE
WHEN initial = TRUE THEN total_amount
ELSE account_balance_spent
END
) AS total_spent
SELECT SUM(totalAmount) AS total_spent
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;
</select>
@@ -18,7 +13,7 @@
SUM(
CASE
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
THEN account_balance_spent + external_spent
THEN external_spent
ELSE 0
END
) AS invocable,
@@ -26,7 +21,7 @@
SUM(
CASE
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@PENDINGINVOICING.code}'
THEN account_balance_spent + external_spent
THEN external_spent
ELSE 0
END
) AS inTheInvoice,
@@ -34,7 +29,7 @@
SUM(
CASE
WHEN is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICINGSUCCESSFUL.code}'
THEN account_balance_spent + external_spent
THEN external_spent
ELSE 0
END
) AS invoiced
@@ -43,7 +38,7 @@
</select>
<select id="getInvoicableAmount" resultType="java.math.BigDecimal">
select sum(account_balance_spent + external_spent) from purchase_record
select sum(external_spent) from purchase_record
where organ_id = #{organId} and is_invocing = '${@com.cf.imes.module.system.enums.pay.InvoiceStatusEnum@INVOICABLE.code}'
and id in
<foreach collection="ids" item="id" open="(" close=")" separator=",">
@@ -63,7 +58,7 @@
<select id="getTodaySales"
resultType="java.math.BigDecimal">
select
sum(total_amount - gift_money_spent) as amount
sum(total_amount) as amount
from purchase_record
where deleted = false and initial != true
and create_time &gt;= CURDATE()
@@ -85,14 +80,4 @@
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
</if>
</sql>
<select id="getPurchaseGroupStatistics"
resultType="com.cf.imes.module.system.dal.dataobject.funds.statistics.FundsTradeTypeGroupStatisticsDO">
select sum(o.total_amount - o.gift_money_spent) as amount
<include refid="dateCreate"/>
from purchase_record o
where o.deleted = false and o.initial != true
and o.create_time between #{req.createTime[0]} and #{req.createTime[1]}
group by date;
</select>
</mapper>