| | |
| | | |
| | | import cn.gistack.sm.sg.DO.SgDeviceDO; |
| | | import cn.gistack.sm.sg.DO.SgGxStepDO; |
| | | import cn.gistack.sm.sg.DO.SgProgressReportDO; |
| | | import cn.gistack.sm.sg.DTO.SgDeviceSearchDTO; |
| | | import cn.gistack.sm.sg.mapper.SgDeviceMapper; |
| | | import cn.gistack.sm.sg.mapper.SgGxStepMapper; |
| | | import cn.gistack.sm.sg.mapper.SgProgressReportMapper; |
| | | import cn.gistack.sm.sg.service.SgDeviceService; |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class SgDeviceServiceImpl extends ServiceImpl<SgDeviceMapper, SgDeviceDO> implements SgDeviceService { |
| | | @Autowired |
| | | private SgGxStepMapper sgGxStepMapper; |
| | | |
| | | @Autowired |
| | | private SgProgressReportMapper sgProgressReportMapper; |
| | | |
| | | @Override |
| | | public IPage<SgDeviceDO> queryPageList(IPage<SgDeviceDO> page, SgDeviceSearchDTO searchDTO) { |
| | | List<SgDeviceDO> sgDeviceDOS = baseMapper.queryPageList(page,searchDTO); |
| | |
| | | @Override |
| | | public List<SgDeviceDO> getDeviceList(String programId) { |
| | | QueryWrapper<SgDeviceDO> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("program_id",programId); |
| | | queryWrapper.eq("program_id",programId).or() |
| | | .in("device_type", Arrays.asList("sgys", "sgzb")).orderByAsc("create_time"); |
| | | return baseMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<SgGxStepDO> queryStepList(String deviceId) { |
| | | return sgGxStepMapper.queryStepList(deviceId); |
| | | QueryWrapper<SgGxStepDO> queryWrapper = new QueryWrapper<>(); |
| | | if (deviceId.equals("36")) { |
| | | queryWrapper.eq("gx_info_id", 9); |
| | | } else if (deviceId.equals("37")) { |
| | | queryWrapper.eq("gx_info_id", 10); |
| | | } else { |
| | | return sgGxStepMapper.queryStepList(deviceId); |
| | | } |
| | | return sgGxStepMapper.selectList(queryWrapper); |
| | | } |
| | | } |