package com.sonic.lion.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sonic.lion.domain.entity.UserSubscriptionNotify;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface UserSubscriptionNotifyDao extends BaseMapper<UserSubscriptionNotify> {

    @Update("update user_subscription_notify set status = #{status}  where id =#{id} ")
    int updateStatus(@Param("id") Long id, @Param("status") String status);

    @Update("update user_subscription_notify set status = #{status}, subscription_id = #{subscriptionId}  where id =#{id} ")
    int updateStatusAndSubscriptionId(@Param("id") Long id, @Param("status") String status, @Param("subscriptionId") String subscriptionId);

    @Update("update user_subscription_notify set subscription_id = #{subscriptionId}  where id =#{id} ")
    int setSubscriptionId(@Param("id") Long id, @Param("subscriptionId") String subscriptionId);


    @Update("update user_subscription_notify set extend = #{extend}  where id =#{id} ")
    int updateNotifyExtend(@Param("id") Long id, @Param("extend") String extend);


    @Update("update user_subscription_notify set apple_refund_record_id = #{appleRefundRecordId}, extend = #{extend}  where id =#{id} ")
    int updateNotifyExtend(@Param("id") Long id, @Param("appleRefundRecordId") Long appleRefundRecordId, @Param("extend") String extend);
}
