package cn.com.ctop.kuaishou.modules.batch.service.impl;


import cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouCampaignCreate;
import cn.com.ctop.kuaishou.modules.batch.mapper.KuaiShouCampaignCreateMapper;
import cn.com.ctop.kuaishou.modules.batch.service.IKuaiShouCampaignCreateService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: 快手-创建广告计划
 * @Author: jeecg-boot
 * @Date: 2019-07-23
 * @Version: V1.0
 */
@Service
public class KuaiShouCampaignCreateServiceImpl extends ServiceImpl<KuaiShouCampaignCreateMapper, KuaiShouCampaignCreate> implements IKuaiShouCampaignCreateService {
    @Autowired
    private KuaiShouCampaignCreateMapper campaignCreateMapper;

    @Override
    public KuaiShouCampaignCreate selectCampaignByCampaignId(String campaignId) {
        QueryWrapper<KuaiShouCampaignCreate> wrapper = new QueryWrapper<>();
        wrapper.eq("campaign_id", campaignId);
        wrapper.orderByDesc("create_time");
        wrapper.last("limit 1");
        KuaiShouCampaignCreate campaignCreate = campaignCreateMapper.selectOne(wrapper);
        return campaignCreate;
    }
}
