update 大数据屏接口

This commit is contained in:
jsowell
2026-08-04 16:29:17 +08:00
parent bfa209becb
commit 9315e701e6
22 changed files with 320 additions and 83 deletions

View File

@@ -346,12 +346,42 @@
</select>
<select id="countTotalMembers" resultType="java.lang.Long">
select count(*) from member_basic_info where del_flag = '0'
select count(*) from member_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>
<!-- 站点管理员:统计站点所属运营商下的会员 -->
<if test="stationIdList != null and stationIdList.size() > 0">
and t1.merchant_id in (
select merchant_id from pile_station_info where del_flag = '0' and id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
</select>
<select id="countTodayNewMembers" resultType="java.lang.Long">
select count(*) from member_basic_info where del_flag = '0'
and create_time <![CDATA[ >= ]]> #{startTime}
and create_time <![CDATA[ < ]]> #{endTime}
select count(*) from member_basic_info t1 where t1.del_flag = '0'
and t1.create_time <![CDATA[ >= ]]> #{startTime}
and t1.create_time <![CDATA[ < ]]> #{endTime}
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 站点管理员:统计站点所属运营商下的会员 -->
<if test="stationIdList != null and stationIdList.size() > 0">
and t1.merchant_id in (
select merchant_id from pile_station_info where del_flag = '0' and id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
)
</if>
</select>
</mapper>

View File

@@ -3712,6 +3712,18 @@
and t1.order_status = '6'
and t1.create_time <![CDATA[ >= ]]> #{startTime}
and t1.create_time <![CDATA[ < ]]> #{endTime}
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<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>
<!-- 今日充电电量明细Java汇总日期由代码传入 -->
@@ -3723,5 +3735,17 @@
and t1.order_status = '6'
and t1.create_time <![CDATA[ >= ]]> #{startTime}
and t1.create_time <![CDATA[ < ]]> #{endTime}
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<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>

View File

@@ -512,12 +512,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</update>
<!-- 本月日均充电电量按trade_date分组取每日合计Java层再对行数取平均 -->
<select id="getMonthlyAvgElectricity" resultType="java.math.BigDecimal">
select t1.use_electricity
select sum(t1.use_electricity)
from settle_order_report t1
where t1.del_flag = '0'
and t1.trade_date >= #{monthStartDate}
and t1.trade_date <![CDATA[ < ]]> #{monthEndDate}
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t1.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="stationIdList != null and stationIdList.size() > 0">
and t1.station_id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
group by t1.trade_date
</select>
<select id="countTotalPilesByStationIds" resultType="java.lang.Long">

View File

@@ -352,14 +352,46 @@
</select>
<select id="countTotalConnectors" resultType="java.lang.Long">
select count(*) from pile_connector_info where del_flag = '0'
select count(*)
from pile_connector_info t1
<if test="(merchantIdList != null and merchantIdList.size() > 0) or (stationIdList != null and stationIdList.size() > 0)">
join pile_basic_info t2 on t2.sn = t1.pile_sn and t2.del_flag = '0'
</if>
where t1.del_flag = '0'
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t2.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="stationIdList != null and stationIdList.size() > 0">
and t2.station_id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="countOnlinePiles" resultType="java.lang.Long">
select count(distinct t1.pile_sn)
from pile_connector_info t1
<if test="(merchantIdList != null and merchantIdList.size() > 0) or (stationIdList != null and stationIdList.size() > 0)">
join pile_basic_info t2 on t2.sn = t1.pile_sn and t2.del_flag = '0'
</if>
where t1.del_flag = '0'
and t1.status not in ('0', '255')
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t2.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="stationIdList != null and stationIdList.size() > 0">
and t2.station_id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="countDcPiles" resultType="java.lang.Long">
@@ -369,6 +401,18 @@
join pile_model_info t3 on t3.id = t2.model_id and t3.del_flag = '0'
where t1.del_flag = '0'
and t3.speed_type = '1'
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t2.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="stationIdList != null and stationIdList.size() > 0">
and t2.station_id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="countAcPiles" resultType="java.lang.Long">
@@ -378,5 +422,17 @@
join pile_model_info t3 on t3.id = t2.model_id and t3.del_flag = '0'
where t1.del_flag = '0'
and t3.speed_type = '2'
<if test="merchantIdList != null and merchantIdList.size() > 0">
and t2.merchant_id in
<foreach collection="merchantIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="stationIdList != null and stationIdList.size() > 0">
and t2.station_id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
</mapper>

View File

@@ -759,7 +759,19 @@
</select>
<select id="countTotalStations" resultType="java.lang.Long">
select count(*) from pile_station_info where del_flag = '0'
select count(*) from pile_station_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>
<if test="stationIdList != null and stationIdList.size() > 0">
and t1.id in
<foreach collection="stationIdList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="getStationMapData" resultType="com.jsowell.pile.vo.web.StationMapVO">