package com.zy.asrs.service.impl;
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
import com.zy.asrs.entity.BasDevpErrLog;
|
import com.zy.asrs.mapper.BasDevpErrLogMapper;
|
import com.zy.asrs.service.BasDevpErrLogService;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
@Service("basDevpErrLogService")
|
public class BasDevpErrLogServiceImpl extends ServiceImpl<BasDevpErrLogMapper, BasDevpErrLog> implements BasDevpErrLogService {
|
|
@Override
|
public BasDevpErrLog findLatestByTaskNo(Integer sourceStaNo, Integer taskNo) {
|
List<BasDevpErrLog> basErrLogs = this.baseMapper.selectList(new EntityWrapper<BasDevpErrLog>().eq("source_sta_no", sourceStaNo).eq("wrk_no", taskNo).orderBy("start_time", false));
|
if (basErrLogs == null || basErrLogs.size() == 0) {
|
return null;
|
} else {
|
return basErrLogs.get(0);
|
}
|
}
|
|
@Override
|
public BasDevpErrLog findLatest(Integer sourceStaNo) {
|
List<BasDevpErrLog> basErrLogs = this.baseMapper.selectList(new EntityWrapper<BasDevpErrLog>().eq("source_sta_no", sourceStaNo).orderBy("start_time", false));
|
if (basErrLogs == null || basErrLogs.size() == 0) {
|
return null;
|
} else {
|
return basErrLogs.get(0);
|
}
|
}
|
|
}
|