`r`.`deleted_at` IS NULL AND `r`.`store_id` = #{page.storeId} AND `r`.`customer_id` = #{page.customerId} AND `r`.`responsible_user_id` = #{page.responsibleUserId} AND `r`.`status` = #{page.status} AND `r`.`remind_at` >= #{page.beginRemindAt} AND `r`.`remind_at` <= #{page.endRemindAt} UPDATE `gao_customer_follow_up_reminder` SET `status` = 'COMPLETED', `updated_by` = #{updatedBy}, `completed_by` = #{completedBy}, `completed_at` = #{completedAt}, `updated_at` = #{completedAt} WHERE `id` = #{id} AND `status` = 'PENDING' AND `deleted_at` IS NULL UPDATE `gao_customer_follow_up_reminder` SET `sms_notify_detail_id` = #{smsNotifyDetailId}, `updated_at` = FLOOR(UNIX_TIMESTAMP(NOW(3)) * 1000) WHERE `id` IN #{id} AND `status` = 'PENDING' AND `deleted_at` IS NULL AND `sms_notify_enabled` = 1 AND `sms_notify_detail_id` IS NULL 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} )