96cae5a1c6c9d0b4b1e6206336edf8cde787d372.svn-base 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. package com.cockpit.dao;
  2. import java.sql.SQLException;
  3. import java.util.ArrayList;
  4. import java.util.List;
  5. import org.slf4j.LoggerFactory;
  6. import com.cockpit.vo.GPSProgramResource;
  7. import com.cockpit.vo.GpsProgram;
  8. public class GridDao extends ConnDaoImpl{
  9. private static final org.slf4j.Logger log = LoggerFactory.getLogger(GridDao.class);
  10. public String getGridNo(String sql){
  11. rs = executeQuery(sql);
  12. try {
  13. if(rs.next()){
  14. return rs.getString("GRIDNO");
  15. }
  16. } catch (SQLException e) {
  17. log.error("装备分布坐标查询错误"+e.getMessage());
  18. } finally { closeAll(); }
  19. return "0";
  20. }
  21. public String getGridNoSetObj(String sql, Object...obj){
  22. rs = executeQuerySetPs(sql, obj);
  23. try {
  24. if(rs.next()){
  25. return rs.getString("GRIDNO");
  26. }
  27. } catch (SQLException e) {
  28. log.error("装备分布坐标查询错误"+e.getMessage());
  29. } finally { closeAll(); }
  30. return "0";
  31. }
  32. public String getLTRes(String sql, String pageNum, String limit){
  33. int pageNo = Integer.parseInt(pageNum);
  34. int pageSize = Integer.parseInt(limit);
  35. StringBuffer sb = new StringBuffer();
  36. sb.append("[");
  37. rs = executeQuerySetPs(sql, (pageNo*pageSize-(pageSize-1)), (pageNo*pageSize));
  38. try {
  39. while(rs.next()){
  40. sb.append("{\"EQUIPMENTNAME\":\"" + rs.getString("EQUIPMENTNAME") + "\",\"VOLLEVEL\":\"" + rs.getString("VOLLEVEL") +
  41. "\",\"AREA\":\"" + rs.getString("AREA") + "\",\"TRIPTIME\":\"" + rs.getString("TRIPTIME") +
  42. "\",\"ONTIME\":\"" + rs.getString("ONTIME") + "\",\"RECLOSE\":\"" + rs.getString("RECLOSE") + "\"},") ;
  43. }
  44. sb.deleteCharAt(sb.length() - 1) ;
  45. if(sb.length()==0){ return "" ; }
  46. sb.append("]");
  47. log.info("线路跳闸表格查询:========" + sb.toString());
  48. return sb.toString() ;
  49. } catch (SQLException e) {
  50. log.error("线路跳闸表格查询错误"+e.getMessage());
  51. } finally { closeAll(); }
  52. return "";
  53. }
  54. public String getHouseGridRes(String sql, String pageNum, String limit){
  55. int pageNo = Integer.parseInt(pageNum);
  56. int pageSize = Integer.parseInt(limit);
  57. StringBuffer sb = new StringBuffer();
  58. sb.append("[");
  59. rs = executeQuerySetPs(sql, (pageNo*pageSize-(pageSize-1)), (pageNo*pageSize));
  60. try {
  61. while(rs.next()){
  62. sb.append("{\"ADMINISTRATIVE_DEPT_NAME\":\"" + rs.getString("ADMINISTRATIVE_DEPT_NAME") +
  63. "\",\"NAME\":\"" + rs.getString("NAME") +
  64. "\",\"MATERIAL_USES\":\"" + rs.getString("MATERIAL_USES") +
  65. "\",\"MODEL\":\"" + rs.getString("MODEL") +
  66. "\",\"MEASUREMENT_UNIT\":\"" + rs.getString("MEASUREMENT_UNIT") +
  67. "\",\"AMOUNT\":\"" + rs.getString("AMOUNT") +
  68. "\",\"WAREHOUSE_SPACE\":\"" + rs.getString("WAREHOUSE_SPACE") +
  69. "\",\"SUPPLIERS\":\"" + rs.getString("SUPPLIERS") +
  70. "\",\"ADMINISTRATIVE_DEPT\":\"" + rs.getString("ADMINISTRATIVE_DEPT") + "\"},") ;
  71. }
  72. sb.deleteCharAt(sb.length() - 1) ;
  73. if(sb.length()==0){ return "" ; }
  74. sb.append("]");
  75. log.info("线路跳闸表格查询:========" + sb.toString());
  76. return sb.toString() ;
  77. } catch (SQLException e) {
  78. log.error("线路跳闸表格查询错误"+e.getMessage());
  79. } finally { closeAll(); }
  80. return "";
  81. }
  82. /**
  83. * 保供电任务详情表
  84. * @param sql
  85. * @param obj
  86. * @return
  87. */
  88. public List<GpsProgram> getGPSProgramInfo(String sql, Object...obj){
  89. List<GpsProgram> list = new ArrayList<GpsProgram>();
  90. rs = executeQuerySetPs(sql, obj);
  91. try {
  92. while(rs.next()){
  93. GpsProgram gp = new GpsProgram();
  94. gp.setENDTIME(rs.getString("ENDTIME"));
  95. gp.setFD_OBJECTID(rs.getString("FD_OBJECTID"));
  96. gp.setPROGRAM_NAME(rs.getString("PROGRAM_NAME"));
  97. gp.setSTART_TIME(rs.getString("START_TIME"));
  98. gp.setISENDTIME(rs.getString("ISENDTIME"));
  99. gp.setEND_TIME(rs.getString("END_TIME"));
  100. gp.setGPS_TASK_PROPERTY(rs.getString("GPS_TASK_PROPERTY"));
  101. gp.setGPS_LEVEL(rs.getString("GPS_LEVEL"));
  102. gp.setGPS_TASK_TYPE(rs.getString("GPS_TASK_TYPE"));
  103. gp.setGPS_SIREL(rs.getString("GPS_SIREL"));
  104. gp.setGPS_TASK_PLAN_TYPE(rs.getString("GPS_TASK_PLAN_TYPE"));
  105. gp.setGPS_TASK_QUYU(rs.getString("GPS_TASK_QUYU"));
  106. gp.setGPS_AREA_NAME(rs.getString("GPS_AREA_NAME"));
  107. gp.setGPS_AREA_CITY(rs.getString("GPS_AREA_CITY"));
  108. list.add(gp);
  109. }
  110. } catch (SQLException e) {
  111. log.error("装备分布坐标查询错误"+e.getMessage());
  112. } finally { closeAll(); }
  113. return list;
  114. }
  115. /**
  116. * 保供电任务详情表
  117. * @param sql
  118. * @param obj
  119. * @return
  120. */
  121. public List<GPSProgramResource> getGPSProgramResource(String sql, Object...obj){
  122. List<GPSProgramResource> list = new ArrayList<GPSProgramResource>();
  123. rs = executeQuerySetPs(sql, obj);
  124. try {
  125. while(rs.next()){
  126. GPSProgramResource gpr = new GPSProgramResource();
  127. gpr.setPROGRAM_NAME(rs.getString("PROGRAM_NAME"));
  128. gpr.setFD_OBJECTID(rs.getString("FD_OBJECTID"));
  129. gpr.setINPUT_UNIT_ID(rs.getString("INPUT_UNIT_ID"));
  130. gpr.setINPUT_UNIT_NAME(rs.getString("INPUT_UNIT_NAME"));
  131. gpr.setINPUT_NAME(rs.getString("INPUT_NAME"));
  132. gpr.setINPUT_NAME_ID(rs.getString("INPUT_NAME_ID"));
  133. gpr.setSTART_TIME(rs.getString("START_TIME"));
  134. gpr.setEND_TIME(rs.getString("END_TIME"));
  135. gpr.setINPUT_TIME(rs.getString("INPUT_TIME"));
  136. gpr.setISSUE_TIME(rs.getString("ISSUE_TIME"));
  137. gpr.setISSUE_DEPT(rs.getString("ISSUE_DEPT"));
  138. gpr.setGPS_TASK_NUMBER(rs.getString("GPS_TASK_NUMBER"));
  139. gpr.setGPS_TASK_FDC_DAY(rs.getString("GPS_TASK_FDC_DAY"));
  140. gpr.setGPS_TASK__FDC_TOTAL(rs.getString("GPS_TASK__FDC_TOTAL"));
  141. gpr.setGPS_TASK_FDJ_DAY(rs.getString("GPS_TASK_FDJ_DAY"));
  142. gpr.setGPS_TASK_FDJ_TOTAL(rs.getString("GPS_TASK_FDJ_TOTAL"));
  143. gpr.setGPS_TASK_CAR(rs.getString("GPS_TASK_CAR"));
  144. gpr.setGPS_TASK_ZBZHGLRY(rs.getString("GPS_TASK_ZBZHGLRY"));
  145. gpr.setGPS_TASK_BDWBZRY(rs.getString("GPS_TASK_BDWBZRY"));
  146. gpr.setGPS_TASK_ABRY(rs.getString("GPS_TASK_ABRY"));
  147. gpr.setGPS_TASK_WWSCRY(rs.getString("GPS_TASK_WWSCRY"));
  148. gpr.setGPS_CONTINATION_TIME(rs.getString("GPS_CONTINATION_TIME"));
  149. gpr.setTASK_ID(rs.getString("TASK_ID"));
  150. gpr.setTASK_NAME(rs.getString("TASK_NAME"));
  151. list.add(gpr);
  152. }
  153. } catch (SQLException e) {
  154. log.error("装备分布坐标查询错误"+e.getMessage());
  155. } finally { closeAll(); }
  156. return list;
  157. }
  158. }