zhwl/zhwl-business/zhwl-hotel-homestay-order/target/classes/mapper/hotelHomestay/ZdyHotelHomestayOrderRefundMapper.xml
2025-07-01 17:54:58 +08:00

339 lines
13 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.zhwl.hotel.homestay.order.mapper.ZdyHotelHomestayOrderRefundMapper">
<resultMap type="ZdyHotelHomestayOrderRefund" id="ZdyHotelHomestayOrderRefundResult">
<result property="id" column="id"/>
<result property="orderId" column="order_id"/>
<result property="orderCode" column="order_code"/>
<result property="refundCode" column="refund_code"/>
<result property="orderPrepayId" column="order_prepay_id"/>
<result property="refundSource" column="refund_source"/>
<result property="totalAmount" column="total_amount"/>
<result property="penaltyFee" column="penalty_fee"/>
<result property="actualAmount" column="actual_amount"/>
<result property="refundStatus" column="refund_status"/>
<result property="refundTime" column="refund_time"/>
<result property="personalRefundType" column="personal_refund_type"/>
<result property="businessRefundDesc" column="business_refund_desc"/>
<result property="rejectionDesc" column="rejection_desc"/>
<result property="auditTime" column="audit_time"/>
<result property="createZdyUserId" column="create_zdy_user_id"/>
<result property="createSysUserId" column="create_sys_user_id"/>
<result property="createTime" column="create_time"/>
<result property="updaterId" column="updater_id"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectZdyHotelHomestayOrderRefundVo">
select id,
order_id,
order_code,
refund_code,
order_prepay_id,
refund_source,
total_amount,
penalty_fee,
actual_amount,
refund_status,
refund_time,
personal_refund_type,
business_refund_desc,
rejection_desc,
audit_time,
create_zdy_user_id,
create_sys_user_id,
create_time,
updater_id,
update_time
from zdy_hotel_homestay_order_refund
</sql>
<select id="selectZdyHotelHomestayOrderRefundList" parameterType="ZdyHotelHomestayOrderRefund"
resultMap="ZdyHotelHomestayOrderRefundResult">
<include refid="selectZdyHotelHomestayOrderRefundVo"/>
<where>
<if test="orderId != null ">
and order_id = #{orderId}
</if>
<if test="orderCode != null and orderCode != ''">
and order_code = #{orderCode}
</if>
<if test="refundCode != null and refundCode != ''">
and refund_code = #{refundCode}
</if>
<if test="orderPrepayId != null and orderPrepayId != ''">
and order_prepay_id = #{orderPrepayId}
</if>
<if test="refundSource != null and refundSource != ''">
and refund_source = #{refundSource}
</if>
<if test="totalAmount != null ">
and total_amount = #{totalAmount}
</if>
<if test="penaltyFee != null ">
and penalty_fee = #{penaltyFee}
</if>
<if test="actualAmount != null ">
and actual_amount = #{actualAmount}
</if>
<if test="refundStatus != null and refundStatus != ''">
and refund_status = #{refundStatus}
</if>
<if test="refundTime != null ">
and refund_time = #{refundTime}
</if>
<if test="personalRefundType != null and personalRefundType != ''">
and personal_refund_type = #{personalRefundType}
</if>
<if test="businessRefundDesc != null and businessRefundDesc != ''">
and business_refund_desc = #{businessRefundDesc}
</if>
<if test="rejectionDesc != null and rejectionDesc != ''">
and rejection_desc = #{rejectionDesc}
</if>
<if test="createZdyUserId != null ">
and create_zdy_user_id = #{createZdyUserId}
</if>
<if test="createSysUserId != null ">
and create_sys_user_id = #{createSysUserId}
</if>
<if test="updaterId != null ">
and updater_id = #{updaterId}
</if>
</where>
</select>
<select id="selectZdyHotelHomestayOrderRefundById" parameterType="Long"
resultMap="ZdyHotelHomestayOrderRefundResult">
<include refid="selectZdyHotelHomestayOrderRefundVo"/>
where id = #{id}
</select>
<insert id="insertZdyHotelHomestayOrderRefund" parameterType="ZdyHotelHomestayOrderRefund" useGeneratedKeys="true"
keyProperty="id">
insert into zdy_hotel_homestay_order_refund
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,
</if>
<if test="orderCode != null and orderCode != ''">order_code,
</if>
<if test="refundCode != null and refundCode != ''">refund_code,
</if>
<if test="orderPrepayId != null">order_prepay_id,
</if>
<if test="refundSource != null">refund_source,
</if>
<if test="totalAmount != null">total_amount,
</if>
<if test="penaltyFee != null">penalty_fee,
</if>
<if test="actualAmount != null">actual_amount,
</if>
<if test="refundStatus != null and refundStatus != ''">refund_status,
</if>
<if test="refundTime != null">refund_time,
</if>
<if test="personalRefundType != null">personal_refund_type,
</if>
<if test="businessRefundDesc != null">business_refund_desc,
</if>
<if test="rejectionDesc != null">rejection_desc,
</if>
<if test="auditTime != null">audit_time,
</if>
<if test="createZdyUserId != null">create_zdy_user_id,
</if>
<if test="createSysUserId != null">create_sys_user_id,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updaterId != null">updater_id,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},
</if>
<if test="orderCode != null and orderCode != ''">#{orderCode},
</if>
<if test="refundCode != null and refundCode != ''">#{refundCode},
</if>
<if test="orderPrepayId != null">#{orderPrepayId},
</if>
<if test="refundSource != null">#{refundSource},
</if>
<if test="totalAmount != null">#{totalAmount},
</if>
<if test="penaltyFee != null">#{penaltyFee},
</if>
<if test="actualAmount != null">#{actualAmount},
</if>
<if test="refundStatus != null and refundStatus != ''">#{refundStatus},
</if>
<if test="refundTime != null">#{refundTime},
</if>
<if test="personalRefundType != null">#{personalRefundType},
</if>
<if test="businessRefundDesc != null">#{businessRefundDesc},
</if>
<if test="rejectionDesc != null">#{rejectionDesc},
</if>
<if test="auditTime != null">#{auditTime},
</if>
<if test="createZdyUserId != null">#{createZdyUserId},
</if>
<if test="createSysUserId != null">#{createSysUserId},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updaterId != null">#{updaterId},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateZdyHotelHomestayOrderRefund" parameterType="ZdyHotelHomestayOrderRefund">
update zdy_hotel_homestay_order_refund
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id =
#{orderId},
</if>
<if test="orderCode != null and orderCode != ''">order_code =
#{orderCode},
</if>
<if test="refundCode != null and refundCode != ''">refund_code =
#{refundCode},
</if>
<if test="orderPrepayId != null">order_prepay_id =
#{orderPrepayId},
</if>
<if test="refundSource != null">refund_source =
#{refundSource},
</if>
<if test="totalAmount != null">total_amount =
#{totalAmount},
</if>
<if test="penaltyFee != null">penalty_fee =
#{penaltyFee},
</if>
<if test="actualAmount != null">actual_amount =
#{actualAmount},
</if>
<if test="refundStatus != null and refundStatus != ''">refund_status =
#{refundStatus},
</if>
<if test="refundTime != null">refund_time =
#{refundTime},
</if>
<if test="personalRefundType != null">personal_refund_type =
#{personalRefundType},
</if>
<if test="businessRefundDesc != null">business_refund_desc =
#{businessRefundDesc},
</if>
<if test="rejectionDesc != null">rejection_desc =
#{rejectionDesc},
</if>
<if test="auditTime != null">audit_time =
#{auditTime},
</if>
<if test="createZdyUserId != null">create_zdy_user_id =
#{createZdyUserId},
</if>
<if test="createSysUserId != null">create_sys_user_id =
#{createSysUserId},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updaterId != null">updater_id =
#{updaterId},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<update id="updateByOrderCodeAndRefundCode" parameterType="ZdyHotelHomestayOrderRefund">
update zdy_hotel_homestay_order_refund
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id =
#{orderId},
</if>
<if test="orderPrepayId != null">order_prepay_id =
#{orderPrepayId},
</if>
<if test="refundSource != null">refund_source =
#{refundSource},
</if>
<if test="totalAmount != null">total_amount =
#{totalAmount},
</if>
<if test="penaltyFee != null">penalty_fee =
#{penaltyFee},
</if>
<if test="actualAmount != null">actual_amount =
#{actualAmount},
</if>
<if test="refundStatus != null and refundStatus != ''">refund_status =
#{refundStatus},
</if>
<if test="refundTime != null">refund_time =
#{refundTime},
</if>
<if test="personalRefundType != null">personal_refund_type =
#{personalRefundType},
</if>
<if test="businessRefundDesc != null">business_refund_desc =
#{businessRefundDesc},
</if>
<if test="rejectionDesc != null">rejection_desc =
#{rejectionDesc},
</if>
<if test="auditTime != null">audit_time =
#{auditTime},
</if>
<if test="createZdyUserId != null">create_zdy_user_id =
#{createZdyUserId},
</if>
<if test="createSysUserId != null">create_sys_user_id =
#{createSysUserId},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updaterId != null">updater_id =
#{updaterId},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where
order_code = #{orderCode}
and refund_code = #{refundCode}
</update>
<select id="getByOrderCodeAndRefundCode" resultMap="ZdyHotelHomestayOrderRefundResult">
<include refid="selectZdyHotelHomestayOrderRefundVo"/>
where
order_code = #{orderCode}
and refund_code = #{refundCode}
</select>
<select id="getLastByOrderIdAndStatus" resultMap="ZdyHotelHomestayOrderRefundResult">
<include refid="selectZdyHotelHomestayOrderRefundVo"/>
where order_id = #{orderId}
and refund_status = #{refundStatus}
order by create_time desc
${"limit 1"}
</select>
</mapper>