From e3c3bbe191679117c706288c34b35d2ff99c3e26 Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.33> Date: 星期四, 11 十月 2018 15:49:07 +0800 Subject: [PATCH] 配组记录添加的修改 --- gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java | 20 ++++++++++---------- gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java | 5 ++++- gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java | 28 +++++++++++++++++++++++++--- 3 files changed, 39 insertions(+), 14 deletions(-) diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java index d50f513..060996f 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInf_RebuildImpl.java @@ -1,6 +1,8 @@ package com.fgkj.dao.impl; import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; import java.util.List; import com.fgkj.dao.BaseDAO; @@ -8,6 +10,7 @@ import com.fgkj.dao.DAOHelper; import com.fgkj.db.DBUtil; import com.fgkj.dto.BattInf_Rebuild; +import com.mysql.fabric.xmlrpc.base.Array; public class BattInf_RebuildImpl implements BaseDAO,CallBack{ @@ -41,10 +44,29 @@ // TODO Auto-generated method stub return null; } - + //鏌ヨnew_battgroupid,new_monum鏄惁鏈夎閰嶇粍鐨勮褰� public List serchByCondition(Object obj) { - // TODO Auto-generated method stub - return null; + BattInf_Rebuild br=(BattInf_Rebuild) obj; + String sql="select * from db_battinf.tb_battinf_rebuild where new_battgroupid=? and new_monum=? and rebuild_clear_type=1 limit 1"; + List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{br.getNew_battgroupid(),br.getNew_monum()}, new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + BattInf_Rebuild br=new BattInf_Rebuild(); + br.setNew_battgroupid(rs.getInt("new_battgroupid")); + br.setNew_monum(rs.getInt("new_monum")); + list.add(br); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + }); + return list; } public List serchByInfo(Object obj) { diff --git a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java index 6ccb984..c0dd585 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/ram/Bts_station_stateImpl.java @@ -36,7 +36,10 @@ //鏌ヨ鏈烘埧瀹炴椂鐘舵�� public List serchByCondition(Object obj) { Bts_station_state bs=(Bts_station_state) obj; - String sql=""; + String sql="select distinct station_id,dev_id,record_datetime,station_stat,station_poff_start_time,station_poff_tlong,station_fadian_start_time,station_fadian_tlong" + + " ,station_diaozhan_start_time,station_diaozhan_tlong,station_temp,station_damp,station_dooropen_start_time,station_dooropen_tlong " + + " from db_ram_db.tb_bts_station_station_state " + + " where "; return null; } diff --git a/gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java b/gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java index c1181d6..86db40b 100644 --- a/gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java +++ b/gx_tieta/src/com/fgkj/services/BattInf_RebuildService.java @@ -1,5 +1,7 @@ package com.fgkj.services; +import java.util.List; + import com.fgkj.dao.BaseDAO; import com.fgkj.dao.BaseDAOFactory; import com.fgkj.dto.ServiceModel; @@ -14,16 +16,14 @@ } //娣诲姞 public ServiceModel add(Object obj) { - boolean b=dao.update(obj); - if(b){ - boolean bl=dao.add(obj); - if(bl){ - model.setCode(1); - model.setMsg("娣诲姞鎴愬姛!"); - }else{ - model.setCode(0); - model.setMsg("娣诲姞澶辫触!"); - } + List list=dao.serchByCondition(obj); + if(list!=null&&list.size()>0){ + boolean b=dao.update(obj); + } + boolean bl=dao.add(obj); + if(bl){ + model.setCode(1); + model.setMsg("娣诲姞鎴愬姛!"); }else{ model.setCode(0); model.setMsg("娣诲姞澶辫触!"); -- Gitblit v1.9.1