AdMgrServiceImpl.java 1.07 KB
package com.glsx.service.impl;

import com.glsx.mapper.PlatformAdMapper;
import com.glsx.model.PlatformAd;
import com.glsx.service.AdMgrService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

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

@Service
public class AdMgrServiceImpl implements AdMgrService {
    /**
     * 日志
     */
    private final static Logger LOGGER = LoggerFactory.getLogger(AdMgrServiceImpl.class);

    @Resource
    private PlatformAdMapper adMapper;

    @Override
    public List<PlatformAd> getAdMgrList() {
        return adMapper.getAdMgrList();
    }

    @Override
    public int insertAd(PlatformAd ad) {
        return adMapper.insert(ad);
    }

    @Override
    public int updateAd(PlatformAd ad) {
        return adMapper.updateByPrimaryKeySelective(ad);
    }

    @Override
    public int startandstop(int id, int status) {
        PlatformAd ad = new PlatformAd();
        ad.setId(id);
        ad.setStatus(status);
        return adMapper.updateByPrimaryKeySelective(ad);
    }
}