mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
165 lines
8.8 KiB
XML
165 lines
8.8 KiB
XML
<?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.jsowell.pile.mapper.SettleOrderReportMapper">
|
|
|
|
<resultMap type="com.jsowell.pile.domain.SettleOrderReport" id="SettleOrderReportResult">
|
|
<result property="id" column="id" />
|
|
<result property="merchantId" column="merchant_id" />
|
|
<result property="stationId" column="station_id" />
|
|
<result property="useElectricity" column="use_electricity" />
|
|
<result property="chargeNum" column="charge_num" />
|
|
<result property="chargeTime" column="charge_time" />
|
|
<result property="electricityAmount" column="electricity_amount" />
|
|
<result property="serviceAmount" column="service_amount" />
|
|
<result property="totalAmount" column="total_amount" />
|
|
<result property="virtualAmount" column="virtual_amount" />
|
|
<result property="tradeDate" column="trade_date" />
|
|
<result property="tradeAmount" column="trade_amount" />
|
|
<result property="tradeFee" column="trade_fee" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="delFlag" column="del_flag" />
|
|
</resultMap>
|
|
|
|
<sql id="selectSettleOrderReportVo">
|
|
select id, merchant_id, station_id, use_electricity, charge_num, charge_time, electricity_amount, service_amount, total_amount, virtual_amount, trade_date, trade_amount, trade_fee, create_time, del_flag from settle_order_report
|
|
</sql>
|
|
|
|
<sql id="Base_Column_List">
|
|
id, merchant_id, station_id, 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="selectSettleOrderReportList" parameterType="com.jsowell.pile.domain.SettleOrderReport" resultMap="SettleOrderReportResult">
|
|
<include refid="selectSettleOrderReportVo"/>
|
|
<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>
|
|
</select>
|
|
|
|
<select id="selectSettleOrderReportById" parameterType="Long" resultMap="SettleOrderReportResult">
|
|
<include refid="selectSettleOrderReportVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertSettleOrderReport" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
|
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>
|
|
<if test="delFlag != null">del_flag,</if>
|
|
</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>
|
|
<if test="delFlag != null">#{delFlag},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateSettleOrderReport" parameterType="com.jsowell.pile.domain.SettleOrderReport">
|
|
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>
|
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
|
</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
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="getMerchantOrderReport" resultType="com.jsowell.pile.vo.web.SettleOrderReportVO">
|
|
select
|
|
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
|
|
from
|
|
settle_order_report t1 join pile_station_info t2 on t1.station_id = t2.id
|
|
where
|
|
t1.del_flag = '0'
|
|
<if test="dto.merchantId != null and dto.merchantId != ''">
|
|
and t1.merchant_id = #{dto.merchantId,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="dto.startTime != null and dto.startTime != ''">
|
|
and t1.trade_date <![CDATA[ >= ]]> #{dto.startTime,jdbcType=VARCHAR}
|
|
</if>
|
|
<if test="dto.endTime != null and dto.endTime != ''">
|
|
and t1.trade_date <![CDATA[ <= ]]> #{dto.endTime,jdbcType=VARCHAR}
|
|
</if>
|
|
order by t1.trade_date DESC
|
|
</select>
|
|
|
|
<select id="selectByStationIdAndDate" resultMap="SettleOrderReportResult">
|
|
select <include refid="Base_Column_List"/>
|
|
from settle_order_report
|
|
where del_flag = '0'
|
|
and station_id = #{stationId,jdbcType=VARCHAR}
|
|
and trade_date = #{date,jdbcType=VARCHAR}
|
|
</select>
|
|
</mapper> |