update point tier rule
This commit is contained in:
@@ -26,6 +26,39 @@
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<select id="countByEventIdAndNumberValue" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
FROM `gao_event_record`
|
||||
WHERE
|
||||
`event_id` = #{eventId}
|
||||
AND `number_value` IS NOT NULL
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<select id="sumNumberValue" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COALESCE(SUM(`number_value`), 0)
|
||||
FROM `gao_event_record`
|
||||
WHERE
|
||||
`store_id` = #{storeId}
|
||||
AND `customer_id` = #{customerId}
|
||||
AND `event_id` = #{eventId}
|
||||
AND `registered_at` >= #{beginAt}
|
||||
AND `registered_at` < #{endAt}
|
||||
AND `deleted_at` IS NULL
|
||||
</select>
|
||||
|
||||
<update id="updateEarnedPointValue">
|
||||
UPDATE `gao_event_record`
|
||||
SET
|
||||
`earned_point_value` = #{earnedPointValue},
|
||||
`updated_at` = ROUND(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3)) * 1000)
|
||||
WHERE
|
||||
`id` = #{id}
|
||||
AND `deleted_at` IS NULL
|
||||
</update>
|
||||
|
||||
<select id="countByStoreIdAndRegisteredDateValue" resultType="java.lang.Long">
|
||||
SELECT
|
||||
COUNT(1)
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
AND (`begin_at` IS NULL OR `begin_at` <= #{now})
|
||||
AND (`end_at` IS NULL OR #{now} <= `end_at`)
|
||||
AND `deleted_at` IS NULL
|
||||
ORDER BY `priority` ASC, `created_at` ASC, `id` ASC
|
||||
ORDER BY `priority`, `created_at`, `id`
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user