123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- package com.cockpit.dao;
- import java.sql.SQLException;
- import java.util.ArrayList;
- import java.util.List;
- import org.slf4j.LoggerFactory;
- import com.cockpit.vo.GPSProgramResource;
- import com.cockpit.vo.GpsProgram;
- public class GridDao extends ConnDaoImpl{
- private static final org.slf4j.Logger log = LoggerFactory.getLogger(GridDao.class);
-
- public String getGridNo(String sql){
- rs = executeQuery(sql);
- try {
- if(rs.next()){
- return rs.getString("GRIDNO");
- }
- } catch (SQLException e) {
- log.error("装备分布坐标查询错误"+e.getMessage());
- } finally { closeAll(); }
-
- return "0";
- }
-
- public String getGridNoSetObj(String sql, Object...obj){
- rs = executeQuerySetPs(sql, obj);
- try {
- if(rs.next()){
- return rs.getString("GRIDNO");
- }
- } catch (SQLException e) {
- log.error("装备分布坐标查询错误"+e.getMessage());
- } finally { closeAll(); }
-
- return "0";
- }
-
- public String getLTRes(String sql, String pageNum, String limit){
- int pageNo = Integer.parseInt(pageNum);
- int pageSize = Integer.parseInt(limit);
-
- StringBuffer sb = new StringBuffer();
- sb.append("[");
- rs = executeQuerySetPs(sql, (pageNo*pageSize-(pageSize-1)), (pageNo*pageSize));
- try {
- while(rs.next()){
- sb.append("{\"EQUIPMENTNAME\":\"" + rs.getString("EQUIPMENTNAME") + "\",\"VOLLEVEL\":\"" + rs.getString("VOLLEVEL") +
- "\",\"AREA\":\"" + rs.getString("AREA") + "\",\"TRIPTIME\":\"" + rs.getString("TRIPTIME") +
- "\",\"ONTIME\":\"" + rs.getString("ONTIME") + "\",\"RECLOSE\":\"" + rs.getString("RECLOSE") + "\"},") ;
-
- }
- sb.deleteCharAt(sb.length() - 1) ;
- if(sb.length()==0){ return "" ; }
- sb.append("]");
- log.info("线路跳闸表格查询:========" + sb.toString());
- return sb.toString() ;
-
- } catch (SQLException e) {
- log.error("线路跳闸表格查询错误"+e.getMessage());
- } finally { closeAll(); }
-
- return "";
-
- }
-
- public String getHouseGridRes(String sql, String pageNum, String limit){
- int pageNo = Integer.parseInt(pageNum);
- int pageSize = Integer.parseInt(limit);
-
- StringBuffer sb = new StringBuffer();
- sb.append("[");
- rs = executeQuerySetPs(sql, (pageNo*pageSize-(pageSize-1)), (pageNo*pageSize));
- try {
- while(rs.next()){
-
- sb.append("{\"ADMINISTRATIVE_DEPT_NAME\":\"" + rs.getString("ADMINISTRATIVE_DEPT_NAME") +
- "\",\"NAME\":\"" + rs.getString("NAME") +
- "\",\"MATERIAL_USES\":\"" + rs.getString("MATERIAL_USES") +
- "\",\"MODEL\":\"" + rs.getString("MODEL") +
- "\",\"MEASUREMENT_UNIT\":\"" + rs.getString("MEASUREMENT_UNIT") +
- "\",\"AMOUNT\":\"" + rs.getString("AMOUNT") +
- "\",\"WAREHOUSE_SPACE\":\"" + rs.getString("WAREHOUSE_SPACE") +
- "\",\"SUPPLIERS\":\"" + rs.getString("SUPPLIERS") +
- "\",\"ADMINISTRATIVE_DEPT\":\"" + rs.getString("ADMINISTRATIVE_DEPT") + "\"},") ;
-
- }
- sb.deleteCharAt(sb.length() - 1) ;
- if(sb.length()==0){ return "" ; }
- sb.append("]");
- log.info("线路跳闸表格查询:========" + sb.toString());
- return sb.toString() ;
-
- } catch (SQLException e) {
- log.error("线路跳闸表格查询错误"+e.getMessage());
- } finally { closeAll(); }
-
- return "";
-
- }
-
-
- /**
- * 保供电任务详情表
- * @param sql
- * @param obj
- * @return
- */
- public List<GpsProgram> getGPSProgramInfo(String sql, Object...obj){
- List<GpsProgram> list = new ArrayList<GpsProgram>();
- rs = executeQuerySetPs(sql, obj);
- try {
- while(rs.next()){
- GpsProgram gp = new GpsProgram();
- gp.setENDTIME(rs.getString("ENDTIME"));
- gp.setFD_OBJECTID(rs.getString("FD_OBJECTID"));
- gp.setPROGRAM_NAME(rs.getString("PROGRAM_NAME"));
- gp.setSTART_TIME(rs.getString("START_TIME"));
- gp.setISENDTIME(rs.getString("ISENDTIME"));
- gp.setEND_TIME(rs.getString("END_TIME"));
- gp.setGPS_TASK_PROPERTY(rs.getString("GPS_TASK_PROPERTY"));
- gp.setGPS_LEVEL(rs.getString("GPS_LEVEL"));
- gp.setGPS_TASK_TYPE(rs.getString("GPS_TASK_TYPE"));
- gp.setGPS_SIREL(rs.getString("GPS_SIREL"));
- gp.setGPS_TASK_PLAN_TYPE(rs.getString("GPS_TASK_PLAN_TYPE"));
- gp.setGPS_TASK_QUYU(rs.getString("GPS_TASK_QUYU"));
- gp.setGPS_AREA_NAME(rs.getString("GPS_AREA_NAME"));
- gp.setGPS_AREA_CITY(rs.getString("GPS_AREA_CITY"));
- list.add(gp);
- }
- } catch (SQLException e) {
- log.error("装备分布坐标查询错误"+e.getMessage());
- } finally { closeAll(); }
-
- return list;
-
- }
-
-
- /**
- * 保供电任务详情表
- * @param sql
- * @param obj
- * @return
- */
- public List<GPSProgramResource> getGPSProgramResource(String sql, Object...obj){
- List<GPSProgramResource> list = new ArrayList<GPSProgramResource>();
- rs = executeQuerySetPs(sql, obj);
- try {
- while(rs.next()){
- GPSProgramResource gpr = new GPSProgramResource();
- gpr.setPROGRAM_NAME(rs.getString("PROGRAM_NAME"));
- gpr.setFD_OBJECTID(rs.getString("FD_OBJECTID"));
- gpr.setINPUT_UNIT_ID(rs.getString("INPUT_UNIT_ID"));
- gpr.setINPUT_UNIT_NAME(rs.getString("INPUT_UNIT_NAME"));
- gpr.setINPUT_NAME(rs.getString("INPUT_NAME"));
- gpr.setINPUT_NAME_ID(rs.getString("INPUT_NAME_ID"));
- gpr.setSTART_TIME(rs.getString("START_TIME"));
- gpr.setEND_TIME(rs.getString("END_TIME"));
- gpr.setINPUT_TIME(rs.getString("INPUT_TIME"));
- gpr.setISSUE_TIME(rs.getString("ISSUE_TIME"));
- gpr.setISSUE_DEPT(rs.getString("ISSUE_DEPT"));
- gpr.setGPS_TASK_NUMBER(rs.getString("GPS_TASK_NUMBER"));
- gpr.setGPS_TASK_FDC_DAY(rs.getString("GPS_TASK_FDC_DAY"));
- gpr.setGPS_TASK__FDC_TOTAL(rs.getString("GPS_TASK__FDC_TOTAL"));
- gpr.setGPS_TASK_FDJ_DAY(rs.getString("GPS_TASK_FDJ_DAY"));
- gpr.setGPS_TASK_FDJ_TOTAL(rs.getString("GPS_TASK_FDJ_TOTAL"));
- gpr.setGPS_TASK_CAR(rs.getString("GPS_TASK_CAR"));
- gpr.setGPS_TASK_ZBZHGLRY(rs.getString("GPS_TASK_ZBZHGLRY"));
- gpr.setGPS_TASK_BDWBZRY(rs.getString("GPS_TASK_BDWBZRY"));
- gpr.setGPS_TASK_ABRY(rs.getString("GPS_TASK_ABRY"));
- gpr.setGPS_TASK_WWSCRY(rs.getString("GPS_TASK_WWSCRY"));
- gpr.setGPS_CONTINATION_TIME(rs.getString("GPS_CONTINATION_TIME"));
- gpr.setTASK_ID(rs.getString("TASK_ID"));
- gpr.setTASK_NAME(rs.getString("TASK_NAME"));
-
- list.add(gpr);
- }
- } catch (SQLException e) {
- log.error("装备分布坐标查询错误"+e.getMessage());
- } finally { closeAll(); }
-
- return list;
-
- }
-
- }
|