d5e8b316069dcce0db5655105f8f4ab7f297b4ee.svn-base 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. package com.cockpit.dao;
  2. import java.sql.SQLException;
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. import java.util.Map;
  6. import java.util.HashMap;
  7. import org.slf4j.LoggerFactory;
  8. import com.cockpit.util.CockpitUtil;
  9. import com.cockpit.vo.Position;
  10. import com.cockpit.vo.YiJiZiYuan;
  11. public class MapDao extends ConnDaoImpl {
  12. private static final org.slf4j.Logger log = LoggerFactory.getLogger(MapDao.class);
  13. private CockpitUtil cutil = new CockpitUtil();
  14. public List<Position> getBmapPosXY(String sql){
  15. log.info("根据DEPT_ID查询百度坐标SQL:"+sql);
  16. List<Position> list = new ArrayList<Position>();
  17. rs = executeQuery(sql);
  18. try{
  19. while(rs.next()){
  20. Position pos = new Position();
  21. pos.setDEPT_ID(rs.getString("DEPT_ID"));
  22. pos.setPOS_X(rs.getString("POS_X"));
  23. pos.setPOS_Y(rs.getString("POS_Y"));
  24. list.add(pos);
  25. }
  26. return list;
  27. } catch (SQLException e) {
  28. log.error("根据DEPT_ID查询百度坐标SQL错误:"+ sql);
  29. } finally { closeAll(); }
  30. return null;
  31. }
  32. public Map<String, YiJiZiYuan> getYingjiziyuanNative(String sql, String wn, String flag, String dept_id){
  33. StringBuffer sb = new StringBuffer();
  34. sb.append("[");
  35. rs = executeQuerySetPs(sql, wn, flag, dept_id);
  36. log.info("应急处置_应急资源SQL:"+sql);
  37. Map<String, YiJiZiYuan> zy = new HashMap<String, YiJiZiYuan>();
  38. try {
  39. while(rs.next()){
  40. YiJiZiYuan zyEmpty = new YiJiZiYuan();
  41. zyEmpty.setWARNING_NUMBER(rs.getString("WARNING_NUMBER"));
  42. zyEmpty.setDEPT_NAME(rs.getString("DEPT_NAME"));
  43. zyEmpty.setPARENT_ID(rs.getString("PARENT_ID"));
  44. zyEmpty.setSORT(rs.getString("SORT"));
  45. zyEmpty.setCOMP_ID(rs.getString("COMP_ID"));
  46. zyEmpty.setREPORT_ID(rs.getString("REPORT_ID"));
  47. zyEmpty.setPERSON_BD((String)cutil.getResoultByDefault(rs.getString("PERSON_BD"), "0"));
  48. zyEmpty.setCAR_BD((String)cutil.getResoultByDefault(rs.getString("CAR_BD"), "0"));
  49. zyEmpty.setFADIAN_CAR_BD((String)cutil.getResoultByDefault(rs.getString("FADIAN_CAR_BD"), "0"));
  50. zyEmpty.setFADIAN_JI_BD((String)cutil.getResoultByDefault(rs.getString("FADIAN_JI_BD"), "0"));
  51. zyEmpty.setPERSON_KQ("0");
  52. zyEmpty.setCAR_KQ("0");
  53. zyEmpty.setFADIAN_CAR_KQ("0");
  54. zyEmpty.setFADIAN_JI_KQ("0");
  55. zyEmpty.setDATA_TYPE((String)cutil.getResoultByDefault(rs.getString("DATA_TYPE"), ""));
  56. zyEmpty.setREPORTER_ID(rs.getString("REPORTER_ID"));
  57. zyEmpty.setAPPEAR_TIME(rs.getString("APPEAR_TIME"));
  58. zyEmpty.setSEND_TIME(rs.getString("SEND_TIME"));
  59. zyEmpty.setREPORTER(rs.getString("REPORTER"));
  60. zy.put(rs.getString("COMP_ID"), zyEmpty);
  61. }
  62. return zy ;
  63. } catch (SQLException e) {
  64. log.error("驾驶舱__处置__应急资源_本地队伍/发电车/发电机查询错误:"+e.getMessage());
  65. } finally { closeAll(); }
  66. return null;
  67. }
  68. public Map<String, YiJiZiYuan> getYingjiziyuanCross(String sql, String wn, String flag, String dept_id,Map<String,YiJiZiYuan> map){
  69. StringBuffer sb = new StringBuffer();
  70. sb.append("[");
  71. rs = executeQuerySetPs(sql, wn, flag, dept_id);
  72. try {
  73. while(rs.next()){
  74. YiJiZiYuan zyEmpty ;
  75. zyEmpty = map.get(rs.getString("COMP_ID"));
  76. if(zyEmpty==null){
  77. zyEmpty = new YiJiZiYuan();
  78. zyEmpty.setWARNING_NUMBER(rs.getString("WARNING_NUMBER"));
  79. zyEmpty.setDEPT_NAME(rs.getString("DEPT_NAME"));
  80. zyEmpty.setPARENT_ID(rs.getString("PARENT_ID"));
  81. zyEmpty.setSORT(rs.getString("SORT"));
  82. zyEmpty.setCOMP_ID(rs.getString("COMP_ID"));
  83. zyEmpty.setREPORT_ID(rs.getString("REPORT_ID"));
  84. zyEmpty.setPERSON_KQ((String)cutil.getResoultByDefault(rs.getString("PERSON_KQ"), "0"));
  85. zyEmpty.setCAR_KQ((String)cutil.getResoultByDefault(rs.getString("CAR_KQ"), "0"));
  86. zyEmpty.setFADIAN_CAR_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_CAR_KQ"), "0"));
  87. zyEmpty.setFADIAN_JI_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_JI_KQ"), "0"));
  88. zyEmpty.setDATA_TYPE((String)cutil.getResoultByDefault(rs.getString("DATA_TYPE"), ""));
  89. zyEmpty.setREPORTER_ID(rs.getString("REPORTER_ID"));
  90. zyEmpty.setAPPEAR_TIME(rs.getString("APPEAR_TIME"));
  91. zyEmpty.setSEND_TIME(rs.getString("SEND_TIME"));
  92. zyEmpty.setREPORTER(rs.getString("REPORTER"));
  93. }else{
  94. zyEmpty.setPERSON_KQ((String)cutil.getResoultByDefault(rs.getString("PERSON_KQ"), "0"));
  95. zyEmpty.setCAR_KQ((String)cutil.getResoultByDefault(rs.getString("CAR_KQ"), "0"));
  96. zyEmpty.setFADIAN_CAR_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_CAR_KQ"), "0"));
  97. zyEmpty.setFADIAN_JI_KQ((String)cutil.getResoultByDefault(rs.getString("FADIAN_JI_KQ"), "0"));
  98. }
  99. map.put(rs.getString("COMP_ID"), zyEmpty);
  100. }
  101. return map ;
  102. } catch (SQLException e) {
  103. log.error("驾驶舱__处置__应急资源_跨区队伍/发电车/发电机查询错误:"+e.getMessage());
  104. } finally { closeAll(); }
  105. return null;
  106. }
  107. }