| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import jdk.nashorn.internal.objects.annotations.Getter; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("afeRectifier") |
| | |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | @PutMapping("updateState1") |
| | | @ApiOperation(value = "更新整流状态-演示使用") |
| | | public Response updateState1(@RequestParam int devId,@RequestParam int rectifierRun){ |
| | | return service.updateState1(devId,rectifierRun); |
| | | } |
| | | |
| | | @PutMapping("updateState2") |
| | | @ApiOperation(value = "更新逆变状态-演示使用") |
| | | public Response updateState2(@RequestParam int devId,@RequestParam int invertRun){ |
| | | return service.updateState2(devId,invertRun); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return service.getOutField(); |
| | | } |
| | | |
| | | @PutMapping("updateState") |
| | | @ApiOperation(value = "更新状态-演示使用") |
| | | public Response updateState(@RequestParam int devId,@RequestParam int switchClose){ |
| | | return service.updateState(devId,switchClose); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return service.getField(); |
| | | } |
| | | |
| | | @PutMapping("updateStatus") |
| | | @ApiOperation(value = "更新状态-演示使用") |
| | | public Response updateStatus(@RequestParam int devId,@RequestParam int switchFaultBusScreen){ |
| | | return service.updateStatus(devId,switchFaultBusScreen); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | return service.getInfoByDevId(devId); |
| | | } |
| | | |
| | | @PutMapping("updateState") |
| | | @ApiOperation(value = "更新状态-演示使用") |
| | | public Response updateState(@RequestParam int devId,@RequestParam int rectifierPowerState){ |
| | | return service.updatePowerState(devId,rectifierPowerState); |
| | | } |
| | | |
| | | @GetMapping("field") |
| | | @ApiOperation(value = "查询告警阈值字段") |
| | | public Response<Map<String, List>> getField(){ |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.whyc.mapper.AFEInverterMapper; |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.AFEInverterState; |
| | | import com.whyc.pojo.AFERectifierState; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | import com.whyc.mapper.CommonMapper; |
| | | import com.whyc.pojo.AFEInverterState; |
| | | import com.whyc.pojo.AFERectifierState; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Wrapper; |
| | |
| | | PageInfo<AFERectifierState> afeInverterStatePageInfo = new PageInfo<>(afeInverterStates); |
| | | return new Response<PageInfo<AFERectifierState>>().set(1,afeInverterStatePageInfo); |
| | | } |
| | | |
| | | |
| | | public Response updateState1(int devId, int rectifierRun) { |
| | | UpdateWrapper<AFERectifierState> wrapper = Wrappers.update(); |
| | | wrapper.set("rectifier_run",rectifierRun).eq("dev_id",devId); |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | |
| | | public Response updateState2(int devId, int invertRun) { |
| | | UpdateWrapper<AFERectifierState> wrapper = Wrappers.update(); |
| | | wrapper.set("invert_run",invertRun).eq("dev_id",devId); |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | |
| | | PageInfo<CentralMonitorSysRT> centralMonitorSysRTPageInfo = new PageInfo<>(centralMonitorSysRTs); |
| | | return new Response<PageInfo<CentralMonitorSysRT>>().set(1,centralMonitorSysRTPageInfo); |
| | | } |
| | | |
| | | public Response updateState(int devId, int switchClose) { |
| | | UpdateWrapper<CentralMonitorSysRT> wrapper = Wrappers.update(); |
| | | wrapper.set("switch_close",switchClose).eq("dev_id",devId); |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | |
| | | return new Response<PageInfo<CentralMonitorSysST>>().set(1,centralMonitorSysSTPageInfo); |
| | | |
| | | } |
| | | |
| | | public Response updateStatus(int devId, int switchFaultBusScreen) { |
| | | UpdateWrapper<CentralMonitorSysST> wrapper = Wrappers.update(); |
| | | wrapper.set("switch_fault_bus_screen",switchFaultBusScreen).eq("dev_id",devId); |
| | | |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | fieldMap.put("fieldValues",fieldValues); |
| | | return new Response<Map<String,List>>().set(1,fieldMap); |
| | | } |
| | | |
| | | public Response updatePowerState(int devId,int rectifierPowerState) { |
| | | UpdateWrapper<RectifierPowerRT> wrapper = Wrappers.update(); |
| | | wrapper.set("rectifier_power_state",rectifierPowerState).eq("dev_id",devId); |
| | | |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | } |