dataease-dm/backend/src/main/java/io/dataease/service/dataset/DataSetTableTaskLogService.java

53 lines
1.8 KiB
Java
Raw Normal View History

package io.dataease.service.dataset;
import io.dataease.base.domain.DatasetTableTaskLog;
import io.dataease.base.domain.DatasetTableTaskLogExample;
import io.dataease.base.mapper.DatasetTableTaskLogMapper;
import io.dataease.base.mapper.ext.ExtDataSetTaskMapper;
import io.dataease.dto.dataset.DataSetTaskLogDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.UUID;
/**
* @Author gin
* @Date 2021/3/4 1:26 下午
*/
@Service
public class DataSetTableTaskLogService {
@Resource
private DatasetTableTaskLogMapper datasetTableTaskLogMapper;
@Resource
private ExtDataSetTaskMapper extDataSetTaskMapper;
public DatasetTableTaskLog save(DatasetTableTaskLog datasetTableTaskLog) {
if (StringUtils.isEmpty(datasetTableTaskLog.getId())) {
datasetTableTaskLog.setId(UUID.randomUUID().toString());
datasetTableTaskLog.setCreateTime(System.currentTimeMillis());
datasetTableTaskLogMapper.insert(datasetTableTaskLog);
} else {
2021-03-25 18:18:44 +08:00
datasetTableTaskLogMapper.updateByPrimaryKeySelective(datasetTableTaskLog);
}
return datasetTableTaskLog;
}
public void delete(String id) {
datasetTableTaskLogMapper.deleteByPrimaryKey(id);
}
public List<DataSetTaskLogDTO> list(DatasetTableTaskLog request) {
return extDataSetTaskMapper.list(request);
}
2021-03-10 18:13:27 +08:00
public void deleteByTaskId(String taskId){
DatasetTableTaskLogExample datasetTableTaskLogExample = new DatasetTableTaskLogExample();
DatasetTableTaskLogExample.Criteria criteria = datasetTableTaskLogExample.createCriteria();
criteria.andTaskIdEqualTo(taskId);
datasetTableTaskLogMapper.deleteByExample(datasetTableTaskLogExample);
}
}