Obsidian/Recognition/zzz.resources/DbService.java

46 lines
1.1 KiB
Java

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");
}
}