package net.northking.cctp.dw.db.impl;

import net.northking.cctp.common.db.BasicDao;
import net.northking.cctp.common.db.PaginationService;
import net.northking.cctp.dw.db.dao.DwAtuPlanScriptLinkDao;
import net.northking.cctp.dw.db.entity.DwAtuPlanScriptLink;
import net.northking.cctp.dw.db.service.DwAtuPlanScriptLinkService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.stereotype.Service;

@Service
@ConditionalOnMissingBean(name = "DwAtuPlanScriptLinkServiceImpl")
public class DwAtuPlanScriptLinkServiceImpl extends PaginationService<DwAtuPlanScriptLink> implements DwAtuPlanScriptLinkService {
    private static final Logger logger = LoggerFactory.getLogger(DwAtuPlanScriptLinkServiceImpl.class);

    private final DwAtuPlanScriptLinkDao dwAtuPlanScriptLinkDao;

    public DwAtuPlanScriptLinkServiceImpl(DwAtuPlanScriptLinkDao dwAtuPlanScriptLinkDao) {
        this.dwAtuPlanScriptLinkDao = dwAtuPlanScriptLinkDao;
    }

    @Override
    protected void beforeInsert(DwAtuPlanScriptLink dwAtuPlanScriptLink) {

    }

    @Override
    protected void beforeUpdate(DwAtuPlanScriptLink dwAtuPlanScriptLink) {

    }

    @Override
    public DwAtuPlanScriptLink createEntity() {
        return new DwAtuPlanScriptLink();
    }

    @Override
    public BasicDao<DwAtuPlanScriptLink> getDao() {
        return dwAtuPlanScriptLinkDao;
    }

    @Override
    public Integer deleteByPlanIdAndScriptId(String planId, String scriptId) {
        return dwAtuPlanScriptLinkDao.deleteByPlanIdAndScriptId(planId,scriptId);
    }
}
