分账小改动,订单列表优化速度

This commit is contained in:
2025-02-21 17:09:14 +08:00
parent b51b3260c7
commit 1c6e3e3cd3
6 changed files with 39 additions and 8 deletions

View File

@@ -8,11 +8,19 @@
(#{record.scenicId}, #{record.orderId}, #{record.userId}, #{record.userName}, #{record.amount}, #{record.wxAmount}, #{record.manualAmount}, #{record.rateMode}, #{record.wxRate}, #{record.realRate}, #{record.orderAmount}, #{record.createTime})
</foreach>
</insert>
<update id="deleteByScenicIdAndOrderId">
UPDATE profit_sharing_record
SET delete_time = now(), delete_reason = #{reason}
WHERE scenic_id = #{scenicId} AND order_id = #{orderId}
</update>
<select id="list" resultType="com.ycwl.basic.profitsharing.dto.ProfitSharingRecordRespVO">
SELECT r.*, s.name as scenic_name
FROM profit_sharing_record r
LEFT JOIN scenic s ON s.id = r.scenic_id
<where>
<if test="withDeleted != true">
delete_time is null
</if>
<if test="scenicId != null">
AND r.scenic_id = #{scenicId}
</if>