Files
jsowell-charger-web/jsowell-pile/src/main/resources/mapper/pile/OrderBasicInfoMapper.xml

3617 lines
156 KiB
XML
Raw Normal View History

2024-01-06 15:13:50 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2023-03-04 16:29:55 +08:00
<mapper namespace="com.jsowell.pile.mapper.OrderBasicInfoMapper">
2024-12-25 14:40:57 +08:00
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.OrderBasicInfo">
<!--@mbg.generated-->
<!--@Table order_basic_info-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="order_code" jdbcType="VARCHAR" property="orderCode"/>
<result column="transaction_code" jdbcType="VARCHAR" property="transactionCode"/>
<result column="order_status" jdbcType="VARCHAR" property="orderStatus"/>
2025-06-16 15:59:44 +08:00
<result column="order_type" jdbcType="VARCHAR" property="orderType"/>
<result column="merge_charge_number" jdbcType="VARCHAR" property="mergeChargeNumber"/>
<result column="main_connector_code" jdbcType="VARCHAR" property="mainConnectorCode"/>
2024-12-25 14:40:57 +08:00
<result column="member_id" jdbcType="VARCHAR" property="memberId"/>
<result column="station_id" jdbcType="VARCHAR" property="stationId"/>
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId"/>
<result column="pile_sn" jdbcType="VARCHAR" property="pileSn"/>
<result column="connector_code" jdbcType="VARCHAR" property="connectorCode"/>
<result column="pile_connector_code" jdbcType="VARCHAR" property="pileConnectorCode"/>
<result column="logic_card" jdbcType="VARCHAR" property="logicCard"/>
<result column="vin_code" jdbcType="VARCHAR" property="vinCode"/>
<result column="start_mode" jdbcType="VARCHAR" property="startMode"/>
<result column="third_party_type" jdbcType="VARCHAR" property="thirdPartyType"/>
<result column="pay_mode" jdbcType="VARCHAR" property="payMode"/>
<result column="pay_status" jdbcType="VARCHAR" property="payStatus"/>
<result column="pay_amount" jdbcType="DECIMAL" property="payAmount"/>
<result column="pay_time" jdbcType="TIMESTAMP" property="payTime"/>
<result column="insurance_amount" jdbcType="DECIMAL" property="insuranceAmount"/>
2024-12-25 14:40:57 +08:00
<result column="plate_number" jdbcType="VARCHAR" property="plateNumber"/>
<result column="order_amount" jdbcType="DECIMAL" property="orderAmount"/>
<result column="virtual_amount" jdbcType="DECIMAL" property="virtualAmount"/>
<result column="group_code" jdbcType="VARCHAR" property="groupCode"/>
<result column="discount_amount" jdbcType="DECIMAL" property="discountAmount"/>
<result column="settle_amount" jdbcType="DECIMAL" property="settleAmount"/>
<result column="actual_received_amount" jdbcType="DECIMAL" property="actualReceivedAmount"/>
2024-12-25 14:40:57 +08:00
<result column="remedial_amount" jdbcType="DECIMAL" property="remedialAmount"/>
<result column="charge_start_time" jdbcType="TIMESTAMP" property="chargeStartTime"/>
<result column="charge_end_time" jdbcType="TIMESTAMP" property="chargeEndTime"/>
<result column="start_type" jdbcType="VARCHAR" property="startType"/>
<result column="reserved_start_time" jdbcType="TIMESTAMP" property="reservedStartTime"/>
<result column="reserved_end_time" jdbcType="TIMESTAMP" property="reservedEndTime"/>
<result column="start_soc" jdbcType="VARCHAR" property="startSoc"/>
<result column="end_soc" jdbcType="VARCHAR" property="endSoc"/>
<result column="stop_reason_code" jdbcType="VARCHAR" property="stopReasonCode"/>
<result column="reason" jdbcType="VARCHAR" property="reason"/>
<result column="settlement_time" jdbcType="TIMESTAMP" property="settlementTime"/>
<result column="refund_amount" jdbcType="DECIMAL" property="refundAmount"/>
<result column="refund_status" jdbcType="VARCHAR" property="refundStatus"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
2025-06-16 15:59:44 +08:00
id, order_code, transaction_code, order_status, order_type, merge_charge_number, main_connector_code, member_id, station_id, merchant_id,
2024-12-25 14:40:57 +08:00
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode, third_party_type,
pay_mode, pay_status, pay_amount, pay_time, insurance_amount, plate_number, order_amount, virtual_amount,
group_code, discount_amount, settle_amount, actual_received_amount, remedial_amount, charge_start_time, charge_end_time,
2024-12-25 14:40:57 +08:00
start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code, reason,
settlement_time, refund_amount,
refund_status, create_by, create_time, update_by, update_time, del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from order_basic_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete from order_basic_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderBasicInfo"
useGeneratedKeys="true">
<!--@mbg.generated-->
2025-06-16 15:59:44 +08:00
insert into order_basic_info (order_code, transaction_code, order_status, order_type, merge_charge_number, main_connector_code,
2024-12-25 14:40:57 +08:00
member_id, station_id, merchant_id,
pile_sn, connector_code, pile_connector_code,
logic_card, vin_code, start_mode,
third_party_type, pay_mode, pay_status,
pay_amount, pay_time, insurance_amount, plate_number,
2024-12-25 14:40:57 +08:00
order_amount, virtual_amount, group_code,
discount_amount, settle_amount, actual_received_amount, remedial_amount,
2024-12-25 14:40:57 +08:00
charge_start_time, charge_end_time, start_type,
reserved_start_time, reserved_end_time,
start_soc, end_soc, stop_reason_code,
reason, settlement_time, refund_amount,
refund_status, create_by, create_time,
update_by, update_time, del_flag
2024-01-06 15:13:50 +08:00
)
2024-12-25 14:40:57 +08:00
values (#{orderCode,jdbcType=VARCHAR}, #{transactionCode,jdbcType=VARCHAR}, #{orderStatus,jdbcType=VARCHAR},
2025-06-16 15:59:44 +08:00
#{orderType,jdbcType=VARCHAR}, #{mergeChargeNumber,jdbcType=VARCHAR}, #{mainConnectorCode,jdbcType=VARCHAR},
2024-12-25 14:40:57 +08:00
#{memberId,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR},
#{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR}, #{pileConnectorCode,jdbcType=VARCHAR},
#{logicCard,jdbcType=VARCHAR}, #{vinCode,jdbcType=VARCHAR}, #{startMode,jdbcType=VARCHAR},
#{thirdPartyType,jdbcType=VARCHAR}, #{payMode,jdbcType=VARCHAR}, #{payStatus,jdbcType=VARCHAR},
#{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{insuranceAmount,jdbcType=DECIMAL}, #{plateNumber,jdbcType=VARCHAR},
2024-12-25 14:40:57 +08:00
#{orderAmount,jdbcType=DECIMAL}, #{virtualAmount,jdbcType=DECIMAL}, #{groupCode,jdbcType=VARCHAR},
#{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{actualReceivedAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
#{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR},
#{reservedStartTime,jdbcType=TIMESTAMP},#{reservedEndTime,jdbcType=TIMESTAMP},
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR}, #{stopReasonCode,jdbcType=VARCHAR},
#{reason,jdbcType=VARCHAR}, #{settlementTime,jdbcType=TIMESTAMP}, #{refundAmount,jdbcType=DECIMAL},
#{refundStatus,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=CHAR}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderBasicInfo"
useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null">
order_code,
</if>
<if test="transactionCode != null">
transaction_code,
</if>
<if test="orderStatus != null">
order_status,
</if>
2025-06-16 15:59:44 +08:00
<if test="orderType != null">
order_type,
</if>
<if test="mergeChargeNumber != null">
merge_charge_number,
</if>
<if test="mainConnectorCode != null">
main_connector_code,
</if>
2024-12-25 14:40:57 +08:00
<if test="memberId != null">
member_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="merchantId != null">
merchant_id,
</if>
<if test="pileSn != null">
pile_sn,
</if>
<if test="connectorCode != null">
connector_code,
</if>
<if test="pileConnectorCode != null">
pile_connector_code,
</if>
<if test="logicCard != null">
logic_card,
</if>
<if test="vinCode != null">
vin_code,
</if>
<if test="startMode != null">
start_mode,
</if>
<if test="thirdPartyType != null">
third_party_type,
</if>
<if test="payMode != null">
pay_mode,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="payAmount != null">
pay_amount,
</if>
<if test="payTime != null">
pay_time,
</if>
<if test="insuranceAmount != null">
insurance_ammount,
</if>
2024-12-25 14:40:57 +08:00
<if test="plateNumber != null">
plate_number,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="virtualAmount != null">
virtual_amount,
</if>
<if test="groupCode != null">
group_code,
</if>
<if test="discountAmount != null">
discount_amount,
</if>
<if test="settleAmount != null">
settle_amount,
</if>
<if test="actualReceivedAmount != null">
actual_received_amount,
</if>
2024-12-25 14:40:57 +08:00
<if test="remedialAmount != null">
remedial_amount,
</if>
<if test="chargeStartTime != null">
charge_start_time,
</if>
<if test="chargeEndTime != null">
charge_end_time,
</if>
<if test="startType != null">
start_type,
</if>
<if test="reservedStartTime != null">
reserved_start_time,
</if>
<if test="reservedEndTime != null">
reserved_end_time,
</if>
<if test="startSoc != null">
start_soc,
</if>
<if test="endSoc != null">
end_soc,
</if>
<if test="stopReasonCode != null">
stop_reason_code,,
</if>
<if test="reason != null">
reason,
</if>
<if test="settlementTime != null">
settlement_time,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="refundStatus != null">
refund_status,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
#{transactionCode,jdbcType=VARCHAR},
</if>
<if test="orderStatus != null">
#{orderStatus,jdbcType=VARCHAR},
</if>
2025-06-16 15:59:44 +08:00
<if test="orderType != null">
#{orderType,jdbcType=VARCHAR},
</if>
<if test="mergeChargeNumber != null">
#{mergeChargeNumber,jdbcType=VARCHAR},
</if>
<if test="mainConnectorCode != null">
#{mainConnectorCode,jdbcType=VARCHAR},
</if>
2024-12-25 14:40:57 +08:00
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
#{stationId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
#{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
#{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="logicCard != null">
#{logicCard,jdbcType=VARCHAR},
</if>
<if test="vinCode != null">
#{vinCode,jdbcType=VARCHAR},
</if>
<if test="startMode != null">
#{startMode,jdbcType=VARCHAR},
</if>
<if test="thirdPartyType != null">
#{thirdPartyType,jdbcType=VARCHAR},
</if>
<if test="payMode != null">
#{payMode,jdbcType=VARCHAR},
</if>
<if test="payStatus != null">
#{payStatus,jdbcType=VARCHAR},
</if>
<if test="payAmount != null">
#{payAmount,jdbcType=DECIMAL},
</if>
<if test="payTime != null">
#{payTime,jdbcType=TIMESTAMP},
</if>
<if test="insuranceAmount != null">
#{insuranceAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="plateNumber != null">
#{plateNumber,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
#{orderAmount,jdbcType=DECIMAL},
</if>
<if test="virtualAmount != null">
#{virtualAmount,jdbcType=DECIMAL},
</if>
<if test="groupCode != null">
#{groupCode,jdbcType=VARCHAR},
</if>
<if test="discountAmount != null">
#{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
<if test="actualReceivedAmount != null">
#{actualReceivedAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="remedialAmount != null">
#{remedialAmount,jdbcType=DECIMAL},
</if>
<if test="chargeStartTime != null">
#{chargeStartTime,jdbcType=TIMESTAMP},
</if>
<if test="chargeEndTime != null">
#{chargeEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startType != null">
#{startType,jdbcType=VARCHAR},
</if>
<if test="reservedStartTime != null">
#{reservedStartTime},
</if>
<if test="reservedEndTime != null">
#{reservedEndTime},
</if>
<if test="startSoc != null">
#{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
#{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
<if test="settlementTime != null">
#{settlementTime,jdbcType=TIMESTAMP},
</if>
<if test="refundAmount != null">
#{refundAmount,jdbcType=DECIMAL},
</if>
<if test="refundStatus != null">
#{refundStatus,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.OrderBasicInfo">
<!--@mbg.generated-->
update order_basic_info
<set>
<if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
transaction_code = #{transactionCode,jdbcType=VARCHAR},
</if>
<if test="orderStatus != null">
order_status = #{orderStatus,jdbcType=VARCHAR},
</if>
2025-06-16 15:59:44 +08:00
<if test="orderType != null">
order_type = #{orderType,jdbcType=VARCHAR},
</if>
<if test="mergeChargeNumber != null">
merge_charge_number = #{mergeChargeNumber,jdbcType=VARCHAR},
</if>
<if test="mainConnectorCode != null">
main_connector_code = #{mainConnectorCode,jdbcType=VARCHAR},
</if>
2024-12-25 14:40:57 +08:00
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
station_id = #{stationId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
pile_sn = #{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
connector_code = #{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="logicCard != null">
logic_card = #{logicCard,jdbcType=VARCHAR},
</if>
<if test="vinCode != null">
vin_code = #{vinCode,jdbcType=VARCHAR},
</if>
<if test="startMode != null">
start_mode = #{startMode,jdbcType=VARCHAR},
</if>
<if test="thirdPartyType != null">
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
</if>
<if test="payMode != null">
pay_mode = #{payMode,jdbcType=VARCHAR},
</if>
<if test="payStatus != null">
pay_status = #{payStatus,jdbcType=VARCHAR},
</if>
<if test="payAmount != null">
pay_amount = #{payAmount,jdbcType=DECIMAL},
</if>
<if test="payTime != null">
pay_time = #{payTime,jdbcType=TIMESTAMP},
</if>
<if test="insuranceAmount != null">
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="plateNumber != null">
plate_number = #{plateNumber,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
order_amount = #{orderAmount,jdbcType=DECIMAL},
</if>
<if test="virtualAmount != null">
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
</if>
<if test="groupCode != null">
group_code = #{groupCode,jdbcType=VARCHAR},
</if>
<if test="discountAmount != null">
discount_amount = #{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
<if test="actualReceivedAmount != null">
actual_received_amount = #{actualReceivedAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="remedialAmount != null">
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
</if>
<if test="chargeStartTime != null">
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
</if>
<if test="chargeEndTime != null">
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startType != null">
start_type = #{startType,jdbcType=VARCHAR},
</if>
<if test="reservedStartTime != null">
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
</if>
<if test="reservedEndTime != null">
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startSoc != null">
start_soc = #{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
end_soc = #{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="settlementTime != null">
settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount,jdbcType=DECIMAL},
</if>
<if test="refundStatus != null">
refund_status = #{refundStatus,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.OrderBasicInfo">
<!--@mbg.generated-->
update order_basic_info
set order_code = #{orderCode,jdbcType=VARCHAR},
transaction_code = #{transactionCode,jdbcType=VARCHAR},
order_status = #{orderStatus,jdbcType=VARCHAR},
2025-06-16 15:59:44 +08:00
order_type = #{orderType,jdbcType=VARCHAR},
merge_charge_number = #{mergeChargeNumber,jdbcType=VARCHAR},
main_connector_code = #{mainConnectorCode,jdbcType=VARCHAR},
2024-12-25 14:40:57 +08:00
member_id = #{memberId,jdbcType=VARCHAR},
station_id = #{stationId,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=VARCHAR},
pile_sn = #{pileSn,jdbcType=VARCHAR},
connector_code = #{connectorCode,jdbcType=VARCHAR},
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
logic_card = #{logicCard,jdbcType=VARCHAR},
vin_code = #{vinCode,jdbcType=VARCHAR},
start_mode = #{startMode,jdbcType=VARCHAR},
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
pay_mode = #{payMode,jdbcType=VARCHAR},
pay_status = #{payStatus,jdbcType=VARCHAR},
pay_amount = #{payAmount,jdbcType=DECIMAL},
pay_time = #{payTime,jdbcType=TIMESTAMP},
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
plate_number = #{plateNumber,jdbcType=VARCHAR},
order_amount = #{orderAmount,jdbcType=DECIMAL},
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
group_code = #{groupCode,jdbcType=VARCHAR},
discount_amount = #{discountAmount,jdbcType=DECIMAL},
settle_amount = #{settleAmount,jdbcType=DECIMAL},
actual_received_amount = #{actualReceivedAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
start_type = #{startType,jdbcType=VARCHAR},
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR},
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
refund_status = #{refundStatus,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=CHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update order_basic_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="order_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="transaction_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="order_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderStatus,jdbcType=VARCHAR}
</foreach>
</trim>
2025-06-16 15:59:44 +08:00
<trim prefix="order_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="merge_charge_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.mergeChargeNumber,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="main_connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.mainConnectorCode,jdbcType=VARCHAR}
</foreach>
</trim>
2024-12-25 14:40:57 +08:00
<trim prefix="member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="station_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="merchant_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pile_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pile_connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="logic_card = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.logicCard,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="vin_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.vinCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="start_mode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.startMode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="third_party_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.thirdPartyType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pay_mode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.payMode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pay_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pay_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="pay_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="insurance_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.insuranceAmount,jdbc=DECIMAL}
</foreach>
</trim>
2024-12-25 14:40:57 +08:00
<trim prefix="plate_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.plateNumber,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="order_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="virtual_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="group_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.groupCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="discount_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.discountAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="settle_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="actual_received_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.actualReceivedAmount,jdbcType=DECIMAL}
</foreach>
</trim>
2024-12-25 14:40:57 +08:00
<trim prefix="remedial_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.remedialAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="charge_start_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeStartTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="charge_end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeEndTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="start_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="reserved_start_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="reserved_end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="start_soc = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.startSoc,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="end_soc = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="stop_reason_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="reason = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="settlement_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.settlementTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="refund_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="refund_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundStatus,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update order_basic_info
<trim prefix="set" suffixOverrides=",">
<trim prefix="order_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.orderCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="transaction_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.transactionCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="order_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.orderStatus != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderStatus,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
2025-06-16 15:59:44 +08:00
<trim prefix="order_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.orderType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="merge_charge_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.mergeChargeNumber != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.mergeChargeNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="main_connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.mainConnectorCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.mainConnectorCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
2024-12-25 14:40:57 +08:00
<trim prefix="member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.memberId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="station_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stationId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="merchant_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.merchantId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.merchantId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="pile_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.pileSn != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.connectorCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="pile_connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.pileConnectorCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="logic_card = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.logicCard != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.logicCard,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="vin_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.vinCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.vinCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="start_mode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.startMode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.startMode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="third_party_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.thirdPartyType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.thirdPartyType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="pay_mode = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.payMode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.payMode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="pay_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.payStatus != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="pay_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.payAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.payAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="pay_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.payTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.payTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="insurance_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.insuranceAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.insuranceAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
2024-12-25 14:40:57 +08:00
<trim prefix="plate_number = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.plateNumber != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.plateNumber,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="order_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.orderAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="virtual_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.virtualAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="group_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.groupCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.groupCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="discount_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.discountAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.discountAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="settle_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.settleAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.settleAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="actual_received_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.actualReceivedAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.actualReceivedAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
2024-12-25 14:40:57 +08:00
<trim prefix="remedial_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.remedialAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.remedialAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="charge_start_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.chargeStartTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeStartTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="charge_end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.chargeEndTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeEndTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="start_type = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.startType != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.startType,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="reserved_start_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.reservedStartTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedStartTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="reserved_end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.reservedEndTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.reservedEndTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="start_soc = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.startSoc != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.startSoc,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="end_soc = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.endSoc != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.endSoc,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="stop_reason_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stopReasonCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.stopReasonCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="reason = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.reason != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.reason,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="settlement_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.settlementTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.settlementTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="refund_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.refundAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="refund_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.refundStatus != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.refundStatus,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="create_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.delFlag != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_basic_info
2025-06-16 15:59:44 +08:00
(order_code, transaction_code, order_status, order_type, merge_charge_number, main_connector_code, member_id, station_id, merchant_id,
2024-12-25 14:40:57 +08:00
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode,
third_party_type, pay_mode, pay_status, pay_amount, pay_time, insurance_amount, plate_number, order_amount,
virtual_amount, group_code, discount_amount, settle_amount, actual_received_amount, remedial_amount, charge_start_time,
2024-12-25 14:40:57 +08:00
charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, stop_reason_code,
reason, settlement_time,
refund_amount, refund_status, create_by, create_time, update_by, update_time, del_flag
)
values
<foreach collection="list" item="item" separator=",">
(#{item.orderCode,jdbcType=VARCHAR}, #{item.transactionCode,jdbcType=VARCHAR},
2025-06-16 15:59:44 +08:00
#{item.orderStatus,jdbcType=VARCHAR}, #{item.orderType,jdbcType=VARCHAR}, #{item.mergeChargeNumber,jdbcType=VARCHAR}, #{item.mainConnectorCode,jdbcType=VARCHAR},
2024-12-25 14:40:57 +08:00
#{item.memberId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR},
#{item.pileSn,jdbcType=VARCHAR}, #{item.connectorCode,jdbcType=VARCHAR},
#{item.pileConnectorCode,jdbcType=VARCHAR},
#{item.logicCard,jdbcType=VARCHAR}, #{item.vinCode,jdbcType=VARCHAR}, #{item.startMode,jdbcType=VARCHAR},
#{item.thirdPartyType,jdbcType=VARCHAR}, #{item.payMode,jdbcType=VARCHAR},
#{item.payStatus,jdbcType=VARCHAR},
#{item.payAmount,jdbcType=DECIMAL}, #{item.payTime,jdbcType=TIMESTAMP}, #{item.insuranceAmount,jdbc=DECIMAL},
2024-12-25 14:40:57 +08:00
#{item.plateNumber,jdbcType=VARCHAR},
#{item.orderAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL},
#{item.groupCode,jdbcType=VARCHAR},
#{item.discountAmount,jdbcType=DECIMAL}, #{item.settleAmount,jdbcType=DECIMAL},
#{item.actualReceivedAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
#{item.remedialAmount,jdbcType=DECIMAL}, #{item.chargeStartTime,jdbcType=TIMESTAMP},
#{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR},
#{item.reservedStartTime,jdbcType=TIMESTAMP},
#{item.reservedEndTime,jdbcType=TIMESTAMP},
#{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,jdbcType=VARCHAR}, #{item.stopReasonCode,jdbcType=VARCHAR},
#{item.reason,jdbcType=VARCHAR},
#{item.settlementTime,jdbcType=TIMESTAMP}, #{item.refundAmount,jdbcType=DECIMAL},
#{item.refundStatus,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR},
#{item.createTime,jdbcType=TIMESTAMP},
#{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, #{item.delFlag,jdbcType=CHAR}
)
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderBasicInfo"
useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
order_code,
transaction_code,
order_status,
2025-06-16 15:59:44 +08:00
order_type,
merge_charge_number,
main_connector_code,
2024-12-25 14:40:57 +08:00
member_id,
station_id,
merchant_id,
pile_sn,
connector_code,
pile_connector_code,
logic_card,
vin_code,
start_mode,
third_party_type,
pay_mode,
pay_status,
pay_amount,
pay_time,
insurance_amount,
2024-12-25 14:40:57 +08:00
plate_number,
order_amount,
virtual_amount,
group_code,
discount_amount,
settle_amount,
actual_received_amount,
2024-12-25 14:40:57 +08:00
remedial_amount,
charge_start_time,
charge_end_time,
start_type,
reserved_start_time,
reserved_end_time,
start_soc,
end_soc,
stop_reason_code,
reason,
settlement_time,
refund_amount,
refund_status,
create_by,
create_time,
update_by,
update_time,
del_flag,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{orderCode,jdbcType=VARCHAR},
#{transactionCode,jdbcType=VARCHAR},
#{orderStatus,jdbcType=VARCHAR},
2025-06-16 15:59:44 +08:00
#{orderType,jdbcType=VARCHAR},
#{mergeChargeNumber,jdbcType=VARCHAR},
#{mainConnectorCode,jdbcType=VARCHAR},
2024-12-25 14:40:57 +08:00
#{memberId,jdbcType=VARCHAR},
#{stationId,jdbcType=VARCHAR},
#{merchantId,jdbcType=VARCHAR},
#{pileSn,jdbcType=VARCHAR},
#{connectorCode,jdbcType=VARCHAR},
#{pileConnectorCode,jdbcType=VARCHAR},
#{logicCard,jdbcType=VARCHAR},
#{vinCode,jdbcType=VARCHAR},
#{startMode,jdbcType=VARCHAR},
#{thirdPartyType,jdbcType=VARCHAR},
#{payMode,jdbcType=VARCHAR},
#{payStatus,jdbcType=VARCHAR},
#{payAmount,jdbcType=DECIMAL},
#{payTime,jdbcType=TIMESTAMP},
#{insuranceAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
#{plateNumber,jdbcType=VARCHAR},
#{orderAmount,jdbcType=DECIMAL},
#{virtualAmount,jdbcType=DECIMAL},
#{groupCode,jdbcType=VARCHAR},
#{discountAmount,jdbcType=DECIMAL},
#{settleAmount,jdbcType=DECIMAL},
#{actualReceivedAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
#{remedialAmount,jdbcType=DECIMAL},
#{chargeStartTime,jdbcType=TIMESTAMP},
#{chargeEndTime,jdbcType=TIMESTAMP},
#{startType,jdbcType=VARCHAR},
#{reservedStartTime,jdbcType=TIMESTAMP},
#{reservedEndTime,jdbcType=TIMESTAMP},
#{startSoc,jdbcType=VARCHAR},
#{endSoc,jdbcType=VARCHAR},
#{stopReasonCode,jdbcType=VARCHAR},
#{reason,jdbcType=VARCHAR},
#{settlementTime,jdbcType=TIMESTAMP},
#{refundAmount,jdbcType=DECIMAL},
#{refundStatus,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=CHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
order_code = #{orderCode,jdbcType=VARCHAR},
transaction_code = #{transactionCode,jdbcType=VARCHAR},
order_status = #{orderStatus,jdbcType=VARCHAR},
2025-06-16 15:59:44 +08:00
order_type = #{orderType,jdbcType=VARCHAR},
merge_charge_number = #{mergeChargeNumber,jdbcType=VARCHAR},
main_connector_code = #{mainConnectorCode,jdbcType=VARCHAR},
2024-12-25 14:40:57 +08:00
member_id = #{memberId,jdbcType=VARCHAR},
station_id = #{stationId,jdbcType=VARCHAR},
merchant_id = #{merchantId,jdbcType=VARCHAR},
pile_sn = #{pileSn,jdbcType=VARCHAR},
connector_code = #{connectorCode,jdbcType=VARCHAR},
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
logic_card = #{logicCard,jdbcType=VARCHAR},
vin_code = #{vinCode,jdbcType=VARCHAR},
start_mode = #{startMode,jdbcType=VARCHAR},
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
pay_mode = #{payMode,jdbcType=VARCHAR},
pay_status = #{payStatus,jdbcType=VARCHAR},
pay_amount = #{payAmount,jdbcType=DECIMAL},
pay_time = #{payTime,jdbcType=TIMESTAMP},
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
plate_number = #{plateNumber,jdbcType=VARCHAR},
order_amount = #{orderAmount,jdbcType=DECIMAL},
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
group_code = #{groupCode,jdbcType=VARCHAR},
discount_amount = #{discountAmount,jdbcType=DECIMAL},
settle_amount = #{settleAmount,jdbcType=DECIMAL},
actual_received_amount = #{actualReceivedAmount,jdbcType=DECIMAL},
2024-12-25 14:40:57 +08:00
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
start_type = #{startType,jdbcType=VARCHAR},
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,jdbcType=VARCHAR},
stop_reason_code = {stopReasonCode,jdbcType=VARCHAR},
reason = #{reason,jdbcType=VARCHAR},
settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
refund_amount = #{refundAmount,jdbcType=DECIMAL},
refund_status = #{refundStatus,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=CHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
parameterType="com.jsowell.pile.domain.OrderBasicInfo" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="orderCode != null">
order_code,
</if>
<if test="transactionCode != null">
transaction_code,
</if>
<if test="orderStatus != null">
order_status,
</if>
2025-06-16 15:59:44 +08:00
<if test="orderType != null">
order_type,
</if>
<if test="mergeChargeNumber != null">
merge_charge_number,
</if>
<if test="mainConnectorCode != null">
main_connector_code,
</if>
2024-12-25 14:40:57 +08:00
<if test="memberId != null">
member_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="merchantId != null">
merchant_id,
</if>
<if test="pileSn != null">
pile_sn,
</if>
<if test="connectorCode != null">
connector_code,
</if>
<if test="pileConnectorCode != null">
pile_connector_code,
</if>
<if test="logicCard != null">
logic_card,
</if>
<if test="vinCode != null">
vin_code,
</if>
<if test="startMode != null">
start_mode,
</if>
<if test="thirdPartyType != null">
third_party_type,
</if>
<if test="payMode != null">
pay_mode,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="payAmount != null">
pay_amount,
</if>
<if test="payTime != null">
pay_time,
</if>
<if test="insuranceAmount != null">
insurance_amount,
</if>
2024-12-25 14:40:57 +08:00
<if test="plateNumber != null">
plate_number,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="virtualAmount != null">
virtual_amount,
</if>
<if test="groupCode != null">
group_code,
</if>
<if test="discountAmount != null">
discount_amount,
</if>
<if test="settleAmount != null">
settle_amount,
</if>
<if test="actualReceivedAmount != null">
actual_received_amount,
</if>
2024-12-25 14:40:57 +08:00
<if test="remedialAmount != null">
remedial_amount,
</if>
<if test="chargeStartTime != null">
charge_start_time,
</if>
<if test="chargeEndTime != null">
charge_end_time,
</if>
<if test="startType != null">
start_type,
</if>
<if test="reservedStartTime != null">
reserved_start_time,
</if>
<if test="reservedEndTime != null">
reserved_end_time,
</if>
<if test="startSoc != null">
start_soc,
</if>
<if test="endSoc != null">
end_soc,
</if>
<if test="stopReasonCode != null">
stop_reason_code,
</if>
<if test="reason != null">
reason,
</if>
<if test="settlementTime != null">
settlement_time,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="refundStatus != null">
refund_status,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
#{transactionCode,jdbcType=VARCHAR},
</if>
<if test="orderStatus != null">
#{orderStatus,jdbcType=VARCHAR},
</if>
2025-06-16 15:59:44 +08:00
<if test="orderType != null">
#{orderType,jdbcType=VARCHAR},
</if>
<if test="mergeChargeNumber != null">
#{mergeChargeNumber,jdbcType=VARCHAR},
</if>
<if test="mainConnectorCode != null">
#{mainConnectorCode,jdbcType=VARCHAR},
</if>
2024-12-25 14:40:57 +08:00
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
#{stationId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
#{merchantId,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
#{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
#{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="logicCard != null">
#{logicCard,jdbcType=VARCHAR},
</if>
<if test="vinCode != null">
#{vinCode,jdbcType=VARCHAR},
</if>
<if test="startMode != null">
#{startMode,jdbcType=VARCHAR},
</if>
<if test="thirdPartyType != null">
#{thirdPartyType,jdbcType=VARCHAR},
</if>
<if test="payMode != null">
#{payMode,jdbcType=VARCHAR},
</if>
<if test="payStatus != null">
#{payStatus,jdbcType=VARCHAR},
</if>
<if test="payAmount != null">
#{payAmount,jdbcType=DECIMAL},
</if>
<if test="payTime != null">
#{payTime,jdbcType=TIMESTAMP},
</if>
<if test="insuranceAmount != null">
#{insuranceAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="plateNumber != null">
#{plateNumber,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
#{orderAmount,jdbcType=DECIMAL},
</if>
<if test="virtualAmount != null">
#{virtualAmount,jdbcType=DECIMAL},
</if>
<if test="groupCode != null">
#{groupCode,jdbcType=VARCHAR},
</if>
<if test="discountAmount != null">
#{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
<if test="actualReceivedAmount != null">
#{actualReceivedAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="remedialAmount != null">
#{remedialAmount,jdbcType=DECIMAL},
</if>
<if test="chargeStartTime != null">
#{chargeStartTime,jdbcType=TIMESTAMP},
</if>
<if test="chargeEndTime != null">
#{chargeEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startType != null">
#{startType,jdbcType=VARCHAR},
</if>
<if test="reservedStartTime != null">
#{reservedStartTime,jdbcType=TIMESTAMP},
</if>
<if test="reservedEndTime != null">
#{reservedEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startSoc != null">
#{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
#{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
#{reason,jdbcType=VARCHAR},
</if>
<if test="settlementTime != null">
#{settlementTime,jdbcType=TIMESTAMP},
</if>
<if test="refundAmount != null">
#{refundAmount,jdbcType=DECIMAL},
</if>
<if test="refundStatus != null">
#{refundStatus,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
transaction_code = #{transactionCode,jdbcType=VARCHAR},
</if>
<if test="orderStatus != null">
order_status = #{orderStatus,jdbcType=VARCHAR},
</if>
2025-06-16 15:59:44 +08:00
<if test="orderType != null">
order_type = #{orderType,jdbcType=VARCHAR},
</if>
<if test="mergeChargeNumber != null">
merge_charge_number = #{mergeChargeNumber,jdbcType=VARCHAR},
</if>
<if test="mainConnectorCode != null">
main_connector_code = #{mainConnectorCode,jdbcType=VARCHAR},
</if>
2024-12-25 14:40:57 +08:00
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
station_id = #{stationId,jdbcType=VARCHAR},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
pile_sn = #{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
connector_code = #{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="logicCard != null">
logic_card = #{logicCard,jdbcType=VARCHAR},
</if>
<if test="vinCode != null">
vin_code = #{vinCode,jdbcType=VARCHAR},
</if>
<if test="startMode != null">
start_mode = #{startMode,jdbcType=VARCHAR},
</if>
<if test="thirdPartyType != null">
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
</if>
<if test="payMode != null">
pay_mode = #{payMode,jdbcType=VARCHAR},
</if>
<if test="payStatus != null">
pay_status = #{payStatus,jdbcType=VARCHAR},
</if>
<if test="payAmount != null">
pay_amount = #{payAmount,jdbcType=DECIMAL},
</if>
<if test="payTime != null">
pay_time = #{payTime,jdbcType=TIMESTAMP},
</if>
<if test="insuranceAmount != null">
insurance_amount = #{insuranceAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="plateNumber != null">
plate_number = #{plateNumber,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
order_amount = #{orderAmount,jdbcType=DECIMAL},
</if>
<if test="virtualAmount != null">
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
</if>
<if test="groupCode != null">
group_code = #{groupCode,jdbcType=VARCHAR},
</if>
<if test="discountAmount != null">
discount_amount = #{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
<if test="actualReceivedAmount != null">
actual_received_amount = #{actualReceivedAmount,jdbcType=DECIMAL},
</if>
2024-12-25 14:40:57 +08:00
<if test="remedialAmount != null">
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
</if>
<if test="chargeStartTime != null">
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
</if>
<if test="chargeEndTime != null">
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startType != null">
start_type = #{startType,jdbcType=VARCHAR},
</if>
<if test="reservedStartTime != null">
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
</if>
<if test="reservedEndTime != null">
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startSoc != null">
start_soc = #{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
end_soc = #{endSoc,jdbcType=VARCHAR},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode,jdbcType=VARCHAR},
</if>
<if test="reason != null">
reason = #{reason,jdbcType=VARCHAR},
</if>
<if test="settlementTime != null">
settlement_time = #{settlementTime,jdbcType=TIMESTAMP},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount,jdbcType=DECIMAL},
</if>
<if test="refundStatus != null">
refund_status = #{refundStatus,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
2023-03-04 16:29:55 +08:00
2024-12-25 14:40:57 +08:00
<resultMap extends="BaseResultMap" id="OrderBasicInfoOrderDetailResult"
type="com.jsowell.pile.domain.OrderBasicInfo">
<collection javaType="java.util.List" notNullColumn="sub_id" property="orderDetailList"
resultMap="OrderDetailResult"/>
2023-03-04 16:29:55 +08:00
</resultMap>
2024-01-06 15:13:50 +08:00
<resultMap id="OrderDetailResult" type="com.jsowell.pile.domain.OrderDetail">
2024-12-25 14:40:57 +08:00
<result column="id" property="id"/>
<result column="order_code" property="orderCode"/>
2025-10-13 16:50:24 +08:00
<result column="ammeter_total_start" property="ammeterTotalStart"/>
<result column="ammeter_total_end" property="ammeterTotalEnd"/>
2024-12-25 14:40:57 +08:00
<result column="total_used_electricity" property="totalUsedElectricity"/>
<result column="total_order_amount" property="totalOrderAmount"/>
<result column="total_electricity_amount" property="totalElectricityAmount"/>
2025-10-13 16:50:24 +08:00
<result column="discount_electricity_amount" property="discountElectricityAmount"/>
2024-12-25 14:40:57 +08:00
<result column="total_service_amount" property="totalServiceAmount"/>
2025-10-13 16:50:24 +08:00
<result column="discount_service_amount" property="discountServiceAmount"/>
2024-12-25 14:40:57 +08:00
<result column="sharp_price" property="sharpPrice"/>
<result column="sharp_used_electricity" property="sharpUsedElectricity"/>
<result column="sharp_electricity_price" property="sharpElectricityPrice"/>
<result column="sharp_service_price" property="sharpServicePrice"/>
<result column="sharp_amount" property="sharpAmount"/>
<result column="peak_price" property="peakPrice"/>
<result column="peak_used_electricity" property="peakUsedElectricity"/>
<result column="peak_electricity_price" property="peakElectricityPrice"/>
<result column="peak_service_price" property="peakServicePrice"/>
<result column="peak_amount" property="peakAmount"/>
<result column="flat_price" property="flatPrice"/>
<result column="flat_used_electricity" property="flatUsedElectricity"/>
<result column="flat_electricity_price" property="flatElectricityPrice"/>
<result column="flat_service_price" property="flatServicePrice"/>
<result column="flat_amount" property="flatAmount"/>
<result column="valley_price" property="valleyPrice"/>
<result column="valley_used_electricity" property="valleyUsedElectricity"/>
<result column="valley_electricity_price" property="valleyElectricityPrice"/>
<result column="valley_service_price" property="valleyServicePrice"/>
<result column="valley_amount" property="valleyAmount"/>
<result column="create_by" property="createBy"/>
<result column="create_time" property="createTime"/>
<result column="update_by" property="updateBy"/>
<result column="update_time" property="updateTime"/>
<result column="del_flag" property="delFlag"/>
2023-03-04 16:29:55 +08:00
</resultMap>
<sql id="selectOrderBasicInfoVo">
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-03-04 16:29:55 +08:00
from order_basic_info
</sql>
<sql id="Detail_Base_Column_List">
id,
order_code,
2025-10-13 16:50:24 +08:00
ammeter_total_start,
ammeter_total_end,
2023-03-04 16:29:55 +08:00
total_used_electricity,
total_order_amount,
total_electricity_amount,
2025-10-13 16:50:24 +08:00
discount_electricity_amount,
2023-03-04 16:29:55 +08:00
total_service_amount,
2025-10-13 16:50:24 +08:00
discount_service_amount,
sharp_price,
2023-03-04 16:29:55 +08:00
sharp_used_electricity,
sharp_electricity_price,
sharp_service_price,
sharp_amount,
peak_price,
2023-03-04 16:29:55 +08:00
peak_used_electricity,
peak_electricity_price,
peak_service_price,
peak_amount,
flat_price,
2023-03-04 16:29:55 +08:00
flat_used_electricity,
flat_electricity_price,
flat_service_price,
flat_amount,
valley_price,
2023-03-04 16:29:55 +08:00
valley_used_electricity,
valley_electricity_price,
valley_service_price,
valley_amount,
2023-03-04 16:29:55 +08:00
create_by,
create_time,
update_by,
update_time,
del_flag
</sql>
2024-12-25 14:40:57 +08:00
<select id="selectOrderBasicInfoList" parameterType="com.jsowell.pile.dto.QueryOrderDTO"
resultType="com.jsowell.pile.vo.web.OrderListVO">
SELECT t1.id as id,
t1.order_code as orderCode,
t1.transaction_code as transactionCode,
t1.order_status as orderStatus,
t1.member_id as memberId,
t2.nick_name as nickName,
t2.mobile_number as mobileNumber,
t1.station_id as stationId,
t3.station_name as stationName,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.logic_card as logicCard,
t1.vin_code as vinCode,
t1.plate_number as plateNumber,
t1.start_mode as startMode,
t1.third_party_type as thirdPartyType,
t1.pay_mode as payMode,
t1.pay_status as payStatus,
t1.pay_amount as payAmount,
t1.pay_time as payTime,
t1.reason as reason,
t1.order_amount as orderAmount,
t1.virtual_amount as virtualAmount,
t1.discount_amount as discountAmount,
t1.settle_amount as settleAmount,
2025-09-27 13:46:26 +08:00
t1.insurance_amount as insuranceAmount,
ifnull(t1.actual_received_amount, '0') as actualReceivedAmount,
2024-12-25 14:40:57 +08:00
t1.settlement_time as settlementTime,
t1.start_soc as startSoc,
t1.end_soc as endSoc,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeEndTime,
t1.create_time as createTime,
t4.total_used_electricity as chargingDegree,
t4.total_electricity_amount as totalElectricityAmount,
t4.total_service_amount as totalServiceAmount,
t4.sharp_used_electricity as sharpElectricity,
t4.peak_used_electricity as peakElectricity,
t4.flat_used_electricity as flatElectricity,
t4.valley_used_electricity as valleyElectricity
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'
2026-01-05 11:38:13 +08:00
<!-- 优先使用最严格的过滤条件,减少扫描数据量 -->
<if test="stationIdList != null and stationIdList.size() != 0">
and t1.station_id in
<foreach collection="stationIdList" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
2024-12-25 14:40:57 +08:00
</if>
2026-01-05 11:38:13 +08:00
<if test="excludeStationIdList != null and excludeStationIdList.size() != 0">
and t1.station_id not in
<foreach close=")" collection="excludeStationIdList" item="excludeStationId" open="(" separator=",">
#{excludeStationId}
</foreach>
2024-12-25 14:40:57 +08:00
</if>
2026-01-05 11:38:13 +08:00
<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}
2024-12-25 14:40:57 +08:00
</if>
<if test="orderStatus != null and orderStatus != ''">
and t1.order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
2026-01-05 11:38:13 +08:00
<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>
2024-12-25 14:40:57 +08:00
<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>
2026-01-05 11:38:13 +08:00
<if test="pileSn != null and pileSn != ''">
and t1.pile_sn = #{pileSn,jdbcType=VARCHAR}
</if>
<if test="connectorCode != null and connectorCode != ''">
and t1.connector_code = #{connectorCode,jdbcType=VARCHAR}
</if>
<if test="memberId != null and memberId != ''">
and t1.member_id = #{memberId,jdbcType=VARCHAR}
</if>
2024-12-25 14:40:57 +08:00
<if test="mobileNumber != null and mobileNumber != ''">
and t2.mobile_number = #{mobileNumber,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="startSettleTime != null and startSettleTime != ''">
and t1.settlement_time <![CDATA[ >= ]]> #{startSettleTime,jdbcType=VARCHAR}
</if>
<if test="endSettleTime != null and endSettleTime != ''">
and t1.settlement_time <![CDATA[ <= ]]> #{endSettleTime,jdbcType=VARCHAR}
</if>
<if test="groupCode != null and groupCode != ''">
and t1.group_code = #{groupCode,jdbcType=VARCHAR}
</if>
<if test="vinCode != null and vinCode != ''">
and t1.vin_code = #{vinCode,jdbcType=VARCHAR}
</if>
<if test="plateNumber != null and plateNumber != ''">
and t1.plate_number = #{plateNumber,jdbcType=VARCHAR}
</if>
<if test="payMode != null and payMode != ''">
and t1.pay_mode = #{payMode,jdbcType=VARCHAR}
</if>
2024-12-25 14:40:57 +08:00
order by t1.create_time desc
</select>
2023-03-04 16:29:55 +08:00
2024-12-25 14:40:57 +08:00
<select id="getOrderTotalData" parameterType="com.jsowell.pile.dto.QueryOrderDTO"
resultType="com.jsowell.pile.vo.web.OrderTotalDataVO">
2023-12-04 15:49:02 +08:00
select
IFNULL(sum(t1.order_amount),0) as sumOrderAmount,
IFNULL(sum(t4.total_used_electricity),0) as sumUsedElectricity,
IFNULL(sum(t1.actual_received_amount), 0) as sumActualReceivedAmount,
2023-12-04 15:49:02 +08:00
IFNULL(sum(t1.settle_amount),0) as sumSettleAmount
from order_basic_info t1
2024-12-25 14:40:57 +08:00
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'
2023-12-04 15:49:02 +08:00
where t1.del_flag = '0'
<if test="pileSn != null and pileSn != ''">
and t1.pile_sn = #{pileSn,jdbcType=VARCHAR}
</if>
<if test="connectorCode != null and connectorCode != ''">
and t1.connector_code = #{connectorCode,jdbcType=VARCHAR}
</if>
<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>
<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>
<if test="endSettleTime != null and endSettleTime != ''">
and t1.settlement_time <![CDATA[ <= ]]> #{endSettleTime,jdbcType=VARCHAR}
</if>
<if test="merchantId != null and merchantId != ''">
and t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
</if>
2024-12-25 14:40:57 +08:00
<if test="stationIdList != null and stationIdList.size() != 0">
and t1.station_id in
<foreach collection="stationIdList" item="stationId" open="(" separator="," close=")">
#{stationId}
</foreach>
</if>
2023-12-04 15:49:02 +08:00
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
and t3.dept_id in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="stationDeptIds" item="stationDeptId" open="(" separator=",">
2023-12-04 15:49:02 +08:00
#{stationDeptId}
</foreach>
</if>
order by t1.create_time desc
</select>
2026-01-04 08:40:56 +08:00
<!--
统计订单数量和总金额(用于运营端小程序)
使用子查询去重,确保与分页查询 selectOrderBasicInfoList 的条件一致
包含相同的 JOIN 条件order_detail、pile_station_info和过滤条件
-->
<select id="countBusinessOrderStatistics" parameterType="com.jsowell.pile.dto.QueryOrderDTO"
resultType="com.jsowell.pile.vo.web.OrderStatisticsVO">
2026-01-04 08:40:56 +08:00
SELECT
COUNT(*) AS orderCount,
2026-01-05 11:38:13 +08:00
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)">
2026-01-04 11:40:37 +08:00
JOIN pile_station_info t3
ON t1.station_id = t3.id
2026-01-04 08:40:56 +08:00
AND t3.del_flag = '0'
2026-01-05 11:38:13 +08:00
</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>
2023-03-04 16:29:55 +08:00
<select id="selectOrderBasicInfoById" parameterType="Long" resultMap="OrderBasicInfoOrderDetailResult">
select a.id,
a.order_code,
a.order_status,
a.member_id,
a.station_id,
a.pile_sn,
a.connector_code,
a.start_mode,
a.pay_mode,
a.pay_status,
a.pay_amount,
a.pay_time,
a.order_amount,
a.reason,
a.create_by,
a.create_time,
a.update_by,
a.update_time,
a.del_flag,
b.id as sub_id,
b.order_code as sub_order_code,
b.total_used_electricity as sub_total_used_electricity,
b.total_order_amount as sub_total_order_amount,
b.total_electricity_amount as sub_total_electricity_amount,
b.total_service_amount as sub_total_service_amount,
b.sharp_used_electricity as sub_sharp_used_electricity,
b.sharp_electricity_price as sub_sharp_electricity_price,
b.sharp_service_price as sub_sharp_service_price,
b.peak_used_electricity as sub_peak_used_electricity,
b.peak_electricity_price as sub_peak_electricity_price,
b.peak_service_price as sub_peak_service_price,
b.flat_used_electricity as sub_flat_used_electricity,
b.flat_electricity_price as sub_flat_electricity_price,
b.flat_service_price as sub_flat_service_price,
b.valley_used_electricity as sub_valley_used_electricity,
b.valley_electricity_price as sub_valley_electricity_price,
b.valley_service_price as sub_valley_service_price,
b.create_by as sub_create_by,
b.create_time as sub_create_time,
b.update_by as sub_update_by,
b.update_time as sub_update_time,
b.del_flag as sub_del_flag
from order_basic_info a
left join order_detail b on b.order_code = a.id
where a.id = #{id}
</select>
2024-12-25 14:40:57 +08:00
<insert id="insertOrderBasicInfo" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderBasicInfo"
useGeneratedKeys="true">
2023-03-04 16:29:55 +08:00
insert into order_basic_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderCode != null">
order_code,
</if>
<if test="transactionCode != null">
transaction_code,
</if>
2023-03-04 16:29:55 +08:00
<if test="orderStatus != null">
order_status,
</if>
2025-08-06 10:52:43 +08:00
<if test="orderType != null">
order_type,
</if>
<if test="mergeChargeNumber != null">
merge_charge_number,
</if>
<if test="mainConnectorCode != null">
main_connector_code,
</if>
2023-03-04 16:29:55 +08:00
<if test="memberId != null">
member_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="merchantId != null">
merchant_id,
</if>
2023-03-04 16:29:55 +08:00
<if test="pileSn != null">
pile_sn,
</if>
<if test="connectorCode != null">
connector_code,
</if>
<if test="pileConnectorCode != null">
pile_connector_code,
</if>
2023-03-30 09:42:38 +08:00
<if test="logicCard != null">
logic_card,
</if>
2023-07-06 11:01:33 +08:00
<if test="vinCode != null">
vin_code,
</if>
2023-03-04 16:29:55 +08:00
<if test="startMode != null">
start_mode,
</if>
2024-05-21 18:11:01 +08:00
<if test="thirdPartyType != null">
third_party_type,
</if>
2023-03-04 16:29:55 +08:00
<if test="payMode != null">
pay_mode,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="payAmount != null">
pay_amount,
</if>
<if test="payTime != null">
pay_time,
</if>
<if test="insuranceAmount != null">
insurance_amount,
</if>
<if test="plateNumber != null">
plate_number,
</if>
2023-03-04 16:29:55 +08:00
<if test="orderAmount != null">
order_amount,
</if>
<if test="virtualAmount != null">
virtual_amount,
</if>
<if test="settleAmount != null">
settle_amount,
</if>
<if test="actualReceivedAmount != null">
actual_received_amount,
</if>
2023-03-04 16:29:55 +08:00
<if test="chargeStartTime != null">
charge_start_time,
</if>
<if test="chargeEndTime != null">
charge_end_time,
</if>
<if test="startType != null">
start_type,
</if>
2024-05-21 18:11:01 +08:00
<if test="reservedStartTime != null">
reserved_start_time,
</if>
<if test="reservedEndTime != null">
reserved_end_time,
</if>
2024-01-06 15:13:50 +08:00
<if test="startSoc != null">
2023-03-04 16:29:55 +08:00
start_soc,
</if>
2024-01-06 15:13:50 +08:00
<if test="endSoc != null">
2023-03-04 16:29:55 +08:00
end_soc,
</if>
2024-12-25 14:40:57 +08:00
<if test="stopReasonCode != null">
stop_reason_code,
</if>
2023-03-04 16:29:55 +08:00
<if test="reason != null">
reason,
</if>
<if test="settlementTime != null">
settlement_time,
</if>
<if test="refundAmount != null">
refund_amount,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderCode != null">
#{orderCode},
</if>
<if test="transactionCode != null">
#{transactionCode},
</if>
2023-03-04 16:29:55 +08:00
<if test="orderStatus != null">
#{orderStatus},
</if>
2025-08-06 10:52:43 +08:00
<if test="orderType != null">
#{orderType},
</if>
<if test="mergeChargeNumber != null">
#{mergeChargeNumber},
</if>
<if test="mainConnectorCode != null">
#{mainConnectorCode},
</if>
2023-03-04 16:29:55 +08:00
<if test="memberId != null">
#{memberId},
</if>
<if test="stationId != null">
#{stationId},
</if>
<if test="merchantId != null">
#{merchantId},
</if>
2023-03-04 16:29:55 +08:00
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
#{connectorCode},
</if>
<if test="pileConnectorCode != null">
#{pileConnectorCode},
</if>
<if test="logicCard != null">
#{logicCard},
</if>
<if test="vinCode != null">
#{vinCode,jdbcType=VARCHAR},
</if>
2023-03-04 16:29:55 +08:00
<if test="startMode != null">
#{startMode},
</if>
2024-05-21 18:11:01 +08:00
<if test="thirdPartyType != null">
2024-12-25 14:40:57 +08:00
#{thirdPartyType},
2024-05-21 18:11:01 +08:00
</if>
2023-03-04 16:29:55 +08:00
<if test="payMode != null">
#{payMode},
</if>
<if test="payStatus != null">
#{payStatus},
</if>
<if test="payAmount != null">
#{payAmount},
</if>
<if test="payTime != null">
#{payTime},
</if>
<if test="insuranceAmount != null">
#{insuranceAmount},
</if>
<if test="plateNumber != null">
#{plateNumber},
</if>
2023-03-04 16:29:55 +08:00
<if test="orderAmount != null">
#{orderAmount},
</if>
2023-05-26 10:26:43 +08:00
<if test="virtualAmount != null">
#{virtualAmount},
</if>
<if test="settleAmount != null">
#{settleAmount},
</if>
<if test="actualReceivedAmount != null">
#{actualReceivedAmount},
</if>
2023-03-04 16:29:55 +08:00
<if test="chargeStartTime != null">
#{chargeStartTime},
</if>
<if test="chargeEndTime != null">
#{chargeEndTime},
</if>
<if test="startType != null">
#{startType},
</if>
2024-05-21 18:11:01 +08:00
<if test="reservedStartTime != null">
#{reservedStartTime},
</if>
<if test="reservedEndTime != null">
#{reservedEndTime},
</if>
2024-01-06 15:13:50 +08:00
<if test="startSoc != null">
2024-12-25 14:40:57 +08:00
#{startSoc},
2023-03-04 16:29:55 +08:00
</if>
2024-01-06 15:13:50 +08:00
<if test="endSoc != null">
2024-12-25 14:40:57 +08:00
#{endSoc},
</if>
<if test="stopReasonCode != null">
#{stopReasonCode},
2023-03-04 16:29:55 +08:00
</if>
<if test="reason != null">
#{reason},
</if>
<if test="settlementTime != null">
#{settlementTime},
</if>
<if test="refundAmount != null">
#{refundAmount},
</if>
<if test="createBy != null">
#{createBy},
</if>
<if test="createTime != null">
#{createTime},
</if>
<if test="updateBy != null">
#{updateBy},
</if>
<if test="updateTime != null">
#{updateTime},
</if>
<if test="delFlag != null">
#{delFlag},
</if>
</trim>
</insert>
<update id="updateOrderBasicInfo" parameterType="com.jsowell.pile.domain.OrderBasicInfo">
update order_basic_info
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">
order_code = #{orderCode},
</if>
<if test="orderStatus != null">
order_status = #{orderStatus},
</if>
2025-08-06 10:52:43 +08:00
<if test="orderType != null">
order_type = #{orderType},
</if>
<if test="mergeChargeNumber != null">
merge_charge_number = #{mergeChargeNumber},
</if>
<if test="mainConnectorCode != null">
main_connector_code = #{mainConnectorCode},
</if>
2023-03-04 16:29:55 +08:00
<if test="memberId != null">
member_id = #{memberId},
</if>
<if test="stationId != null">
station_id = #{stationId},
</if>
<if test="merchantId != null">
merchant_id = #{merchantId},
</if>
2023-03-04 16:29:55 +08:00
<if test="pileSn != null">
pile_sn = #{pileSn},
</if>
<if test="connectorCode != null">
connector_code = #{connectorCode},
</if>
<if test="pileConnectorCode != null">
pile_connector_code = #{pileConnectorCode},
</if>
<if test="logicCard != null">
logic_card = #{logicCard},
</if>
<if test="vinCode != null">
vin_code = #{vinCode},
</if>
2023-03-04 16:29:55 +08:00
<if test="startMode != null">
start_mode = #{startMode},
</if>
2024-12-25 14:40:57 +08:00
<if test="thirdPartyType != null">
third_party_type = #{thirdPartyType},
</if>
2023-03-04 16:29:55 +08:00
<if test="payMode != null">
pay_mode = #{payMode},
</if>
<if test="payStatus != null">
pay_status = #{payStatus},
</if>
<if test="payAmount != null">
pay_amount = #{payAmount},
</if>
<if test="payTime != null">
pay_time = #{payTime},
</if>
<if test="insuranceAmount != null">
insurance_amount = #{insuranceAmount},
</if>
<if test="plateNumber != null">
plate_number = #{plateNumber},
</if>
2023-03-04 16:29:55 +08:00
<if test="orderAmount != null">
order_amount = #{orderAmount},
</if>
<if test="virtualAmount != null">
virtual_amount = #{virtualAmount},
</if>
2024-12-25 14:40:57 +08:00
<if test="groupCode != null">
group_code = #{groupCode},
</if>
<if test="discountAmount != null">
discount_amount = #{discountAmount},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount},
</if>
<if test="actualReceivedAmount != null">
actual_received_amount = #{actualReceivedAmount},
</if>
2023-03-04 16:29:55 +08:00
<if test="chargeStartTime != null">
charge_start_time = #{chargeStartTime},
</if>
<if test="chargeEndTime != null">
charge_end_time = #{chargeEndTime},
</if>
<if test="startType != null">
start_type = #{startType},
</if>
2024-01-06 15:13:50 +08:00
<if test="startSoc != null">
2024-12-25 14:40:57 +08:00
start_soc = #{startSoc},
2023-03-04 16:29:55 +08:00
</if>
2024-01-06 15:13:50 +08:00
<if test="endSoc != null">
2024-12-25 14:40:57 +08:00
end_soc = #{endSoc},
</if>
<if test="stopReasonCode != null">
stop_reason_code = #{stopReasonCode},
2023-03-04 16:29:55 +08:00
</if>
<if test="reason != null">
reason = #{reason},
</if>
<if test="settlementTime != null">
settlement_time = #{settlementTime},
</if>
<if test="refundAmount != null">
refund_amount = #{refundAmount},
</if>
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteOrderBasicInfoByIds" parameterType="String">
delete
from order_basic_info where id in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="array" item="id" open="(" separator=",">
2023-03-04 16:29:55 +08:00
#{id}
</foreach>
</delete>
<delete id="deleteOrderDetailByOrderCodes" parameterType="String">
delete
from order_detail where order_code in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="array" item="orderCode" open="(" separator=",">
2023-03-04 16:29:55 +08:00
#{orderCode}
</foreach>
</delete>
<delete id="deleteOrderDetailByOrderCode" parameterType="Long">
delete
from order_detail
where order_code = #{orderCode}
</delete>
<insert id="batchOrderDetail">
insert into order_detail(id, order_code, total_used_electricity, total_order_amount, total_electricity_amount,
2024-12-25 14:40:57 +08:00
total_service_amount,
sharp_price, sharp_used_electricity, sharp_electricity_price, sharp_service_price,
sharp_amount,
peak_price, peak_used_electricity, peak_electricity_price, peak_service_price,
peak_amount,
flat_price, flat_used_electricity, flat_electricity_price, flat_service_price,
flat_amount,
valley_price, valley_used_electricity, valley_electricity_price, valley_service_price,
valley_amount,
create_by, update_by)
values
2024-01-06 15:13:50 +08:00
<foreach collection="list" index="index" item="item" separator=",">
(#{item.id}, #{item.orderCode}, #{item.totalUsedElectricity}, #{item.totalOrderAmount},
2024-12-25 14:40:57 +08:00
#{item.totalElectricityAmount}, #{item.totalServiceAmount},
#{item.sharpPrice}, #{item.sharpUsedElectricity}, #{item.sharpElectricityPrice}, #{item.sharpServicePrice},
#{item.sharpAmount},
#{item.peakPrice}, #{item.peakUsedElectricity}, #{item.peakElectricityPrice}, #{item.peakServicePrice},
#{item.peakAmount},
#{item.flatPrice}, #{item.flatUsedElectricity}, #{item.flatElectricityPrice}, #{item.flatServicePrice},
#{item.flatAmount},
#{item.valleyPrice}, #{item.valleyUsedElectricity}, #{item.valleyElectricityPrice},
#{item.valleyServicePrice}, #{item.valleyAmount},
#{item.createBy}, #{item.updateBy})
2023-03-04 16:29:55 +08:00
</foreach>
</insert>
<update id="updateOrderDetail" parameterType="com.jsowell.pile.domain.OrderDetail">
update order_detail
<trim prefix="SET" suffixOverrides=",">
<if test="orderCode != null">
order_code = #{orderCode},
</if>
<if test="totalUsedElectricity != null">
total_used_electricity = #{totalUsedElectricity},
</if>
<if test="totalOrderAmount != null">
total_order_amount = #{totalOrderAmount},
</if>
<if test="totalElectricityAmount != null">
total_electricity_amount = #{totalElectricityAmount},
</if>
2024-12-25 14:40:57 +08:00
<if test="discountElectricityAmount != null">
discount_electricity_amount = #{discountElectricityAmount},
</if>
2023-03-04 16:29:55 +08:00
<if test="totalServiceAmount != null">
total_service_amount = #{totalServiceAmount},
</if>
2024-12-25 14:40:57 +08:00
<if test="discountServiceAmount != null">
discount_service_amount = #{discountServiceAmount},
</if>
<if test="sharpPrice != null">
sharp_price = #{sharpPrice},
</if>
2023-03-04 16:29:55 +08:00
<if test="sharpUsedElectricity != null">
sharp_used_electricity = #{sharpUsedElectricity},
</if>
<if test="sharpElectricityPrice != null">
sharp_electricity_price = #{sharpElectricityPrice},
</if>
<if test="sharpServicePrice != null">
sharp_service_price = #{sharpServicePrice},
</if>
<if test="sharpAmount != null">
sharp_amount = #{sharpAmount},
</if>
<if test="peakPrice != null">
peak_price = #{peakPrice},
</if>
2023-03-04 16:29:55 +08:00
<if test="peakUsedElectricity != null">
peak_used_electricity = #{peakUsedElectricity},
</if>
<if test="peakElectricityPrice != null">
peak_electricity_price = #{peakElectricityPrice},
</if>
<if test="peakServicePrice != null">
peak_service_price = #{peakServicePrice},
</if>
<if test="peakAmount != null">
peak_amount = #{peakAmount},
</if>
<if test="flatPrice != null">
flat_price = #{flatPrice},
</if>
2023-03-04 16:29:55 +08:00
<if test="flatUsedElectricity != null">
flat_used_electricity = #{flatUsedElectricity},
</if>
<if test="flatElectricityPrice != null">
flat_electricity_price = #{flatElectricityPrice},
</if>
<if test="flatServicePrice != null">
flat_service_price = #{flatServicePrice},
</if>
<if test="flatAmount != null">
flat_amount = #{flatAmount},
</if>
<if test="valleyPrice != null">
valley_price = #{valleyPrice},
</if>
2023-03-04 16:29:55 +08:00
<if test="valleyUsedElectricity != null">
valley_used_electricity = #{valleyUsedElectricity},
</if>
<if test="valleyElectricityPrice != null">
valley_electricity_price = #{valleyElectricityPrice},
</if>
<if test="valleyServicePrice != null">
valley_service_price = #{valleyServicePrice},
</if>
<if test="valleyAmount != null">
valley_amount = #{valleyAmount},
</if>
2023-03-04 16:29:55 +08:00
<if test="createBy != null">
create_by = #{createBy},
</if>
<if test="updateBy != null">
update_by = #{updateBy},
</if>
<if test="delFlag != null">
del_flag = #{delFlag},
</if>
</trim>
where id = #{id}
</update>
2024-01-11 17:28:45 +08:00
<select id="getOrderInfoByOrderCode" resultMap="BaseResultMap">
2023-03-04 16:29:55 +08:00
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-03-04 16:29:55 +08:00
from order_basic_info
<where>
order_code = #{orderCode,jdbcType=VARCHAR}
</where>
and del_flag = '0'
</select>
2024-01-11 17:28:45 +08:00
<select id="getOrderInfoByTransactionCode" resultMap="BaseResultMap">
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and transaction_code = #{transactionCode,jdbcType=VARCHAR}
</select>
2024-01-11 17:28:45 +08:00
<select id="queryOrderBasicInfo" resultMap="BaseResultMap">
2023-03-04 16:29:55 +08:00
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-03-04 16:29:55 +08:00
from order_basic_info
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and pile_sn = #{pileSn,jdbcType=VARCHAR}
and connector_code = #{connectorCode,jdbcType=VARCHAR}
and order_status = #{orderStatus,jdbcType=VARCHAR}
2023-03-04 16:29:55 +08:00
order by create_time DESC
limit 1
</select>
<select id="getOrderDetailByOrderCode" resultMap="OrderDetailResult">
select
2024-12-25 14:40:57 +08:00
<include refid="Detail_Base_Column_List"/>
2023-03-04 16:29:55 +08:00
from order_detail
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and order_code = #{orderCode,jdbcType=VARCHAR}
2023-03-04 16:29:55 +08:00
</select>
2024-07-16 14:07:06 +08:00
<select id="getListByMemberIdAndOrderStatus" resultType="com.jsowell.pile.vo.uniapp.customer.OrderVO">
SELECT t1.id,
2024-12-25 14:40:57 +08:00
t1.order_code as orderCode,
t1.transaction_code as transactionCode,
t1.order_status as orderStatus,
t1.stop_reason_code as stopReasonCode,
t1.reason,
t1.station_id as stationId,
t3.station_name as stationName,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.pay_status as payStatus,
t1.start_mode as startMode,
t1.plate_number as licensePlateNumber,
2024-12-25 14:40:57 +08:00
t1.order_amount as orderAmount,
t1.virtual_amount as virtualAmount,
t1.settle_amount as settleAmount,
t1.pay_amount as payAmount,
t2.total_used_electricity as chargingDegree,
t1.charge_start_time as startTime,
t1.charge_end_time as endTime,
t2.total_electricity_amount as totalElectricityAmount,
t2.total_service_amount as totalServiceAmount
2023-03-04 16:29:55 +08:00
from order_basic_info t1
2024-12-25 14:40:57 +08:00
join order_detail t2 on t1.order_code = t2.order_code
join pile_station_info t3 on t1.station_id = t3.id
2023-03-04 16:29:55 +08:00
where t1.del_flag = '0'
2024-12-25 14:40:57 +08:00
and t1.member_id = #{memberId,jdbcType=VARCHAR}
<if test="stationId != null and stationId != ''">
and t1.station_id = #{stationId,jdbcType=VARCHAR}
</if>
2023-03-04 16:29:55 +08:00
<if test="orderStatusList != null and orderStatusList.size() != 0">
and t1.order_status in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="orderStatusList" item="orderStatus" open="(" separator=",">
2023-03-04 16:29:55 +08:00
#{orderStatus,jdbcType=VARCHAR}
</foreach>
</if>
<if test="dateTime != null">
and t1.create_time <![CDATA[ >= ]]> #{dateTime,jdbcType=VARCHAR}
</if>
2023-03-04 16:29:55 +08:00
order by t1.create_time desc
</select>
<update id="updateOrderStatusByOrderCode">
update order_basic_info
set order_status = #{orderStatus,jdbcType=VARCHAR}
2023-03-04 16:29:55 +08:00
where del_flag = '0'
and order_code = #{orderCode,jdbcType=VARCHAR}
2023-03-04 16:29:55 +08:00
</update>
<select id="getIndexOrderInfo" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO">
SELECT DATE_FORMAT(t1.create_time, '%Y-%m-%d') as date,
2024-12-25 14:40:57 +08:00
sum(t2.total_used_electricity) AS totalElectricity,
sum(t2.total_order_amount) AS totalOrderAmount,
sum(t2.sharp_used_electricity) AS totalSharpUsedElectricity,
sum(t2.peak_used_electricity) AS totalPeakUsedElectricity,
sum(t2.flat_used_electricity) AS totalFlatUsedElectricity,
sum(t2.valley_used_electricity) AS totalValleyUsedElectricity
FROM order_basic_info t1
2024-12-25 14:40:57 +08:00
JOIN order_detail t2 ON t1.order_code = t2.order_code
AND t1.del_flag = '0'
2024-01-06 15:13:50 +08:00
WHERE date(t1.create_time) &gt;= DATE_SUB(CURDATE(), INTERVAL 30 day)
2024-12-25 14:40:57 +08:00
and t1.order_status = '6'
<if test="dto.stationId != null and dto.stationId != ''">
and t1.station_id = #{dto.stationId,jdbcType=VARCHAR}
</if>
<if test="dto.stationIdList != null and dto.stationIdList.size() != 0">
and t1.station_id in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="dto.stationIdList" item="item" open="(" separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
group by DATE_FORMAT(t1.create_time, '%Y-%m-%d')
2023-03-04 16:29:55 +08:00
</select>
2024-01-11 17:28:45 +08:00
<select id="getUnpaidOrderListOver15Min" resultMap="BaseResultMap">
2023-03-04 16:29:55 +08:00
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-03-04 16:29:55 +08:00
from order_basic_info
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and order_status = '0'
and pay_status = '0'
<!--and create_time <![CDATA[ <= ]]> #{createTime,jdbcType=VARCHAR}-->
and create_time between date_sub(#{createTime,jdbcType=VARCHAR}, interval 15 minute) and
#{createTime,jdbcType=VARCHAR}
2024-11-29 09:50:32 +08:00
</select>
<select id="getUnpaidOrderList" resultMap="BaseResultMap">
2024-12-25 14:40:57 +08:00
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
and order_status = '0'
and pay_status = '0'
and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
2023-03-04 16:29:55 +08:00
</select>
2024-01-11 17:28:45 +08:00
<select id="selectOrderListByTimeRangeAndStatus" resultMap="BaseResultMap">
2023-03-04 16:29:55 +08:00
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-03-04 16:29:55 +08:00
from order_basic_info
where del_flag = '0'
and start_mode != '4'
2023-03-04 16:29:55 +08:00
<if test="startTime != null and startTime != ''">
and create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</if>
<if test="endTime != null and endTime != ''">
and create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</if>
<if test="orderStatus != null and orderStatus != ''">
and order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="payStatus != null and payStatus != ''">
and pay_status = #{payStatus,jdbcType=VARCHAR}
</if>
</select>
<update id="updateOrderStatusById">
update order_basic_info
set order_status = #{orderStatus,jdbcType=VARCHAR}
2023-03-04 16:29:55 +08:00
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and id in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="orderIds" item="orderId" open="(" separator=",">
2023-03-04 16:29:55 +08:00
#{orderId,jdbcType=VARCHAR}
</foreach>
</update>
2024-07-16 14:07:06 +08:00
<select id="selectOrderInfoByOrderCode" resultType="com.jsowell.pile.vo.uniapp.customer.SendMessageVO">
SELECT t1.order_code as orderCode,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeStopTime,
t1.reason as stopReason,
t1.station_id as stationId,
t2.station_name as stationName,
t3.total_order_amount as orderAmount,
2024-12-25 14:40:57 +08:00
t1.order_amount as orderAmount,
t1.discount_amount as discountAmount,
t1.settle_amount as settleAmount,
t3.total_used_electricity as chargingDegree,
t4.open_id as openId
FROM order_basic_info t1
2024-12-25 14:40:57 +08:00
JOIN pile_station_info t2 ON t1.station_id = t2.id and t1.del_flag = '0'
join order_detail t3 on t1.order_code = t3.order_code and t3.del_flag = '0'
join member_basic_info t4 on t1.member_id = t4.member_id and t4.del_flag = '0'
2023-10-14 11:33:57 +08:00
where t1.del_flag = '0'
2024-12-25 14:40:57 +08:00
and t1.order_code = #{orderCode,jdbcType=VARCHAR}
2023-03-04 16:29:55 +08:00
</select>
2024-01-11 17:28:45 +08:00
<select id="getOrderBasicInfo" resultMap="BaseResultMap">
2023-03-04 16:29:55 +08:00
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-03-04 16:29:55 +08:00
from order_basic_info
where del_flag = '0'
<if test="memberId != null and memberId != ''">
AND member_id = #{memberId,jdbcType=VARCHAR}
</if>
<if test="pileConnectorCode != null and pileConnectorCode != ''">
AND pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
</if>
<if test="orderStatus != null and orderStatus != ''">
AND order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="startMode != null and startMode != ''">
AND start_mode = #{startMode,jdbcType=VARCHAR}
</if>
2025-06-19 14:51:31 +08:00
<if test="orderType != null and startMode != ''" >
and order_type = #{orderType,jdbcType=VARCHAR}
</if>
2023-03-04 16:29:55 +08:00
order by create_time desc
limit 1
</select>
2024-07-16 14:07:06 +08:00
<select id="getAccumulativeInfo" resultType="com.jsowell.pile.vo.uniapp.customer.PersonPileConnectorSumInfoVO">
2024-12-25 14:40:57 +08:00
SELECT t1.member_id as memberId,
t1.pile_connector_code as pileConnectorCode,
t1.pile_sn as pileSn,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeEndTime,
t2.total_used_electricity as sumChargingDegree
FROM order_basic_info t1
2024-06-03 09:31:46 +08:00
JOIN order_detail t2 ON t1.order_code = t2.order_code
WHERE t1.pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
2024-12-25 14:40:57 +08:00
<!--AND t1.member_id = #{memberId,jdbcType=VARCHAR}-->
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
<!--AND t1.order_status = '6'-->
AND t1.del_flag = '0'
2024-08-27 09:07:25 +08:00
order by t1.create_time desc
2023-03-04 16:29:55 +08:00
</select>
2024-07-16 14:07:06 +08:00
<select id="getListByOrderCodes" resultType="com.jsowell.pile.vo.uniapp.customer.OrderVO">
2024-12-25 14:40:57 +08:00
SELECT t1.order_code as orderCode,
t1.order_status as orderStatus,
t1.reason as reason,
t1.merchant_id as merchantId,
t1.station_id as stationId,
t3.station_name as stationName,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.pay_status as payStatus,
t1.order_amount as orderAmount,
t1.pay_amount as payAmount,
t2.total_used_electricity as chargingDegree,
t1.charge_start_time as startTime,
t1.charge_end_time as endTime,
t2.total_electricity_amount as totalElectricityAmount,
t2.total_service_amount as totalServiceAmount
from order_basic_info t1
2023-08-04 13:40:38 +08:00
join order_detail t2 on t1.order_code = t2.order_code
join pile_station_info t3 on t1.station_id = t3.id
where t1.del_flag = '0'
2024-12-25 14:40:57 +08:00
and t1.order_code in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="orderCodes" item="orderCode" open="(" separator=",">
#{orderCode,jdbcType=VARCHAR}
</foreach>
</select>
<select id="getAccumulativeInfoForLianLian" resultType="com.jsowell.pile.vo.lianlian.AccumulativeInfoVO">
SELECT t1.order_code as orderCode,
t1.pile_connector_code as pileConnectorCode,
t1.pile_sn as pileSn,
t1.station_id as stationId,
2024-12-25 14:40:57 +08:00
t1.charge_start_time as startTime,
t1.charge_end_time as endTime,
IFNULL(t2.total_used_electricity, 0.00) as connectorElectricity
FROM order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
WHERE t1.del_flag = '0'
AND t1.station_id = #{stationID,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
</select>
2023-04-18 15:44:13 +08:00
<select id="queryElecAmountNullList" resultMap="OrderDetailResult">
select
2024-12-25 14:40:57 +08:00
<include refid="Detail_Base_Column_List"/>
2023-04-18 15:44:13 +08:00
from order_detail
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and total_order_amount is not null
AND total_order_amount &gt; '0.00'
and total_electricity_amount is null
2023-04-18 15:44:13 +08:00
</select>
<update id="batchUpdateOrderDetail">
update order_detail
<trim prefix="set" suffixOverrides=",">
<trim prefix="total_electricity_amount =case" suffix="end,">
2024-01-06 15:13:50 +08:00
<foreach collection="list" index="index" item="item">
<if test="item.totalElectricityAmount != null">
when id = #{item.id} then #{item.totalElectricityAmount}
2023-04-18 15:44:13 +08:00
</if>
</foreach>
</trim>
<trim prefix="total_service_amount =case" suffix="end,">
2024-01-06 15:13:50 +08:00
<foreach collection="list" index="index" item="item">
<if test="item.totalServiceAmount != null">
when id = #{item.id} then #{item.totalServiceAmount}
2023-04-18 15:44:13 +08:00
</if>
</foreach>
</trim>
</trim>
where
2024-01-06 15:13:50 +08:00
<foreach collection="list" index="index" item="i" separator="or">
id = #{i.id}
2023-04-18 15:44:13 +08:00
</foreach>
</update>
2023-05-12 15:03:29 +08:00
<select id="getOrderDetailList" resultMap="OrderDetailResult">
select
2024-12-25 14:40:57 +08:00
<include refid="Detail_Base_Column_List"/>
2023-05-12 15:03:29 +08:00
from order_detail
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and order_code in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="list" item="item" open="(" separator=",">
2023-05-12 15:03:29 +08:00
#{item,jdbcType=VARCHAR}
</foreach>
</select>
2024-01-11 17:28:45 +08:00
<select id="tempQueryWeChatRefundOrders" resultMap="BaseResultMap">
2023-05-31 13:59:27 +08:00
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-05-31 13:59:27 +08:00
from order_basic_info
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and pay_mode = '4'
and refund_amount &gt; '0.00'
and create_time BETWEEN #{startTime} and #{endTime}
2023-05-31 13:59:27 +08:00
</select>
<select id="getMerchantOrderInfoList" resultType="com.jsowell.pile.vo.base.MerchantOrderInfoVO">
2024-12-25 14:40:57 +08:00
select t1.order_code as orderCode,
t1.transaction_code as transactionCode,
t1.order_status as orderStatus,
t1.station_id as stationId,
t2.station_name as stationName,
t1.order_amount as orderAmount,
t1.settlement_time as orderSettleTime
from order_basic_info t1
2024-12-25 14:40:57 +08:00
left join pile_station_info t2 on t1.station_id = t2.id
where t1.del_flag = '0'
2024-12-25 14:40:57 +08:00
and t1.merchant_id = #{dto.merchantId,jdbcType=VARCHAR}
<if test="dto.startTime != null">
and t1.create_time <![CDATA[ >= ]]> #{dto.startTime,jdbcType=VARCHAR}
</if>
<if test="dto.endTime != null">
and t1.settlement_time <![CDATA[ <= ]]> #{dto.endTime,jdbcType=VARCHAR}
</if>
order by t1.create_time desc
</select>
2023-07-10 15:49:54 +08:00
<select id="batchRefundQuery" resultType="com.jsowell.pile.vo.web.RefundOrder">
2024-12-25 14:40:57 +08:00
SELECT t1.order_code as orderCode,
t1.`order_status` as orderStatus,
t1.station_id as stationId,
t2.station_name AS stationName,
t1.pay_amount AS payAmount,
t1.order_amount AS orderAmount,
t1.refund_amount AS refundAmount
FROM order_basic_info t1
2024-12-25 14:40:57 +08:00
JOIN pile_station_info t2 ON t1.station_id = t2.id
2023-07-10 15:49:54 +08:00
WHERE
2024-12-25 14:40:57 +08:00
t1.order_code IN
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="list" item="itme" open="(" separator=",">
2023-07-10 15:49:54 +08:00
#{itme,jdbcType=VARCHAR}
</foreach>
</select>
2023-07-26 18:05:54 +08:00
2024-01-11 17:28:45 +08:00
<select id="queryOrderList" resultMap="BaseResultMap">
2023-07-26 18:05:54 +08:00
select
2024-12-25 14:40:57 +08:00
<include refid="Base_Column_List"/>
2023-07-26 18:05:54 +08:00
from order_basic_info
where del_flag = '0'
2024-12-25 14:40:57 +08:00
and order_code in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="orderCodeList" item="item" open="(" separator=",">
2023-07-26 18:05:54 +08:00
#{item,jdbcType=VARCHAR}
</foreach>
</select>
<select id="getIndexOrderInfoV2" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO">
2024-12-25 14:40:57 +08:00
SELECT trade_date AS date,
order_codes as orderCodes,
use_electricity AS totalElectricity,
2025-08-08 13:18:14 +08:00
settle_amount as totalSettleAmount,
2024-12-25 14:40:57 +08:00
total_amount as totalOrderAmount
from settle_order_report
2024-06-14 15:48:42 +08:00
where del_flag = '0'
<!-- and date(trade_date) &gt;= DATE_SUB(CURDATE(), INTERVAL 30 day)-->
and trade_date between #{dto.startTime,jdbcType=VARCHAR} and #{dto.endTime,jdbcType=VARCHAR}
<if test="dto.stationId != null and dto.stationId != ''">
and station_id = #{dto.stationId,jdbcType=VARCHAR}
</if>
<if test="dto.stationIdList != null and dto.stationIdList.size() != 0">
and station_id in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="dto.stationIdList" item="item" open="(" separator=",">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<select id="getIndexOrderDetail" resultType="com.jsowell.pile.vo.web.IndexOrderInfoVO">
select
2024-12-25 14:40:57 +08:00
sum(sharp_used_electricity) AS totalSharpUsedElectricity,
2025-01-08 09:15:56 +08:00
sum(sharp_amount) as totalSharpAmount,
2024-12-25 14:40:57 +08:00
sum(peak_used_electricity) AS totalPeakUsedElectricity,
2025-01-08 09:15:56 +08:00
sum(peak_amount) as totalPeakAmount,
2024-12-25 14:40:57 +08:00
sum(flat_used_electricity) AS totalFlatUsedElectricity,
2025-01-08 09:15:56 +08:00
sum(flat_amount) as totalFlatAmount,
sum(valley_used_electricity) AS totalValleyUsedElectricity,
sum(valley_amount) as totalValleyAmount
from order_detail
<if test="list != null and list.size() != 0">
where order_code in
2024-01-06 15:13:50 +08:00
<foreach close=")" collection="list" item="orderCode" open="(" separator=",">
#{orderCode,jdbcType=VARCHAR}
</foreach>
</if>
</select>
<update id="updateMerchantByStationId">
update
order_basic_info
2024-12-25 14:40:57 +08:00
set merchant_id = #{newMerchantId,jdbcType=VARCHAR}
where station_id = #{stationId,jdbcType=BIGINT}
</update>
2023-10-10 16:20:45 +08:00
<select id="getNROrderInfoByOrderCode" resultType="com.jsowell.pile.vo.nanrui.JiangSuOrderInfoVO">
2023-10-10 16:20:45 +08:00
SELECT
2024-12-25 14:40:57 +08:00
t1.station_id as stationId,
t1.merchant_id,
t1.third_party_type as thirdPartyType,
t3.organization_code AS operatorId,
t1.pile_connector_code AS connectorId,
t1.order_code AS startChargeSeq,
t2.total_used_electricity AS elect,
t2.sharp_used_electricity AS cuspElect,
t2.peak_used_electricity AS peakElect,
t2.flat_used_electricity AS flatElect,
t2.valley_used_electricity AS valleyElect,
t1.charge_start_time AS startTime,
t1.charge_end_time AS endTime
2023-10-10 16:20:45 +08:00
FROM
2024-12-25 14:40:57 +08:00
order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
AND t1.del_flag = '0'
JOIN pile_merchant_info t3 ON t1.merchant_id = t3.id
AND t3.del_flag = '0'
2023-10-10 16:20:45 +08:00
<where>
<if test="dto.orderCode != null and dto.orderCode != ''">
and t1.order_code = #{dto.orderCode,jdbcType=VARCHAR}
</if>
<if test="dto.queryStartTime != null and dto.queryStartTime != '' and dto.queryEndTime != null and dto.queryEndTime != ''">
2024-12-25 14:40:57 +08:00
and t1.charge_end_time between #{dto.queryStartTime,jdbcType=VARCHAR} and
#{dto.queryEndTime,jdbcType=VARCHAR}
2023-10-10 16:20:45 +08:00
</if>
</where>
</select>
2024-08-06 15:46:43 +08:00
<select id="queryOrderPayDetail" resultType="com.jsowell.pile.vo.web.OrderPaymentDetailVO">
2024-12-25 14:40:57 +08:00
select t1.order_code as orderCode,
t1.create_time as createTime,
t1.settlement_time as settlementTime,
t1.`pay_amount` as payAmount,
t1.refund_amount as refundAmount,
t1.settle_amount as settleAmount,
t1.refund_amount as refundAmount,
t1.merchant_id as merchantId,
t2.payment_id as paymentId
from order_basic_info t1
2024-12-25 14:40:57 +08:00
join adapay_callback_record t2 on t1.order_code = t2.order_code
where t1.`del_flag` = '0'
and t1.settlement_time BETWEEN #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
2024-01-06 15:13:50 +08:00
and t1.settle_amount &gt; 0.00
and t1.pay_mode = '4'
</select>
2024-07-16 14:07:06 +08:00
<select id="getOrderInfoByNXJT" resultType="com.jsowell.pile.vo.uniapp.customer.OrderVO">
SELECT
2024-12-25 14:40:57 +08:00
t1.charge_start_time AS startTime,
t1.station_id AS stationId,
t2.station_name AS stationName,
t1.plate_number as licensePlateNumber,
t1.order_amount AS orderAmount
FROM
2024-12-25 14:40:57 +08:00
order_basic_info t1
JOIN pile_station_info t2 ON t1.station_id = t2.id
WHERE t1.del_flag = '0'
2024-12-25 14:40:57 +08:00
<if test="licensePlateNumber != null and licensePlateNumber != ''">
AND t1.plate_number = #{licensePlateNumber,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>
</select>
2023-12-04 15:49:02 +08:00
2024-12-25 14:40:57 +08:00
<select id="queryRepayOrder" resultMap="BaseResultMap">
select
2024-02-26 13:43:02 +08:00
<include refid="Base_Column_List"/>
2024-12-25 14:40:57 +08:00
from order_basic_info
where order_status = '3'
and member_id =#{memberId,jdbcType=VARCHAR}
</select>
2024-02-26 13:43:02 +08:00
2024-12-25 14:40:57 +08:00
<select id="queryOrderListByGroupCode" resultMap="BaseResultMap">
select
2024-02-26 13:43:02 +08:00
<include refid="Base_Column_List"/>
2024-12-25 14:40:57 +08:00
from order_basic_info
where order_status = '6'
and pay_mode = '1'
and group_code =#{groupCode,jdbcType=VARCHAR}
</select>
2024-02-28 14:47:47 +08:00
2024-12-25 14:40:57 +08:00
<select id="queryXDTOrderList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_basic_info
where order_status = '3'
and member_id =#{memberId,jdbcType=VARCHAR}
</select>
2024-07-16 14:07:06 +08:00
<select id="getChargeOrderInfoByOrderCode" resultType="com.jsowell.pile.vo.uniapp.customer.OrderVO">
SELECT t1.merchant_id as merchantId,
2024-12-25 14:40:57 +08:00
t3.organization_code as organizationCode,
t1.order_code AS orderCode,
t4.mobile_number as phoneNumber,
2024-12-25 14:40:57 +08:00
t1.transaction_code AS transactionCode,
t1.order_status AS orderStatus,
t1.station_id AS stationId,
t1.third_party_type as thirdPartyType,
t5.station_name as stationName,
2024-12-25 14:40:57 +08:00
t1.pile_sn AS pileSn,
t1.member_id as memberId,
t1.connector_code AS connectorCode,
t1.pile_connector_code AS pileConnectorCode,
t1.pay_mode AS payMode,
t1.pay_amount AS payAmount,
t1.logic_card as cardNumber,
2024-12-25 14:40:57 +08:00
t1.pay_time AS payTime,
t1.order_amount AS orderAmount,
t1.plate_number AS licensePlateNumber,
2024-12-25 14:40:57 +08:00
t1.discount_amount AS discountAmount,
t1.settlement_time as settlementTime,
2024-12-25 14:40:57 +08:00
t1.settle_amount AS settleAmount,
t1.create_time as createTime,
t1.charge_start_time AS startTime,
t1.charge_end_time AS endTime,
t1.start_soc AS startSoc,
t1.end_soc AS endSoc,
t1.reason AS reason,
t1.vin_code as vinCode,
2024-12-25 14:40:57 +08:00
t2.total_used_electricity AS totalPower,
t2.total_electricity_amount AS totalElectricityAmount,
t2.total_service_amount AS totalServiceAmount
FROM order_basic_info t1
JOIN
order_detail t2 ON t1.order_code = t2.order_code
join
pile_merchant_info t3 on t1.merchant_id = t3.id
join
2026-01-09 15:14:13 +08:00
member_basic_info t4 on t1.member_id = t4.member_id
join pile_station_info t5 on t1.station_id = t5.id
2024-12-25 14:40:57 +08:00
WHERE t1.del_flag = '0'
AND t1.order_code = #{orderCode,jdbcType=VARCHAR}
</select>
2024-05-21 18:11:01 +08:00
2024-12-25 14:40:57 +08:00
<select id="getReservedOrder" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
and pay_status = '1'
and start_type = 'reserved'
and order_status = '0'
and order_basic_info.reserved_start_time <![CDATA[ <= ]]> #{dateTime,jdbcType=TIMESTAMP}
</select>
2024-12-25 14:40:57 +08:00
<select id="queryOrderListByStationId" resultType="com.jsowell.pile.vo.SupStationStatsVO">
SELECT t1.order_code as orderCode,
t3.organization_code as organizationCode,
t1.station_id AS stationId,
t1.pile_sn AS pileSn,
t1.pile_connector_code AS pileConnectorCode,
t1.charge_start_time AS StartTime,
t1.charge_end_time AS EndTime,
t2.total_used_electricity AS totalPower
FROM order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
AND t1.del_flag = '0'
JOIN pile_merchant_info t3 on t1.merchant_id = t3.id
WHERE t1.station_id = #{stationId,jdbcType=VARCHAR}
AND t1.charge_start_time <![CDATA[ >= ]]> DATE_SUB(CURDATE(), INTERVAL 1 DAY)
AND t1.charge_start_time <![CDATA[ < ]]> CURDATE()
</select>
2024-07-16 15:33:44 +08:00
2024-12-25 14:40:57 +08:00
<select id="queryOrderByOccupyTime" resultType="com.jsowell.pile.vo.web.OrderListVO">
SELECT t1.id as id,
t1.order_code as orderCode,
t1.transaction_code as transactionCode,
t1.order_status as orderStatus,
t1.member_id as memberId,
t2.nick_name as nickName,
t2.mobile_number as mobileNumber,
t1.station_id as stationId,
t3.station_name as stationName,
t1.pile_sn as pileSn,
t1.connector_code as connectorCode,
t1.logic_card as logicCard,
t1.vin_code as vinCode,
t1.plate_number as plateNumber,
t1.start_mode as startMode,
t1.third_party_type as thirdPartyType,
t1.pay_mode as payMode,
t1.pay_status as payStatus,
t1.pay_amount as payAmount,
t1.pay_time as payTime,
t1.order_amount as orderAmount,
t1.virtual_amount as virtualAmount,
t1.discount_amount as discountAmount,
t1.settle_amount as settleAmount,
t1.settlement_time as settlementTime,
t1.start_soc as startSoc,
t1.end_soc as endSoc,
t1.charge_start_time as chargeStartTime,
t1.charge_end_time as chargeEndTime,
t1.create_time as createTime,
t4.total_used_electricity as chargingDegree,
t4.total_electricity_amount as totalElectricityAmount,
t4.total_service_amount as totalServiceAmount,
t4.sharp_used_electricity as sharpElectricity,
t4.peak_used_electricity as peakElectricity,
t4.flat_used_electricity as flatElectricity,
t4.valley_used_electricity as valleyElectricity
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'
and `t1`.`member_id` = #{memberId,jdbcType=VARCHAR}
and `t1`.`station_id` = #{stationId,jdbcType=VARCHAR}
and `t1`.`charge_start_time` <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
and `t1`.`charge_end_time` <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
</select>
2024-12-25 14:40:57 +08:00
<select id="getOrderDetailByStationIds" resultType="com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO">
SELECT
DATE_FORMAT( t1.create_time, '%Y-%m-%d' ) AS tradeDate,
<!-- t1.order_code AS orderCode,-->
<!-- t1.station_id AS stationId,-->
t1.pile_connector_code as pileConnectorCode,
t2.sharp_used_electricity AS sharpUsedElectricity,
t2.sharp_amount AS sharpAmount,
t2.sharp_electricity_price AS sharpElectricityPrice,
t2.peak_used_electricity AS peakUsedElectricity,
t2.peak_amount AS peakAmount,
t2.peak_electricity_price AS peakElectricityPrice,
t2.flat_used_electricity AS flatUsedElectricity,
t2.flat_amount AS flatAmount,
t2.flat_electricity_price AS flatElectricityPrice,
t2.valley_used_electricity AS valleyUsedElectricity,
t2.valley_amount AS valleyAmount,
t2.valley_electricity_price AS valleyElectricityPrice,
t2.total_service_amount AS totalServiceAmount,
t1.settle_amount AS settleAmount
FROM
order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
AND t1.del_flag = '0'
2024-12-25 14:40:57 +08:00
WHERE
t1.station_id IN
<foreach collection="stationIds" item="stationId" open="(" separator="," close=")">
#{stationId,jdbcType=VARCHAR}
</foreach>
AND t1.create_time BETWEEN #{startTime,jdbcType=VARCHAR} AND DATE_ADD(#{endTime,jdbcType=VARCHAR}, INTERVAL 1
DAY)
order by t1.create_time
</select>
<select id="queryOrdersByPileConnectorCodeAndStatus" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
and pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR}
and order_status != '7'
<if test="orderStatus != null and orderStatus != ''">
and order_status = #{orderStatus,jdbcType=VARCHAR}
</if>
<if test="payStatus != null and payStatus != ''">
and pay_status = #{payStatus,jdbcType=VARCHAR}
</if>
order by create_time DESC
limit 20
</select>
2024-09-23 11:41:19 +08:00
2024-12-25 14:40:57 +08:00
<select id="tempGetOrderCodes" resultType="java.lang.String">
select order_code
from order_basic_info
where station_id = #{stationId,jdbcType=VARCHAR}
and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
</select>
2024-09-23 11:41:19 +08:00
2024-12-25 14:40:57 +08:00
<select id="selectThirdPartyOrderList" resultType="com.jsowell.pile.vo.uniapp.customer.OrderVO">
select t1.order_code as orderCode,
t1.start_mode as startMode,
t1.pile_connector_code as pileConnectorCode,
t1.charge_start_time as startTime,
t1.charge_end_time as endTime,
t2.total_used_electricity as totalPower,
t2.total_electricity_amount as totalElectricityAmount,
t2.total_service_amount as totalServiceAmount,
t1.order_amount as orderAmount
from order_basic_info t1
join order_detail t2 on t1.order_code = t2.order_code
and t1.del_flag = '0'
<where>
<if test="dto.lastQueryTime != null and dto.lastQueryTime != ''">
and t1.create_time <![CDATA[ >= ]]> #{dto.lastQueryTime,jdbcType=VARCHAR}
</if>
<if test="dto.lastQueryEndTime != null and dto.lastQueryEndTime != ''">
and t1.create_time <![CDATA[ <= ]]> #{dto.lastQueryEndTime,jdbcType=VARCHAR}
</if>
</where>
</select>
2025-03-19 11:53:33 +08:00
2025-04-08 08:44:34 +08:00
<select id="queryOrderCreateTimeByStationId" resultType="java.time.LocalDateTime">
SELECT
create_time
FROM
order_basic_info
WHERE
2025-04-08 09:11:39 +08:00
del_flag = '0'
and
2025-04-08 08:44:34 +08:00
station_id = #{stationId}
ORDER BY
create_time DESC
LIMIT 1;
</select>
<select id="getOrderBasicInfoByTimeInterval" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_basic_info
where del_flag = '0'
and station_id in
<foreach collection="stationIds" item="stationId" open="(" separator="," close=")">
#{stationId,jdbcType=VARCHAR}
</foreach>
and create_time between #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
</select>
2025-07-09 18:36:46 +08:00
<select id="queryOrderListByStationIdAndTime" resultType="com.jsowell.pile.vo.SupStationStatsVO">
select
t1.order_code as orderCode,
t3.organization_code as organizationCode,
t1.station_id AS stationId,
t1.pile_sn AS pileSn,
t1.pile_connector_code AS pileConnectorCode,
t1.charge_start_time AS StartTime,
t1.charge_end_time AS EndTime,
t2.total_used_electricity AS totalPower
FROM order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
AND t1.del_flag = '0'
JOIN pile_merchant_info t3 on t1.merchant_id = t3.id
where t1.station_id = #{stationId,jdbcType=VARCHAR}
and t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
and t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
order by t1.create_time DESC
</select>
2025-10-10 11:54:35 +08:00
2025-10-10 13:32:53 +08:00
<select id="getSplitOrders" resultType="com.jsowell.pile.vo.web.OrderPaymentDetailVO">
2025-10-10 11:54:35 +08:00
SELECT
t1.`order_code` as orderCode,
t1.`settle_amount` as settleAmount,
2025-10-10 14:06:23 +08:00
t1.station_id as stationId,
2025-10-10 11:54:35 +08:00
t2.payment_id as paymentId
FROM
`order_basic_info` t1
LEFT JOIN `adapay_callback_record` t2 ON `t1`.`order_code` = t2.`order_code`
WHERE
t1.`del_flag` = '0'
AND t1.`merchant_id` = #{dto.merchantId,jdbcType=VARCHAR}
AND t1.`settlement_time` BETWEEN #{dto.startTime,jdbcType=VARCHAR}
AND #{dto.endTime,jdbcType=VARCHAR}
AND t1.`settle_amount` > 0;
</select>
2025-10-16 16:26:14 +08:00
<select id="getOrderDetailByStationIdsForMonth" resultType="com.jsowell.pile.vo.uniapp.business.BusinessOrderDetailInfoVO">
SELECT
DATE_FORMAT(t1.create_time, '%Y-%m-%d') AS tradeDate,
t1.pile_connector_code AS pileConnectorCode,
t2.sharp_used_electricity AS sharpUsedElectricity,
t2.sharp_amount AS sharpAmount,
t2.sharp_electricity_price AS sharpElectricityPrice,
t2.peak_used_electricity AS peakUsedElectricity,
t2.peak_amount AS peakAmount,
t2.peak_electricity_price AS peakElectricityPrice,
t2.flat_used_electricity AS flatUsedElectricity,
t2.flat_amount AS flatAmount,
t2.flat_electricity_price AS flatElectricityPrice,
t2.valley_used_electricity AS valleyUsedElectricity,
t2.valley_amount AS valleyAmount,
t2.valley_electricity_price AS valleyElectricityPrice,
t2.total_service_amount AS totalServiceAmount,
t1.settle_amount AS settleAmount
FROM order_basic_info t1
JOIN order_detail t2 ON t1.order_code = t2.order_code
WHERE t1.del_flag = '0'
AND t1.station_id IN
<foreach collection="stationIds" item="stationId" open="(" separator="," close=")">
#{stationId,jdbcType=VARCHAR}
</foreach>
AND t1.create_time BETWEEN #{startTime,jdbcType=VARCHAR}
AND DATE_ADD(#{endTime,jdbcType=VARCHAR}, INTERVAL 1 DAY)
ORDER BY t1.create_time DESC
</select>
<select id="getPlatformProfit" resultType="com.jsowell.pile.vo.web.IndexPlatformProfitVO">
select
count(DISTINCT(`order_code` ) ) as chargeTimes,
trade_date as tradeDate,
-- station_name as '站点名称',
adapay_member_id as adapayMemberId,
sum(`electricity_amount` ) as electricityAmount,
sum(`service_amount` ) as serviceAmount,
sum(`settle_amount` ) as settleAmount,
sum(electricity_split_amount) as electricitySplitAmount,
sum(service_split_amount) as serviceSplitAmount,
sum(electricity_split_amount + service_split_amount) as totalSplitAmount
from
`order_split_record`
WHERE
`trade_date` BETWEEN #{startTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
and `adapay_member_id` = '0'
and `electricity_split_ratio` = '2'
and `del_flag` = '0'
group by
`trade_date`
</select>
2025-11-13 14:25:11 +08:00
<select id="selectOrderCountAndInsuranceByMonth"
parameterType="com.jsowell.pile.dto.QueryOrderDTO"
resultType="com.jsowell.pile.vo.web.OrderMonthStatVO">
SELECT
DATE_FORMAT(create_time, '%Y-%m') AS month,
COUNT(*) AS orderCount,
IFNULL(SUM(insurance_amount), 0) AS insuranceAmount
FROM order_basic_info
WHERE create_time <![CDATA[ >= ]]> #{dto.startTime}
AND create_time <![CDATA[ < ]]> #{dto.endTime}
GROUP BY DATE_FORMAT(create_time, '%Y-%m')
ORDER BY month ASC
</select>
<select id="selectOrderTemp" resultMap="BaseResultMap">
select
2025-11-14 15:44:24 +08:00
order_code, refund_amount, settle_amount, pile_sn
from order_basic_info
where order_code in
<foreach item="item" collection="orderCodes" separator="," open="(" close=")">
#{item}
</foreach>
</select>
<select id="getInsuranceAmount" resultType="com.jsowell.pile.vo.web.IndexPlatformProfitVO">
select
DATE_FORMAT(settlement_time, '%Y-%m-%d') as tradeDate,
sum(insurance_amount) as insuranceAmount
from
`order_basic_info`
WHERE
`del_flag` = '0'
AND `insurance_amount` > 0
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>