update 首页数据大屏

This commit is contained in:
Lemon
2026-05-26 16:19:19 +08:00
parent 52b1535216
commit 05699d5686
15 changed files with 483 additions and 106 deletions

View File

@@ -344,6 +344,8 @@
</select>
<select id="countTodayNewMembers" resultType="java.lang.Long">
select count(*) from member_basic_info where del_flag = '0' and DATE(create_time) = CURDATE()
select count(*) from member_basic_info where del_flag = '0'
and create_time <![CDATA[ >= ]]> #{startTime}
and create_time <![CDATA[ < ]]> #{endTime}
</select>
</mapper>

View File

@@ -3703,4 +3703,25 @@
GROUP BY HOUR(t1.create_time)
ORDER BY hour ASC
</select>
<!-- 今日交易金额明细Java汇总日期由代码传入 -->
<select id="getTodayOrderAmountRows" resultType="java.math.BigDecimal">
select t1.order_amount
from order_basic_info t1
where t1.del_flag = '0'
and t1.order_status = '6'
and t1.create_time <![CDATA[ >= ]]> #{startTime}
and t1.create_time <![CDATA[ < ]]> #{endTime}
</select>
<!-- 今日充电电量明细Java汇总日期由代码传入 -->
<select id="getTodayElectricityRows" resultType="java.math.BigDecimal">
select t2.total_used_electricity
from order_basic_info t1
join order_detail t2 on t2.order_code = t1.order_code and t2.del_flag = '0'
where t1.del_flag = '0'
and t1.order_status = '6'
and t1.create_time <![CDATA[ >= ]]> #{startTime}
and t1.create_time <![CDATA[ < ]]> #{endTime}
</select>
</mapper>

View File

@@ -400,10 +400,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getGeneralSituationInfo" resultType="com.jsowell.pile.vo.web.IndexGeneralSituationVO">
select
ifnull(sum(t1.total_amount), 0) as totalChargingAmount,
ifnull(sum(t1.settle_amount), 0) as totalSettleAmount,
ifnull(sum(t1.use_electricity), 0) as totalChargingDegree,
ifnull(sum(t1.charge_num), 0) as totalChargingQuantity
t1.total_amount as totalChargingAmount,
t1.settle_amount as totalSettleAmount,
t1.use_electricity as totalChargingDegree,
t1.charge_num as totalChargingQuantity
from
settle_order_report t1
where
@@ -497,29 +497,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</update>
<select id="getTodayTransactionAmount" resultType="java.math.BigDecimal">
select ifnull(sum(t1.total_amount), 0)
from settle_order_report t1
where t1.del_flag = '0'
and t1.trade_date = DATE_FORMAT(CURDATE(), '%Y-%m-%d')
</select>
<select id="getTodayElectricity" resultType="java.math.BigDecimal">
select ifnull(sum(t1.use_electricity), 0)
from settle_order_report t1
where t1.del_flag = '0'
and t1.trade_date = DATE_FORMAT(CURDATE(), '%Y-%m-%d')
</select>
<select id="getMonthlyAvgElectricity" resultType="java.math.BigDecimal">
select ifnull(avg(day_total), 0)
from (
select sum(t1.use_electricity) as day_total
from settle_order_report t1
where t1.del_flag = '0'
and t1.trade_date >= DATE_FORMAT(DATE_SUB(CURDATE(), INTERVAL DAYOFMONTH(CURDATE()) - 1 DAY), '%Y-%m-%d')
and t1.trade_date &lt; DATE_FORMAT(DATE_ADD(CURDATE(), INTERVAL 1 DAY), '%Y-%m-%d')
group by t1.trade_date
) day_data
select t1.use_electricity
from settle_order_report t1
where t1.del_flag = '0'
and t1.trade_date >= #{monthStartDate}
and t1.trade_date <![CDATA[ < ]]> #{monthEndDate}
</select>
<select id="countTotalPilesByStationIds" resultType="java.lang.Long">
select count(distinct t1.sn)
from pile_basic_info t1
where t1.del_flag = '0'
<if test="stationIdList != null and stationIdList.size() > 0">
and t1.station_id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="countTotalPilesByMerchantIds" resultType="java.lang.Long">
select count(distinct t1.sn)
from pile_basic_info t1
where t1.del_flag = '0'
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!-- 按merchantId分组汇总settle_order_report每个商户一行Java再汇总 -->
<select id="getSettleReportGroupByMerchant" resultType="com.jsowell.pile.vo.web.IndexGeneralSituationVO">
select
t1.total_amount as totalChargingAmount,
t1.settle_amount as totalSettleAmount,
t1.use_electricity as totalChargingDegree,
t1.charge_num as totalChargingQuantity
from settle_order_report t1
where t1.del_flag = '0'
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<!-- 按stationId查settle_order_report原始行Java汇总返回 -->
<select id="getSettleReportGroupByStation" resultType="com.jsowell.pile.vo.web.IndexGeneralSituationVO">
select
t1.total_amount as totalChargingAmount,
t1.settle_amount as totalSettleAmount,
t1.use_electricity as totalChargingDegree,
t1.charge_num as totalChargingQuantity
from settle_order_report t1
where t1.del_flag = '0'
<if test="stationIdList != null and stationIdList.size() > 0">
and t1.station_id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>