297 lines
14 KiB
XML
Raw Normal View History

<?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">
<result column="history_order_id" property="historyOrderId"/>
<result column="charging_station_id" property="chargingStationId"/>
<result column="charging_order_id" property="chargingOrderId"/>
<result column="user_id" property="userId"/>
<result column="terminal_id" property="terminalId"/>
<result column="serial_number" property="serialNumber"/>
<result column="internet_serial_number" property="internetSerialNumber"/>
<result column="total_price" property="totalPrice"/>
<result column="promotion_discount" property="promotionDiscount"/>
<result column="act_price" property="actPrice"/>
<result column="act_power_price" property="actPowerPrice"/>
<result column="act_service_price" property="actServicePrice"/>
<result column="internet_commission" property="internetCommission"/>
<result column="internet_svc_commission" property="internetSvcCommission"/>
<result column="platform_commission" property="platformCommission"/>
<result column="platform_svc_commisssion" property="platformSvcCommisssion"/>
<result column="operation_commission" property="operationCommission"/>
<result column="start_soc" property="startSoc"/>
<result column="end_soc" property="endSoc"/>
<result column="reconciliation_status" property="reconciliationStatus"/>
<result column="sorting_status" property="sortingStatus"/>
<result column="type" property="type"/>
<result column="status" property="status"/>
<result column="del_flag" property="delFlag"/>
<result column="create_time" property="createTime"/>
<result column="create_by" property="createBy"/>
<result column="update_time" property="updateTime"/>
<result column="update_by" property="updateBy"/>
<result column="remark" property="remark"/>
</resultMap>
<insert id="insert" parameterType="com.xhpc.order.domain.XhpcHistoryOrder" useGeneratedKeys="true"
keyProperty="XhpcHistoryOrderId">
INSERT INTO xhpc_history_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId and '' != chargingStationId">
charging_station_id,
</if>
<if test="null != chargingOrderId and '' != chargingOrderId">
charging_order_id,
</if>
<if test="null != userId and '' != userId">
user_id,
</if>
<if test="null != terminalId and '' != terminalId">
terminal_id,
</if>
<if test="null != serialNumber and '' != serialNumber">
serial_number,
</if>
<if test="null != internetSerialNumber and '' != internetSerialNumber">
internet_serial_number,
</if>
<if test="null != totalPrice and '' != totalPrice">
total_price,
</if>
<if test="null != promotionDiscount and '' != promotionDiscount">
promotion_discount,
</if>
<if test="null != actPrice and '' != actPrice">
act_price,
</if>
<if test="null != actPowerPrice and '' != actPowerPrice">
act_power_price,
</if>
<if test="null != actServicePrice and '' != actServicePrice">
act_service_price,
</if>
<if test="null != internetCommission and '' != internetCommission">
internet_commission,
</if>
<if test="null != internetSvcCommission and '' != internetSvcCommission">
internet_svc_commission,
</if>
<if test="null != platformCommission and '' != platformCommission">
platform_commission,
</if>
<if test="null != platformSvcCommisssion and '' != platformSvcCommisssion">
platform_svc_commisssion,
</if>
<if test="null != operationCommission and '' != operationCommission">
operation_commission,
</if>
<if test="null != operationSvcCommission and '' != operationSvcCommission">
operation_svc_commission,
</if>
<if test="null != startSoc and '' != startSoc">
start_soc,
</if>
<if test="null != endSoc and '' != endSoc">
end_soc,
</if>
<if test="null != reconciliationStatus and '' != reconciliationStatus">
reconciliation_status,
</if>
<if test="null != sortingStatus and '' != sortingStatus">
sorting_status,
</if>
<if test="null != type and '' != type">
type,
</if>
<if test="null != status and '' != status">
status,
</if>
<if test="null != delFlag and '' != delFlag">
del_flag,
</if>
<if test="null != createTime and '' != createTime">
create_time,
</if>
<if test="null != createBy and '' != createBy">
create_by,
</if>
<if test="null != updateTime and '' != updateTime">
update_time,
</if>
<if test="null != updateBy and '' != updateBy">
update_by,
</if>
<if test="null != remark and '' != remark">
remark
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="null != chargingStationId and '' != chargingStationId">
#{chargingStationId},
</if>
<if test="null != chargingOrderId and '' != chargingOrderId">
#{chargingOrderId},
</if>
<if test="null != userId and '' != userId">
#{userId},
</if>
<if test="null != terminalId and '' != terminalId">
#{terminalId},
</if>
<if test="null != serialNumber and '' != serialNumber">
#{serialNumber},
</if>
<if test="null != internetSerialNumber and '' != internetSerialNumber">
#{internetSerialNumber},
</if>
<if test="null != totalPrice and '' != totalPrice">
#{totalPrice},
</if>
<if test="null != promotionDiscount and '' != promotionDiscount">
#{promotionDiscount},
</if>
<if test="null != actPrice and '' != actPrice">
#{actPrice},
</if>
<if test="null != actPowerPrice and '' != actPowerPrice">
#{actPowerPrice},
</if>
<if test="null != actServicePrice and '' != actServicePrice">
#{actServicePrice},
</if>
<if test="null != internetCommission and '' != internetCommission">
#{internetCommission},
</if>
<if test="null != internetSvcCommission and '' != internetSvcCommission">
#{internetSvcCommission},
</if>
<if test="null != platformCommission and '' != platformCommission">
#{platformCommission},
</if>
<if test="null != platformSvcCommisssion and '' != platformSvcCommisssion">
#{platformSvcCommisssion},
</if>
<if test="null != operationCommission and '' != operationCommission">
#{operationCommission},
</if>
<if test="null != operationSvcCommission and '' != operationSvcCommission">
#{operationSvcCommission},
</if>
<if test="null != startSoc and '' != startSoc">
#{startSoc},
</if>
<if test="null != endSoc and '' != endSoc">
#{endSoc},
</if>
<if test="null != reconciliationStatus and '' != reconciliationStatus">
#{reconciliationStatus},
</if>
<if test="null != sortingStatus and '' != sortingStatus">
#{sortingStatus},
</if>
<if test="null != type and '' != type">
#{type},
</if>
<if test="null != status and '' != status">
#{status},
</if>
<if test="null != delFlag and '' != delFlag">
#{delFlag},
</if>
<if test="null != createTime and '' != createTime">
#{createTime},
</if>
<if test="null != createBy and '' != createBy">
#{createBy},
</if>
<if test="null != updateTime and '' != updateTime">
#{updateTime},
</if>
<if test="null != updateBy and '' != updateBy">
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark}
</if>
</trim>
</insert>
<update id="update" parameterType="com.xhpc.order.domain.XhpcHistoryOrder">
UPDATE xhpc_history_order
<set>
<if test="null != chargingStationId and '' != chargingStationId">charging_station_id =
#{chargingStationId},
</if>
<if test="null != chargingOrderId and '' != chargingOrderId">charging_order_id = #{chargingOrderId},</if>
<if test="null != userId and '' != userId">user_id = #{userId},</if>
<if test="null != terminalId and '' != terminalId">terminal_id = #{terminalId},</if>
<if test="null != serialNumber and '' != serialNumber">serial_number = #{serialNumber},</if>
<if test="null != internetSerialNumber and '' != internetSerialNumber">internet_serial_number =
#{internetSerialNumber},
</if>
<if test="null != totalPrice and '' != totalPrice">total_price = #{totalPrice},</if>
<if test="null != promotionDiscount and '' != promotionDiscount">promotion_discount =
#{promotionDiscount},
</if>
<if test="null != actPrice and '' != actPrice">act_price = #{actPrice},</if>
<if test="null != actPowerPrice and '' != actPowerPrice">act_power_price = #{actPowerPrice},</if>
<if test="null != actServicePrice and '' != actServicePrice">act_service_price = #{actServicePrice},</if>
<if test="null != internetCommission and '' != internetCommission">internet_commission =
#{internetCommission},
</if>
<if test="null != internetSvcCommission and '' != internetSvcCommission">internet_svc_commission =
#{internetSvcCommission},
</if>
<if test="null != platformCommission and '' != platformCommission">platform_commission =
#{platformCommission},
</if>
<if test="null != platformSvcCommisssion and '' != platformSvcCommisssion">platform_svc_commisssion =
#{platformSvcCommisssion},
</if>
<if test="null != operationCommission and '' != operationCommission">operation_commission =
#{operationCommission},
</if>
<if test="null != operationSvcCommission and '' != operationSvcCommission">operation_svc_commission =
#{operationSvcCommission},
</if>
<if test="null != startSoc and '' != startSoc">start_soc = #{startSoc},</if>
<if test="null != endSoc and '' != endSoc">end_soc = #{endSoc},</if>
<if test="null != reconciliationStatus and '' != reconciliationStatus">reconciliation_status =
#{reconciliationStatus},
</if>
<if test="null != sortingStatus and '' != sortingStatus">sorting_status = #{sortingStatus},</if>
<if test="null != type and '' != type">type = #{type},</if>
<if test="null != status and '' != status">status = #{status},</if>
<if test="null != delFlag and '' != delFlag">del_flag = #{delFlag},</if>
<if test="null != createTime and '' != createTime">create_time = #{createTime},</if>
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != updateTime and '' != updateTime">update_time = #{updateTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != remark and '' != remark">remark = #{remark}</if>
</set>
WHERE history_order_id = #{historyOrderId}
</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
<update id="updateReconciliation" parameterType="com.xhpc.order.domain.XhpcHistoryOrderReconciliationStatus">
update xhpc_history_order set reconciliation_status = #{status} where history_order_id in
<foreach collection="array" item="xhpcHistoryOrderId" open="(" separator="," close=")">
#{xhpcHistoryOrderId}
</foreach>
</update>
<update id="updateSorting" parameterType="com.xhpc.order.domain.XhpcHistoryOrderReconciliationStatus">
update xhpc_history_order set sorting_status = #{status} where history_order_id in
<foreach collection="array" item="xhpcHistoryOrderId" open="(" separator="," close=")">
#{xhpcHistoryOrderId}
</foreach>
</update>
</mapper>