package com.iailab.module.shasteel.job.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.iailab.framework.common.page.PageData; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.ConvertUtils; import com.iailab.module.shasteel.job.dao.ScheduleJobLogDao; import com.iailab.module.shasteel.job.dto.ScheduleJobLogDTO; import com.iailab.module.shasteel.job.entity.ScheduleJobLogEntity; import com.iailab.module.shasteel.job.service.ScheduleJobLogService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import java.util.Map; @Service public class ScheduleJobLogServiceImpl extends BaseServiceImpl implements ScheduleJobLogService { @Override public PageData page(Map params) { IPage page = baseDao.selectPage( getPage(params, "create_date", false), getWrapper(params) ); return getPageData(page, ScheduleJobLogDTO.class); } private QueryWrapper getWrapper(Map params){ String jobId = (String)params.get("jobId"); QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(jobId), "job_id", jobId); return wrapper; } @Override public ScheduleJobLogDTO get(Long id) { ScheduleJobLogEntity entity = baseDao.selectById(id); return ConvertUtils.sourceToTarget(entity, ScheduleJobLogDTO.class); } }