package com.xxl.job.executor.job.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxl.job.executor.job.entity.JobDistributeInfo;
import com.xxl.job.executor.job.mapper.JobDistributeInfoMapper;
import com.xxl.job.executor.job.service.IJobDistributeInfoService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JobDistributeInfoServiceImpl extends ServiceImpl<JobDistributeInfoMapper, JobDistributeInfo> implements IJobDistributeInfoService {
    @Override
    public List<JobDistributeInfo> selectByParams(String jobType, String mediaType) {
        QueryWrapper<JobDistributeInfo>queryWrapper = new QueryWrapper<>();
        if(null!=jobType&&!"".equals(jobType.trim())){
            queryWrapper.eq("job_type",jobType);
        }
        if(null!=mediaType&&!"".equals(mediaType.trim())){
            queryWrapper.eq("media_type",mediaType);
        }
        queryWrapper.eq("status",1);
        return this.list(queryWrapper);
    }
}
