gunshi-project-ss/src/main/java/com/gunshi/project/xyt/service/ReservoirLevelService.java

95 lines
2.6 KiB
Java
Raw Normal View History

2024-02-01 17:25:13 +08:00
package com.gunshi.project.xyt.service;
import com.gunshi.project.xyt.mapper.StResStcdRefMapper;
import com.gunshi.project.xyt.model.StResB;
import com.gunshi.project.xyt.model.StResBAutoDao;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
/**
* TODO
*
* @ClassName ReservoirLevelService
* @Author Huang Qianxiang
* @Date 2024/2/1 15:37
*/
@Service
@Slf4j
@Transactional(rollbackFor = Exception.class)
public class ReservoirLevelService {
@Resource
private StResBAutoDao stResBAutoDao;
@Resource
private StResStcdRefMapper stResStcdRefMapper;
/**
* ID
* @param resId ID
* @return
*/
public BigDecimal queryChfllvByResId(String resId){
StResB stResB = stResBAutoDao.getById(resId);
if (stResB == null){
throw new IllegalArgumentException("该水库ID不存在");
}
return stResB.getChfllv();
}
/**
* ID
* @param resId ID
* @return
*/
public BigDecimal queryFlLowLimLevByResId(String resId){
StResB stResB = stResBAutoDao.getById(resId);
if (stResB == null){
throw new IllegalArgumentException("该水库ID不存在");
}
return stResB.getFlLowLimLev();
}
/**
* ID
* @param resId ID
* @return
*/
public BigDecimal queryTotCapByResId(String resId){
StResB stResB = stResBAutoDao.getById(resId);
if (stResB == null){
throw new IllegalArgumentException("该水库ID不存在");
}
return stResB.getTotCap();
}
/**
* ID
* @param resId ID
* @return
*/
public BigDecimal queryDeadLevByResId(String resId){
StResB stResB = stResBAutoDao.getById(resId);
if (stResB == null){
throw new IllegalArgumentException("该水库ID不存在");
}
return stResB.getDeadLev();
}
/**
* ID
* @param resId ID
* @return
*/
public BigDecimal queryRzByResId(String resId){
StResB stResB = stResBAutoDao.getById(resId);
if (stResB == null){
throw new IllegalArgumentException("该水库ID不存在");
}
return stResStcdRefMapper.queryRzByResId(resId);
}
}