From 2a4fdc9b345b3148da0348c409a53f1bc13e84d5 Mon Sep 17 00:00:00 2001 From: 81041 <81041@192.168.10.15> Date: 星期四, 22 十一月 2018 09:02:22 +0800 Subject: [PATCH] 电池健康率 --- gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java | 37 +++++++++++++++++++++++++++++++++++-- 1 files changed, 35 insertions(+), 2 deletions(-) diff --git a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java index f11a5a4..0e2c5b6 100644 --- a/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java +++ b/gx_tieta/src/com/fgkj/dao/impl/BattInfImpl.java @@ -1047,7 +1047,7 @@ return list; } - //鏌ヨ澶囨�绘暟 + //鏌ヨ澶囨�绘暟(宸茬粡瀹夎) /*public int serchByDeviceId(){ String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf limit 1"; List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{}, new CallBack() { @@ -1081,6 +1081,39 @@ " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + " where db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.Station_install=1 " + + " limit 1"; + List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() { + + public List getResults(ResultSet rs) { + List list=new ArrayList(); + try { + while(rs.next()){ + BattInf binf=new BattInf(); + binf.setNum(rs.getInt("number")); + list.add(binf); + } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return list; + } + + }); + int number=0;//瀛樻斁鎬绘暟 + if(list!=null&&list.size()>0){ + number=list.get(list.size()-1).getNum(); + } + return number; + } + //鏌ヨ璁惧鎬绘暟(鍏ㄩ儴) + public int serchByDeviceId_all(Object obj){ + User_inf uinf=(User_inf) obj; + String sql=" SELECT COUNT(DISTINCT fbsdeviceid) number FROM db_battinf.tb_battinf " + + " left outer join db_user.tb_user_battgroup_baojigroup_battgroup on db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " + + " left outer join db_user.tb_user_battgroup_baojigroup_usr on db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + + " left outer join db_user.tb_user_inf on tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + + " where db_user.tb_user_inf.uid=? " + " limit 1"; List<BattInf> list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() { @@ -3318,7 +3351,7 @@ " where db_user.tb_user_battgroup_baojigroup_battgroup.BattGroupId=db_battinf.tb_battinf.BattGroupId " + " and db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id=db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id " + " and db_user.tb_user_inf.uid=db_user.tb_user_battgroup_baojigroup_usr.uid " + - " and db_user.tb_user_inf.uid=?" + + " and db_user.tb_user_inf.uid=? and db_battinf.tb_battinf.Station_install=1 " + " limit 1"; List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{uinf.getUId()}, new CallBack() { -- Gitblit v1.9.1