package com.cool.store.mapper;

import com.cool.store.entity.LinePayDO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @author wxp
 * @date 2024-03-27 09:25
 */
public interface LinePayMapper  {
    /**
     *
     * 默认插入方法，只会给有值的字段赋值
	 * 会对传进来的字段做判空处理，如果字段为空，则使用数据库默认字段或者null
     * dateTime:2024-03-27 09:25
     */
    int insertSelective(LinePayDO record);

    /**
     *
     * 默认查询方法，通过主键获取所有字段的值
     * dateTime:2024-03-27 09:25
     */
    LinePayDO selectByPrimaryKey(Long id);

    /**
     *
     * 默认更新方法，根据主键更新，不会把null值更新到数据库，避免覆盖之前有值的
     * dateTime:2024-03-27 09:25
     */
    int updateByPrimaryKeySelective(LinePayDO record);

    /**
     *
     * 默认更新方法，根据主键物理删除
     * dateTime:2024-03-27 09:25
     */
    int deleteByPrimaryKey(Long id);

    LinePayDO getLinePayByLineId(@Param("lineId") Long lineId);

    LinePayDO getByLineIdAndPayTypeAndShopId(@Param("lineId") Long lineId,
                                           @Param("payBusinessType")Integer payBusinessType,
                                           @Param("shopId") Long shopId);

    /**
     * getLinePayByLineIds
     * @param lineIds
     * @return
     */
    List<LinePayDO> getLinePayByLineIds(@Param("lineIds") List<Long> lineIds, @Param("shopIds") List<Long> shopIds, @Param("businessType") Integer businessType);

    void updateByPidAndLid(@Param("lineId") Long lineId,
                           @Param("partnerId") String partnerId,
                           @Param("auditId") Long auditId);

    List<LinePayDO>getFranchiseFeePayInfoByShopId(@Param("shopId") Long shopId);

    Integer deleteById(@Param("id") Long id,@Param("userId")String userId);

    LinePayDO selectByPaymentReceiptCode(@Param("paymentReceiptCode") String  paymentReceiptCode);
    //数据处理专用0604，查询加盟费阶段缴费信息
    List<LinePayDO> getDateHandler();

     Integer dataUpdateLinePay(@Param("list") List<LinePayDO> linePayDOList);

    Integer updateXgjClaimStatus(@Param("list") List<Long> shopIds,@Param("xgjClaimStatus") Integer xgjClaimStatus,@Param("payBusinessType") Integer payBusinessType);

    Integer deleteByShopId(@Param("list")List<Long> shopIds);

    LinePayDO getLastPay(@Param("shopId") Long shopId);
}