update 生成占桩订单

This commit is contained in:
2023-08-07 16:57:01 +08:00
parent 9783769b46
commit 579d1619a8
3 changed files with 59 additions and 18 deletions

View File

@@ -24,7 +24,7 @@ public class OrderPileOccupy {
private String occupyCode;
/**
* 状态0-占桩中1-待支付2-无需支付3订单完成)
* 状态0-占桩中1-订单完成)
*/
private String status;
@@ -53,6 +53,11 @@ public class OrderPileOccupy {
*/
private Date endTime;
/**
* 支付状态0-未支付1-支付完成2-无需支付)
*/
private String payStatus;
/**
* 充电桩编号
*/

View File

@@ -109,7 +109,8 @@ public class OrderPileOccupyServiceImpl implements OrderPileOccupyService{
String occupyCode = "OP" + IdUtils.getOrderCode();
orderPileOccupy.setOccupyCode(occupyCode);
orderPileOccupy.setMemberId(memberId);
orderPileOccupy.setStatus(Constants.ZERO);
orderPileOccupy.setStatus(Constants.ZERO); // 占桩中
orderPileOccupy.setPayStatus(Constants.ZERO); // 未支付
orderPileOccupy.setPileSn(pileSn);
orderPileOccupy.setConnectorCode(connectorCode);
orderPileOccupy.setPileConnectorCode(pileSn + connectorCode);

View File

@@ -12,6 +12,7 @@
<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="pile_sn" jdbcType="VARCHAR" property="pileSn" />
<result column="connector_code" jdbcType="VARCHAR" property="connectorCode" />
<result column="pile_connector_code" jdbcType="VARCHAR" property="pileConnectorCode" />
@@ -24,8 +25,8 @@
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, occupy_code, `status`, member_id, order_code, transaction_code, start_time, end_time,
pile_sn, connector_code, pile_connector_code, create_time, create_by, update_time,
update_by, del_flag
pay_status, 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-->
@@ -43,16 +44,16 @@
<!--@mbg.generated-->
insert into order_pile_occupy (occupy_code, `status`, member_id,
order_code, transaction_code, start_time,
end_time, pile_sn, connector_code,
pile_connector_code, create_time, create_by,
update_time, update_by, del_flag
)
end_time, pay_status, 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},
#{orderCode,jdbcType=VARCHAR}, #{transactionCode,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP}, #{pileSn,jdbcType=VARCHAR}, #{connectorCode,jdbcType=VARCHAR},
#{pileConnectorCode,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{createBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR}
)
#{endTime,jdbcType=TIMESTAMP}, #{payStatus,jdbcType=VARCHAR}, #{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-->
@@ -79,6 +80,9 @@
<if test="endTime != null">
end_time,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="pileSn != null">
pile_sn,
</if>
@@ -126,6 +130,9 @@
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
#{payStatus,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
@@ -177,6 +184,9 @@
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
pay_status = #{payStatus,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
pile_sn = #{pileSn,jdbcType=VARCHAR},
</if>
@@ -214,6 +224,7 @@
transaction_code = #{transactionCode,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
pay_status = #{payStatus,jdbcType=VARCHAR},
pile_sn = #{pileSn,jdbcType=VARCHAR},
connector_code = #{connectorCode,jdbcType=VARCHAR},
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
@@ -263,6 +274,11 @@
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="pile_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
when id = #{item.id,jdbcType=INTEGER} then #{item.pileSn,jdbcType=VARCHAR}
@@ -362,6 +378,13 @@
</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="pile_sn = case" suffix="end,">
<foreach collection="list" index="index" item="item">
<if test="item.pileSn != null">
@@ -428,16 +451,16 @@
<!--@mbg.generated-->
insert into order_pile_occupy
(occupy_code, `status`, member_id, order_code, transaction_code, start_time, end_time,
pile_sn, connector_code, pile_connector_code, create_time, create_by, update_time,
update_by, del_flag)
pay_status, 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.orderCode,jdbcType=VARCHAR}, #{item.transactionCode,jdbcType=VARCHAR}, #{item.startTime,jdbcType=TIMESTAMP},
#{item.endTime,jdbcType=TIMESTAMP}, #{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})
#{item.endTime,jdbcType=TIMESTAMP}, #{item.payStatus,jdbcType=VARCHAR}, #{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">
@@ -454,6 +477,7 @@
transaction_code,
start_time,
end_time,
pay_status,
pile_sn,
connector_code,
pile_connector_code,
@@ -475,6 +499,7 @@
#{transactionCode,jdbcType=VARCHAR},
#{startTime,jdbcType=TIMESTAMP},
#{endTime,jdbcType=TIMESTAMP},
#{payStatus,jdbcType=VARCHAR},
#{pileSn,jdbcType=VARCHAR},
#{connectorCode,jdbcType=VARCHAR},
#{pileConnectorCode,jdbcType=VARCHAR},
@@ -496,6 +521,7 @@
transaction_code = #{transactionCode,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=TIMESTAMP},
end_time = #{endTime,jdbcType=TIMESTAMP},
pay_status = #{payStatus,jdbcType=VARCHAR},
pile_sn = #{pileSn,jdbcType=VARCHAR},
connector_code = #{connectorCode,jdbcType=VARCHAR},
pile_connector_code = #{pileConnectorCode,jdbcType=VARCHAR},
@@ -534,6 +560,9 @@
<if test="endTime != null">
end_time,
</if>
<if test="payStatus != null">
pay_status,
</if>
<if test="pileSn != null">
pile_sn,
</if>
@@ -585,6 +614,9 @@
<if test="endTime != null">
#{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
#{payStatus,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
#{pileSn,jdbcType=VARCHAR},
</if>
@@ -636,6 +668,9 @@
<if test="endTime != null">
end_time = #{endTime,jdbcType=TIMESTAMP},
</if>
<if test="payStatus != null">
pay_status = #{payStatus,jdbcType=VARCHAR},
</if>
<if test="pileSn != null">
pile_sn = #{pileSn,jdbcType=VARCHAR},
</if>