| | |
| | | |
| | | @PutMapping("updateStatus") |
| | | @ApiOperation(value = "更新状态-演示使用") |
| | | public Response updateStatus(@RequestParam int devId,@RequestParam int switchFaultBusScreen){ |
| | | return service.updateStatus(devId,switchFaultBusScreen); |
| | | public Response updateStatus(@RequestParam int devId,@RequestParam int switchCloseBusScreen){ |
| | | return service.updateStatus(devId,switchCloseBusScreen); |
| | | } |
| | | |
| | | /** |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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 oilState){ |
| | | return service.updateStatus(devId,oilState); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | 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 waterState){ |
| | | return service.updateStatus(devId,waterState); |
| | | } |
| | | |
| | | /** |
| | | * ======History====== |
| | | * 历史查询时,因为历史记录是按照日期分表的,如果查询所有的日期表(union)后再分页,会导致速度极慢,故查询按照单个日期查询 |
| | |
| | | |
| | | } |
| | | |
| | | public Response updateStatus(int devId, int switchFaultBusScreen) { |
| | | public Response updateStatus(int devId, int switchCloseBusScreen) { |
| | | UpdateWrapper<CentralMonitorSysST> wrapper = Wrappers.update(); |
| | | wrapper.set("switch_fault_bus_screen",switchFaultBusScreen).eq("dev_id",devId); |
| | | wrapper.set("switch_close_bus_screen",switchCloseBusScreen).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; |
| | |
| | | PageInfo<OilComm> oilCommPageInfo = new PageInfo<>(oilComms); |
| | | return new Response<PageInfo<OilComm>>().set(1,oilCommPageInfo); |
| | | } |
| | | |
| | | public Response updateStatus(int devId, int oilState) { |
| | | UpdateWrapper<OilComm> wrapper = Wrappers.update(); |
| | | wrapper.set("oil_state",oilState).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.mapper.CommonMapper; |
| | | import com.whyc.mapper.WaterCommHistoryMapper; |
| | | import com.whyc.mapper.WaterCommMapper; |
| | | import com.whyc.pojo.OilComm; |
| | | import com.whyc.pojo.UPSComm; |
| | | import com.whyc.pojo.WaterComm; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | PageInfo<WaterComm> waterCommPageInfo = new PageInfo<>(waterComms); |
| | | return new Response<PageInfo<WaterComm>>().set(1,waterCommPageInfo); |
| | | } |
| | | |
| | | public Response updateStatus(int devId, int waterState) { |
| | | UpdateWrapper<WaterComm> wrapper = Wrappers.update(); |
| | | wrapper.set("water_state",waterState).eq("dev_id",devId); |
| | | |
| | | mapper.update(null,wrapper); |
| | | return new Response().setMsg(1,"更新成功"); |
| | | } |
| | | } |