|
@@ -0,0 +1,51 @@
|
|
|
+package com.gyee.impala.controller.sample.cases;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.gyee.impala.common.result.JsonResult;
|
|
|
+import com.gyee.impala.common.result.ResultCode;
|
|
|
+import com.gyee.impala.model.master.Casefaultrepair;
|
|
|
+import com.gyee.impala.model.master.ICasefaultrepairService;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 前端控制器
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author gfhd
|
|
|
+ * @since 2022-10-13
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/case")
|
|
|
+public class CasefaultrepairController {
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ICasefaultrepairService casefaultrepairService;
|
|
|
+
|
|
|
+ @GetMapping("/faultrepair/list")
|
|
|
+ public JSONObject faultRepairList(@RequestParam(value = "windturbineid",required = false) String windturbineid,
|
|
|
+ @RequestParam(value = "starttime",required = false) String starttime,
|
|
|
+ @RequestParam(value = "endtime",required = false) String endtime){
|
|
|
+ QueryWrapper<Casefaultrepair> wrapper = new QueryWrapper<>();
|
|
|
+ wrapper.eq(StringUtils.isNotEmpty(windturbineid),"windturbineid",windturbineid)
|
|
|
+ .gt(StringUtils.isNotEmpty(starttime),"starttime",starttime)
|
|
|
+ .lt(StringUtils.isNotEmpty(endtime),"starttime",endtime)
|
|
|
+ .orderByDesc("starttime");
|
|
|
+ List<Casefaultrepair> list = casefaultrepairService.list(wrapper);
|
|
|
+ return JsonResult.successData(ResultCode.SUCCESS, list);
|
|
|
+ }
|
|
|
+ @PostMapping("/faultrepair/addorupdate")
|
|
|
+ public JSONObject faultRepairAddOrUpdate(@RequestBody Casefaultrepair cf){
|
|
|
+ if(cf.getId()!=null){
|
|
|
+ casefaultrepairService.updateById(cf);
|
|
|
+ }else{
|
|
|
+ casefaultrepairService.save(cf);
|
|
|
+ }
|
|
|
+ return JsonResult.success();
|
|
|
+ }
|
|
|
+}
|