package com.cool.store.dao;

import com.cool.store.entity.OpeningAcceptanceDO;
import com.cool.store.mapper.OpeningAcceptanceMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;

@Slf4j
@Repository
public class OpeningAcceptanceMapperDAO {

    @Resource
    private OpeningAcceptanceMapper openingAcceptanceMapper;

    public Integer addOpeningAcceptance(OpeningAcceptanceDO openingAcceptanceDO){
        return openingAcceptanceMapper.insert(openingAcceptanceDO);
    }

    public Integer updateOpeningAcceptance(OpeningAcceptanceDO openingAcceptanceDO){
        return openingAcceptanceMapper.updateByPrimaryKeySelective(openingAcceptanceDO);
    }

    public OpeningAcceptanceDO getOpeningAcceptanceByShopId(Long shopId){
        if (shopId == null){
            return null;
        }
        return openingAcceptanceMapper.getOpeningAcceptanceByShopId(shopId);
    }




}
