Obsidian/Recognition/zzz.resources/DbService.java

46 lines
1.1 KiB
Java
Raw Permalink Normal View History

2023-08-14 16:19:25 +00:00
package kr.gmtc.eyegw.service;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import kr.gmtc.eyegw.db.vo.ServiceStatusVO;
import kr.gmtc.eyegw.parser.vo.StaticVO;
import kr.gmtc.eyegw.mapper.dao5.Db5Mapper;
@Service("dbService")
public class DbService {
@Autowired
private Db5Mapper db5Mapper;
@Autowired
private SqlSessionTemplate batchDb5SqlSessionTemplate;
public int getDb5Ping() throws Exception {
int result = 0;
try {
result = db5Mapper.ping();
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
public void insertSSVO(List<ServiceStatusVO> list) throws Exception {
Iterator<ServiceStatusVO> it = list.iterator();
while (it.hasNext()) {
batchDb5SqlSessionTemplate.insert("kr.gmtc.eyegw.mapper.dao5.Db5Mapper.insertServiceStatus", it.next());
}
}
public List<StaticVO> selectShipList() throws Exception{
return batchDb5SqlSessionTemplate.selectList("kr.gmtc.eyegw.mapper.dao5.Db5Mapper.selectShipList");
}
}