2023-07-24 16:10:27 +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-06-05 11:56:07 +08:00
|
|
|
<mapper namespace="com.jsowell.pile.mapper.SettleOrderReportMapper">
|
2023-07-24 16:10:27 +08:00
|
|
|
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.SettleOrderReport">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
<!--@Table settle_order_report-->
|
|
|
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
|
|
|
<result column="merchant_id" jdbcType="VARCHAR" property="merchantId" />
|
|
|
|
|
<result column="station_id" jdbcType="VARCHAR" property="stationId" />
|
|
|
|
|
<result column="order_codes" jdbcType="LONGVARCHAR" property="orderCodes" />
|
|
|
|
|
<result column="use_electricity" jdbcType="DECIMAL" property="useElectricity" />
|
|
|
|
|
<result column="charge_num" jdbcType="VARCHAR" property="chargeNum" />
|
|
|
|
|
<result column="charge_time" jdbcType="VARCHAR" property="chargeTime" />
|
|
|
|
|
<result column="electricity_amount" jdbcType="DECIMAL" property="electricityAmount" />
|
|
|
|
|
<result column="service_amount" jdbcType="DECIMAL" property="serviceAmount" />
|
|
|
|
|
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
|
|
|
|
|
<result column="virtual_amount" jdbcType="DECIMAL" property="virtualAmount" />
|
|
|
|
|
<result column="trade_date" jdbcType="VARCHAR" property="tradeDate" />
|
|
|
|
|
<result column="trade_amount" jdbcType="DECIMAL" property="tradeAmount" />
|
|
|
|
|
<result column="trade_fee" jdbcType="DECIMAL" property="tradeFee" />
|
|
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
|
|
<result column="del_flag" jdbcType="VARCHAR" property="delFlag" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
id, merchant_id, station_id, order_codes, use_electricity, charge_num, charge_time,
|
|
|
|
|
electricity_amount, service_amount, total_amount, virtual_amount, trade_date, trade_amount,
|
|
|
|
|
trade_fee, create_time, del_flag
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
from settle_order_report
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</select>
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
delete from settle_order_report
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</delete>
|
|
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into settle_order_report (merchant_id, station_id, order_codes,
|
|
|
|
|
use_electricity, charge_num, charge_time,
|
|
|
|
|
electricity_amount, service_amount, total_amount,
|
|
|
|
|
virtual_amount, trade_date, trade_amount,
|
|
|
|
|
trade_fee, create_time, del_flag
|
|
|
|
|
)
|
|
|
|
|
values (#{merchantId,jdbcType=VARCHAR}, #{stationId,jdbcType=VARCHAR}, #{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
#{useElectricity,jdbcType=DECIMAL}, #{chargeNum,jdbcType=VARCHAR}, #{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
#{electricityAmount,jdbcType=DECIMAL}, #{serviceAmount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{virtualAmount,jdbcType=DECIMAL}, #{tradeDate,jdbcType=VARCHAR}, #{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{tradeFee,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=VARCHAR}
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into settle_order_report
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderCodes != null">
|
|
|
|
|
order_codes,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="useElectricity != null">
|
|
|
|
|
use_electricity,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeNum != null">
|
|
|
|
|
charge_num,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeTime != null">
|
|
|
|
|
charge_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="electricityAmount != null">
|
|
|
|
|
electricity_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="serviceAmount != null">
|
|
|
|
|
service_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalAmount != null">
|
|
|
|
|
total_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="virtualAmount != null">
|
|
|
|
|
virtual_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeDate != null">
|
|
|
|
|
trade_date,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeAmount != null">
|
|
|
|
|
trade_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeFee != null">
|
|
|
|
|
trade_fee,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag,
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="merchantId != null">
|
|
|
|
|
#{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
#{stationId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderCodes != null">
|
|
|
|
|
#{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="useElectricity != null">
|
|
|
|
|
#{useElectricity,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeNum != null">
|
|
|
|
|
#{chargeNum,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeTime != null">
|
|
|
|
|
#{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="electricityAmount != null">
|
|
|
|
|
#{electricityAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="serviceAmount != null">
|
|
|
|
|
#{serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalAmount != null">
|
|
|
|
|
#{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="virtualAmount != null">
|
|
|
|
|
#{virtualAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeDate != null">
|
|
|
|
|
#{tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeAmount != null">
|
|
|
|
|
#{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeFee != null">
|
|
|
|
|
#{tradeFee,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
#{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update settle_order_report
|
|
|
|
|
<set>
|
|
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id = #{stationId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderCodes != null">
|
|
|
|
|
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="useElectricity != null">
|
|
|
|
|
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeNum != null">
|
|
|
|
|
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeTime != null">
|
|
|
|
|
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="electricityAmount != null">
|
|
|
|
|
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="serviceAmount != null">
|
|
|
|
|
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalAmount != null">
|
|
|
|
|
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="virtualAmount != null">
|
|
|
|
|
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeDate != null">
|
|
|
|
|
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeAmount != null">
|
|
|
|
|
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeFee != null">
|
|
|
|
|
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag = #{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update settle_order_report
|
|
|
|
|
set merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
station_id = #{stationId,jdbcType=VARCHAR},
|
|
|
|
|
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
|
|
|
|
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
|
|
|
|
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
|
|
|
|
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
|
|
|
|
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
del_flag = #{delFlag,jdbcType=VARCHAR}
|
|
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateBatch" parameterType="java.util.List">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
update settle_order_report
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<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="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="order_codes = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCodes,jdbcType=LONGVARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="use_electricity = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.useElectricity,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="charge_num = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeNum,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="charge_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeTime,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="electricity_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.electricityAmount,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="service_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.serviceAmount,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="total_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.totalAmount,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="virtual_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="trade_date = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeDate,jdbcType=VARCHAR}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="trade_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeAmount,jdbcType=DECIMAL}
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="trade_fee = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeFee,jdbcType=DECIMAL}
|
|
|
|
|
</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="del_flag = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=VARCHAR}
|
|
|
|
|
</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 settle_order_report
|
|
|
|
|
<trim prefix="set" suffixOverrides=",">
|
|
|
|
|
<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="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="order_codes = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.orderCodes != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCodes,jdbcType=LONGVARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="use_electricity = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.useElectricity != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.useElectricity,jdbcType=DECIMAL}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="charge_num = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.chargeNum != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeNum,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="charge_time = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.chargeTime != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.chargeTime,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="electricity_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.electricityAmount != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.electricityAmount,jdbcType=DECIMAL}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="service_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.serviceAmount != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.serviceAmount,jdbcType=DECIMAL}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="total_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.totalAmount != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.totalAmount,jdbcType=DECIMAL}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="virtual_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.virtualAmount != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.virtualAmount,jdbcType=DECIMAL}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="trade_date = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.tradeDate != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeDate,jdbcType=VARCHAR}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="trade_amount = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.tradeAmount != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeAmount,jdbcType=DECIMAL}
|
|
|
|
|
</if>
|
|
|
|
|
</foreach>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="trade_fee = case" suffix="end,">
|
|
|
|
|
<foreach collection="list" index="index" item="item">
|
|
|
|
|
<if test="item.tradeFee != null">
|
|
|
|
|
when id = #{item.id,jdbcType=INTEGER} then #{item.tradeFee,jdbcType=DECIMAL}
|
|
|
|
|
</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="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=VARCHAR}
|
|
|
|
|
</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 settle_order_report
|
|
|
|
|
(merchant_id, station_id, order_codes, use_electricity, charge_num, charge_time,
|
|
|
|
|
electricity_amount, service_amount, total_amount, virtual_amount, trade_date, trade_amount,
|
|
|
|
|
trade_fee, create_time, del_flag)
|
|
|
|
|
values
|
|
|
|
|
<foreach collection="list" item="item" separator=",">
|
|
|
|
|
(#{item.merchantId,jdbcType=VARCHAR}, #{item.stationId,jdbcType=VARCHAR}, #{item.orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
#{item.useElectricity,jdbcType=DECIMAL}, #{item.chargeNum,jdbcType=VARCHAR}, #{item.chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
#{item.electricityAmount,jdbcType=DECIMAL}, #{item.serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{item.totalAmount,jdbcType=DECIMAL}, #{item.virtualAmount,jdbcType=DECIMAL}, #{item.tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
#{item.tradeAmount,jdbcType=DECIMAL}, #{item.tradeFee,jdbcType=DECIMAL}, #{item.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
#{item.delFlag,jdbcType=VARCHAR})
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into settle_order_report
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
|
|
|
|
merchant_id,
|
|
|
|
|
station_id,
|
|
|
|
|
order_codes,
|
|
|
|
|
use_electricity,
|
|
|
|
|
charge_num,
|
|
|
|
|
charge_time,
|
|
|
|
|
electricity_amount,
|
|
|
|
|
service_amount,
|
|
|
|
|
total_amount,
|
|
|
|
|
virtual_amount,
|
|
|
|
|
trade_date,
|
|
|
|
|
trade_amount,
|
|
|
|
|
trade_fee,
|
|
|
|
|
</trim>
|
|
|
|
|
values
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
#{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
#{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
#{stationId,jdbcType=VARCHAR},
|
|
|
|
|
#{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
#{useElectricity,jdbcType=DECIMAL},
|
|
|
|
|
#{chargeNum,jdbcType=VARCHAR},
|
|
|
|
|
#{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
#{electricityAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{virtualAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
#{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
#{tradeFee,jdbcType=DECIMAL},
|
|
|
|
|
</trim>
|
|
|
|
|
on duplicate key update
|
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
station_id = #{stationId,jdbcType=VARCHAR},
|
|
|
|
|
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
|
|
|
|
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
|
|
|
|
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
|
|
|
|
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
|
|
|
|
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.SettleOrderReport" useGeneratedKeys="true">
|
|
|
|
|
<!--@mbg.generated-->
|
|
|
|
|
insert into settle_order_report
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderCodes != null">
|
|
|
|
|
order_codes,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="useElectricity != null">
|
|
|
|
|
use_electricity,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeNum != null">
|
|
|
|
|
charge_num,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeTime != null">
|
|
|
|
|
charge_time,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="electricityAmount != null">
|
|
|
|
|
electricity_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="serviceAmount != null">
|
|
|
|
|
service_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalAmount != null">
|
|
|
|
|
total_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="virtualAmount != null">
|
|
|
|
|
virtual_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeDate != null">
|
|
|
|
|
trade_date,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeAmount != null">
|
|
|
|
|
trade_amount,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeFee != null">
|
|
|
|
|
trade_fee,
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_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="merchantId != null">
|
|
|
|
|
#{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
#{stationId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderCodes != null">
|
|
|
|
|
#{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="useElectricity != null">
|
|
|
|
|
#{useElectricity,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeNum != null">
|
|
|
|
|
#{chargeNum,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeTime != null">
|
|
|
|
|
#{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="electricityAmount != null">
|
|
|
|
|
#{electricityAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="serviceAmount != null">
|
|
|
|
|
#{serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalAmount != null">
|
|
|
|
|
#{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="virtualAmount != null">
|
|
|
|
|
#{virtualAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeDate != null">
|
|
|
|
|
#{tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeAmount != null">
|
|
|
|
|
#{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeFee != null">
|
|
|
|
|
#{tradeFee,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
#{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
on duplicate key update
|
|
|
|
|
<trim suffixOverrides=",">
|
|
|
|
|
<if test="id != null">
|
|
|
|
|
id = #{id,jdbcType=INTEGER},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="merchantId != null">
|
|
|
|
|
merchant_id = #{merchantId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="stationId != null">
|
|
|
|
|
station_id = #{stationId,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderCodes != null">
|
|
|
|
|
order_codes = #{orderCodes,jdbcType=LONGVARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="useElectricity != null">
|
|
|
|
|
use_electricity = #{useElectricity,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeNum != null">
|
|
|
|
|
charge_num = #{chargeNum,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="chargeTime != null">
|
|
|
|
|
charge_time = #{chargeTime,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="electricityAmount != null">
|
|
|
|
|
electricity_amount = #{electricityAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="serviceAmount != null">
|
|
|
|
|
service_amount = #{serviceAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="totalAmount != null">
|
|
|
|
|
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="virtualAmount != null">
|
|
|
|
|
virtual_amount = #{virtualAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeDate != null">
|
|
|
|
|
trade_date = #{tradeDate,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeAmount != null">
|
|
|
|
|
trade_amount = #{tradeAmount,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="tradeFee != null">
|
|
|
|
|
trade_fee = #{tradeFee,jdbcType=DECIMAL},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="createTime != null">
|
|
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="delFlag != null">
|
|
|
|
|
del_flag = #{delFlag,jdbcType=VARCHAR},
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
2023-06-05 11:56:07 +08:00
|
|
|
|
2023-07-24 16:10:27 +08:00
|
|
|
<resultMap id="SettleOrderReportResult" type="com.jsowell.pile.domain.SettleOrderReport">
|
|
|
|
|
<result column="id" property="id" />
|
|
|
|
|
<result column="merchant_id" property="merchantId" />
|
|
|
|
|
<result column="station_id" property="stationId" />
|
|
|
|
|
<result column="use_electricity" property="useElectricity" />
|
|
|
|
|
<result column="charge_num" property="chargeNum" />
|
|
|
|
|
<result column="charge_time" property="chargeTime" />
|
|
|
|
|
<result column="electricity_amount" property="electricityAmount" />
|
|
|
|
|
<result column="service_amount" property="serviceAmount" />
|
|
|
|
|
<result column="total_amount" property="totalAmount" />
|
|
|
|
|
<result column="virtual_amount" property="virtualAmount" />
|
|
|
|
|
<result column="trade_date" property="tradeDate" />
|
|
|
|
|
<result column="trade_amount" property="tradeAmount" />
|
|
|
|
|
<result column="trade_fee" property="tradeFee" />
|
|
|
|
|
<result column="create_time" property="createTime" />
|
|
|
|
|
<result column="del_flag" property="delFlag" />
|
2023-06-05 11:56:07 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectSettleOrderReportVo">
|
2023-07-24 16:10:27 +08:00
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from settle_order_report
|
2023-06-12 14:51:09 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectSettleOrderReportList" parameterType="com.jsowell.pile.domain.SettleOrderReport" resultMap="SettleOrderReportResult">
|
2023-07-24 16:10:27 +08:00
|
|
|
<include refid="selectSettleOrderReportVo" />
|
2023-06-05 11:56:07 +08:00
|
|
|
<where>
|
|
|
|
|
<if test="merchantId != null and merchantId != ''"> and merchant_id = #{merchantId}</if>
|
|
|
|
|
<if test="stationId != null and stationId != ''"> and station_id = #{stationId}</if>
|
|
|
|
|
<if test="useElectricity != null "> and use_electricity = #{useElectricity}</if>
|
|
|
|
|
<if test="chargeNum != null and chargeNum != ''"> and charge_num = #{chargeNum}</if>
|
|
|
|
|
<if test="chargeTime != null and chargeTime != ''"> and charge_time = #{chargeTime}</if>
|
|
|
|
|
<if test="electricityAmount != null "> and electricity_amount = #{electricityAmount}</if>
|
|
|
|
|
<if test="serviceAmount != null "> and service_amount = #{serviceAmount}</if>
|
|
|
|
|
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
|
|
|
|
|
<if test="virtualAmount != null "> and virtual_amount = #{virtualAmount}</if>
|
|
|
|
|
<if test="tradeDate != null and tradeDate != ''"> and trade_date = #{tradeDate}</if>
|
|
|
|
|
<if test="tradeAmount != null "> and trade_amount = #{tradeAmount}</if>
|
|
|
|
|
<if test="tradeFee != null "> and trade_fee = #{tradeFee}</if>
|
|
|
|
|
</where>
|
2023-07-20 10:09:27 +08:00
|
|
|
order by trade_date DESC
|
2023-06-05 11:56:07 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectSettleOrderReportById" parameterType="Long" resultMap="SettleOrderReportResult">
|
2023-07-24 16:10:27 +08:00
|
|
|
<include refid="selectSettleOrderReportVo" />
|
2023-06-05 11:56:07 +08:00
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
2023-06-12 14:51:09 +08:00
|
|
|
<insert id="insertSettleOrderReport" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
2023-06-05 11:56:07 +08:00
|
|
|
insert into settle_order_report
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">id,</if>
|
|
|
|
|
<if test="merchantId != null">merchant_id,</if>
|
|
|
|
|
<if test="stationId != null">station_id,</if>
|
|
|
|
|
<if test="useElectricity != null">use_electricity,</if>
|
|
|
|
|
<if test="chargeNum != null">charge_num,</if>
|
|
|
|
|
<if test="chargeTime != null">charge_time,</if>
|
|
|
|
|
<if test="electricityAmount != null">electricity_amount,</if>
|
|
|
|
|
<if test="serviceAmount != null">service_amount,</if>
|
|
|
|
|
<if test="totalAmount != null">total_amount,</if>
|
|
|
|
|
<if test="virtualAmount != null">virtual_amount,</if>
|
|
|
|
|
<if test="tradeDate != null">trade_date,</if>
|
|
|
|
|
<if test="tradeAmount != null">trade_amount,</if>
|
|
|
|
|
<if test="tradeFee != null">trade_fee,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
2023-06-05 13:49:12 +08:00
|
|
|
<if test="delFlag != null">del_flag,</if>
|
2023-06-05 11:56:07 +08:00
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="id != null">#{id},</if>
|
|
|
|
|
<if test="merchantId != null">#{merchantId},</if>
|
|
|
|
|
<if test="stationId != null">#{stationId},</if>
|
|
|
|
|
<if test="useElectricity != null">#{useElectricity},</if>
|
|
|
|
|
<if test="chargeNum != null">#{chargeNum},</if>
|
|
|
|
|
<if test="chargeTime != null">#{chargeTime},</if>
|
|
|
|
|
<if test="electricityAmount != null">#{electricityAmount},</if>
|
|
|
|
|
<if test="serviceAmount != null">#{serviceAmount},</if>
|
|
|
|
|
<if test="totalAmount != null">#{totalAmount},</if>
|
|
|
|
|
<if test="virtualAmount != null">#{virtualAmount},</if>
|
|
|
|
|
<if test="tradeDate != null">#{tradeDate},</if>
|
|
|
|
|
<if test="tradeAmount != null">#{tradeAmount},</if>
|
|
|
|
|
<if test="tradeFee != null">#{tradeFee},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
2023-06-05 13:49:12 +08:00
|
|
|
<if test="delFlag != null">#{delFlag},</if>
|
2023-06-05 11:56:07 +08:00
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
2023-06-12 14:51:09 +08:00
|
|
|
<update id="updateSettleOrderReport" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
2023-06-05 11:56:07 +08:00
|
|
|
update settle_order_report
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="merchantId != null">merchant_id = #{merchantId},</if>
|
|
|
|
|
<if test="stationId != null">station_id = #{stationId},</if>
|
|
|
|
|
<if test="useElectricity != null">use_electricity = #{useElectricity},</if>
|
|
|
|
|
<if test="chargeNum != null">charge_num = #{chargeNum},</if>
|
|
|
|
|
<if test="chargeTime != null">charge_time = #{chargeTime},</if>
|
|
|
|
|
<if test="electricityAmount != null">electricity_amount = #{electricityAmount},</if>
|
|
|
|
|
<if test="serviceAmount != null">service_amount = #{serviceAmount},</if>
|
|
|
|
|
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
|
|
|
|
<if test="virtualAmount != null">virtual_amount = #{virtualAmount},</if>
|
|
|
|
|
<if test="tradeDate != null">trade_date = #{tradeDate},</if>
|
|
|
|
|
<if test="tradeAmount != null">trade_amount = #{tradeAmount},</if>
|
|
|
|
|
<if test="tradeFee != null">trade_fee = #{tradeFee},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
2023-06-05 13:49:12 +08:00
|
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
2023-06-05 11:56:07 +08:00
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSettleOrderReportById" parameterType="Long">
|
|
|
|
|
delete from settle_order_report where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteSettleOrderReportByIds" parameterType="String">
|
|
|
|
|
delete from settle_order_report where id in
|
2023-07-24 16:10:27 +08:00
|
|
|
<foreach close=")" collection="array" item="id" open="(" separator=",">
|
2023-06-05 11:56:07 +08:00
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2023-06-12 14:51:09 +08:00
|
|
|
|
2023-06-15 17:39:23 +08:00
|
|
|
<select id="getMerchantOrderReport" resultType="com.jsowell.pile.vo.web.SettleOrderReportVO">
|
2023-06-12 14:51:09 +08:00
|
|
|
select
|
2023-06-15 17:39:23 +08:00
|
|
|
t1.id,
|
|
|
|
|
t1.merchant_id as merchantId,
|
|
|
|
|
t1.station_id as stationId,
|
|
|
|
|
t2.station_name as stationName,
|
|
|
|
|
t1.use_electricity as useElectricity,
|
|
|
|
|
t1.charge_num as chargeNum,
|
|
|
|
|
t1.charge_time as chargeTime,
|
|
|
|
|
t1.electricity_amount as electricityAmount,
|
|
|
|
|
t1.service_amount as serviceAmount,
|
|
|
|
|
t1.total_amount as totalAmount,
|
|
|
|
|
t1.virtual_amount as virtualAmount,
|
|
|
|
|
t1.trade_date as tradeDate,
|
|
|
|
|
t1.trade_amount as tradeAmount,
|
|
|
|
|
t1.trade_fee as tradeFee
|
2023-06-12 14:51:09 +08:00
|
|
|
from
|
2023-06-15 17:39:23 +08:00
|
|
|
settle_order_report t1 join pile_station_info t2 on t1.station_id = t2.id
|
2023-06-12 14:51:09 +08:00
|
|
|
where
|
2023-06-15 17:39:23 +08:00
|
|
|
t1.del_flag = '0'
|
2023-06-12 14:51:09 +08:00
|
|
|
<if test="dto.merchantId != null and dto.merchantId != ''">
|
2023-06-15 17:39:23 +08:00
|
|
|
and t1.merchant_id = #{dto.merchantId,jdbcType=VARCHAR}
|
2023-06-12 14:51:09 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.startTime != null and dto.startTime != ''">
|
2023-06-15 17:39:23 +08:00
|
|
|
and t1.trade_date <![CDATA[ >= ]]> #{dto.startTime,jdbcType=VARCHAR}
|
2023-06-12 14:51:09 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="dto.endTime != null and dto.endTime != ''">
|
2023-06-15 17:39:23 +08:00
|
|
|
and t1.trade_date <![CDATA[ <= ]]> #{dto.endTime,jdbcType=VARCHAR}
|
2023-06-12 14:51:09 +08:00
|
|
|
</if>
|
2023-07-15 16:24:17 +08:00
|
|
|
order by t1.trade_date DESC
|
2023-06-12 14:51:09 +08:00
|
|
|
</select>
|
2023-07-14 13:55:35 +08:00
|
|
|
|
|
|
|
|
<select id="selectByStationIdAndDate" resultMap="SettleOrderReportResult">
|
2023-07-24 16:10:27 +08:00
|
|
|
select <include refid="Base_Column_List" />
|
2023-07-14 13:55:35 +08:00
|
|
|
from settle_order_report
|
|
|
|
|
where del_flag = '0'
|
|
|
|
|
and station_id = #{stationId,jdbcType=VARCHAR}
|
|
|
|
|
and trade_date = #{date,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
2023-07-24 16:10:27 +08:00
|
|
|
|
|
|
|
|
<select id="selectByMerchantIdAndDate" resultMap="SettleOrderReportResult">
|
|
|
|
|
select <include refid="Base_Column_List" />
|
|
|
|
|
from settle_order_report
|
|
|
|
|
where del_flag = '0'
|
|
|
|
|
and merchant_id = #{merchantId,jdbcType=VARCHAR}
|
|
|
|
|
and trade_date = #{date,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
2023-06-05 11:56:07 +08:00
|
|
|
</mapper>
|