2021-07-24 18:07:51 +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">
<mapper namespace= "com.xhpc.order.mapper.XhpcHistoryOrderMapper" >
<resultMap type= "com.xhpc.order.domain.XhpcHistoryOrder" id= "XhpcHistoryOrderResult" >
2021-09-23 10:42:06 +08:00
<id column= "history_order_id" jdbcType= "BIGINT" property= "historyOrderId" />
<result column= "charging_station_id" jdbcType= "BIGINT" property= "chargingStationId" />
<result column= "charge_order_id" jdbcType= "BIGINT" property= "chargeOrderId" />
<result column= "user_id" jdbcType= "BIGINT" property= "userId" />
<result column= "terminal_id" jdbcType= "BIGINT" property= "terminalId" />
<result column= "serial_number" jdbcType= "VARCHAR" property= "serialNumber" />
<result column= "internet_serial_number" jdbcType= "VARCHAR" property= "internetSerialNumber" />
<result column= "power_price_total" jdbcType= "DECIMAL" property= "powerPriceTotal" />
<result column= "service_price_total" jdbcType= "DECIMAL" property= "servicePriceTotal" />
<result column= "total_price" jdbcType= "DECIMAL" property= "totalPrice" />
<result column= "promotion_discount" jdbcType= "DECIMAL" property= "promotionDiscount" />
<result column= "act_price" jdbcType= "DECIMAL" property= "actPrice" />
<result column= "act_power_price" jdbcType= "DECIMAL" property= "actPowerPrice" />
<result column= "act_service_price" jdbcType= "DECIMAL" property= "actServicePrice" />
<result column= "internet_commission" jdbcType= "DECIMAL" property= "internetCommission" />
<result column= "internet_svc_commission" jdbcType= "DECIMAL" property= "internetSvcCommission" />
<result column= "platform_commission" jdbcType= "DECIMAL" property= "platformCommission" />
<result column= "platform_svc_commisssion" jdbcType= "DECIMAL" property= "platformSvcCommisssion" />
<result column= "operation_commission" jdbcType= "DECIMAL" property= "operationCommission" />
<result column= "operation_svc_commission" jdbcType= "DECIMAL" property= "operationSvcCommission" />
<result column= "start_soc" jdbcType= "VARCHAR" property= "startSoc" />
<result column= "end_soc" jdbcType= "VARCHAR" property= "endSoc" />
<result column= "reconciliation_status" jdbcType= "INTEGER" property= "reconciliationStatus" />
<result column= "sorting_status" jdbcType= "INTEGER" property= "sortingStatus" />
<result column= "type" jdbcType= "TINYINT" property= "type" />
<result column= "status" jdbcType= "INTEGER" property= "status" />
<result column= "del_flag" jdbcType= "INTEGER" property= "delFlag" />
<result column= "create_time" jdbcType= "TIMESTAMP" property= "createTime" />
<result column= "create_by" jdbcType= "VARCHAR" property= "createBy" />
<result column= "update_time" jdbcType= "TIMESTAMP" property= "updateTime" />
<result column= "update_by" jdbcType= "VARCHAR" property= "updateBy" />
<result column= "remark" jdbcType= "VARCHAR" property= "remark" />
<result column= "state" jdbcType= "INTEGER" property= "state" />
<result column= "vin_normal" jdbcType= "VARCHAR" property= "vinNormal" />
<result column= "search_value" jdbcType= "VARCHAR" property= "searchValue" />
<result column= "operator_id_evcs" jdbcType= "VARCHAR" property= "operatorIdEvcs" />
<result column= "charge_model_evcs" jdbcType= "INTEGER" property= "chargeModelEvcs" />
<result column= "connector_power_evcs" jdbcType= "DOUBLE" property= "connectorPowerEvcs" />
<result column= "meter_value_end_evcs" jdbcType= "DOUBLE" property= "meterValueEndEvcs" />
<result column= "meter_value_start_evcs" jdbcType= "DOUBLE" property= "meterValueStartEvcs" />
<result column= "operator_id3rdpty_evcs" jdbcType= "VARCHAR" property= "operatorId3rdptyEvcs" />
<result column= "start_time" jdbcType= "TIMESTAMP" property= "startTime" />
2021-10-22 14:37:29 +08:00
<result column= "end_time" jdbcType= "TIMESTAMP" property= "endTime" />
2021-09-23 10:42:06 +08:00
<result column= "stop_reason_evcs" jdbcType= "INTEGER" property= "stopReasonEvcs" />
<result column= "total_power" jdbcType= "DOUBLE" property= "totalPower" />
<result column= "user_name_evcs" jdbcType= "VARCHAR" property= "userNameEvcs" />
<result column= "phone" jdbcType= "VARCHAR" property= "phone" />
2021-07-24 18:07:51 +08:00
</resultMap>
2021-09-23 10:42:06 +08:00
<sql id= "Base_Column_List" >
history_order_id, charging_station_id, charge_order_id, user_id, terminal_id, serial_number,
internet_serial_number, power_price_total, service_price_total, total_price, promotion_discount,
act_price, act_power_price, act_service_price, internet_commission, internet_svc_commission,
platform_commission, platform_svc_commisssion, operation_commission, operation_svc_commission,
start_soc, end_soc, reconciliation_status, sorting_status, `type`, `status`, del_flag,
create_time, create_by, update_time, update_by, remark, `state`, vin_normal, search_value,
operator_id_evcs, charge_model_evcs, connector_power_evcs, meter_value_end_evcs,
meter_value_start_evcs, operator_id3rdpty_evcs, start_time, stop_reason_evcs, total_power,
user_name_evcs, phone
</sql>
2021-07-24 18:07:51 +08:00
<insert id= "insert" parameterType= "com.xhpc.order.domain.XhpcHistoryOrder" useGeneratedKeys= "true"
2021-07-27 18:38:32 +08:00
keyProperty="historyOrderId">
2021-07-24 18:07:51 +08:00
INSERT INTO xhpc_history_order
<trim prefix= "(" suffix= ")" suffixOverrides= "," >
2021-09-23 10:42:06 +08:00
<if test= "chargingStationId != null" >
2021-07-24 18:07:51 +08:00
charging_station_id,
</if>
2021-09-23 10:42:06 +08:00
<if test= "chargeOrderId != null" >
2021-08-09 18:47:43 +08:00
charge_order_id,
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "userId != null" >
2021-07-24 18:07:51 +08:00
user_id,
</if>
2021-09-23 10:42:06 +08:00
<if test= "terminalId != null" >
2021-07-24 18:07:51 +08:00
terminal_id,
</if>
2021-09-23 10:42:06 +08:00
<if test= "serialNumber != null" >
2021-07-24 18:07:51 +08:00
serial_number,
</if>
2021-09-23 10:42:06 +08:00
<if test= "internetSerialNumber != null" >
2021-07-24 18:07:51 +08:00
internet_serial_number,
</if>
2021-09-23 10:42:06 +08:00
<if test= "powerPriceTotal != null" >
power_price_total,
</if>
<if test= "servicePriceTotal != null" >
service_price_total,
</if>
<if test= "totalPrice != null" >
2021-07-24 18:07:51 +08:00
total_price,
</if>
2021-09-23 10:42:06 +08:00
<if test= "promotionDiscount != null" >
2021-07-24 18:07:51 +08:00
promotion_discount,
</if>
2021-09-23 10:42:06 +08:00
<if test= "actPrice != null" >
2021-07-24 18:07:51 +08:00
act_price,
</if>
2021-09-23 10:42:06 +08:00
<if test= "actPowerPrice != null" >
2021-07-24 18:07:51 +08:00
act_power_price,
</if>
2021-09-23 10:42:06 +08:00
<if test= "actServicePrice != null" >
2021-07-24 18:07:51 +08:00
act_service_price,
</if>
2021-09-23 10:42:06 +08:00
<if test= "internetCommission != null" >
2021-07-24 18:07:51 +08:00
internet_commission,
</if>
2021-09-23 10:42:06 +08:00
<if test= "internetSvcCommission != null" >
2021-07-24 18:07:51 +08:00
internet_svc_commission,
</if>
2021-09-23 10:42:06 +08:00
<if test= "platformCommission != null" >
2021-07-24 18:07:51 +08:00
platform_commission,
</if>
2021-09-23 10:42:06 +08:00
<if test= "platformSvcCommisssion != null" >
2021-07-24 18:07:51 +08:00
platform_svc_commisssion,
</if>
2021-09-23 10:42:06 +08:00
<if test= "operationCommission != null" >
2021-07-24 18:07:51 +08:00
operation_commission,
</if>
2021-09-23 10:42:06 +08:00
<if test= "operationSvcCommission != null" >
2021-07-24 18:07:51 +08:00
operation_svc_commission,
</if>
2021-09-23 10:42:06 +08:00
<if test= "startSoc != null" >
2021-07-24 18:07:51 +08:00
start_soc,
</if>
2021-09-23 10:42:06 +08:00
<if test= "endSoc != null" >
2021-07-24 18:07:51 +08:00
end_soc,
</if>
2021-09-23 10:42:06 +08:00
<if test= "reconciliationStatus != null" >
2021-07-24 18:07:51 +08:00
reconciliation_status,
</if>
2021-09-23 10:42:06 +08:00
<if test= "sortingStatus != null" >
2021-07-24 18:07:51 +08:00
sorting_status,
</if>
2021-09-23 10:42:06 +08:00
<if test= "type != null" >
`type`,
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "status != null" >
`status`,
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "delFlag != null" >
2021-07-24 18:07:51 +08:00
del_flag,
</if>
2021-09-23 10:42:06 +08:00
<if test= "createTime != null" >
2021-07-24 18:07:51 +08:00
create_time,
</if>
2021-09-23 10:42:06 +08:00
<if test= "createBy != null" >
2021-07-24 18:07:51 +08:00
create_by,
</if>
2021-09-23 10:42:06 +08:00
<if test= "updateTime != null" >
2021-07-24 18:07:51 +08:00
update_time,
</if>
2021-09-23 10:42:06 +08:00
<if test= "updateBy != null" >
2021-07-24 18:07:51 +08:00
update_by,
</if>
2021-09-23 10:42:06 +08:00
<if test= "remark != null" >
2021-08-25 18:45:52 +08:00
remark,
</if>
2021-09-23 10:42:06 +08:00
<if test= "state != null" >
`state`,
2021-08-25 18:45:52 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "vinNormal != null" >
vin_normal,
</if>
<if test= "searchValue != null" >
search_value,
</if>
<if test= "operatorIdEvcs != null" >
operator_id_evcs,
</if>
<if test= "chargeModelEvcs != null" >
charge_model_evcs,
2021-09-10 15:35:39 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "connectorPowerEvcs != null" >
connector_power_evcs,
</if>
<if test= "meterValueEndEvcs != null" >
meter_value_end_evcs,
</if>
<if test= "meterValueStartEvcs != null" >
meter_value_start_evcs,
</if>
<if test= "operatorId3rdptyEvcs != null" >
operator_id3rdpty_evcs,
</if>
<if test= "startTime != null" >
start_time,
</if>
2021-10-22 14:37:29 +08:00
<if test= "endTime != null" >
end_time,
</if>
2021-09-23 10:42:06 +08:00
<if test= "stopReasonEvcs != null" >
stop_reason_evcs,
</if>
<if test= "totalPower != null" >
total_power,
</if>
<if test= "userNameEvcs != null" >
user_name_evcs,
</if>
<if test= "phone != null" >
2021-10-08 15:41:14 +08:00
phone,
2021-07-24 18:07:51 +08:00
</if>
</trim>
<trim prefix= "values (" suffix= ")" suffixOverrides= "," >
2021-09-23 10:42:06 +08:00
<if test= "chargingStationId != null" >
2021-10-08 15:41:14 +08:00
#{chargingStationId,jdbcType=BIGINT},
2021-09-23 10:42:06 +08:00
</if>
<if test= "chargeOrderId != null" >
2021-10-08 15:41:14 +08:00
#{chargeOrderId,jdbcType=BIGINT},
2021-09-23 10:42:06 +08:00
</if>
<if test= "userId != null" >
2021-10-08 15:41:14 +08:00
#{userId,jdbcType=BIGINT},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "terminalId != null" >
2021-10-08 15:41:14 +08:00
#{terminalId,jdbcType=BIGINT},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "serialNumber != null" >
2021-10-08 15:41:14 +08:00
#{serialNumber,jdbcType=VARCHAR},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "internetSerialNumber != null" >
2021-10-08 15:41:14 +08:00
#{internetSerialNumber,jdbcType=VARCHAR},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "powerPriceTotal != null" >
2021-10-08 15:41:14 +08:00
#{powerPriceTotal,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "servicePriceTotal != null" >
2021-10-08 15:41:14 +08:00
#{servicePriceTotal,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "totalPrice != null" >
2021-10-08 15:41:14 +08:00
#{totalPrice,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "promotionDiscount != null" >
2021-10-08 15:41:14 +08:00
#{promotionDiscount,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "actPrice != null" >
2021-10-08 15:41:14 +08:00
#{actPrice,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "actPowerPrice != null" >
2021-10-08 15:41:14 +08:00
#{actPowerPrice,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "actServicePrice != null" >
2021-10-08 15:41:14 +08:00
#{actServicePrice,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "internetCommission != null" >
2021-10-08 15:41:14 +08:00
#{internetCommission,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "internetSvcCommission != null" >
2021-10-08 15:41:14 +08:00
#{internetSvcCommission,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "platformCommission != null" >
2021-10-08 15:41:14 +08:00
#{platformCommission,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "platformSvcCommisssion != null" >
2021-10-08 15:41:14 +08:00
#{platformSvcCommisssion,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "operationCommission != null" >
2021-10-08 15:41:14 +08:00
#{operationCommission,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "operationSvcCommission != null" >
2021-10-08 15:41:14 +08:00
#{operationSvcCommission,jdbcType=DECIMAL},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "startSoc != null" >
2021-10-08 15:41:14 +08:00
#{startSoc,jdbcType=VARCHAR},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "endSoc != null" >
2021-10-08 15:41:14 +08:00
#{endSoc,jdbcType=VARCHAR},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "reconciliationStatus != null" >
2021-10-08 15:41:14 +08:00
#{reconciliationStatus,jdbcType=INTEGER},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "sortingStatus != null" >
2021-10-08 15:41:14 +08:00
#{sortingStatus,jdbcType=INTEGER},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "type != null" >
2021-10-08 15:41:14 +08:00
#{type,jdbcType=TINYINT},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "status != null" >
2021-10-08 15:41:14 +08:00
#{status,jdbcType=INTEGER},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "delFlag != null" >
2021-10-08 15:41:14 +08:00
#{delFlag,jdbcType=INTEGER},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "createTime != null" >
2021-10-08 15:41:14 +08:00
#{createTime,jdbcType=TIMESTAMP},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "createBy != null" >
2021-10-08 15:41:14 +08:00
#{createBy,jdbcType=VARCHAR},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "updateTime != null" >
2021-10-08 15:41:14 +08:00
#{updateTime,jdbcType=TIMESTAMP},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "updateBy != null" >
2021-10-08 15:41:14 +08:00
#{updateBy,jdbcType=VARCHAR},
2021-07-24 18:07:51 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "remark != null" >
2021-10-08 15:41:14 +08:00
#{remark,jdbcType=VARCHAR},
2021-08-25 18:45:52 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "state != null" >
2021-10-08 15:41:14 +08:00
#{state,jdbcType=INTEGER},
2021-08-25 18:45:52 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "vinNormal != null" >
2021-10-08 15:41:14 +08:00
#{vinNormal,jdbcType=VARCHAR},
2021-09-10 15:35:39 +08:00
</if>
2021-09-23 10:42:06 +08:00
<if test= "searchValue != null" >
2021-10-08 15:41:14 +08:00
#{searchValue,jdbcType=VARCHAR},
2021-09-23 10:42:06 +08:00
</if>
<if test= "operatorIdEvcs != null" >
2021-10-08 15:41:14 +08:00
#{operatorIdEvcs,jdbcType=VARCHAR},
2021-09-23 10:42:06 +08:00
</if>
<if test= "chargeModelEvcs != null" >
2021-10-08 15:41:14 +08:00
#{chargeModelEvcs,jdbcType=INTEGER},
2021-09-23 10:42:06 +08:00
</if>
<if test= "connectorPowerEvcs != null" >
2021-10-08 15:41:14 +08:00
#{connectorPowerEvcs,jdbcType=DOUBLE},
2021-09-23 10:42:06 +08:00
</if>
<if test= "meterValueEndEvcs != null" >
2021-10-08 15:41:14 +08:00
#{meterValueEndEvcs,jdbcType=DOUBLE},
2021-09-23 10:42:06 +08:00
</if>
<if test= "meterValueStartEvcs != null" >
2021-10-08 15:41:14 +08:00
#{meterValueStartEvcs,jdbcType=DOUBLE},
2021-09-23 10:42:06 +08:00
</if>
<if test= "operatorId3rdptyEvcs != null" >
2021-10-08 15:41:14 +08:00
#{operatorId3rdptyEvcs,jdbcType=VARCHAR},
2021-09-23 10:42:06 +08:00
</if>
<if test= "startTime != null" >
2021-10-08 15:41:14 +08:00
#{startTime,jdbcType=TIMESTAMP},
2021-09-23 10:42:06 +08:00
</if>
2021-10-22 14:37:29 +08:00
<if test= "endTime != null" >
#{endTime,jdbcType=TIMESTAMP},
</if>
2021-09-23 10:42:06 +08:00
<if test= "stopReasonEvcs != null" >
2021-10-08 15:41:14 +08:00
#{stopReasonEvcs,jdbcType=INTEGER},
2021-09-23 10:42:06 +08:00
</if>
<if test= "totalPower != null" >
2021-10-08 15:41:14 +08:00
#{totalPower,jdbcType=DOUBLE},
2021-09-23 10:42:06 +08:00
</if>
<if test= "userNameEvcs != null" >
2021-10-08 15:41:14 +08:00
#{userNameEvcs,jdbcType=VARCHAR},
2021-09-23 10:42:06 +08:00
</if>
<if test= "phone != null" >
2021-10-08 15:41:14 +08:00
#{phone,jdbcType=VARCHAR},
2021-07-24 18:07:51 +08:00
</if>
</trim>
</insert>
<update id= "update" parameterType= "com.xhpc.order.domain.XhpcHistoryOrder" >
UPDATE xhpc_history_order
<set >
2021-09-23 10:42:06 +08:00
<if test= "chargingStationId != null" >
2021-09-27 09:49:43 +08:00
charging_station_id = #{chargingStationId},
2021-09-23 10:42:06 +08:00
</if>
<if test= "chargeOrderId != null" >
2021-09-27 09:49:43 +08:00
charge_order_id = #{chargeOrderId},
2021-09-23 10:42:06 +08:00
</if>
<if test= "userId != null" >
2021-09-27 09:49:43 +08:00
user_id = #{userId},
2021-09-23 10:42:06 +08:00
</if>
<if test= "terminalId != null" >
2021-09-27 09:49:43 +08:00
terminal_id = #{terminalId},
2021-09-23 10:42:06 +08:00
</if>
<if test= "serialNumber != null" >
2021-09-27 09:49:43 +08:00
serial_number = #{serialNumber},
2021-09-23 10:42:06 +08:00
</if>
<if test= "internetSerialNumber != null" >
2021-09-27 09:49:43 +08:00
internet_serial_number = #{internetSerialNumber},
2021-09-23 10:42:06 +08:00
</if>
<if test= "powerPriceTotal != null" >
2021-09-27 09:49:43 +08:00
power_price_total = #{powerPriceTotal},
2021-09-23 10:42:06 +08:00
</if>
<if test= "servicePriceTotal != null" >
2021-09-27 09:49:43 +08:00
service_price_total = #{servicePriceTotal},
2021-09-23 10:42:06 +08:00
</if>
<if test= "totalPrice != null" >
2021-09-27 09:49:43 +08:00
total_price = #{totalPrice},
2021-09-23 10:42:06 +08:00
</if>
<if test= "promotionDiscount != null" >
2021-09-27 09:49:43 +08:00
promotion_discount = #{promotionDiscount},
2021-09-23 10:42:06 +08:00
</if>
<if test= "actPrice != null" >
2021-09-27 09:49:43 +08:00
act_price = #{actPrice},
2021-09-23 10:42:06 +08:00
</if>
<if test= "actPowerPrice != null" >
2021-09-27 09:49:43 +08:00
act_power_price = #{actPowerPrice},
2021-09-23 10:42:06 +08:00
</if>
<if test= "actServicePrice != null" >
2021-09-27 09:49:43 +08:00
act_service_price = #{actServicePrice},
2021-09-23 10:42:06 +08:00
</if>
<if test= "internetCommission != null" >
2021-09-27 09:49:43 +08:00
internet_commission = #{internetCommission},
2021-09-23 10:42:06 +08:00
</if>
<if test= "internetSvcCommission != null" >
2021-09-27 09:49:43 +08:00
internet_svc_commission = #{internetSvcCommission},
2021-09-23 10:42:06 +08:00
</if>
<if test= "platformCommission != null" >
2021-09-27 09:49:43 +08:00
platform_commission = #{platformCommission},
2021-09-23 10:42:06 +08:00
</if>
<if test= "platformSvcCommisssion != null" >
2021-09-27 09:49:43 +08:00
platform_svc_commisssion = #{platformSvcCommisssion},
2021-09-23 10:42:06 +08:00
</if>
<if test= "operationCommission != null" >
2021-09-27 09:49:43 +08:00
operation_commission = #{operationCommission},
2021-09-23 10:42:06 +08:00
</if>
<if test= "operationSvcCommission != null" >
2021-09-27 09:49:43 +08:00
operation_svc_commission = #{operationSvcCommission},
2021-09-23 10:42:06 +08:00
</if>
<if test= "startSoc != null" >
2021-09-27 09:49:43 +08:00
start_soc = #{startSoc},
2021-09-23 10:42:06 +08:00
</if>
<if test= "endSoc != null" >
2021-09-27 09:49:43 +08:00
end_soc = #{endSoc},
2021-09-23 10:42:06 +08:00
</if>
<if test= "reconciliationStatus != null" >
2021-09-27 09:49:43 +08:00
reconciliation_status = #{reconciliationStatus},
2021-09-23 10:42:06 +08:00
</if>
<if test= "sortingStatus != null" >
2021-09-27 09:49:43 +08:00
sorting_status = #{sortingStatus},
2021-09-23 10:42:06 +08:00
</if>
<if test= "type != null" >
2021-09-27 09:49:43 +08:00
`type` = #{type},
2021-09-23 10:42:06 +08:00
</if>
<if test= "status != null" >
2021-09-27 09:49:43 +08:00
`status` = #{status},
2021-09-23 10:42:06 +08:00
</if>
<if test= "delFlag != null" >
2021-09-27 09:49:43 +08:00
del_flag = #{delFlag},
2021-09-23 10:42:06 +08:00
</if>
<if test= "createTime != null" >
2021-09-27 09:49:43 +08:00
create_time = #{createTime},
2021-09-23 10:42:06 +08:00
</if>
<if test= "createBy != null" >
2021-09-27 09:49:43 +08:00
create_by = #{createBy},
2021-09-23 10:42:06 +08:00
</if>
<if test= "updateTime != null" >
2021-09-27 09:49:43 +08:00
update_time = #{updateTime},
2021-09-23 10:42:06 +08:00
</if>
<if test= "updateBy != null" >
2021-09-27 09:49:43 +08:00
update_by = #{updateBy},
2021-09-23 10:42:06 +08:00
</if>
<if test= "remark != null" >
2021-09-27 09:49:43 +08:00
remark = #{remark},
2021-09-23 10:42:06 +08:00
</if>
<if test= "state != null" >
2021-09-27 09:49:43 +08:00
`state` = #{state},
2021-09-23 10:42:06 +08:00
</if>
<if test= "vinNormal != null" >
2021-09-27 09:49:43 +08:00
vin_normal = #{vinNormal},
2021-09-23 10:42:06 +08:00
</if>
<if test= "searchValue != null" >
2021-09-27 09:49:43 +08:00
search_value = #{searchValue},
2021-09-23 10:42:06 +08:00
</if>
<if test= "operatorIdEvcs != null" >
2021-09-27 09:49:43 +08:00
operator_id_evcs = #{operatorIdEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "chargeModelEvcs != null" >
2021-09-27 09:49:43 +08:00
charge_model_evcs = #{chargeModelEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "connectorPowerEvcs != null" >
2021-09-27 09:49:43 +08:00
connector_power_evcs = #{connectorPowerEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "meterValueEndEvcs != null" >
2021-09-27 09:49:43 +08:00
meter_value_end_evcs = #{meterValueEndEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "meterValueStartEvcs != null" >
2021-09-27 09:49:43 +08:00
meter_value_start_evcs = #{meterValueStartEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "operatorId3rdptyEvcs != null" >
2021-09-27 09:49:43 +08:00
operator_id3rdpty_evcs = #{operatorId3rdptyEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "startTime != null" >
2021-09-27 09:49:43 +08:00
start_time = #{startTime},
2021-09-23 10:42:06 +08:00
</if>
<if test= "stopReasonEvcs != null" >
2021-09-27 09:49:43 +08:00
stop_reason_evcs = #{stopReasonEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "totalPower != null" >
2021-09-27 09:49:43 +08:00
total_power = #{totalPower},
2021-09-23 10:42:06 +08:00
</if>
<if test= "userNameEvcs != null" >
2021-09-27 09:49:43 +08:00
user_name_evcs = #{userNameEvcs},
2021-09-23 10:42:06 +08:00
</if>
<if test= "phone != null" >
2021-09-27 09:49:43 +08:00
phone = #{phone},
2021-09-23 10:42:06 +08:00
</if>
2021-07-24 18:07:51 +08:00
</set>
2021-09-27 09:49:43 +08:00
where history_order_id = #{historyOrderId}
2021-07-24 18:07:51 +08:00
</update>
<select id= "info" parameterType= "java.lang.Long" resultMap= "XhpcHistoryOrderResult" >
select *
from xhpc_history_order xho
where xho.del_flag = 0 and xho.history_order_id = #{historyOrderId}
</select>
2021-07-26 18:02:59 +08:00
2021-08-06 18:46:55 +08:00
<update id= "updateReconciliation" parameterType= "java.lang.String" >
2021-07-26 18:02:59 +08:00
update xhpc_history_order set reconciliation_status = #{status} where history_order_id in
2021-08-06 18:46:55 +08:00
<foreach collection= "xhpcHistoryOrderIds" item= "item" open= "(" separator= "," close= ")" >
#{item}
2021-07-26 18:02:59 +08:00
</foreach>
</update>
2021-08-06 18:46:55 +08:00
<update id= "updateSorting" parameterType= "java.lang.String" >
2021-07-26 18:02:59 +08:00
update xhpc_history_order set sorting_status = #{status} where history_order_id in
2021-08-06 18:46:55 +08:00
<foreach collection= "xhpcHistoryOrderIds" item= "item" open= "(" separator= "," close= ")" >
#{item}
2021-07-26 18:02:59 +08:00
</foreach>
</update>
2021-08-03 22:41:53 +08:00
<select id= "list" resultType= "map" >
SELECT
ho.history_order_id as historyOrderId,
ho.serial_number as serialNumber,
ho.create_time as createTime,
2021-08-09 21:18:02 +08:00
co.status as status,
2021-08-03 22:41:53 +08:00
cs.name as chargingStationName,
te.name as terminalName,
ho.act_price as actPrice,
2021-08-09 12:15:00 +08:00
co.charging_degree as chargingDegree,
co.charging_time as chargingTime
2021-08-03 22:41:53 +08:00
FROM xhpc_history_order as ho
LEFT JOIN xhpc_charging_station as cs on cs.charging_station_id = ho.charging_station_id
LEFT JOIN xhpc_terminal as te on te.terminal_id = ho.terminal_id
2021-08-09 18:47:43 +08:00
left join xhpc_charge_order as co on co.charge_order_id =ho.charge_order_id
2021-08-03 22:41:53 +08:00
where ho.status=0 and ho.del_flag=0 and ho.user_id =#{userId}
2021-08-24 13:59:16 +08:00
order by ho.create_time desc
2021-08-03 22:41:53 +08:00
</select>
<select id= "gethistotyOrderMessage" resultType= "map" >
SELECT
ho.history_order_id as historyOrderId,
ho.serial_number as serialNumber,
ho.type as type,
cs.name as chargingStationName,
te.name as terminalName,
ho.act_price as actPrice,
ho.act_power_price as actPowerPrice,
2021-08-09 12:15:00 +08:00
co.charging_time as chargingTime,
co.charging_degree as chargingDegree,
DATE_FORMAT(co.start_time,'%m月%d日') as daysOne,
2021-09-02 20:08:21 +08:00
DATE_FORMAT(co.start_time,'%H:%i:%s') as timeOne,
2021-08-09 12:15:00 +08:00
DATE_FORMAT(co.end_time,'%m月%d日') as daysTwo,
2021-09-02 20:08:21 +08:00
DATE_FORMAT(co.end_time,'%H:%i:%s') as timeTwo,
2021-08-11 16:25:10 +08:00
co.status as status,
2021-09-03 14:24:44 +08:00
co.type as type,
case when co.type=40 then "APP远程停止"
when co.type=41 then "SOC达到100%"
when co.type=42 then "充电电量满足设定条件"
when co.type=43 then "充电金额满足设定条件"
when co.type=44 then "充电时间满足设定条件"
when co.type=45 then "手动停止充电"
when co.type=46 then "手动停止充电."
when co.type=47 then "手动停止充电.."
when co.type=48 then "急停停止充电"
when co.type=49 then "手动停止充电..."
2021-09-23 12:06:14 +08:00
else "手动停止充电!"
2021-09-03 14:24:44 +08:00
end typeName
2021-08-03 22:41:53 +08:00
FROM xhpc_history_order as ho
LEFT JOIN xhpc_charging_station as cs on cs.charging_station_id = ho.charging_station_id
LEFT JOIN xhpc_terminal as te on te.terminal_id = ho.terminal_id
2021-08-09 18:47:43 +08:00
left join xhpc_charge_order as co on co.charge_order_id =ho.charge_order_id
2021-08-11 16:25:10 +08:00
where ho.status=0 and ho.del_flag=0
2021-08-03 22:41:53 +08:00
<if test= "userId !=null" >
and ho.user_id =#{userId}
</if>
2021-08-11 16:25:10 +08:00
<if test= "historyOrderId !=null" >
and ho.history_order_id =#{historyOrderId}
</if>
<if test= "chargingOrderId !=null" >
and ho.charge_order_id =#{chargingOrderId}
</if>
2021-08-31 19:47:36 +08:00
order by ho.create_time desc
2021-08-03 22:41:53 +08:00
</select>
2021-08-23 19:59:57 +08:00
<select id= "getListPage" resultType= "map" >
select
ho.history_order_id as historyOrderId,
2021-08-25 18:45:52 +08:00
co.charge_order_id as chargeOrderId,
2021-08-23 19:59:57 +08:00
ho.serial_number as serialNumber,
ct.name as chargingStationName,
ter.pile_serial_number as pileSerialNumber,
ter.name as terminalName,
op.operator_id as operatorId,
op.name as operatorName,
cp.power as power,
cp.type as type,
ho.type as orderType,
ho.start_soc as startSoc,
ho.end_soc as endSoc,
ho.internet_serial_number as internetSerialNumber,
ho.total_price as totalPrice,
ho.act_price as actPrice,
2021-11-11 16:27:36 +08:00
ho.confirm_Result as confirmResult,
2021-08-23 19:59:57 +08:00
co.charging_time as chargingTime,
co.charging_degree as chargingDegree,
co.start_time as startTime,
co.end_time as endTime,
co.update_time as updateTime,
co.source as source,
2021-11-22 18:53:46 +08:00
co.Plate_num as plateNum,
2021-11-10 10:01:48 +08:00
dispute_order_status as disputeOrderStatus,
2021-08-23 19:59:57 +08:00
(SELECT phone FROM xhpc_app_user where app_user_id = co.user_id) as appUserPhone,
2021-11-22 18:53:46 +08:00
(SELECT phone from xhpc_internet_user where internet_user_id = co.user_id) as internetUserPhone,
(SELECT name from xhpc_internet_user where internet_user_id = co.user_id and co.source =1) as internetName
2021-08-23 19:59:57 +08:00
from xhpc_history_order as ho
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
left join xhpc_operator as op on op.operator_id = ct.operator_id
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
left join xhpc_terminal as ter on ter.terminal_id = ho.terminal_id
left join xhpc_charging_pile as cp on cp.charging_pile_id = ter.charging_pile_id
2021-11-10 10:01:48 +08:00
left join et_dispute_orders as ed on ed.start_charge_seq = ho.internet_serial_number and ed.dispute_order_status !=2
2021-11-11 01:22:40 +08:00
where ho.status =0 and ho.del_flag=0 and ho.total_price !=0
2021-08-23 19:59:57 +08:00
<if test= "type !=null" >
and ho.type=#{type}
</if>
2021-11-22 18:53:46 +08:00
<if test= "source !=null" >
and co.source=#{source}
</if>
2021-08-23 19:59:57 +08:00
<if test= "startTime !=null and startTime !=''" >
2021-08-25 15:27:57 +08:00
and co.start_time > = #{startTime}
2021-08-23 19:59:57 +08:00
</if>
<if test= "endTime !=null and endTime !=''" >
2021-11-22 18:53:46 +08:00
and co.start_time < = #{endTime}
2021-08-23 19:59:57 +08:00
</if>
<if test= "transactionNumber !=null and transactionNumber !=''" >
and ho.serial_number like concat('%', #{transactionNumber}, '%')
</if>
<if test= "chargingStationName !=null and chargingStationName !=''" >
2021-11-11 01:22:40 +08:00
and ct.name like concat('%', #{chargingStationName}, '%')
2021-08-23 19:59:57 +08:00
</if>
<if test= "operatorId !=null" >
and op.operator_id =#{operatorId}
</if>
<if test= "number==1" >
and co.user_id in (SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%')) or
co.user_id in (SELECT internet_user_id from xhpc_internet_user where phone like concat('%', #{phone}, '%'))
</if>
<if test= "number==2" >
<if test= "source !=null and source ==0" >
and co.user_id in (SELECT app_user_id FROM xhpc_app_user)
</if>
<if test= "source !=null and source ==1" >
and co.user_id in (SELECT internet_user_id from xhpc_internet_user)
</if>
</if>
<if test= "number==3" >
<if test= "source !=null and source ==0" >
and co.user_id in (SELECT app_user_id FROM xhpc_app_user where phone like concat('%', #{phone}, '%'))
</if>
<if test= "source !=null and source ==1" >
and co.user_id in (SELECT internet_user_id from xhpc_internet_user where phone like concat('%',
#{phone}, '%'))
</if>
</if>
2021-11-19 18:24:17 +08:00
<if test= "status==1" >
2021-08-23 19:59:57 +08:00
and co.charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{userId})
</if>
2021-11-19 18:24:17 +08:00
<if test= "status==2" >
and co.charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{userId})
2021-08-23 19:59:57 +08:00
</if>
order by ho.create_time desc
</select>
2021-08-25 18:45:52 +08:00
<select id= "getReatTimeList" resultType= "map" >
select
rt.start_time as startTime,
rt.end_time as endTime,
ra.power_fee as powerFee,
ra.service_fee as serviceFee
from xhpc_rate_time as rt
left join xhpc_rate ra on rt.rate_id =ra.rate_id
2021-11-22 18:53:46 +08:00
WHERE
rt.rate_time_id > = (
SELECT rate_time_id FROM xhpc_rate_time WHERE rate_model_id = #{rateModelId} AND start_time < = #{startTime} AND replace(end_time, '00:00:00', '23:59:59') > = #{startTime}
)
AND rt.rate_time_id < = (
SELECT rate_time_id FROM xhpc_rate_time WHERE rate_model_id = #{rateModelId} AND start_time < = #{endTime} AND replace(end_time, '00:00:00', '23:59:59') > = #{endTime}
2021-11-11 01:22:40 +08:00
)
2021-08-25 18:45:52 +08:00
</select>
<select id= "getById" resultType= "map" >
select
ho.history_order_id as historyOrderId,
co.charge_order_id as chargeOrderId,
ho.serial_number as serialNumber,
ho.internet_serial_number as internetSerialNumber,
co.source as source,
ct.name as chargingStationName,
ter.pile_serial_number as pileSerialNumber,
ter.name as terminalName,
op.operator_id as operatorId,
op.name as operatorName,
cp.type as type,
co.type as orderType,
co.create_time as createTime,
co.start_time as startTime,
co.end_time as endTime,
co.update_time as updateTime,
2021-10-22 18:10:47 +08:00
co.charging_time as chargingTimeTotal,
2021-08-25 18:45:52 +08:00
ho.total_price as totalPrice,
2021-10-22 14:37:29 +08:00
ho.remark as remark,
2021-08-25 18:45:52 +08:00
ho.promotion_discount as promotionDiscount,
ho.act_price as actPrice,
co.erro_remark as erroRemark,
ho.power_price_total as powerPriceTotal,
ho.service_price_total as servicePriceTotal,
ho.internet_commission as internetCommission,
ho.internet_svc_commission as internetSvcCommission,
ho.platform_commission as platformCommission,
ho.platform_svc_commisssion as platformSvcCommisssion,
ho.operation_commission as operationCommission,
ho.operation_svc_commission as operationSvcCommission,
ho.act_power_price as actPowerPrice,
ho.act_service_price as actServicePrice,
2021-11-10 10:01:48 +08:00
ed.total_power as sanTotalPower,
ed.total_money as sanTotalMoney,
case when ed.dispute_reason=1 then "交易不存在"
when ed.dispute_reason=2 then "交易金额错误"
when ed.dispute_reason=3 then "交易电量错误"
else "自定义!"
end sanDisputeReason,
ed.check_order_seq as sanCheckOrderSeq,
2021-08-25 18:45:52 +08:00
(SELECT phone FROM xhpc_app_user where app_user_id = co.user_id) as appUserPhone,
2021-10-22 18:10:47 +08:00
(SELECT phone from xhpc_internet_user where internet_user_id = co.user_id) as internetUserPhone,
2021-11-22 18:53:46 +08:00
co.Plate_num as plateNum,
(SELECT name from xhpc_internet_user where internet_user_id = co.user_id and co.source =1) as internetName,
2021-10-22 18:10:47 +08:00
case when ho.stop_reason_evcs=40 then "APP远程停止"
when ho.stop_reason_evcs=41 then "SOC达到100%"
when ho.stop_reason_evcs=42 then "充电电量满足设定条件"
when ho.stop_reason_evcs=43 then "充电金额满足设定条件"
when ho.stop_reason_evcs=44 then "充电时间满足设定条件"
when ho.stop_reason_evcs=45 then "手动停止充电"
when ho.stop_reason_evcs=46 then "手动停止充电."
when ho.stop_reason_evcs=47 then "手动停止充电.."
when ho.stop_reason_evcs=48 then "急停停止充电"
when ho.stop_reason_evcs=49 then "手动停止充电..."
else "手动停止充电!"
end stopReasonRvcsName
2021-08-25 18:45:52 +08:00
from xhpc_history_order ho
left join xhpc_charging_station as ct on ct.charging_station_id = ho.charging_station_id
left join xhpc_operator as op on op.operator_id = ct.operator_id
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
left join xhpc_terminal as ter on ter.terminal_id = ho.terminal_id
left join xhpc_charging_pile as cp on cp.charging_pile_id = ter.charging_pile_id
2021-11-10 10:01:48 +08:00
left join et_dispute_orders as ed on ed.start_charge_seq = ho.internet_serial_number and ed.dispute_order_status !=2
2021-08-25 18:45:52 +08:00
where ho.history_order_id=#{historyOrderId}
</select>
2021-09-02 20:08:21 +08:00
2021-09-07 10:00:04 +08:00
<select id= "getStatistisList" resultType= "com.xhpc.order.dto.XhpcChargeHistoryOrder" >
2021-09-02 20:08:21 +08:00
select
2021-09-23 10:42:06 +08:00
ho.history_order_id as historyOrderId,
ho.power_price_total as powerPriceTotal,
ho.service_price_total as servicePriceTotal,
ho.promotion_discount as promotionDiscount,
ho.total_price as totalPrice,
ho.act_price as actPrice,
ho.act_power_price as actPowerPrice,
ho.act_service_price as actServicePrice,
ho.internet_commission as internetCommission,
ho.internet_svc_commission as internetSvcCommission,
ho.platform_commission as platformCommission,
ho.platform_svc_commisssion as platformSvcCommisssion,
ho.operation_commission as operationCommission,
ho.operation_svc_commission as operationSvcCommission,
co.source as source,
co.charge_order_id as chargeOrderId,
co.charging_station_id as chargingStationId,
co.terminal_id as terminalId,
2021-11-10 10:01:48 +08:00
ho.start_time as startTime,
ho.end_time as endTime,
2021-09-23 10:42:06 +08:00
co.charging_time_number as chargingTimeNumber,
co.charging_degree as chargingDegree,
co.rate_model_id as rateModelId,
cs.operator_id as operatorId,
te.charging_pile_id as chargingPileId,
2021-11-12 04:32:51 +08:00
co.user_id as userId,
ho.create_time as createTime
2021-09-02 20:08:21 +08:00
from xhpc_history_order ho
2021-09-23 10:42:06 +08:00
left join xhpc_charge_order co on co.charge_order_id = ho.charge_order_id
left join xhpc_charging_station cs on cs.charging_station_id = co.charging_station_id
left join xhpc_terminal as te on te.terminal_id = ho.terminal_id
2021-11-10 16:27:58 +08:00
where ho.state = #{state} and ho.total_price > 0 and ho.end_time > ho.start_time and ho.vin_normal !="2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D" and ho.power_price_total !=0
2021-09-23 10:42:06 +08:00
limit 0,#{number}
2021-09-02 20:08:21 +08:00
</select>
2021-10-19 10:22:25 +08:00
<update id= "updateXhpcHistoryOrder" >
update xhpc_history_order set state = #{state} where history_order_id=#{historyOrderId}
</update>
2021-11-19 18:24:17 +08:00
<select id= "getLandUser" resultType= "map" >
select user_id as userId,user_type as userType,operator_id as operatorId from sys_user where user_id =#{userId}
</select>
2021-09-23 10:42:06 +08:00
</mapper>