Merge branch 'dev' into feature-integrated_with_JCPP

This commit is contained in:
Guoqs
2026-01-04 14:55:17 +08:00
14 changed files with 462 additions and 11 deletions

View File

@@ -1997,6 +1997,18 @@
#{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>
@@ -2066,6 +2078,73 @@
order by t1.create_time desc
</select>
<!--
统计订单数量和总金额(用于运营端小程序)
使用子查询去重,确保与分页查询 selectOrderBasicInfoList 的条件一致
包含相同的 JOIN 条件order_detail、pile_station_info和过滤条件
-->
<select id="countBusinessOrderStatistics" parameterType="com.jsowell.pile.dto.QueryOrderDTO"
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'
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
</select>
<select id="selectOrderBasicInfoById" parameterType="Long" resultMap="OrderBasicInfoOrderDetailResult">
select a.id,
a.order_code,

View File

@@ -671,6 +671,9 @@
#{stationDeptId}
</foreach>
</if>
<if test="dto.stationName != null and dto.stationName != ''">
AND t1.station_name LIKE CONCAT('%', #{dto.stationName,jdbcType=VARCHAR}, '%')
</if>
</select>
<select id="getStationInfoForAmap" resultMap="PileStationInfoResult">