add gao product

This commit is contained in:
Timi
2026-09-03 10:47:58 +08:00
parent a81c8476e7
commit 731c777b8b
129 changed files with 6298 additions and 1719 deletions
@@ -1,24 +1,14 @@
<?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.imyeyu.api.modules.gao.mapper.GaoCustomerPackageMapper">
<select id="selectByRequestNo" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomerPackage">
SELECT * FROM `gao_customer_package`
WHERE `store_id` = #{storeId} AND `request_no` = #{requestNo}
LIMIT 1
</select>
<select id="selectByRequestNoAnyStore" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomerPackage">
SELECT * FROM `gao_customer_package`
WHERE `request_no` = #{requestNo}
LIMIT 1
</select>
<select id="selectForUpdate" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomerPackage">
SELECT * FROM `gao_customer_package`
WHERE `id` = #{id} AND `deleted_at` IS NULL
FOR UPDATE
</select>
<select id="selectByPurchaseEventRecordId" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomerPackage">
<select id="selectBySalesOrderId" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomerPackage">
SELECT * FROM `gao_customer_package`
WHERE `purchase_event_record_id` = #{purchaseEventRecordId}
WHERE `sales_order_id` = #{salesOrderId} AND `deleted_at` IS NULL
LIMIT 1
</select>
<sql id="queryWhere">
@@ -26,10 +16,6 @@
<if test="storeId != null and storeId != ''">AND p.`store_id` = #{storeId}</if>
<if test="customerId != null and customerId != ''">AND p.`customer_id` = #{customerId}</if>
<if test="status != null">AND p.`status` = #{status}</if>
<if test="paymentStatus != null">AND p.`payment_status` = #{paymentStatus}</if>
<if test="refundStatus != null">AND p.`refund_status` = #{refundStatus}</if>
<if test="beginAt != null">AND p.`purchased_at` &gt;= #{beginAt}</if>
<if test="endAt != null">AND p.`purchased_at` &lt;= #{endAt}</if>
<if test="keyword != null and keyword.trim() != ''">AND (p.`package_name_snapshot` LIKE CONCAT('%', #{keyword}, '%') OR c.`name` LIKE CONCAT('%', #{keyword}, '%') OR c.`code` LIKE CONCAT('%', #{keyword}, '%'))</if>
</sql>
<select id="countByQuery" resultType="long">
@@ -44,19 +30,4 @@
ORDER BY p.`purchased_at` DESC, p.`created_at` DESC
LIMIT #{offset}, #{limit}
</select>
<update id="updatePendingPaidAmountDelta">
UPDATE `gao_customer_package`
SET `pending_paid_amount` = `pending_paid_amount` + #{delta}, `updated_at` = FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000)
WHERE `id` = #{id} AND `deleted_at` IS NULL AND `pending_paid_amount` + #{delta} &gt;= 0
</update>
<update id="updatePaidAmountDelta">
UPDATE `gao_customer_package`
SET `paid_amount` = `paid_amount` + #{delta}, `updated_at` = FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000)
WHERE `id` = #{id} AND `deleted_at` IS NULL AND `paid_amount` + #{delta} &gt;= 0
</update>
<update id="updateStatusIf">
UPDATE `gao_customer_package`
SET `status` = #{toStatus}, `cancelled_at` = #{cancelledAt}, `cancel_operator_user_id` = #{cancelOperatorUserId}, `cancel_reason` = #{cancelReason}, `refund_status` = #{refundStatus}, `updated_at` = FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000)
WHERE `id` = #{id} AND `status` = #{fromStatus} AND `deleted_at` IS NULL
</update>
</mapper>