| | |
| | | import com.fgkj.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | |
| | | @RequestMapping("battHistory") |
| | | @RestController |
| | | @Api(tags = "battHistory接口") |
| | | @Api(tags = "battHistory接口 TODO") |
| | | public class Batt_historyController{ |
| | | |
| | | @Resource |
| | | private Batt_historyService service; |
| | | |
| | | //查询所有的历史实时数据 |
| | | //TODO 数据库不同,使用这个表名测试 db_batt_history.tb_batt_910000001_2017_12 |
| | | @GetMapping("serchByCondition") |
| | | @ApiOperation(notes = "TODO 数据库不同表,待测",value="查询所有的历史实时数据") |
| | | public ServiceModel serchByCondition(@RequestBody Batt_history batt_his){ |
| | | // Batt_history batt_his= ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Batt_history.class); |
| | | ServiceModel model=service.serchByCondition(batt_his); |
| | | //TODO 数据库不同,使用这个表名测试 db_batt_history.tb_batt_910000001_2017_12 |
| | | @PostMapping("serchByCondition") |
| | | @ApiOperation(notes = "TODO 数据库不同表字段不同,待测 db_batt_history.tb_batt_910000001_2017_12", value = "查询所有的历史实时数据") |
| | | public ServiceModel serchByCondition(@ApiParam(value = "设备id 910000001", required = true) @RequestParam Integer dev_id, @ApiParam(value = "battGroupId 1005059", required = true) @RequestParam Integer battGroupId, @ApiParam(value = "日期 格式2017/12/29 09:28:31", required = true) @RequestParam Date rec_datetime, @ApiParam(value = "日期 2018/12/29 09:28:31", required = true) @RequestParam Date rec_datetime1) { |
| | | Batt_history batt_his = new Batt_history(); |
| | | batt_his.setDev_id(dev_id); |
| | | batt_his.setBattGroupId(battGroupId); |
| | | batt_his.setRec_datetime(rec_datetime); |
| | | batt_his.setRec_datetime1(rec_datetime1); |
| | | ServiceModel model = service.serchByCondition(batt_his); |
| | | |
| | | return model; |
| | | } |