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

import cn.com.ctop.kuaishou.modules.ai.entity.AiKuaishouStrategyTargetBase;
import cn.com.ctop.kuaishou.modules.ai.mapper.AiKuaishouStrategyTargetBaseMapper;
import cn.com.ctop.kuaishou.modules.ai.service.IAiKuaishouStrategyTargetBaseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 定向基础表
 * @author jeecg-boot
 * @date   2020-12-15
 * @version V1.0
 */
@Service
public class AiKuaishouStrategyTargetBaseServiceImpl extends ServiceImpl<AiKuaishouStrategyTargetBaseMapper, AiKuaishouStrategyTargetBase> implements IAiKuaishouStrategyTargetBaseService {

    @Override
    public List<AiKuaishouStrategyTargetBase> listByType(String testDirection) {
        QueryWrapper<AiKuaishouStrategyTargetBase>queryWrapper =new QueryWrapper<>();
        if(null!=testDirection&&!"".equals(testDirection.trim())){
            queryWrapper.eq("target_type",testDirection);
        }
        queryWrapper.eq("status",1);
        return this.list(queryWrapper);
    }
}
