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

3009 lines
119 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-01-06 15:13:50 +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" />
<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" />
2024-01-17 16:00:48 +08:00
<result column="third_party_type" jdbcType="VARCHAR" property="thirdPartyType" />
2024-01-06 15:13:50 +08:00
<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="plate_number" jdbcType="VARCHAR" property="plateNumber" />
<result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
<result column="virtual_amount" jdbcType="DECIMAL" property="virtualAmount" />
2024-01-14 14:44:14 +08:00
<result column="group_code" jdbcType="VARCHAR" property="groupCode" />
2024-01-06 15:13:50 +08:00
<result column="discount_amount" jdbcType="DECIMAL" property="discountAmount" />
<result column="settle_amount" jdbcType="DECIMAL" property="settleAmount" />
2024-01-17 16:00:48 +08:00
<result column="remedial_amount" jdbcType="DECIMAL" property="remedialAmount" />
2024-01-06 15:13:50 +08:00
<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" />
2024-05-21 18:11:01 +08:00
<result column="reserved_start_time" jdbcType="TIMESTAMP" property="reservedStartTime" />
<result column="reserved_end_time" jdbcType="TIMESTAMP" property="reservedEndTime" />
2024-01-06 15:13:50 +08:00
<result column="start_soc" jdbcType="VARCHAR" property="startSoc" />
<result column="end_soc" jdbcType="VARCHAR" property="endSoc" />
<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-->
id, order_code, transaction_code, order_status, member_id, station_id, merchant_id,
2024-01-17 16:00:48 +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, plate_number, order_amount, virtual_amount,
group_code, discount_amount, settle_amount, remedial_amount, charge_start_time, charge_end_time,
2024-05-21 18:11:01 +08:00
start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, reason, settlement_time, refund_amount,
2024-01-17 16:00:48 +08:00
refund_status, create_by, create_time, update_by, update_time, del_flag
2024-01-06 15:13:50 +08:00
</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-->
insert into order_basic_info (order_code, transaction_code, order_status,
member_id, station_id, merchant_id,
pile_sn, connector_code, pile_connector_code,
2024-01-14 14:44:14 +08:00
logic_card, vin_code, start_mode,
2024-01-17 16:00:48 +08:00
third_party_type, pay_mode, pay_status,
pay_amount, pay_time, plate_number,
order_amount, virtual_amount, group_code,
discount_amount, settle_amount, remedial_amount,
2024-05-21 18:11:01 +08:00
charge_start_time, charge_end_time, start_type,
reserved_start_time, reserved_end_time,
start_soc, end_soc,
2024-01-17 16:00:48 +08:00
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
values (#{orderCode,jdbcType=VARCHAR}, #{transactionCode,jdbcType=VARCHAR}, #{orderStatus,jdbcType=VARCHAR},
#{memberId,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR},
#{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR}, #{pileConnectorCode,jdbcType=VARCHAR},
2024-01-14 14:44:14 +08:00
#{logicCard,jdbcType=VARCHAR}, #{vinCode,jdbcType=VARCHAR}, #{startMode,jdbcType=VARCHAR},
2024-01-17 16:00:48 +08:00
#{thirdPartyType,jdbcType=VARCHAR}, #{payMode,jdbcType=VARCHAR}, #{payStatus,jdbcType=VARCHAR},
#{payAmount,jdbcType=DECIMAL}, #{payTime,jdbcType=TIMESTAMP}, #{plateNumber,jdbcType=VARCHAR},
#{orderAmount,jdbcType=DECIMAL}, #{virtualAmount,jdbcType=DECIMAL}, #{groupCode,jdbcType=VARCHAR},
#{discountAmount,jdbcType=DECIMAL}, #{settleAmount,jdbcType=DECIMAL}, #{remedialAmount,jdbcType=DECIMAL},
2024-05-21 18:11:01 +08:00
#{chargeStartTime,jdbcType=TIMESTAMP}, #{chargeEndTime,jdbcType=TIMESTAMP}, #{startType,jdbcType=VARCHAR},
#{reservedStartTime,jdbcType=TIMESTAMP},#{reservedEndTime,jdbcType=TIMESTAMP},
#{startSoc,jdbcType=VARCHAR}, #{endSoc,jdbcType=VARCHAR},
2024-01-17 16:00:48 +08:00
#{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}
)
2024-01-06 15:13:50 +08:00
</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>
<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>
2024-01-17 16:00:48 +08:00
<if test="thirdPartyType != null">
third_party_type,
</if>
2024-01-06 15:13:50 +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="plateNumber != null">
plate_number,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="virtualAmount != null">
virtual_amount,
</if>
2024-01-14 14:44:14 +08:00
<if test="groupCode != null">
group_code,
</if>
2024-01-06 15:13:50 +08:00
<if test="discountAmount != null">
discount_amount,
</if>
<if test="settleAmount != null">
settle_amount,
</if>
2024-01-17 16:00:48 +08:00
<if test="remedialAmount != null">
remedial_amount,
</if>
2024-01-06 15:13:50 +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,
2024-01-06 15:13:50 +08:00
</if>
<if test="startSoc != null">
start_soc,
</if>
<if test="endSoc != null">
end_soc,
</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>
<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>
2024-01-17 16:00:48 +08:00
<if test="thirdPartyType != null">
#{thirdPartyType,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<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="plateNumber != null">
#{plateNumber,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
#{orderAmount,jdbcType=DECIMAL},
</if>
<if test="virtualAmount != null">
#{virtualAmount,jdbcType=DECIMAL},
</if>
2024-01-14 14:44:14 +08:00
<if test="groupCode != null">
#{groupCode,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<if test="discountAmount != null">
#{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
2024-01-17 16:00:48 +08:00
<if test="remedialAmount != null">
#{remedialAmount,jdbcType=DECIMAL},
</if>
2024-01-06 15:13:50 +08:00
<if test="chargeStartTime != null">
#{chargeStartTime,jdbcType=TIMESTAMP},
</if>
<if test="chargeEndTime != null">
#{chargeEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startType != null">
#{startType,jdbcType=VARCHAR},
</if>
2024-05-21 18:11:01 +08:00
<if test="reservedStartTime != null">
#{reservedStartTime},
</if>
<if test="reservedEndTime != null">
#{reservedEndTime},
2024-01-06 15:13:50 +08:00
</if>
<if test="startSoc != null">
#{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
#{endSoc,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>
<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>
2024-01-17 16:00:48 +08:00
<if test="thirdPartyType != null">
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<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="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>
2024-01-14 14:44:14 +08:00
<if test="groupCode != null">
group_code = #{groupCode,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<if test="discountAmount != null">
discount_amount = #{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
2024-01-17 16:00:48 +08:00
<if test="remedialAmount != null">
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
</if>
2024-01-06 15:13:50 +08:00
<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>
2024-05-21 18:11:01 +08:00
<if test="reservedStartTime != null">
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
</if>
<if test="reservedEndTime != null">
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
2024-01-06 15:13:50 +08:00
</if>
<if test="startSoc != null">
start_soc = #{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
end_soc = #{endSoc,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},
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},
2024-01-17 16:00:48 +08:00
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
2024-01-06 15:13:50 +08:00
pay_mode = #{payMode,jdbcType=VARCHAR},
pay_status = #{payStatus,jdbcType=VARCHAR},
pay_amount = #{payAmount,jdbcType=DECIMAL},
pay_time = #{payTime,jdbcType=TIMESTAMP},
plate_number = #{plateNumber,jdbcType=VARCHAR},
order_amount = #{orderAmount,jdbcType=DECIMAL},
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
2024-01-14 14:44:14 +08:00
group_code = #{groupCode,jdbcType=VARCHAR},
2024-01-06 15:13:50 +08:00
discount_amount = #{discountAmount,jdbcType=DECIMAL},
settle_amount = #{settleAmount,jdbcType=DECIMAL},
2024-01-17 16:00:48 +08:00
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
2024-01-06 15:13:50 +08:00
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
start_type = #{startType,jdbcType=VARCHAR},
2024-05-21 18:11:01 +08:00
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
2024-01-06 15:13:50 +08:00
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,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>
<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>
2024-01-17 16:00:48 +08:00
<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>
2024-01-06 15:13:50 +08:00
<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="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>
2024-01-14 14:44:14 +08:00
<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>
2024-01-06 15:13:50 +08:00
<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>
2024-01-17 16:00:48 +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>
2024-01-06 15:13:50 +08:00
<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>
2024-05-21 18:11:01 +08:00
<trim prefix="reserved_start_time = case" suffix="end,">
2024-01-06 15:13:50 +08:00
<foreach collection="list" index="index" item="item">
2024-05-21 18:11:01 +08:00
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}
2024-01-06 15:13:50 +08:00
</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="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>
<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>
2024-01-17 16:00:48 +08:00
<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>
2024-01-06 15:13:50 +08:00
<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="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>
2024-01-14 14:44:14 +08:00
<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>
2024-01-06 15:13:50 +08:00
<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>
2024-01-17 16:00:48 +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>
2024-01-06 15:13:50 +08:00
<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>
2024-05-21 18:11:01 +08:00
<trim prefix="reserved_start_time = case" suffix="end,">
2024-01-06 15:13:50 +08:00
<foreach collection="list" index="index" item="item">
2024-05-21 18:11:01 +08:00
<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}
2024-01-06 15:13:50 +08:00
</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="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
(order_code, transaction_code, order_status, member_id, station_id, merchant_id,
2024-01-14 14:44:14 +08:00
pile_sn, connector_code, pile_connector_code, logic_card, vin_code, start_mode,
2024-01-17 16:00:48 +08:00
third_party_type, pay_mode, pay_status, pay_amount, pay_time, plate_number, order_amount,
virtual_amount, group_code, discount_amount, settle_amount, remedial_amount, charge_start_time,
2024-05-21 18:11:01 +08:00
charge_end_time, start_type, reserved_start_time, reserved_end_time, start_soc, end_soc, reason, settlement_time,
2024-01-17 16:00:48 +08:00
refund_amount, refund_status, create_by, create_time, update_by, update_time, del_flag
)
2024-01-06 15:13:50 +08:00
values
<foreach collection="list" item="item" separator=",">
(#{item.orderCode,jdbcType=VARCHAR}, #{item.transactionCode,jdbcType=VARCHAR}, #{item.orderStatus,jdbcType=VARCHAR},
#{item.memberId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR}, #{item.merchantId,jdbcType=VARCHAR},
#{item.pileSn,jdbcType=VARCHAR}, #{item.connectorCode,jdbcType=VARCHAR}, #{item.pileConnectorCode,jdbcType=VARCHAR},
2024-01-14 14:44:14 +08:00
#{item.logicCard,jdbcType=VARCHAR}, #{item.vinCode,jdbcType=VARCHAR}, #{item.startMode,jdbcType=VARCHAR},
2024-01-17 16:00:48 +08:00
#{item.thirdPartyType,jdbcType=VARCHAR}, #{item.payMode,jdbcType=VARCHAR}, #{item.payStatus,jdbcType=VARCHAR},
#{item.payAmount,jdbcType=DECIMAL}, #{item.payTime,jdbcType=TIMESTAMP}, #{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.remedialAmount,jdbcType=DECIMAL}, #{item.chargeStartTime,jdbcType=TIMESTAMP},
2024-05-21 18:11:01 +08:00
#{item.chargeEndTime,jdbcType=TIMESTAMP}, #{item.startType,jdbcType=VARCHAR}, #{item.reservedStartTime,jdbcType=TIMESTAMP},
#{item.reservedEndTime,jdbcType=TIMESTAMP},
2024-01-06 15:13:50 +08:00
#{item.startSoc,jdbcType=VARCHAR}, #{item.endSoc,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,
member_id,
station_id,
merchant_id,
pile_sn,
connector_code,
pile_connector_code,
logic_card,
vin_code,
start_mode,
2024-01-17 16:00:48 +08:00
third_party_type,
2024-01-06 15:13:50 +08:00
pay_mode,
pay_status,
pay_amount,
pay_time,
plate_number,
order_amount,
virtual_amount,
2024-01-14 14:44:14 +08:00
group_code,
2024-01-06 15:13:50 +08:00
discount_amount,
settle_amount,
2024-01-17 16:00:48 +08:00
remedial_amount,
2024-01-06 15:13:50 +08:00
charge_start_time,
charge_end_time,
start_type,
2024-05-21 18:11:01 +08:00
reserved_start_time,
reserved_end_time,
2024-01-06 15:13:50 +08:00
start_soc,
end_soc,
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},
#{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},
2024-01-17 16:00:48 +08:00
#{thirdPartyType,jdbcType=VARCHAR},
2024-01-06 15:13:50 +08:00
#{payMode,jdbcType=VARCHAR},
#{payStatus,jdbcType=VARCHAR},
#{payAmount,jdbcType=DECIMAL},
#{payTime,jdbcType=TIMESTAMP},
#{plateNumber,jdbcType=VARCHAR},
#{orderAmount,jdbcType=DECIMAL},
#{virtualAmount,jdbcType=DECIMAL},
2024-01-14 14:44:14 +08:00
#{groupCode,jdbcType=VARCHAR},
2024-01-06 15:13:50 +08:00
#{discountAmount,jdbcType=DECIMAL},
#{settleAmount,jdbcType=DECIMAL},
2024-01-17 16:00:48 +08:00
#{remedialAmount,jdbcType=DECIMAL},
2024-01-06 15:13:50 +08:00
#{chargeStartTime,jdbcType=TIMESTAMP},
#{chargeEndTime,jdbcType=TIMESTAMP},
#{startType,jdbcType=VARCHAR},
2024-05-21 18:11:01 +08:00
#{reservedStartTime,jdbcType=TIMESTAMP},
#{reservedEndTime,jdbcType=TIMESTAMP},
2024-01-06 15:13:50 +08:00
#{startSoc,jdbcType=VARCHAR},
#{endSoc,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},
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},
2024-01-17 16:00:48 +08:00
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
2024-01-06 15:13:50 +08:00
pay_mode = #{payMode,jdbcType=VARCHAR},
pay_status = #{payStatus,jdbcType=VARCHAR},
pay_amount = #{payAmount,jdbcType=DECIMAL},
pay_time = #{payTime,jdbcType=TIMESTAMP},
plate_number = #{plateNumber,jdbcType=VARCHAR},
order_amount = #{orderAmount,jdbcType=DECIMAL},
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
2024-01-14 14:44:14 +08:00
group_code = #{groupCode,jdbcType=VARCHAR},
2024-01-06 15:13:50 +08:00
discount_amount = #{discountAmount,jdbcType=DECIMAL},
settle_amount = #{settleAmount,jdbcType=DECIMAL},
2024-01-17 16:00:48 +08:00
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
2024-01-06 15:13:50 +08:00
charge_start_time = #{chargeStartTime,jdbcType=TIMESTAMP},
charge_end_time = #{chargeEndTime,jdbcType=TIMESTAMP},
start_type = #{startType,jdbcType=VARCHAR},
2024-05-21 18:11:01 +08:00
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
2024-01-06 15:13:50 +08:00
start_soc = #{startSoc,jdbcType=VARCHAR},
end_soc = #{endSoc,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>
<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>
2024-01-17 16:00:48 +08:00
<if test="thirdPartyType != null">
third_party_type,
</if>
2024-01-06 15:13:50 +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="plateNumber != null">
plate_number,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="virtualAmount != null">
virtual_amount,
</if>
2024-01-14 14:44:14 +08:00
<if test="groupCode != null">
group_code,
</if>
2024-01-06 15:13:50 +08:00
<if test="discountAmount != null">
discount_amount,
</if>
<if test="settleAmount != null">
settle_amount,
</if>
2024-01-17 16:00:48 +08:00
<if test="remedialAmount != null">
remedial_amount,
</if>
2024-01-06 15:13:50 +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,
2024-01-06 15:13:50 +08:00
</if>
<if test="startSoc != null">
start_soc,
</if>
<if test="endSoc != null">
end_soc,
</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>
<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>
2024-01-17 16:00:48 +08:00
<if test="thirdPartyType != null">
#{thirdPartyType,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<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="plateNumber != null">
#{plateNumber,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
#{orderAmount,jdbcType=DECIMAL},
</if>
<if test="virtualAmount != null">
#{virtualAmount,jdbcType=DECIMAL},
</if>
2024-01-14 14:44:14 +08:00
<if test="groupCode != null">
#{groupCode,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<if test="discountAmount != null">
#{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
#{settleAmount,jdbcType=DECIMAL},
</if>
2024-01-17 16:00:48 +08:00
<if test="remedialAmount != null">
#{remedialAmount,jdbcType=DECIMAL},
</if>
2024-01-06 15:13:50 +08:00
<if test="chargeStartTime != null">
#{chargeStartTime,jdbcType=TIMESTAMP},
</if>
<if test="chargeEndTime != null">
#{chargeEndTime,jdbcType=TIMESTAMP},
</if>
<if test="startType != null">
#{startType,jdbcType=VARCHAR},
</if>
2024-05-21 18:11:01 +08:00
<if test="reservedStartTime != null">
#{reservedStartTime,jdbcType=TIMESTAMP},
</if>
<if test="reservedEndTime != null">
#{reservedEndTime,jdbcType=TIMESTAMP},
2024-01-06 15:13:50 +08:00
</if>
<if test="startSoc != null">
#{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
#{endSoc,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>
<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>
2024-01-17 16:00:48 +08:00
<if test="thirdPartyType != null">
third_party_type = #{thirdPartyType,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<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="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>
2024-01-14 14:44:14 +08:00
<if test="groupCode != null">
group_code = #{groupCode,jdbcType=VARCHAR},
</if>
2024-01-06 15:13:50 +08:00
<if test="discountAmount != null">
discount_amount = #{discountAmount,jdbcType=DECIMAL},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount,jdbcType=DECIMAL},
</if>
2024-01-17 16:00:48 +08:00
<if test="remedialAmount != null">
remedial_amount = #{remedialAmount,jdbcType=DECIMAL},
</if>
2024-01-06 15:13:50 +08:00
<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>
2024-05-21 18:11:01 +08:00
<if test="reservedStartTime != null">
reserved_start_time = #{reservedStartTime,jdbcType=TIMESTAMP},
</if>
<if test="reservedEndTime != null">
reserved_end_time = #{reservedEndTime,jdbcType=TIMESTAMP},
2024-01-06 15:13:50 +08:00
</if>
<if test="startSoc != null">
start_soc = #{startSoc,jdbcType=VARCHAR},
</if>
<if test="endSoc != null">
end_soc = #{endSoc,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-01-11 17:28:45 +08:00
<resultMap extends="BaseResultMap" id="OrderBasicInfoOrderDetailResult" type="com.jsowell.pile.domain.OrderBasicInfo">
2024-01-06 15:13:50 +08:00
<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">
<result column="id" property="id" />
<result column="order_code" property="orderCode" />
<result column="total_used_electricity" property="totalUsedElectricity" />
<result column="total_order_amount" property="totalOrderAmount" />
<result column="total_electricity_amount" property="totalElectricityAmount" />
<result column="total_service_amount" property="totalServiceAmount" />
<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-01-06 15:13:50 +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,
total_used_electricity,
total_order_amount,
total_electricity_amount,
total_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-03-05 14:56:43 +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.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'
<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="merchantId != null and merchantId != ''">
and t1.merchant_id = #{merchantId,jdbcType=VARCHAR}
</if>
2024-03-05 14:56:43 +08:00
<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="groupCode != null and groupCode != ''">
and t1.group_code = #{groupCode,jdbcType=VARCHAR}
</if>
2024-03-05 15:02:32 +08:00
<if test="vinCode != null and vinCode != ''">
and t1.vin_code = #{vinCode,jdbcType=VARCHAR}
</if>
2024-03-05 14:56:43 +08:00
<if test="stationDeptIds != null and stationDeptIds.size() != 0">
and t3.dept_id in
<foreach close=")" collection="stationDeptIds" item="stationDeptId" open="(" separator=",">
#{stationDeptId}
</foreach>
</if>
order by t1.create_time desc
</select>
2023-03-04 16:29:55 +08:00
2023-12-04 15:49:02 +08:00
<select id="getOrderTotalData" parameterType="com.jsowell.pile.dto.QueryOrderDTO" resultType="com.jsowell.pile.vo.web.OrderTotalDataVO">
select
IFNULL(sum(t1.order_amount),0) as sumOrderAmount,
IFNULL(sum(t4.total_used_electricity),0) as sumUsedElectricity,
IFNULL(sum(t1.settle_amount),0) as sumSettleAmount
from order_basic_info t1
left join member_basic_info t2 on t1.member_id = t2.member_id and t2.del_flag = '0'
join pile_station_info t3 on t1.station_id = t3.id and t3.del_flag = '0'
join order_detail t4 on t4.order_code = t1.order_code and t4.del_flag = '0'
where t1.del_flag = '0'
<if test="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>
<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>
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-01-06 15:13:50 +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>
<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="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>
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>
<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>
<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">
#{thirdPartyType},
</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="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>
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">
#{startSoc},
2023-03-04 16:29:55 +08:00
</if>
2024-01-06 15:13:50 +08:00
<if test="endSoc != null">
#{endSoc},
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>
<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>
<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="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-01-14 15:55:53 +08:00
<if test="groupCode != null">
group_code = #{groupCode},
</if>
2024-01-11 17:28:45 +08:00
<if test="discountAmount != null">
discount_amount = #{discountAmount},
</if>
<if test="settleAmount != null">
settle_amount = #{settleAmount},
</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">
start_soc = #{startSoc},
2023-03-04 16:29:55 +08:00
</if>
2024-01-06 15:13:50 +08:00
<if test="endSoc != null">
end_soc = #{endSoc},
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,
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},
#{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-01-11 17:28:45 +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-01-11 17:28:45 +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-01-06 15:13:50 +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-01-06 15:13:50 +08:00
<include refid="Base_Column_List" />
from order_basic_info
where del_flag = '0'
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-01-06 15:13:50 +08:00
<include refid="Base_Column_List" />
2023-03-04 16:29:55 +08:00
from order_basic_info
where del_flag = '0'
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-01-06 15:13:50 +08:00
<include refid="Detail_Base_Column_List" />
2023-03-04 16:29:55 +08:00
from order_detail
where del_flag = '0'
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,
t1.order_code as orderCode,
t1.transaction_code as transactionCode,
t1.order_status as orderStatus,
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.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
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'
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,
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
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)
2023-03-04 16:29:55 +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-01-06 15:13:50 +08:00
<include refid="Base_Column_List" />
2023-03-04 16:29:55 +08:00
from order_basic_info
where del_flag = '0'
and order_status = '0'
and pay_status = '0'
and create_time <![CDATA[ <= ]]> #{createTime,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-01-06 15:13:50 +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'
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,
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-06-18 10:04:06 +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'
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-01-06 15:13:50 +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>
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">
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-08-03 10:53:44 +08:00
<!--AND t1.member_id = #{memberId,jdbcType=VARCHAR}-->
2023-03-04 16:29:55 +08:00
AND t1.create_time <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
AND t1.create_time <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
2024-08-28 11:55:46 +08:00
<!--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">
SELECT t1.order_code as orderCode,
t1.order_status as orderStatus,
2023-08-04 13:40:38 +08:00
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'
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,
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-01-06 15:13:50 +08:00
<include refid="Detail_Base_Column_List" />
2023-04-18 15:44:13 +08:00
from order_detail
where del_flag = '0'
and total_order_amount is not null
2024-01-06 15:13:50 +08:00
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-01-06 15:13:50 +08:00
<include refid="Detail_Base_Column_List" />
2023-05-12 15:03:29 +08:00
from order_detail
where del_flag = '0'
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-01-06 15:13:50 +08:00
<include refid="Base_Column_List" />
2023-05-31 13:59:27 +08:00
from order_basic_info
where del_flag = '0'
and pay_mode = '4'
2024-01-06 15:13:50 +08:00
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">
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
left join pile_station_info t2 on t1.station_id = t2.id
where t1.del_flag = '0'
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">
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
JOIN pile_station_info t2 ON t1.station_id = t2.id
2023-07-10 15:49:54 +08:00
WHERE
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-01-06 15:13:50 +08:00
<include refid="Base_Column_List" />
2023-07-26 18:05:54 +08:00
from order_basic_info
where del_flag = '0'
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">
SELECT trade_date AS date,
order_codes as orderCodes,
use_electricity AS totalElectricity,
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)
<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
sum(sharp_used_electricity) AS totalSharpUsedElectricity,
sum(peak_used_electricity) AS totalPeakUsedElectricity,
sum(flat_used_electricity) AS totalFlatUsedElectricity,
sum(valley_used_electricity) AS totalValleyUsedElectricity
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
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
2023-10-19 11:21:02 +08:00
t1.station_id as stationId,
2023-10-10 16:20:45 +08:00
t1.merchant_id,
t1.third_party_type as thirdPartyType,
2023-10-10 16:20:45 +08:00
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
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
AND t3.del_flag = '0'
<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 != ''">
and t1.charge_end_time between #{dto.queryStartTime,jdbcType=VARCHAR} and #{dto.queryEndTime,jdbcType=VARCHAR}
</if>
</where>
</select>
2024-08-06 15:46:43 +08:00
<select id="queryOrderPayDetail" resultType="com.jsowell.pile.vo.web.OrderPaymentDetailVO">
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
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
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
order_basic_info t1
JOIN pile_station_info t2 ON t1.station_id = t2.id
WHERE t1.del_flag = '0'
<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-01-17 17:41:57 +08:00
<select id="queryRepayOrder" resultMap="BaseResultMap">
2024-02-26 13:43:02 +08:00
select
<include refid="Base_Column_List"/>
2024-01-17 17:41: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
<select id="queryOrderListByGroupCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
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
<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 mercahntId,
t3.organization_code as organizationCode,
t1.order_code AS orderCode,
t1.transaction_code AS transactionCode,
t1.order_status AS orderStatus,
t1.station_id AS stationId,
t1.pile_sn AS pileSn,
t1.connector_code AS connectorCode,
t1.pile_connector_code AS pileConnectorCode,
t1.pay_mode AS payMode,
t1.pay_amount AS payAmount,
t1.pay_time AS payTime,
t1.order_amount AS orderAmount,
t1.plate_number AS plateNumber,
t1.discount_amount AS discountAmount,
t1.settlement_time as settlemetTime,
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 stopReason,
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
WHERE
t1.del_flag = '0'
AND
t1.order_code = #{orderCode,jdbcType=VARCHAR}
</select>
2024-05-21 18:11:01 +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>
<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
<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}
2024-07-25 17:49:23 +08:00
and `t1`.`charge_start_time` <![CDATA[ <= ]]> #{endTime,jdbcType=VARCHAR}
and `t1`.`charge_end_time` <![CDATA[ >= ]]> #{startTime,jdbcType=VARCHAR}
2024-07-16 15:33:44 +08:00
</select>
<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,-->
2024-08-05 14:10:04 +08:00
<!-- 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'
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>
2024-09-23 11:41:19 +08:00
<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}
<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>
2023-03-04 16:29:55 +08:00
</mapper>