提交 | 用户 | 时间
|
516ef4
|
1 |
package com.iailab.module.shasteel.job.service.impl; |
L |
2 |
|
|
3 |
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
4 |
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
5 |
import com.iailab.framework.common.page.PageData; |
|
6 |
import com.iailab.framework.common.service.impl.BaseServiceImpl; |
|
7 |
import com.iailab.framework.common.util.object.ConvertUtils; |
|
8 |
import com.iailab.module.shasteel.job.dao.ScheduleJobLogDao; |
|
9 |
import com.iailab.module.shasteel.job.dto.ScheduleJobLogDTO; |
|
10 |
import com.iailab.module.shasteel.job.entity.ScheduleJobLogEntity; |
|
11 |
import com.iailab.module.shasteel.job.service.ScheduleJobLogService; |
|
12 |
import org.apache.commons.lang3.StringUtils; |
|
13 |
import org.springframework.stereotype.Service; |
|
14 |
|
|
15 |
import java.util.Map; |
|
16 |
|
|
17 |
@Service |
|
18 |
public class ScheduleJobLogServiceImpl extends BaseServiceImpl<ScheduleJobLogDao, ScheduleJobLogEntity> implements ScheduleJobLogService { |
|
19 |
|
|
20 |
@Override |
|
21 |
public PageData<ScheduleJobLogDTO> page(Map<String, Object> params) { |
|
22 |
IPage<ScheduleJobLogEntity> page = baseDao.selectPage( |
94c44e
|
23 |
getPage(params, "create_date", false), |
516ef4
|
24 |
getWrapper(params) |
L |
25 |
); |
|
26 |
return getPageData(page, ScheduleJobLogDTO.class); |
|
27 |
} |
|
28 |
|
|
29 |
private QueryWrapper<ScheduleJobLogEntity> getWrapper(Map<String, Object> params){ |
|
30 |
String jobId = (String)params.get("jobId"); |
|
31 |
|
|
32 |
QueryWrapper<ScheduleJobLogEntity> wrapper = new QueryWrapper<>(); |
|
33 |
wrapper.eq(StringUtils.isNotBlank(jobId), "job_id", jobId); |
|
34 |
|
|
35 |
return wrapper; |
|
36 |
} |
|
37 |
|
|
38 |
@Override |
|
39 |
public ScheduleJobLogDTO get(Long id) { |
|
40 |
ScheduleJobLogEntity entity = baseDao.selectById(id); |
|
41 |
|
|
42 |
return ConvertUtils.sourceToTarget(entity, ScheduleJobLogDTO.class); |
|
43 |
} |
|
44 |
|
|
45 |
} |