Obsidian/Recognition/zzz.resources/WeatherService.java

101 lines
2.9 KiB
Java

package kr.gmtc.eyesvmsg.send.weather;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import gmt.proj.sv_msg.vo.ForeCastVO;
import gmt.proj.sv_msg.vo.WeatherDetailVO;
import gmt.proj.sv_msg.vo.WeatherVO;
import kr.gmtc.eyesvmsg.mapper.dao1.Db1Mapper;
import kr.gmtc.eyesvmsg.mapper.dao2.Db2Mapper;
import kr.gmtc.eyesvmsg.mapper.dao5.Db5Mapper;
@Service("weatherService")
@Transactional(rollbackFor=Exception.class)
public class WeatherService {
@Value("${patch.mode}")
private boolean patchMode = false;
@Value("${test.mode}")
private boolean testMode = false;
@Autowired
private Db1Mapper db1Mapper;
@Autowired
private Db2Mapper db2Mapper;
@Autowired
private Db5Mapper db5Mapper;
public int getPing() throws Exception {
return db2Mapper.ping();
}
public List<ForeCastVO> selectForecastWeatherDate() throws Exception {
// if(patchMode && testMode) {
// return db1Mapper.testSelectForecastWeatherDate();
// } else
if(patchMode && !testMode) {
return db2Mapper.selectForecastWeatherDatePatch();
}else {
return db2Mapper.selectForecastWeatherDate();
}
}
public List<ForeCastVO> selectForecastWeather(String frcst_dt) throws Exception {
// if(patchMode && testMode) {
// return db1Mapper.testSelectForecastWeather(frcst_dt);
// } else
if(patchMode && !testMode) {
return db2Mapper.selectForecastWeatherPatch(frcst_dt);
}else {
return db2Mapper.selectForecastWeather(frcst_dt);
}
}
public List<WeatherVO> selectSendWeather(int process, String samenss_snd_dt) throws Exception {
return db5Mapper.selectSendWeather(process, samenss_snd_dt);
}
public List<WeatherDetailVO> selectSendWeatherDetail(String mssage_id) throws Exception {
return db5Mapper.selectSendWeatherDetail(mssage_id);
}
public int getSendWeatherCnt() {
return db5Mapper.selectSendWeatherCnt();
}
public int insertWeather(WeatherVO weatherVO) throws Exception {
return db5Mapper.insertWeather(weatherVO);
}
public int updateWeatherCnt(String mssage_id, int totCnt) throws Exception {
return db5Mapper.updateWeatherCnt(mssage_id, totCnt);
}
public int updateWeather(String mssage_id) throws Exception {
return db5Mapper.updateWeather(mssage_id);
}
public int updateWeatherProcess(String mssage_id, int process) throws Exception {
return db5Mapper.updateWeatherProcess(mssage_id, process);
}
public int insertWeatherDetail(WeatherDetailVO weatherDetailVO) throws Exception {
return db5Mapper.insertWeatherDetail(weatherDetailVO);
}
public int updateWeatherDetail(WeatherDetailVO weatherDetailVO) throws Exception {
return db5Mapper.updateWeatherDetail(weatherDetailVO);
}
}