mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-14 05:42:06 +08:00
1、新增账户资金统计、账户数量统计;2、管理端各项统计增加忽略组织标记;
This commit is contained in:
+28
@@ -26,4 +26,32 @@
|
||||
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.OrderStatisticsUnit@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.OrderStatisticsUnit@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.OrderStatisticsUnit@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.OrderStatisticsUnit@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>
|
||||
+26
@@ -76,4 +76,30 @@
|
||||
from purchase_record
|
||||
where deleted = false;
|
||||
</select>
|
||||
|
||||
<sql id="dateCreate">
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
||||
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS
|
||||
date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
||||
,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>
|
||||
+52
@@ -53,4 +53,56 @@
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<sql id="dateUpdate">
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
||||
,CONCAT(YEAR(o.update_time), '-', QUARTER(o.update_time)) as date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time)) as date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', FLOOR((DayOfMonth(o.update_time)-1)/7)+1) AS date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
||||
,CONCAT(YEAR(o.update_time), '-', MONTH(o.update_time), '-', DAY(o.update_time)) as date
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<sql id="dateCreate">
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@QUARTER.getValue()">
|
||||
,CONCAT(YEAR(o.create_time), '-', QUARTER(o.create_time)) as date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@MONTH.getValue()">
|
||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time)) as date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@WEEK.getValue()">
|
||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', FLOOR((DayOfMonth(o.create_time)-1)/7)+1) AS
|
||||
date
|
||||
</if>
|
||||
<if test="req.unit != null and req.unit == @com.cf.imes.framework.common.enums.OrderStatisticsUnit@DAY.getValue()">
|
||||
,CONCAT(YEAR(o.create_time), '-', MONTH(o.create_time), '-', DAY(o.create_time)) as date
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectUserStatusGroupStatistics"
|
||||
resultType="com.cf.imes.module.system.dal.dataobject.user.UserStatusGroupStatisticsDO">
|
||||
select count(o.id) as userCount
|
||||
<if test="deleted">
|
||||
<include refid="dateUpdate"/>
|
||||
</if>
|
||||
<if test="!deleted">
|
||||
<include refid="dateCreate"/>
|
||||
</if>
|
||||
from system_users o
|
||||
where
|
||||
<if test="deleted">
|
||||
o.update_time between #{req.createTime[0]} and #{req.createTime[1]}
|
||||
</if>
|
||||
<if test="!deleted">
|
||||
o.create_time between #{req.createTime[0]} and #{req.createTime[1]}
|
||||
</if>
|
||||
and o.deleted = #{deleted}
|
||||
group by date;
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user