2024-06-10 19:03:11 +00:00
|
|
|
<?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">
|
2024-02-15 14:53:45 +00:00
|
|
|
<mapper namespace="com.ruoyi.pay.mapper.PayOrderMapper">
|
2025-03-10 08:46:14 +00:00
|
|
|
|
2024-02-15 14:53:45 +00:00
|
|
|
<resultMap type="PayOrder" id="PayOrderResult">
|
2025-03-10 08:46:14 +00:00
|
|
|
<result property="orderId" column="order_id" />
|
|
|
|
<result property="orderNumber" column="order_number" />
|
|
|
|
<result property="thirdNumber" column="third_number" />
|
|
|
|
<result property="orderStatus" column="order_status" />
|
|
|
|
<result property="totalAmount" column="total_amount" />
|
|
|
|
<result property="actualAmount" column="actual_amount" />
|
|
|
|
<result property="orderContent" column="order_content" />
|
|
|
|
<result property="orderMessage" column="order_message" />
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
<result property="remark" column="remark" />
|
2024-02-15 14:53:45 +00:00
|
|
|
</resultMap>
|
|
|
|
|
2024-06-10 19:03:11 +00:00
|
|
|
<sql id="selectPayOrderVo">
|
|
|
|
select order_id, order_number, order_status, total_amount, actual_amount, order_content, order_message, create_by, create_time, update_by, update_time, remark from pay_order
|
|
|
|
</sql>
|
2024-02-15 14:53:45 +00:00
|
|
|
|
|
|
|
<select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
|
2024-06-10 19:03:11 +00:00
|
|
|
<include refid="selectPayOrderVo"/>
|
2025-03-10 08:46:14 +00:00
|
|
|
<where>
|
2024-03-30 07:08:55 +00:00
|
|
|
<if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
|
2025-03-10 06:33:06 +00:00
|
|
|
<if test="thirdNumber != null and thirdNumber != ''"> and third_number = #{thirdNumber}</if>
|
2024-03-30 07:08:55 +00:00
|
|
|
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
|
|
|
|
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount}</if>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="actualAmount != null and actualAmount != ''"> and actual_amount = #{actualAmount}</if>
|
|
|
|
<if test="orderContent != null and orderContent != ''"> and order_content = #{orderContent}</if>
|
|
|
|
<if test="orderMessage != null and orderMessage != ''"> and order_message = #{orderMessage}</if>
|
2024-02-15 14:53:45 +00:00
|
|
|
</where>
|
|
|
|
</select>
|
2025-03-10 08:46:14 +00:00
|
|
|
|
2024-02-15 14:53:45 +00:00
|
|
|
<select id="selectPayOrderByOrderId" parameterType="Long" resultMap="PayOrderResult">
|
2024-06-10 19:03:11 +00:00
|
|
|
<include refid="selectPayOrderVo"/>
|
|
|
|
where pay_order.order_id = #{orderId}
|
2024-05-21 08:42:21 +00:00
|
|
|
</select>
|
2025-03-10 08:46:14 +00:00
|
|
|
|
|
|
|
<select id="selectPayOrderByOrderNumber" parameterType="String" resultMap="PayOrderResult">
|
|
|
|
<include refid="selectPayOrderVo"/>
|
|
|
|
where pay_order.order_number = #{orderNumber}
|
|
|
|
</select>
|
|
|
|
|
2024-06-10 19:03:11 +00:00
|
|
|
<insert id="insertPayOrder" parameterType="PayOrder" useGeneratedKeys="true" keyProperty="orderId">
|
|
|
|
insert into pay_order
|
2024-05-21 08:42:21 +00:00
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="orderNumber != null">order_number,</if>
|
2025-03-10 06:33:06 +00:00
|
|
|
<if test="thirdNumber != null">third_number,</if>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="orderStatus != null">order_status,</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="totalAmount != null">total_amount,</if>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="actualAmount != null">actual_amount,</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="orderContent != null">order_content,</if>
|
|
|
|
<if test="orderMessage != null">order_message,</if>
|
2024-06-10 19:03:11 +00:00
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
<if test="remark != null">remark,</if>
|
2025-03-10 08:46:14 +00:00
|
|
|
</trim>
|
2024-05-21 08:42:21 +00:00
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="orderNumber != null">#{orderNumber},</if>
|
2025-03-10 06:33:06 +00:00
|
|
|
<if test="thirdNumber != null">#{thirdNumber},</if>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="orderStatus != null">#{orderStatus},</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="totalAmount != null">#{totalAmount},</if>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="actualAmount != null">#{actualAmount},</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="orderContent != null">#{orderContent},</if>
|
|
|
|
<if test="orderMessage != null">#{orderMessage},</if>
|
2024-06-10 19:03:11 +00:00
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
<if test="remark != null">#{remark},</if>
|
2025-03-10 08:46:14 +00:00
|
|
|
</trim>
|
2024-05-21 08:42:21 +00:00
|
|
|
</insert>
|
2024-02-15 14:53:45 +00:00
|
|
|
|
2024-06-10 19:03:11 +00:00
|
|
|
<update id="updatePayOrder" parameterType="PayOrder">
|
|
|
|
update pay_order
|
2024-05-21 08:42:21 +00:00
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="orderNumber != null">order_number = #{orderNumber},</if>
|
2025-03-10 06:33:06 +00:00
|
|
|
<if test="thirdNumber != null">third_number = #{thirdNumber},</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="orderStatus != null">order_status = #{orderStatus},</if>
|
|
|
|
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="actualAmount != null">actual_amount = #{actualAmount},</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="orderContent != null">order_content = #{orderContent},</if>
|
|
|
|
<if test="orderMessage != null">order_message = #{orderMessage},</if>
|
2024-06-10 19:03:11 +00:00
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
</trim>
|
2024-06-10 19:03:11 +00:00
|
|
|
where pay_order.order_id = #{orderId}
|
|
|
|
</update>
|
2024-02-15 14:53:45 +00:00
|
|
|
|
2024-06-10 19:03:11 +00:00
|
|
|
<delete id="deletePayOrderByOrderId" parameterType="Long">
|
|
|
|
delete from pay_order where order_id = #{orderId}
|
2024-05-21 08:42:21 +00:00
|
|
|
</delete>
|
2024-03-30 07:08:55 +00:00
|
|
|
|
2024-05-21 08:42:21 +00:00
|
|
|
<delete id="deletePayOrderByOrderNumber" parameterType="String">
|
2024-03-30 07:08:55 +00:00
|
|
|
delete from pay_order where order_number= #{orderNumber}
|
2024-05-21 08:42:21 +00:00
|
|
|
</delete>
|
2024-02-15 14:53:45 +00:00
|
|
|
|
2024-06-10 19:03:11 +00:00
|
|
|
<delete id="deletePayOrderByOrderIds" parameterType="String">
|
2024-06-06 09:19:05 +00:00
|
|
|
delete from pay_order where order_id in
|
2024-05-21 08:42:21 +00:00
|
|
|
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
2024-06-06 09:19:05 +00:00
|
|
|
#{orderId}
|
2024-05-21 08:42:21 +00:00
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<update id="updateStatus" parameterType="String">
|
2024-06-06 09:19:05 +00:00
|
|
|
update pay_order set order_status = #{orderStatus} where order_number = #{orderNumber}
|
2024-05-21 08:42:21 +00:00
|
|
|
</update>
|
2024-02-15 14:53:45 +00:00
|
|
|
</mapper>
|