| | |
| | |
|
| | | import com.fgkj.dao.impl.BattInfImpl;
|
| | | import com.fgkj.dao.impl.Batt_rtstateDAOImpl;
|
| | | import com.fgkj.dao.impl.Battinf_applyImpl;
|
| | | import com.fgkj.dao.impl.Database_backupImpl;
|
| | | import com.fgkj.dto.BattInf;
|
| | | import com.fgkj.dto.Database_backup;
|
| | |
| | | }
|
| | | //查询当前最大的电池组id
|
| | | public static int searchMaxBattgroupId(){
|
| | | int BattgroupId_max=(new Batt_rtstateDAOImpl()).searchMaxBattgroupId();//当前内存中最大的电池组id
|
| | | int BattgroupId_next=BattgroupId_max+1;
|
| | | return BattgroupId_next;
|
| | | int battgroupid=0;
|
| | | int BattgroupId_rtstate=(new Batt_rtstateDAOImpl()).searchMaxBattgroupId();//当前内存中最大的电池组id
|
| | | int BattgroupId_apply=(new Battinf_applyImpl()).searchMaxBattgroupId_apply();//当前内存中最大的电池组id
|
| | | int BattgroupId_inf=(new BattInfImpl()).searchMaxBattgroupId();//当前内存中最大的电池组id
|
| | | if(BattgroupId_inf>=BattgroupId_apply){
|
| | | battgroupid=BattgroupId_inf;
|
| | | if(battgroupid>=BattgroupId_rtstate) {
|
| | | battgroupid=battgroupid;
|
| | | }else {
|
| | | battgroupid=BattgroupId_rtstate;
|
| | | }
|
| | | }else{
|
| | | battgroupid=BattgroupId_apply;
|
| | | if(battgroupid>=BattgroupId_rtstate) {
|
| | | battgroupid=battgroupid;
|
| | | }else {
|
| | | battgroupid=BattgroupId_rtstate;
|
| | | }
|
| | | }
|
| | | return battgroupid+1;
|
| | | }
|
| | | //查询当前最大的stationid
|
| | | public static int searchStationId(){
|
| | | int station_max=(new BattInfImpl()).searchMaxId();//当前最大的stationid
|
| | | int station_next=station_max+1;
|
| | | return station_next;
|
| | | int stationid=0;
|
| | | int stationid_inf=(new BattInfImpl()).searchMaxId();//当前最大的stationid
|
| | | int stationid_apply=(new Battinf_applyImpl()).searchMaxId_apply();//当前最大的stationid
|
| | | if(stationid_inf>=stationid_apply){
|
| | | stationid=stationid_inf+1;
|
| | | }else{
|
| | | stationid=stationid_apply+1;
|
| | | }
|
| | | return stationid;
|
| | | }
|
| | | |
| | | //查询当前最大的dev_id
|
| | | public static int searchmaxdev_id(){
|
| | | int dev_id=0;
|
| | | int devid_inf=(new BattInfImpl()).searchMaxdevId_binf();
|
| | | int devid_apply=(new Battinf_applyImpl()).searchMaxdevId_apply();
|
| | | if(devid_inf>=devid_apply){
|
| | | dev_id=devid_inf+1;
|
| | | }else{
|
| | | dev_id=devid_apply+1;
|
| | | }
|
| | | return dev_id;
|
| | | }
|
| | | //当对battinf表中数据进行增删改的操作时,先备份db_battinf.tb_battinf
|
| | | public static boolean backup_battinf(){
|
| | | boolean en=false;
|