package com.dy.pipIrrRemote.mqttSd1.soil;
|
|
import com.dy.common.aop.SsoAop;
|
import com.dy.common.webUtil.BaseResponse;
|
import com.dy.common.webUtil.BaseResponseUtils;
|
import com.dy.common.webUtil.QueryResultVo;
|
import com.dy.pipIrrGlobal.voRm.VoSoil;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import lombok.RequiredArgsConstructor;
|
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.RestController;
|
|
import java.util.List;
|
|
/**
|
* @Author: liurunyu
|
* @Date: 2025/6/26 09:31
|
* @Description
|
*/
|
@Slf4j
|
@Tag(name = "墒情数据查询", description = "墒情数据查询")
|
@RestController("rmSoilCtrl")
|
@RequestMapping(path = "soil")
|
@RequiredArgsConstructor
|
public class SoilCtrl {
|
|
private SoilSv sv;
|
|
@Autowired
|
public void setSv(SoilSv sv){
|
this.sv = sv ;
|
}
|
|
/**
|
* 根据指定条件查询最新记录
|
* @param soilId
|
* @return
|
*/
|
@GetMapping(path = "oneLast")
|
@SsoAop()
|
public BaseResponse<VoSoil> oneLast(Long soilId){
|
try {
|
return BaseResponseUtils.buildSuccess(sv.oneLast(soilId));
|
} catch (Exception e) {
|
return BaseResponseUtils.buildException(e.getMessage()) ;
|
}
|
}
|
|
/**
|
* 根据指定条件查询历史记录
|
* @param soilId
|
* @return
|
*/
|
@GetMapping(path = "oneHistory")
|
@SsoAop()
|
public BaseResponse<QueryResultVo<List<VoSoil>>> oneHistory(Long soilId){
|
try {
|
|
return BaseResponseUtils.buildSuccess(sv.oneHistory(soilId));
|
} catch (Exception e) {
|
return BaseResponseUtils.buildException(e.getMessage()) ;
|
}
|
}
|
|
/**
|
* 根据指定条件查询最新记录
|
* @param qo
|
* @return
|
*/
|
@GetMapping(path = "someLast")
|
@SsoAop()
|
public BaseResponse<QueryResultVo<List<VoSoil>>> someLast(SoilQo qo){
|
try {
|
return BaseResponseUtils.buildSuccess(sv.someLast(qo));
|
} catch (Exception e) {
|
return BaseResponseUtils.buildException(e.getMessage()) ;
|
}
|
}
|
|
/**
|
* 根据指定条件查询历史记录
|
* @param qo
|
* @return
|
*/
|
@GetMapping(path = "someHistory")
|
@SsoAop()
|
public BaseResponse<QueryResultVo<List<VoSoil>>> someHistory(SoilQo qo){
|
try {
|
return BaseResponseUtils.buildSuccess(sv.someHistory(qo));
|
} catch (Exception e) {
|
return BaseResponseUtils.buildException(e.getMessage()) ;
|
}
|
}
|
}
|