123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- package com.cockpit.dao;
- import java.sql.SQLException;
- import java.util.ArrayList;
- import java.util.List;
- import java.util.Map;
- import java.util.HashMap;
- import org.slf4j.LoggerFactory;
- import com.cockpit.util.CockpitUtil;
- import com.cockpit.vo.Position;
- import com.cockpit.vo.YiJiZiYuan;
- public class MapDao extends ConnDaoImpl {
- private static final org.slf4j.Logger log = LoggerFactory.getLogger(MapDao.class);
-
- private CockpitUtil cutil = new CockpitUtil();
-
- public List<Position> getBmapPosXY(String sql){
- log.info("根据DEPT_ID查询百度坐标SQL:"+sql);
- List<Position> list = new ArrayList<Position>();
-
- rs = executeQuery(sql);
- try{
- while(rs.next()){
- Position pos = new Position();
- pos.setDEPT_ID(rs.getString("DEPT_ID"));
- pos.setPOS_X(rs.getString("POS_X"));
- pos.setPOS_Y(rs.getString("POS_Y"));
- list.add(pos);
- }
- return list;
- } catch (SQLException e) {
- log.error("根据DEPT_ID查询百度坐标SQL错误:"+ sql);
- } finally { closeAll(); }
-
- return null;
- }
-
-
-
-
-
-
- public Map<String, YiJiZiYuan> getYingjiziyuanNative(String sql, String wn, String flag, String dept_id){
- StringBuffer sb = new StringBuffer();
- sb.append("[");
- rs = executeQuerySetPs(sql, wn, flag, dept_id);
- log.info("应急处置_应急资源SQL:"+sql);
- Map<String, YiJiZiYuan> zy = new HashMap<String, YiJiZiYuan>();
- try {
- while(rs.next()){
- YiJiZiYuan zyEmpty = new YiJiZiYuan();
- zyEmpty.setWARNING_NUMBER(rs.getString("WARNING_NUMBER"));
- zyEmpty.setDEPT_NAME(rs.getString("DEPT_NAME"));
- zyEmpty.setPARENT_ID(rs.getString("PARENT_ID"));
- zyEmpty.setSORT(rs.getString("SORT"));
- zyEmpty.setCOMP_ID(rs.getString("COMP_ID"));
- zyEmpty.setREPORT_ID(rs.getString("REPORT_ID"));
- zyEmpty.setPERSON_BD((String)cutil.getResoultByDefault(rs.getString("PERSON_BD"), "0"));
- zyEmpty.setCAR_BD((String)cutil.getResoultByDefault(rs.getString("CAR_BD"), "0"));
- zyEmpty.setFADIAN_CAR_BD((String)cutil.getResoultByDefault(rs.getString("FADIAN_CAR_BD"), "0"));
- zyEmpty.setFADIAN_JI_BD((String)cutil.getResoultByDefault(rs.getString("FADIAN_JI_BD"), "0"));
- zyEmpty.setPERSON_KQ("0");
- zyEmpty.setCAR_KQ("0");
- zyEmpty.setFADIAN_CAR_KQ("0");
- zyEmpty.setFADIAN_JI_KQ("0");
- zyEmpty.setDATA_TYPE((String)cutil.getResoultByDefault(rs.getString("DATA_TYPE"), ""));
- zyEmpty.setREPORTER_ID(rs.getString("REPORTER_ID"));
- zyEmpty.setAPPEAR_TIME(rs.getString("APPEAR_TIME"));
- zyEmpty.setSEND_TIME(rs.getString("SEND_TIME"));
- zyEmpty.setREPORTER(rs.getString("REPORTER"));
-
- zy.put(rs.getString("COMP_ID"), zyEmpty);
-
- }
-
- return zy ;
-
- } catch (SQLException e) {
- log.error("驾驶舱__处置__应急资源_本地队伍/发电车/发电机查询错误:"+e.getMessage());
- } finally { closeAll(); }
-
- return null;
- }
- public Map<String, YiJiZiYuan> getYingjiziyuanCross(String sql, String wn, String flag, String dept_id,Map<String,YiJiZiYuan> map){
- StringBuffer sb = new StringBuffer();
- sb.append("[");
- rs = executeQuerySetPs(sql, wn, flag, dept_id);
-
- try {
- while(rs.next()){
- YiJiZiYuan zyEmpty ;
- zyEmpty = map.get(rs.getString("COMP_ID"));
- if(zyEmpty==null){
- zyEmpty = new YiJiZiYuan();
- zyEmpty.setWARNING_NUMBER(rs.getString("WARNING_NUMBER"));
- zyEmpty.setDEPT_NAME(rs.getString("DEPT_NAME"));
- zyEmpty.setPARENT_ID(rs.getString("PARENT_ID"));
- zyEmpty.setSORT(rs.getString("SORT"));
- zyEmpty.setCOMP_ID(rs.getString("COMP_ID"));
- zyEmpty.setREPORT_ID(rs.getString("REPORT_ID"));
- zyEmpty.setPERSON_KQ((String)cutil.getResoultByDefault(rs.getString("PERSON_KQ"), "0"));
- zyEmpty.setCAR_KQ((String)cutil.getResoultByDefault(rs.getString("CAR_KQ"), "0"));
- zyEmpty.setFADIAN_CAR_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_CAR_KQ"), "0"));
- zyEmpty.setFADIAN_JI_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_JI_KQ"), "0"));
- zyEmpty.setDATA_TYPE((String)cutil.getResoultByDefault(rs.getString("DATA_TYPE"), ""));
- zyEmpty.setREPORTER_ID(rs.getString("REPORTER_ID"));
- zyEmpty.setAPPEAR_TIME(rs.getString("APPEAR_TIME"));
- zyEmpty.setSEND_TIME(rs.getString("SEND_TIME"));
- zyEmpty.setREPORTER(rs.getString("REPORTER"));
- }else{
- zyEmpty.setPERSON_KQ((String)cutil.getResoultByDefault(rs.getString("PERSON_KQ"), "0"));
- zyEmpty.setCAR_KQ((String)cutil.getResoultByDefault(rs.getString("CAR_KQ"), "0"));
- zyEmpty.setFADIAN_CAR_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_CAR_KQ"), "0"));
- zyEmpty.setFADIAN_JI_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_JI_KQ"), "0"));
- }
-
- map.put(rs.getString("COMP_ID"), zyEmpty);
- }
-
- return map ;
-
- } catch (SQLException e) {
- log.error("驾驶舱__处置__应急资源_跨区队伍/发电车/发电机查询错误:"+e.getMessage());
- } finally { closeAll(); }
-
- return null;
- }
- }
-
|