feat(gao): support customer birthdate followup reminder

This commit is contained in:
Timi
2026-11-16 16:23:00 +08:00
parent 32bfdaa116
commit ee33284a2c
24 changed files with 1018 additions and 11 deletions
@@ -75,4 +75,28 @@
AND `sms_notify_enabled` = 1
AND `sms_notify_detail_id` IS NULL
</update>
<select id="selectBirthdayCandidate" resultType="com.imyeyu.api.modules.gao.entity.GaoCustomer">
SELECT `c`.`id`, `c`.`store_id`, `c`.`name`, `c`.`birthdate`, `c`.`birthdate_calendar`
FROM `gao_customer` `c`
WHERE `c`.`deleted_at` IS NULL
AND `c`.`birthdate` IS NOT NULL
AND `c`.`store_id` IN
<foreach collection="storeIdList" item="storeId" separator="," open="(" close=")">
#{storeId}
</foreach>
</select>
<!-- 幂等键冲突说明:uk_gao_customer_follow_up_reminder_source 兜底同门店同客户同来源键只允许一条 -->
<insert id="insertIgnore">
INSERT IGNORE INTO `gao_customer_follow_up_reminder` (
`id`, `store_id`, `customer_id`, `responsible_user_id`, `content`, `remind_at`,
`status`, `source`, `source_key`, `metadata`,
`internal_notify_enabled`, `sms_notify_enabled`, `created_by`, `created_at`
) VALUES (
#{id}, #{storeId}, #{customerId}, #{responsibleUserId}, #{content}, #{remindAt},
#{status}, #{source}, #{sourceKey}, #{metadata},
#{internalNotifyEnabled}, #{smsNotifyEnabled}, #{createdBy}, #{createdAt}
)
</insert>
</mapper>