bb81486682a18182c6f1135f996a194efee2a3a3.svn-base 6.4 KB

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