Merge branch 'dev' into feature-integrated_with_JCPP

This commit is contained in:
Guoqs
2026-01-08 09:38:32 +08:00
20 changed files with 573 additions and 156 deletions

View File

@@ -1934,6 +1934,46 @@
join pile_station_info t3 on t1.station_id = t3.id and t3.del_flag = '0'
join order_detail t4 on t4.order_code = t1.order_code and t4.del_flag = '0'
where t1.del_flag = '0'
<!-- 优先使用最严格的过滤条件,减少扫描数据量 -->
<if test="stationIdList != null and stationIdList.size() != 0">
and t1.station_id in
<foreach collection="stationIdList" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
</if>
<if test="excludeStationIdList != null and excludeStationIdList.size() != 0">
and t1.station_id not in
<foreach close=")" collection="excludeStationIdList" item="excludeStationId" open="(" separator=",">
#{excludeStationId}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
and t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
and t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<if test="orderStatus != null and orderStatus != ''">
and t1.order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="startMode != null and startMode != ''">
and t1.start_mode = #{startMode,jdbcType=VARCHAR}
</if>
<if test="stationName != null and stationName != ''">
and t3.station_name like concat('%', #{stationName,jdbcType=VARCHAR}, '%')
</if>
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
and t3.dept_id in
<foreach close=")" collection="stationDeptIds" item="stationDeptId" open="(" separator=",">
#{stationDeptId}
</foreach>
</if>
<if test="orderCode != null and orderCode != ''">
and t1.order_code = #{orderCode,jdbcType=VARCHAR}
</if>
<if test="transactionCode != null and transactionCode != ''">
and t1.transaction_code = #{transactionCode,jdbcType=VARCHAR}
</if>
<if test="pileSn != null and pileSn != ''">
and t1.pile_sn = #{pileSn,jdbcType=VARCHAR}
</if>
@@ -1943,15 +1983,6 @@
<if test="memberId != null and memberId != ''">
and t1.member_id = #{memberId,jdbcType=VARCHAR}
</if>
<if test="orderStatus != null and orderStatus != ''">
and t1.order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="orderCode != null and orderCode != ''">
and t1.order_code = #{orderCode,jdbcType=VARCHAR}
</if>
<if test="transactionCode != null and transactionCode != ''">
and t1.transaction_code = #{transactionCode,jdbcType=VARCHAR}
</if>
<if test="mobileNumber != null and mobileNumber != ''">
and t2.mobile_number = #{mobileNumber,jdbcType=VARCHAR}
</if>
@@ -1961,12 +1992,6 @@
<if test="stationId != null and stationId != ''">
and t1.station_id = #{stationId,jdbcType=VARCHAR}
</if>
<if test="startTime != null and startTime != ''">
and t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
and t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<if test="startSettleTime != null and startSettleTime != ''">
and t1.settlement_time <![CDATA[ >= ]]> #{startSettleTime,jdbcType=VARCHAR}
</if>
@@ -1985,30 +2010,6 @@
<if test="payMode != null and payMode != ''">
and t1.pay_mode = #{payMode,jdbcType=VARCHAR}
</if>
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
and t3.dept_id in
<foreach close=")" collection="stationDeptIds" item="stationDeptId" open="(" separator=",">
#{stationDeptId}
</foreach>
</if>
<if test="excludeStationIdList != null and excludeStationIdList.size() != 0">
and t1.station_id not in
<foreach close=")" collection="excludeStationIdList" item="excludeStationId" open="(" separator=",">
#{excludeStationId}
</foreach>
</if>
<if test="stationIdList != null and stationIdList.size() != 0">
and t1.station_id in
<foreach collection="stationIdList" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
</if>
<if test="startMode != null and startMode != ''">
and t1.start_mode = #{startMode,jdbcType=VARCHAR}
</if>
<if test="stationName != null and stationName != ''">
and t3.station_name like concat('%', #{stationName,jdbcType=VARCHAR}, '%')
</if>
order by t1.create_time desc
</select>
@@ -2087,62 +2088,53 @@
resultType="com.jsowell.pile.vo.web.OrderStatisticsVO">
SELECT
COUNT(*) AS orderCount,
IFNULL(SUM(order_amount), 0) AS orderAmount
FROM (
SELECT DISTINCT
t1.order_code,
t1.order_amount
FROM order_basic_info t1
LEFT JOIN member_basic_info t2
ON t1.member_id = t2.member_id
AND t2.del_flag = '0'
IFNULL(SUM(t1.order_amount), 0) AS orderAmount
FROM order_basic_info t1
<if test="(stationName != null and stationName != '') or (stationDeptIds != null and stationDeptIds.size() != 0)">
JOIN pile_station_info t3
ON t1.station_id = t3.id
AND t3.del_flag = '0'
JOIN order_detail t4
ON t4.order_code = t1.order_code
AND t4.del_flag = '0'
WHERE t1.del_flag = '0'
<if test="orderStatus != null and orderStatus != ''">
AND t1.order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="merchantId != null and merchantId != ''">
AND t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
</if>
<if test="stationId != null and stationId != ''">
AND t1.station_id = #{stationId,jdbcType=VARCHAR}
</if>
<if test="startTime != null and startTime != ''">
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<if test="stationIdList != null and stationIdList.size() != 0">
AND t1.station_id IN
<foreach collection="stationIdList" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
</if>
<if test="startMode != null and startMode != ''">
AND t1.start_mode = #{startMode,jdbcType=VARCHAR}
</if>
<if test="stationName != null and stationName != ''">
AND t3.station_name LIKE CONCAT('%', #{stationName,jdbcType=VARCHAR}, '%')
</if>
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
AND t3.dept_id IN
<foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
#{stationDeptId}
</foreach>
</if>
<if test="excludeStationIdList != null and excludeStationIdList.size() != 0">
AND t1.station_id NOT IN
<foreach collection="excludeStationIdList" item="excludeStationId" open="(" separator="," close=")">
#{excludeStationId}
</foreach>
</if>
) AS temp
</if>
WHERE t1.del_flag = '0'
<if test="stationIdList != null and stationIdList.size() != 0">
AND t1.station_id IN
<foreach collection="stationIdList" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
</if>
<if test="excludeStationIdList != null and excludeStationIdList.size() != 0">
AND t1.station_id NOT IN
<foreach collection="excludeStationIdList" item="excludeStationId" open="(" separator="," close=")">
#{excludeStationId}
</foreach>
</if>
<if test="orderStatus != null and orderStatus != ''">
AND t1.order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="startMode != null and startMode != ''">
AND t1.start_mode = #{startMode,jdbcType=VARCHAR}
</if>
<if test="startTime != null and startTime != ''">
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<if test="merchantId != null and merchantId != ''">
AND t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
</if>
<if test="stationId != null and stationId != ''">
AND t1.station_id = #{stationId,jdbcType=VARCHAR}
</if>
<if test="stationName != null and stationName != ''">
AND t3.station_name LIKE CONCAT('%', #{stationName,jdbcType=VARCHAR}, '%')
</if>
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
AND t3.dept_id IN
<foreach collection="stationDeptIds" item="stationDeptId" open="(" separator="," close=")">
#{stationDeptId}
</foreach>
</if>
</select>
<select id="selectOrderBasicInfoById" parameterType="Long" resultMap="OrderBasicInfoOrderDetailResult">
@@ -3600,4 +3592,17 @@
and `settlement_time` BETWEEN #{dto.startTime,jdbcType=VARCHAR} and #{dto.endTime,jdbcType=VARCHAR}
group by DATE_FORMAT(settlement_time, '%Y-%m-%d');
</select>
<select id="batchQueryChargingConnectorInfo"
resultType="com.jsowell.pile.vo.web.PileConnectorInfoVO">
select
order_code as orderCode,
transaction_code as transactionCode,
pile_connector_code as pileConnectorCode
from order_basic_info where pile_connector_code in
<foreach item="pileConnectorCode" collection="pileConnectorCodes" separator="," open="(" close=")">
#{pileConnectorCode}
</foreach>
and order_status = '1'
</select>
</mapper>

View File

@@ -319,4 +319,27 @@
AND
t1.del_flag = '0'
</select>
<select id="batchSelectConnectorListByStatus" resultType="com.jsowell.pile.vo.base.ConnectorInfoVO">
SELECT
t1.pile_connector_code as pileConnectorCode,
t2.station_id as stationId,
t1.STATUS as connectorStatus,
t1.pile_sn as pileSn,
t2.model_id as modelId,
t3.speed_type as chargingType,
t3.rated_power as ratedPower
FROM
pile_connector_info t1
JOIN pile_basic_info t2 ON (t1.pile_sn = t2.sn AND t2.del_flag = '0')
JOIN pile_model_info t3 ON (t2.model_id = t3.id AND t3.del_flag = '0')
WHERE t1.del_flag = '0'
AND t2.station_id in
<foreach collection="stationIds" item="stationId" open="(" separator="," close=")">
#{stationId, jdbcType=VARCHAR}
</foreach>
<if test="status != null and status != ''">
AND t1.status = #{status,jdbcType=VARCHAR}
</if>
</select>
</mapper>

View File

@@ -743,4 +743,15 @@
ORDER BY
chargeNum DESC;
</select>
<select id="getStationIdsByMerchantIds" resultType="java.lang.String">
select
id
from
pile_station_info
where merchant_id in
<foreach collection="merchantIds" item="merchantId" open="(" separator="," close=")">
#{merchantId,jdbcType=VARCHAR}
</foreach>
</select>
</mapper>