jinpengyong
2020-07-01 6f70d5babbb4291f2f7b3059144368eb407fe7ed
src/main/java/com/moral/controller/MonitorPointController.java
@@ -6,9 +6,13 @@
import com.moral.service.MonitorPointService;
import org.springframework.web.bind.annotation.*;
import static com.moral.common.util.WebUtils.getParametersStartingWith;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@RestController
@@ -35,7 +39,7 @@
     */
    @GetMapping("get-by-id")
    public ResultBean getById(Integer id){
        MonitorPoint monitorPoint = monitorPointService.selectWithRelationById(id);
        MonitorPoint monitorPoint = monitorPointService.queryWithRelationById(id);
        ResultBean resultBean = new ResultBean(ResultBean.SUCCESS);
        resultBean.setData(monitorPoint);
        return resultBean;
@@ -52,5 +56,12 @@
      List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByName(name);
      return new ResultBean<List<MonitorPoint>>(monitorPoints);
   }
    @GetMapping("list/region")
   public ResultBean<List<MonitorPoint>> getMonitorPointsByRegion(HttpServletRequest request) {
       Map<String, Object> parameters = getParametersStartingWith(request, null);
      List<MonitorPoint> monitorPoints = monitorPointService.getMonitorPointsByRegion(parameters);
      return new ResultBean<List<MonitorPoint>>(monitorPoints);
   }
}