2024-03-05 04:06:16 +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">
|
2024-03-05 04:06:16 +00:00
|
|
|
|
2024-02-15 14:53:45 +00:00
|
|
|
<resultMap type="PayOrder" id="PayOrderResult">
|
2024-03-05 04:06:16 +00:00
|
|
|
<result property="orderId" column="order_id" />
|
|
|
|
<result property="userId" column="user_id" />
|
|
|
|
<result property="orderNumber" column="order_number" />
|
|
|
|
<result property="orderStatus" column="order_status" />
|
|
|
|
<result property="totalAmount" column="total_amount" />
|
2024-06-06 09:19:05 +00:00
|
|
|
<result property="actualAmount" column="actual_amount" />
|
2024-03-05 04:06:16 +00:00
|
|
|
<result property="orderContent" column="order_content" />
|
|
|
|
<result property="orderRemark" column="order_remark" />
|
|
|
|
<result property="orderMessage" column="order_message" />
|
2024-02-15 14:53:45 +00:00
|
|
|
</resultMap>
|
|
|
|
|
2024-03-05 04:06:16 +00:00
|
|
|
<sql id="selectPayOrderVo"> select order_id, user_id, order_number, order_status, total_amount,
|
|
|
|
order_content, order_remark, order_message from pay_order </sql>
|
2024-02-15 14:53:45 +00:00
|
|
|
|
|
|
|
<select id="selectPayOrderList" parameterType="PayOrder" resultMap="PayOrderResult">
|
2024-03-05 04:06:16 +00:00
|
|
|
<include refid="selectPayOrderVo" />
|
|
|
|
<where>
|
2024-02-15 14:53:45 +00:00
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
2024-03-30 07:08:55 +00:00
|
|
|
<if test="orderNumber != null and orderNumber != ''"> and order_number = #{orderNumber}</if>
|
|
|
|
<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="orderRemark != null and orderRemark != ''"> and order_remark = #{orderRemark}</if>
|
|
|
|
<if test="orderMessage != null and orderMessage != ''"> and order_message = #{orderMessage}</if>
|
2024-02-15 14:53:45 +00:00
|
|
|
</where>
|
|
|
|
</select>
|
2024-03-05 04:06:16 +00:00
|
|
|
|
2024-02-15 14:53:45 +00:00
|
|
|
<select id="selectPayOrderByOrderId" parameterType="Long" resultMap="PayOrderResult">
|
2024-03-30 07:08:55 +00:00
|
|
|
<include refid="selectPayOrderVo" />
|
2024-05-21 08:42:21 +00:00
|
|
|
where pay_order.order_id = #{orderId}
|
|
|
|
</select>
|
2024-03-05 04:06:16 +00:00
|
|
|
|
|
|
|
<select id="selectPayOrderByOrderNumber" parameterType="String" resultMap="PayOrderResult">
|
2024-03-30 07:08:55 +00:00
|
|
|
<include refid="selectPayOrderVo" />
|
2024-05-21 08:42:21 +00:00
|
|
|
where pay_order.order_number = #{orderNumber}
|
|
|
|
</select>
|
2024-03-05 04:06:16 +00:00
|
|
|
|
2024-05-21 08:42:21 +00:00
|
|
|
<insert id="insertPayOrder" parameterType="PayOrder"> insert into pay_order
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="orderId != null">order_id,</if>
|
|
|
|
<if test="userId != null">user_id,</if>
|
|
|
|
<if test="orderNumber != null">order_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="orderRemark != null">
|
2024-03-05 04:06:16 +00:00
|
|
|
order_remark,</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="orderMessage != null">order_message,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="orderId != null">#{orderId},</if>
|
|
|
|
<if test="userId != null">#{userId},</if>
|
|
|
|
<if test="orderNumber != null">#{orderNumber},</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>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="orderRemark != null">#{orderRemark},</if>
|
2024-05-21 08:42:21 +00:00
|
|
|
<if test="orderMessage != null">#{orderMessage},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
2024-02-15 14:53:45 +00:00
|
|
|
|
2024-05-21 08:42:21 +00:00
|
|
|
<update id="updatePayOrder" parameterType="PayOrder"> update pay_order
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="userId != null">user_id = #{userId},</if>
|
2024-06-06 09:19:05 +00:00
|
|
|
<if test="orderNumber != null">order_number = #{orderNumber},</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="orderRemark != null">order_remark = #{orderRemark},</if>
|
|
|
|
<if test="orderMessage != null">order_message = #{orderMessage},</if>
|
|
|
|
</trim>
|
2024-03-05 04:06:16 +00:00
|
|
|
where pay_order.order_id = #{orderId} </update>
|
2024-02-15 14:53:45 +00:00
|
|
|
|
2024-05-21 08:42:21 +00:00
|
|
|
<delete id="deletePayOrderByOrderId" parameterType="Long">
|
2024-03-30 07:08:55 +00:00
|
|
|
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-05-21 08:42:21 +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>
|