| | |
| | | package com.wgcloud.service; |
| | | |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.wgcloud.entity.FailureLogging; |
| | | import com.wgcloud.entity.InspectionTask; |
| | | import com.wgcloud.entity.TaskInfo; |
| | | import com.wgcloud.mapper.TaskInfoMapper; |
| | | import com.wgcloud.util.UUIDUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author kdq |
| | |
| | | private TaskInfoMapper taskInfoMapper; |
| | | |
| | | public void save(TaskInfo taskInfo) throws Exception { |
| | | taskInfo.setId(UUIDUtil.getUUID()); |
| | | taskInfoMapper.save(taskInfo); |
| | | } |
| | | |
| | | public void saveAll(List<TaskInfo> taskInfos) throws Exception { |
| | | taskInfoMapper.insertList(taskInfos); |
| | | } |
| | | |
| | | public List<TaskInfo> getAllByTaskId(String id) { |
| | | return taskInfoMapper.getAllByTaskId(id); |
| | | } |
| | | |
| | | public PageInfo selectByParams(Map<String, Object> params, Integer currPage, Integer pageSize) throws Exception { |
| | | PageHelper.startPage(currPage, pageSize); |
| | | List<TaskInfo> list = taskInfoMapper.selectByParams(params); |
| | | PageInfo<TaskInfo> pageInfo = new PageInfo<TaskInfo>(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | public TaskInfo selectById(String id) throws Exception { |
| | | return taskInfoMapper.selectById(id); |
| | | } |
| | | |
| | | public void updateById(TaskInfo taskInfo) { |
| | | taskInfoMapper.updateById(taskInfo); |
| | | } |
| | | |
| | | public List<TaskInfo> selectAllByParams(Map<String, Object> params) throws Exception { |
| | | return taskInfoMapper.selectAllByParams(params); |
| | | } |
| | | } |