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

869 lines
37 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.OrderPileOccupyMapper">
<resultMap id="BaseResultMap" type="com.jsowell.pile.domain.OrderPileOccupy">
<!--@mbg.generated-->
<!--@Table order_pile_occupy-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="occupy_code" jdbcType="VARCHAR" property="occupyCode"/>
<result column="status" jdbcType="CHAR" property="status"/>
<result column="member_id" jdbcType="VARCHAR" property="memberId"/>
<result column="station_id" jdbcType="VARCHAR" property="stationId"/>
<result column="order_code" jdbcType="VARCHAR" property="orderCode"/>
<result column="transaction_code" jdbcType="VARCHAR" property="transactionCode"/>
<result column="start_time" jdbcType="TIMESTAMP" property="startTime"/>
<result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
<result column="pay_status" jdbcType="VARCHAR" property="payStatus"/>
<result column="order_amount" jdbcType="DECIMAL" property="orderAmount"/>
<result column="pile_sn" jdbcType="VARCHAR" property="pileSn"/>
<result column="connector_code" jdbcType="VARCHAR" property="connectorCode"/>
<result column="pile_connector_code" jdbcType="VARCHAR" property="pileConnectorCode"/>
<result column="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="del_flag" jdbcType="CHAR" property="delFlag"/>
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id,
occupy_code,
`status`,
member_id,
station_id,
order_code,
transaction_code,
start_time,
end_time,
pay_status,
order_amount,
pile_sn,
connector_code,
pile_connector_code,
create_time,
create_by,
update_time,
update_by,
del_flag
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List"/>
from order_pile_occupy
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete
from order_pile_occupy
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy"
useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_pile_occupy (occupy_code, `status`, member_id,
station_id, order_code, transaction_code,
start_time, end_time, pay_status,
order_amount, pile_sn, connector_code,
pile_connector_code, create_time, create_by,
update_time, update_by, del_flag)
values (#{occupyCode,jdbcType=VARCHAR}, #{status,jdbcType=CHAR}, #{memberId,jdbcType=VARCHAR},
#{stationId,jdbcType=VARCHAR}, #{orderCode,jdbcType=VARCHAR}, #{transactionCode,jdbcType=VARCHAR},
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{payStatus,jdbcType=VARCHAR},
#{orderAmount,jdbcType=DECIMAL}, #{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR},
#{pileConnectorCode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy"
useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_pile_occupy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="occupyCode != null">
occupy_code,
</if>
<if test="status != null">
`status`,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="orderCode != null">
order_code,
</if>
<if test="transactionCode != null">
transaction_code,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="pileSn != null">
pile_sn,
</if>
<if test="connectorCode != null">
connector_code,
</if>
<if test="pileConnectorCode != null">
pile_connector_code,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="occupyCode != null">
#{occupyCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=CHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
#{stationId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
#{transactionCode,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
#{payStatus,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
#{orderAmount,jdbcType=DECIMAL},
</if>
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
#{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
#{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.jsowell.pile.domain.OrderPileOccupy">
<!--@mbg.generated-->
update order_pile_occupy
<set>
<if test="occupyCode != null">
occupy_code = #{occupyCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=CHAR},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
station_id = #{stationId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
transaction_code = #{transactionCode,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
pay_status = #{payStatus,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
order_amount = #{orderAmount,jdbcType=DECIMAL},
</if>
<if test="pileSn != null">
pile_sn = #{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
connector_code = #{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsowell.pile.domain.OrderPileOccupy">
<!--@mbg.generated-->
update order_pile_occupy
set occupy_code = #{occupyCode,jdbcType=VARCHAR},
`status` = #{status,jdbcType=CHAR},
member_id = #{memberId,jdbcType=VARCHAR},
station_id = #{stationId,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR},
transaction_code = #{transactionCode,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
pay_status = #{payStatus,jdbcType=VARCHAR},
order_amount = #{orderAmount,jdbcType=DECIMAL},
pile_sn = #{pileSn,jdbcType=VARCHAR},
connector_code = #{connectorCode,jdbcType=VARCHAR},
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
del_flag = #{delFlag,jdbcType=CHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateBatch" parameterType="java.util.List">
<!--@mbg.generated-->
update order_pile_occupy
<trim prefix="set" suffixOverrides=",">
<trim prefix="occupy_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.occupyCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=CHAR}
</foreach>
</trim>
<trim prefix="member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="station_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="order_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="transaction_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="start_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.startTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.endTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="pay_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="order_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL}
</foreach>
</trim>
<trim prefix="pile_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="pile_connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="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="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<update id="updateBatchSelective" parameterType="java.util.List">
<!--@mbg.generated-->
update order_pile_occupy
<trim prefix="set" suffixOverrides=",">
<trim prefix="occupy_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.occupyCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.occupyCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="`status` = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.status != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.status,jdbcType=CHAR}
</if>
</foreach>
</trim>
<trim prefix="member_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.memberId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.memberId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="station_id = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.stationId != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.stationId,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="order_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.orderCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="transaction_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.transactionCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.transactionCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="start_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.startTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.startTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="end_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.endTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.endTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="pay_status = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.payStatus != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.payStatus,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="order_amount = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.orderAmount != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.orderAmount,jdbcType=DECIMAL}
</if>
</foreach>
</trim>
<trim prefix="pile_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.pileSn != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.connectorCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.connectorCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="pile_connector_code = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.pileConnectorCode != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileConnectorCode,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="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="create_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.createBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.createBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="update_time = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateTime != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateTime,jdbcType=TIMESTAMP}
</if>
</foreach>
</trim>
<trim prefix="update_by = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.updateBy != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.updateBy,jdbcType=VARCHAR}
</if>
</foreach>
</trim>
<trim prefix="del_flag = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.delFlag != null">
when id = #{item.id,jdbcType=INTEGER} then #{item.delFlag,jdbcType=CHAR}
</if>
</foreach>
</trim>
</trim>
where id in
<foreach close=")" collection="list" item="item" open="(" separator=", ">
#{item.id,jdbcType=INTEGER}
</foreach>
</update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_pile_occupy
(occupy_code, `status`, member_id, station_id, order_code, transaction_code, start_time,
end_time, pay_status, order_amount, pile_sn, connector_code, pile_connector_code,
create_time, create_by, update_time, update_by, del_flag)
values
<foreach collection="list" item="item" separator=",">
(#{item.occupyCode,jdbcType=VARCHAR}, #{item.status,jdbcType=CHAR}, #{item.memberId,jdbcType=VARCHAR},
#{item.stationId,jdbcType=VARCHAR}, #{item.orderCode,jdbcType=VARCHAR},
#{item.transactionCode,jdbcType=VARCHAR},
#{item.startTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP},
#{item.payStatus,jdbcType=VARCHAR},
#{item.orderAmount,jdbcType=DECIMAL}, #{item.pileSn,jdbcType=VARCHAR},
#{item.connectorCode,jdbcType=VARCHAR},
#{item.pileConnectorCode,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
#{item.createBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
#{item.updateBy,jdbcType=VARCHAR},
#{item.delFlag,jdbcType=CHAR})
</foreach>
</insert>
<insert id="insertOrUpdate" keyColumn="id" keyProperty="id" parameterType="com.jsowell.pile.domain.OrderPileOccupy"
useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_pile_occupy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
occupy_code,
`status`,
member_id,
station_id,
order_code,
transaction_code,
start_time,
end_time,
pay_status,
order_amount,
pile_sn,
connector_code,
pile_connector_code,
create_time,
create_by,
update_time,
update_by,
del_flag,
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
#{occupyCode,jdbcType=VARCHAR},
#{status,jdbcType=CHAR},
#{memberId,jdbcType=VARCHAR},
#{stationId,jdbcType=VARCHAR},
#{orderCode,jdbcType=VARCHAR},
#{transactionCode,jdbcType=VARCHAR},
#{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP},
#{payStatus,jdbcType=VARCHAR},
#{orderAmount,jdbcType=DECIMAL},
#{pileSn,jdbcType=VARCHAR},
#{connectorCode,jdbcType=VARCHAR},
#{pileConnectorCode,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{createBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR},
#{delFlag,jdbcType=CHAR},
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
occupy_code = #{occupyCode,jdbcType=VARCHAR},
`status` = #{status,jdbcType=CHAR},
member_id = #{memberId,jdbcType=VARCHAR},
station_id = #{stationId,jdbcType=VARCHAR},
order_code = #{orderCode,jdbcType=VARCHAR},
transaction_code = #{transactionCode,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
pay_status = #{payStatus,jdbcType=VARCHAR},
order_amount = #{orderAmount,jdbcType=DECIMAL},
pile_sn = #{pileSn,jdbcType=VARCHAR},
connector_code = #{connectorCode,jdbcType=VARCHAR},
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_by = #{createBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
del_flag = #{delFlag,jdbcType=CHAR},
</trim>
</insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
parameterType="com.jsowell.pile.domain.OrderPileOccupy" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into order_pile_occupy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="occupyCode != null">
occupy_code,
</if>
<if test="status != null">
`status`,
</if>
<if test="memberId != null">
member_id,
</if>
<if test="stationId != null">
station_id,
</if>
<if test="orderCode != null">
order_code,
</if>
<if test="transactionCode != null">
transaction_code,
</if>
<if test="startTime != null">
start_time,
</if>
<if test="endTime != null">
end_time,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="orderAmount != null">
order_amount,
</if>
<if test="pileSn != null">
pile_sn,
</if>
<if test="connectorCode != null">
connector_code,
</if>
<if test="pileConnectorCode != null">
pile_connector_code,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="delFlag != null">
del_flag,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="occupyCode != null">
#{occupyCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=CHAR},
</if>
<if test="memberId != null">
#{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
#{stationId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null">
#{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
#{transactionCode,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
#{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
#{payStatus,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
#{orderAmount,jdbcType=DECIMAL},
</if>
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
#{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
#{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=CHAR},
</if>
</trim>
on duplicate key update
<trim suffixOverrides=",">
<if test="id != null">
id = #{id,jdbcType=INTEGER},
</if>
<if test="occupyCode != null">
occupy_code = #{occupyCode,jdbcType=VARCHAR},
</if>
<if test="status != null">
`status` = #{status,jdbcType=CHAR},
</if>
<if test="memberId != null">
member_id = #{memberId,jdbcType=VARCHAR},
</if>
<if test="stationId != null">
station_id = #{stationId,jdbcType=VARCHAR},
</if>
<if test="orderCode != null">
order_code = #{orderCode,jdbcType=VARCHAR},
</if>
<if test="transactionCode != null">
transaction_code = #{transactionCode,jdbcType=VARCHAR},
</if>
<if test="startTime != null">
start_time = #{startTime,jdbcType=TIMESTAMP},
</if>
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
pay_status = #{payStatus,jdbcType=VARCHAR},
</if>
<if test="orderAmount != null">
order_amount = #{orderAmount,jdbcType=DECIMAL},
</if>
<if test="pileSn != null">
pile_sn = #{pileSn,jdbcType=VARCHAR},
</if>
<if test="connectorCode != null">
connector_code = #{connectorCode,jdbcType=VARCHAR},
</if>
<if test="pileConnectorCode != null">
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
del_flag = #{delFlag,jdbcType=CHAR},
</if>
</trim>
</insert>
<select id="queryByOccupyCode" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_pile_occupy
where del_flag = '0'
and occupy_code = #{occupyCode,jdbcType=VARCHAR}
</select>
<select id="queryOccupyOrderList" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_pile_occupy
where del_flag = '0'
<if test="dto.memberId != null and dto.memberId != ''">
and member_id = #{dto.memberId,jdbcType=VARCHAR}
</if>
<if test="dto.pileConnectorCode != null and dto.pileConnectorCode != ''">
and pile_connector_code = #{dto.pileConnectorCode,jdbcType=VARCHAR}
</if>
<if test="dto.pileSn != null and dto.pileSn != ''">
and pile_sn = #{dto.pileSn,jdbcType=VARCHAR}
</if>
</select>
<select id="queryUnPayOrderByMemberId" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_pile_occupy
where del_flag = '0'
and status = '2'
and member_id = #{memberId,jdbcType=VARCHAR}
</select>
<select id="getOccupyOrderInfo" resultType="com.jsowell.pile.vo.uniapp.OrderPileOccupyVO">
select
t1.occupy_code as occupyCode,
t1.status,
t1.station_id as stationId,
t2.station_name as stationName,
t1.start_time as startTime,
t1.end_time as endTime,
t1.pay_status as payStatus,
t1.order_amount as orderAmount
from
order_pile_occupy t1
left join pile_station_info t2 on t1.station_id = t2.id
where
member_id = #{memberId,jdbcType=VARCHAR}
</select>
<select id="queryOccupiedOrder" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from order_pile_occupy
where del_flag = '0'
and status = '0'
and pile_sn = #{pileSn,jdbcType=VARCHAR}
and connector_code = #{connectorCode,jdbcType=VARCHAR}
order by create_time DESC
</select>
<select id="queryDraftOccupyOrder" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from
order_pile_occupy
where del_flag = '0'
and status = '9'
and pile_sn = #{pileSn,jdbcType=VARCHAR}
and connector_code = #{connectorCode,jdbcType=VARCHAR}
order by create_time DESC
</select>
</mapper>