From 6a164ed3a382326e1f246f4629e6d2ffe276ece2 Mon Sep 17 00:00:00 2001
From: 81041 <81041@192.168.10.29>
Date: 星期一, 15 十月 2018 14:06:15 +0800
Subject: [PATCH] 统计基站在状态
---
gx_tieta/src/com/fgkj/services/ram/Fbs9100s_dfu_stateService.java | 41 ++++++++
gx_tieta/src/com/fgkj/dao/BaseDAO.java | 2
gx_tieta/src/com/fgkj/dao/impl/Batt_devalarm_data_historyImpl.java | 10 -
gx_tieta/src/com/fgkj/dto/ram/Fbs9100s_dfu_state.java | 103 ++++++++++++++++++++
gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100s_dfu_stateImpl.java | 53 ++++++++++
gx_tieta/src/com/fgkj/actions/ram/Fbs9100s_dfu_stateAction.java | 38 +++++++
gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java | 2
7 files changed, 240 insertions(+), 9 deletions(-)
diff --git a/gx_tieta/src/com/fgkj/actions/ram/Fbs9100s_dfu_stateAction.java b/gx_tieta/src/com/fgkj/actions/ram/Fbs9100s_dfu_stateAction.java
new file mode 100644
index 0000000..7deb6b7
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/actions/ram/Fbs9100s_dfu_stateAction.java
@@ -0,0 +1,38 @@
+package com.fgkj.actions.ram;
+
+import com.fgkj.actions.ActionUtil;
+import com.fgkj.dto.ServiceModel;
+import com.fgkj.dto.ram.Fbs9100s_dfu_state;
+import com.fgkj.services.ram.Fbs9100s_dfu_stateService;
+
+public class Fbs9100s_dfu_stateAction extends ActionUtil{
+ private Fbs9100s_dfu_stateService service;
+ private String json;
+ private String result;
+
+ //鍗囩骇鎻掑叆
+ public String add(){
+ Fbs9100s_dfu_state dfu=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9100s_dfu_state.class);
+ ServiceModel model=service.add(dfu);
+ result=tojson(model);
+ return SUCCESS;
+ }
+ //鍗囩骇纭
+ public String update(){
+ Fbs9100s_dfu_state dfu=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Fbs9100s_dfu_state.class);
+ ServiceModel model=service.update(dfu);
+ result=tojson(model);
+ return SUCCESS;
+ }
+
+ public String getResult() {
+ return result;
+ }
+ public void setJson(String json) {
+ this.json = json;
+ }
+
+
+
+
+}
diff --git a/gx_tieta/src/com/fgkj/dao/BaseDAO.java b/gx_tieta/src/com/fgkj/dao/BaseDAO.java
index b867be1..9667b61 100644
--- a/gx_tieta/src/com/fgkj/dao/BaseDAO.java
+++ b/gx_tieta/src/com/fgkj/dao/BaseDAO.java
@@ -182,6 +182,8 @@
public static final int BTS_STATION_STATE=89;
+ public static final int FBS9100S_DFU_STATE=90;
+
public boolean add(Object obj); // 娣诲姞
public boolean update(Object obj); // 鏇存柊
diff --git a/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java b/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java
index 0d6149c..3686ab3 100644
--- a/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java
+++ b/gx_tieta/src/com/fgkj/dao/BaseDAOFactory.java
@@ -80,6 +80,7 @@
import com.fgkj.dao.impl.ram.Fbs9100_setparamImpl;
import com.fgkj.dao.impl.ram.Fbs9100_stateImpl;
import com.fgkj.dao.impl.ram.Fbs9100s_dcdc_stateImpl;
+import com.fgkj.dao.impl.ram.Fbs9100s_dfu_stateImpl;
import com.fgkj.dao.impl.ram.Fbs9600_stateImpl;
import com.fgkj.dao.impl.ram.Hard_dev_sms_stateImpl;
import com.fgkj.dao.impl.ram.Server_stateImpl;
@@ -188,6 +189,7 @@
case 87:return new Batt_enduranceImpl();
case 88:return new BattInf_RebuildImpl();
case 89:return new Bts_station_stateImpl();
+ case 90:return new Fbs9100s_dfu_stateImpl();
default :return null;
}
}
diff --git a/gx_tieta/src/com/fgkj/dao/impl/Batt_devalarm_data_historyImpl.java b/gx_tieta/src/com/fgkj/dao/impl/Batt_devalarm_data_historyImpl.java
index 3b98e06..8808597 100644
--- a/gx_tieta/src/com/fgkj/dao/impl/Batt_devalarm_data_historyImpl.java
+++ b/gx_tieta/src/com/fgkj/dao/impl/Batt_devalarm_data_historyImpl.java
@@ -144,20 +144,12 @@
" ,"+AlarmDaoFactory.ALM_TYPE_BTS9100S_TEMPUP_ComError_ID+","+AlarmDaoFactory.ALM_TYPE_BTS9100S_TEMPLOW_ComError_ID+","+AlarmDaoFactory.ALM_TYPE_BTS9100S_DAMPUP_ComError_ID+","+AlarmDaoFactory.ALM_TYPE_BTS9100S_DAMPLOW_ComError_ID+") " +
" and alm_start_time>=? and alm_start_time<=? " +
" and stationname1 like ? and stationname2 like ? and stationname3 like ? and stationid like ? " ;
- //寮傚父绫诲瀷绛涢��
- String alm_typeSqlT=" and alm_type!=? ";
- String alm_typeSqlF=" and alm_type=? ";
- if(binf.getNum()==0){
- sql+=alm_typeSqlT;
- }else{
- sql+=alm_typeSqlF;
- }
//鎺掑簭
String orderSql=" order by dev_id,alm_start_time,alm_type asc ";
sql+=orderSql;
//System.out.println(sql);
//binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",
- List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%",binf.getNum()}, new CallBack() {
+ List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getBattInUseDate(),binf.getBattInUseDate1(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName3()+"%","%"+binf.getStationId()+"%"}, new CallBack() {
public List getResults(ResultSet rs) {
List list=new ArrayList();
diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100s_dfu_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100s_dfu_stateImpl.java
new file mode 100644
index 0000000..520f940
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Fbs9100s_dfu_stateImpl.java
@@ -0,0 +1,53 @@
+package com.fgkj.dao.impl.ram;
+
+import java.sql.ResultSet;
+import java.util.List;
+
+import com.fgkj.dao.BaseDAO;
+import com.fgkj.dao.CallBack;
+import com.fgkj.dao.DAOHelper;
+import com.fgkj.db.DBUtil;
+import com.fgkj.dto.ram.Fbs9100s_dfu_state;
+
+public class Fbs9100s_dfu_stateImpl implements BaseDAO,CallBack{
+
+ public List getResults(ResultSet rs) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ //鍗囩骇鎻掑叆
+ public boolean add(Object obj) {
+ Fbs9100s_dfu_state dfu=(Fbs9100s_dfu_state) obj;
+ String sql="insert into db_ram_db.tb_fbs9100s_dfu_state (dev_id,dfu_file,dfu_wr_stat,dfu_data_blocknum) values (?,?,?,?)";
+ boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{dfu.getDev_id(),dfu.getDfu_file(),dfu.getDfu_wr_stat(),dfu.getDfu_data_blocknum()});
+ return bl;
+ }
+ //鍗囩骇纭
+ public boolean update(Object obj) {
+ Fbs9100s_dfu_state dfu=(Fbs9100s_dfu_state) obj;
+ String sql="update db_ram_db.tb_fbs9100s_dfu_state set dfu_en=true,dfu_wr_stat=1, dfu_data_blocknum=1 where dev_id=?;";
+ boolean bl=DAOHelper.executeUpdate(DBUtil.getConn(), sql, new Object[]{dfu.getDev_id()});
+ return bl;
+ }
+
+ public boolean del(Object obj) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public List searchAll() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List serchByCondition(Object obj) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List serchByInfo(Object obj) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/gx_tieta/src/com/fgkj/dto/ram/Fbs9100s_dfu_state.java b/gx_tieta/src/com/fgkj/dto/ram/Fbs9100s_dfu_state.java
new file mode 100644
index 0000000..88a0f4d
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/dto/ram/Fbs9100s_dfu_state.java
@@ -0,0 +1,103 @@
+package com.fgkj.dto.ram;
+
+import java.io.Serializable;
+
+public class Fbs9100s_dfu_state implements Serializable{
+ private int num;
+ private int dev_id;
+ private int sysVersion_new;
+ private int softVersion_new;
+ private int sysVersion_dev;
+ private int softVersion_dev;
+ private String dfu_file;
+ private int dfu_en;
+ private int dfu_wr_stat;
+ private int dfu_data_blocknum;
+ private int dfu_data_blocklen;
+ private String dfu_password;
+ public int getNum() {
+ return num;
+ }
+ public void setNum(int num) {
+ this.num = num;
+ }
+ public int getDev_id() {
+ return dev_id;
+ }
+ public void setDev_id(int dev_id) {
+ this.dev_id = dev_id;
+ }
+ public int getSysVersion_new() {
+ return sysVersion_new;
+ }
+ public void setSysVersion_new(int sysVersion_new) {
+ this.sysVersion_new = sysVersion_new;
+ }
+ public int getSoftVersion_new() {
+ return softVersion_new;
+ }
+ public void setSoftVersion_new(int softVersion_new) {
+ this.softVersion_new = softVersion_new;
+ }
+ public int getSysVersion_dev() {
+ return sysVersion_dev;
+ }
+ public void setSysVersion_dev(int sysVersion_dev) {
+ this.sysVersion_dev = sysVersion_dev;
+ }
+ public int getSoftVersion_dev() {
+ return softVersion_dev;
+ }
+ public void setSoftVersion_dev(int softVersion_dev) {
+ this.softVersion_dev = softVersion_dev;
+ }
+ public String getDfu_file() {
+ return dfu_file;
+ }
+ public void setDfu_file(String dfu_file) {
+ this.dfu_file = dfu_file;
+ }
+ public int getDfu_en() {
+ return dfu_en;
+ }
+ public void setDfu_en(int dfu_en) {
+ this.dfu_en = dfu_en;
+ }
+ public int getDfu_wr_stat() {
+ return dfu_wr_stat;
+ }
+ public void setDfu_wr_stat(int dfu_wr_stat) {
+ this.dfu_wr_stat = dfu_wr_stat;
+ }
+ public int getDfu_data_blocknum() {
+ return dfu_data_blocknum;
+ }
+ public void setDfu_data_blocknum(int dfu_data_blocknum) {
+ this.dfu_data_blocknum = dfu_data_blocknum;
+ }
+ public int getDfu_data_blocklen() {
+ return dfu_data_blocklen;
+ }
+ public void setDfu_data_blocklen(int dfu_data_blocklen) {
+ this.dfu_data_blocklen = dfu_data_blocklen;
+ }
+ public String getDfu_password() {
+ return dfu_password;
+ }
+ public void setDfu_password(String dfu_password) {
+ this.dfu_password = dfu_password;
+ }
+ @Override
+ public String toString() {
+ return "Fbs9100s_dfu_state [num=" + num + ", dev_id=" + dev_id
+ + ", sysVersion_new=" + sysVersion_new + ", softVersion_new="
+ + softVersion_new + ", sysVersion_dev=" + sysVersion_dev
+ + ", softVersion_dev=" + softVersion_dev + ", dfu_file="
+ + dfu_file + ", dfu_en=" + dfu_en + ", dfu_wr_stat="
+ + dfu_wr_stat + ", dfu_data_blocknum=" + dfu_data_blocknum
+ + ", dfu_data_blocklen=" + dfu_data_blocklen
+ + ", dfu_password=" + dfu_password + "]";
+ }
+
+
+}
diff --git a/gx_tieta/src/com/fgkj/services/ram/Fbs9100s_dfu_stateService.java b/gx_tieta/src/com/fgkj/services/ram/Fbs9100s_dfu_stateService.java
new file mode 100644
index 0000000..e01ba16
--- /dev/null
+++ b/gx_tieta/src/com/fgkj/services/ram/Fbs9100s_dfu_stateService.java
@@ -0,0 +1,41 @@
+package com.fgkj.services.ram;
+
+import com.fgkj.dao.BaseDAO;
+import com.fgkj.dao.BaseDAOFactory;
+import com.fgkj.dto.ServiceModel;
+
+public class Fbs9100s_dfu_stateService {
+ private ServiceModel model;
+ private BaseDAO dao;
+
+ public Fbs9100s_dfu_stateService() {
+ super();
+ model=new ServiceModel();
+ dao=BaseDAOFactory.getBaseDAO(BaseDAO.FBS9100S_DFU_STATE);
+ }
+
+ //鍗囩骇鎻掑叆
+ public ServiceModel add(Object obj) {
+ boolean bl=dao.add(obj);
+ if(bl){
+ model.setCode(1);
+ model.setMsg("娣诲姞鎴愬姛!");
+ }else{
+ model.setCode(0);
+ model.setMsg("娣诲姞澶辫触!");
+ }
+ return model;
+ }
+ //鍗囩骇纭
+ public ServiceModel update(Object obj) {
+ boolean bl=dao.update(obj);
+ if(bl){
+ model.setCode(1);
+ model.setMsg("淇敼鎴愬姛!");
+ }else{
+ model.setCode(0);
+ model.setMsg("淇敼澶辫触!");
+ }
+ return model;
+ }
+}
--
Gitblit v1.9.1