mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-16 05:10:04 +08:00
update 首页数据大屏
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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 < 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>
|
||||
|
||||
Reference in New Issue
Block a user