package com.cool.store.dao;

import com.cool.store.dto.FranchiseFeeStageDateDTO;
import com.cool.store.entity.FranchiseFeeDO;
import com.cool.store.mapper.FranchiseFeeMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: WangShuo
 * @Date: 2025/05/12/13:53
 * @Version 1.0
 * @注释:
 */
@Repository
public class FranchiseFeeDAO {
    @Resource
    private FranchiseFeeMapper franchiseFeeMapper;

    public  Integer updateBill( List<FranchiseFeeDO> list){
        if (CollectionUtils.isEmpty(list)){
            return 0;
        }
        return franchiseFeeMapper.updateBill(list);
    }

    public  Integer batchUpdateXgjCollectionStatus(List<Long> shopIds,Integer collectionStatus){
        if (CollectionUtils.isEmpty(shopIds)||  collectionStatus==null){
            return 0;
        }
        return franchiseFeeMapper.batchUpdateXgjCollectionStatus(shopIds,collectionStatus);
    }

    public  Integer batchUpdateXgjCollectionStatusAndXgjFeesPaid(   List<FranchiseFeeStageDateDTO> franchiseFeeStageDateDTOList){
        if (CollectionUtils.isEmpty(franchiseFeeStageDateDTOList)){
            return 0;
        }
        return franchiseFeeMapper.batchUpdateXgjCollectionStatusAndXgjFeesPaid(franchiseFeeStageDateDTOList);
    }
}
