2024-04-23 12:23:43 +08:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
2025-04-24 18:59:44 +08:00
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
2024-04-23 12:23:43 +08:00
|
|
|
<mapper namespace="com.sky.mapper.OrderMapper">
|
|
|
|
|
|
|
|
|
|
<insert id="insert" parameterType="Orders" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into orders
|
|
|
|
|
(number, status, user_id, address_book_id, order_time, checkout_time, pay_method, pay_status, amount, remark,
|
|
|
|
|
phone, address, consignee, estimated_delivery_time, delivery_status, pack_amount, tableware_number,
|
|
|
|
|
tableware_status)
|
|
|
|
|
values (#{number}, #{status}, #{userId}, #{addressBookId}, #{orderTime}, #{checkoutTime}, #{payMethod},
|
|
|
|
|
#{payStatus}, #{amount}, #{remark}, #{phone}, #{address}, #{consignee},
|
|
|
|
|
#{estimatedDeliveryTime}, #{deliveryStatus}, #{packAmount}, #{tablewareNumber}, #{tablewareStatus})
|
|
|
|
|
</insert>
|
2025-04-24 18:59:44 +08:00
|
|
|
|
2024-08-07 14:11:29 +08:00
|
|
|
<update id="update" parameterType="com.sky.entity.Orders">
|
|
|
|
|
update orders
|
|
|
|
|
<set>
|
|
|
|
|
<if test="cancelReason != null and cancelReason!='' ">
|
|
|
|
|
cancel_reason=#{cancelReason},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="rejectionReason != null and rejectionReason!='' ">
|
|
|
|
|
rejection_reason=#{rejectionReason},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="cancelTime != null">
|
|
|
|
|
cancel_time=#{cancelTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="payStatus != null">
|
|
|
|
|
pay_status=#{payStatus},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="payMethod != null">
|
|
|
|
|
pay_method=#{payMethod},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="checkoutTime != null">
|
|
|
|
|
checkout_time=#{checkoutTime},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="status != null">
|
|
|
|
|
status = #{status},
|
|
|
|
|
</if>
|
|
|
|
|
<if test="deliveryTime != null">
|
|
|
|
|
delivery_time = #{deliveryTime}
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
2025-04-24 18:59:44 +08:00
|
|
|
|
|
|
|
|
</mapper>
|