| | |
| | | import com.fgkj.dto.Batt_Maint_Dealarm;
|
| | | import com.fgkj.dto.Batt_maint_inf;
|
| | | import com.fgkj.dto.Batt_maintenance_inf;
|
| | | import com.fgkj.dto.Batttestdata;
|
| | | import com.fgkj.dto.Batttestdata_inf;
|
| | | import com.fgkj.dto.Batttestdatastop;
|
| | | import com.fgkj.dto.Limit;
|
| | |
| | | + "FBSDeviceName,GroupIndexInFBSDevice,battgroupId,BattGroupNum,BattGroupName,FloatVolLevel,OfflineVolLevel,BattFloatCurrent" +
|
| | | ",MonCount,MonCapStd,monVolStd,monResStd,MonSerStd,MonVolLowToAvg,BattProducer,BattModel,BattProductDate,BattInUseDate " +
|
| | | " From db_battinf.tb_battinf " +
|
| | | " Where StationName like ? and StationName1 like ? " +
|
| | | " Where StationName like ? and StationName1 like ? and StationName2 like ? " +
|
| | | " order by StationId " +
|
| | | " limit ?,?";
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{"%"+binf.getStationName()+"%","%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list = new ArrayList<BattInf>();
|
| | |
| | | }else{
|
| | | baseSql+=station1SqlF;
|
| | | }
|
| | | //用于维护区
|
| | | String station2SqlT=" and stationname2!=? ";//全部
|
| | | String station2SqlF=" and stationname2=? ";
|
| | | if(binf.getStationName2().equals("")){
|
| | | baseSql+=station2SqlT;
|
| | | }else{
|
| | | baseSql+=station2SqlF;
|
| | | }
|
| | | //用于机房站点
|
| | | String stationSqlT=" and stationname!=? ";//全部
|
| | | String stationSqlF=" and stationname=? ";
|
| | |
| | | String endSql=" order by stationid ";
|
| | | sql=baseSql+endSql;
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getStationName1(),binf.getStationName2(),binf.getStationName(),binf.getBattGroupId()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | " 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_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ?)";
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ? )";
|
| | | baseSql+=userSql;
|
| | | String endSql=" order by StationName1 asc,db_battinf.tb_battinf.BattgroupId asc ";
|
| | | sql=baseSql+endSql;
|
| | | String limitSql=" limit ?,? ";
|
| | | sql+=limitSql;
|
| | | //System.out.println(sql);
|
| | | List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},
|
| | | List<BattInf> list = DAOHelper.executeQueryLimit(sql,conn,new Object[] {binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%",(page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()},
|
| | | new CallBack() {
|
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | |
| | | " 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_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ?)";
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)";
|
| | | baseSql+=userSql;
|
| | | //排序
|
| | | String endSql=" order by db_battinf.tb_battinf.battgroupid asc ";
|
| | |
| | | sql=baseSql+endSql+limitSql;
|
| | | //System.out.println(sql);
|
| | | List<BattInf> list=DAOHelper.executeQueryLimit(sql,conn, new Object[]{
|
| | | binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%",
|
| | | binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%",
|
| | | (page.getPageCurr()-1)*page.getPageSize(),page.getPageSize()}, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | " 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_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ?)";
|
| | | " and db_battinf.tb_battinf.stationname1 like ? and db_battinf.tb_battinf.stationname like ? and db_battinf.tb_battinf.stationname2 like ?)";
|
| | | baseSql+=userSql;
|
| | | //充电放电选择
|
| | | String test_typeA="";//全部
|
| | |
| | | //System.out.println(sql);
|
| | | List<BattInf> list=DAOHelper.executeQuery(sql,DBUtil.getConn(), new Object[]{
|
| | | tinf.getRecord_time(),tinf.getRecord_time1()
|
| | | ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%"
|
| | | ,binf.getBattGroupId(),uinf.getUId(),"%"+binf.getStationName1()+"%","%"+binf.getStationName()+"%","%"+binf.getStationName2()+"%"
|
| | | }, new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where StationId in(" +
|
| | | " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
|
| | | " )";
|
| | | " ) ORDER BY CONVERT( StationName1 USING gbk ) COLLATE gbk_chinese_ci ASC";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where StationId in(" +
|
| | | " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
|
| | | " ) and StationName1 like ?";
|
| | | " ) and StationName1 like ? " +
|
| | | " ORDER BY CONVERT( StationName2 USING gbk ) COLLATE gbk_chinese_ci ASC ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%"},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | //查询管理的机房(左侧导航第三层,查所有的机房,num中存放uid)
|
| | | public List serchStationName3(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName3,stationid,fbsdeviceid " +
|
| | | String sql="select DISTINCT StationName,StationName1,StationName2,StationName3,stationid,fbsdeviceid,FBSDeviceName " +
|
| | | " FROM db_battinf.tb_battinf " +
|
| | | " where StationId in(" +
|
| | | " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
|
| | | " ) and StationName1 like ? and StationName2 like ? ";
|
| | | " ) and StationName1 like ? and StationName2 like ? " +
|
| | | " ORDER BY CONVERT( StationName USING gbk ) COLLATE gbk_chinese_ci ASC ";
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{binf.getNum(),"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%"},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | |
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf batt = new BattInf();
|
| | | batt.setStationName(rs.getString("stationName"));
|
| | | batt.setStationName1(rs.getString("stationName1"));
|
| | | batt.setStationName2(rs.getString("stationName2"));
|
| | | batt.setStationName3(rs.getString("stationName3"));
|
| | | batt.setStationId(rs.getString("stationId"));
|
| | | batt.setFBSDeviceName(rs.getString("fBSDeviceName"));
|
| | | batt.setFBSDeviceId(rs.getInt("fBSDeviceId"));
|
| | | list.add(batt);
|
| | | }
|
| | |
| | | public List serchBattByStation(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="select DISTINCT StationName,StationId,StationIP,FBSDeviceId,BattGroupName,BattGroupName1,BattGroupName2,MonCount,battgroupId,MonCapStd,MonVolStd,MonResStd,MonSerStd,BattProducer,BattInUseDate,GroupIndexInFBSDevice " +
|
| | | "from db_battinf.tb_battinf where stationid=? " +
|
| | | "and StationId in(" +
|
| | | "from db_battinf.tb_battinf where StationName1 like ? and StationName2 like ? and StationName like ? ";
|
| | | //机房id
|
| | | String idSqlT=" and Stationid like ? ";
|
| | | sql+=idSqlT;
|
| | | //用户管理
|
| | | String userSql=" and StationId in(" +
|
| | | " select distinct db_user.tb_user_battgroup_baojigroup_battgroup.StationId from db_user.tb_user_battgroup_baojigroup_battgroup,db_user.tb_user_battgroup_baojigroup_usr where db_user.tb_user_battgroup_baojigroup_battgroup.baoji_group_id=db_user.tb_user_battgroup_baojigroup_usr.baoji_group_id and db_user.tb_user_battgroup_baojigroup_usr.uId=?" +
|
| | | " ) " +
|
| | | "ORDER BY StationName1,battgroupId ";
|
| | | " ) ";
|
| | | sql+=userSql;
|
| | | //排序
|
| | | String orderSql=" ORDER BY StationName1,battgroupId ";
|
| | | //System.out.println(sql);
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{binf.getStationId(),binf.getNum()},new CallBack() {
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(),new Object[]{"%"+binf.getStationName1()+"%","%"+binf.getStationName2()+"%","%"+binf.getStationName()+"%","%"+binf.getStationId()+"%",binf.getNum()},new CallBack() {
|
| | |
|
| | | public List getResults(ResultSet rs) {
|
| | | List list = new ArrayList();
|
| | |
| | | return nums;
|
| | | }
|
| | |
|
| | | |
| | | //电池配组管理(重要)
|
| | | public List serchMakeGroup(Object obj){
|
| | | BattInf binf=(BattInf) obj;
|
| | | String sql="SELECT distinct BattGroupId,stationid,stationname1,stationname2,stationname,stationname3,BattProducer,MonVolStd,MonCapStd,monCount from db_battinf.tb_battinf where stationname2 like ? ";
|
| | | //选中品牌一致
|
| | | String producerSqlT=" order by BattProducer,MonCapStd,MonVolStd ";//一致
|
| | | String producerSqlF=" order by MonCapStd,MonVolStd ";//不一致
|
| | | if(binf.getBattProducer().equals("1")){
|
| | | sql+=producerSqlT;
|
| | | }else{
|
| | | sql+=producerSqlF;
|
| | | }
|
| | | List list=DAOHelper.executeQuery(sql, DBUtil.getConn(), new Object[]{"%"+binf.getStationName2()+"%"}, new CallBack() {
|
| | | |
| | | public List getResults(ResultSet rs) {
|
| | | List list=new ArrayList();
|
| | | try {
|
| | | while(rs.next()){
|
| | | BattInf binf=new BattInf();
|
| | | binf.setBattGroupId(rs.getInt("battGroupId"));
|
| | | binf.setStationId(rs.getString("stationId"));
|
| | | binf.setStationName(rs.getString("stationName"));
|
| | | binf.setStationName1(rs.getString("stationName1"));
|
| | | binf.setStationName2(rs.getString("stationName2"));
|
| | | binf.setStationName3(rs.getString("stationName3"));
|
| | | binf.setBattProducer(rs.getString("battProducer"));
|
| | | binf.setMonVolStd(rs.getFloat("monVolStd"));
|
| | | binf.setMonCapStd(rs.getFloat("monCapStd"));
|
| | | binf.setMonCount(rs.getInt("monCount"));
|
| | | list.add(binf);
|
| | | }
|
| | | } catch (SQLException e) {
|
| | | // TODO Auto-generated catch block
|
| | | e.printStackTrace();
|
| | | }
|
| | | return list;
|
| | | }
|
| | | });
|
| | | return list;
|
| | | }
|
| | | public static void main(String[] args) throws ParseException {
|
| | | //new BattInfImpl().searchAll();
|
| | |
|
| | | BattInfImpl biml = new BattInfImpl();
|
| | | BattInf binf = new BattInf();
|
| | | binf.setBattGroupId(0);
|
| | | binf.setBattGroupId(1000967);
|
| | | binf.setStationName("内蒙古");
|
| | | binf.setStationName1("内蒙古");
|
| | |
|
| | |
| | | bmd.setUinf(uinf);
|
| | | //List<BattInf> list = biml.serchByConditionNew(bmd);
|
| | | //List<BattInf> list=biml.serchByTestType(bmd);
|
| | | List<BattInf> list=biml.serchGroupAssess(bmd);
|
| | | //List<BattInf> list=biml.serchGroupAssess(bmd);
|
| | | List<BattInf> list=biml.serchByMonNum(binf);
|
| | | for (BattInf b : list) {
|
| | | System.out.println(b);
|
| | | }
|