12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package com.gyee.power.fitting.service.impl;
- import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
- import com.gyee.power.fitting.common.base.ExcludeQueryWrapper;
- import com.gyee.power.fitting.model.ProBasicEquipmentPoint;
- import com.gyee.power.fitting.mapper.ProBasicEquipmentPointMapper;
- import com.gyee.power.fitting.service.ProBasicEquipmentPointService;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.cache.annotation.Cacheable;
- import org.springframework.stereotype.Service;
- import java.util.ArrayList;
- import java.util.List;
- /**
- * <p>
- * 设备测点 服务实现类
- * </p>
- *
- * @author chenmh
- * @since 2023-09-22
- */
- @Service
- public class ProBasicEquipmentPointServiceImpl extends ServiceImpl<ProBasicEquipmentPointMapper, ProBasicEquipmentPoint> implements ProBasicEquipmentPointService {
- @Override
- public List<ProBasicEquipmentPoint> selectList(String station, List<String> points) {
- List<ProBasicEquipmentPoint> list = new ArrayList();
- ExcludeQueryWrapper wrapper = new ExcludeQueryWrapper();
- wrapper.eq("windpowerstation_id", station);
- wrapper.in("uniform_code", points);
- try{
- list = baseMapper.selectList(wrapper);
- }catch (Exception e){
- log.error("ProBasicEquipmentPoint--selectList", e);
- }
- return list;
- }
- @Override
- @Cacheable("wtpoint")
- public List<ProBasicEquipmentPoint> getPoints(String station, String windturbine, String uniformcode) {
- QueryWrapper<ProBasicEquipmentPoint> wrapper = new QueryWrapper<>();
- if ("GDC".equals(station)) {
- wrapper.like("windpowerstation_id", "_GDC_STA");
- } else if ("FDC".equals(station)) {
- wrapper.like("windpowerstation_id", "_FDC_STA");
- } else {
- wrapper.eq(StringUtils.isNotEmpty(station), "windpowerstation_id", station);
- }
- wrapper.eq(StringUtils.isNotEmpty(windturbine), "windturbine_id", windturbine);
- wrapper.eq("uniform_code", uniformcode).orderByAsc("windturbine_id");
- return baseMapper.selectList(wrapper);
- }
- }
|