蓄电池监控管理平台数据库初始化程序
whycrzg
2021-10-21 0a147c84dc30b766344993838b82a73cd5412d65
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
package com.database_util;
 
import java.sql.ResultSet;
import java.sql.SQLException;
 
import com.sql.MysqlConnPool;
import com.sql.Sql_Mysql;
 
/**
 *     ¹¹½¨db_battinfÊý¾Ý¿âÖеÄÊý¾Ý¿â±í                            Â¼ÈëÔÚ¸ÃÊý¾Ý¿âÖÐÐÂÌí¼ÓµÄÊý¾Ý¿â±í
 * @author LiJun
 *
 */
public class DB_battinf {
    public static void init(MysqlConnPool pool, boolean recreate) {
        createDB_battinf(pool);                                        //´´½¨db_battinf Êý¾Ý¿â                ²»´æÔÚÔò´´½¨db_battinfÊý¾Ý¿â
        
        createBattInf_Table(pool, recreate);                          //´´½¨µç³Ø×éÐÅÏ¢ÅäÖñí
        
        createBattinfApply_table(pool, recreate);                    //´´½¨»ú·¿°²×°ÉóÅú±í
        
        createBattinfEx_TABLE(pool, recreate);                        //´´½¨»ùÕ¾ÐÅÏ¢
        
        createDeverrorRecord_Table(pool, recreate);                 //´´½¨»ú·¿ÎÊÌâ¼Ç¼±í
        
        createBattinfRebuild_TABLE(pool, recreate);                    //´´½¨»ú·¿Åä×é¼Ç¼±í
        
        createBattmonTestcap_TABLE(pool, recreate);                 //´´½¨±ê×¼²âÊÔÇúÏß±í
 
        createBattcurr_Inf_TABLE(pool, recreate);
        
        createBatt_Maint_Process_TABLE(pool, recreate);
        
        createBatt_Maint_Inf_TABLE(pool, recreate);
        
        createBatt_Alm_Param_TABLE(pool, recreate);
        
        createBattspare_TABLE(pool, recreate);
        
        createBattscrap_TABLE(pool, recreate);
        
        createBattspare_Record_TABLE(pool, recreate);
    }
 
    private static void createBattspare_Record_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battspare_Record_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battspare_Record_TABLE + " (" + 
                "  `id` int(11) NOT NULL AUTO_INCREMENT," +
                "  `spare_id` int(11) DEFAULT NULL COMMENT '±¸¼þid'," +
                "  `operation_num` int(11) DEFAULT NULL COMMENT '³ö/Èë¿âÊýÁ¿'," +
                "  `operation_type` int(11) DEFAULT NULL COMMENT '³öÈë¿âÀàÐÍ:-1,³ö¿â;1,Èë¿â;0,³õʼ»¯¿â´æ'," +
                "  `operation_time` datetime DEFAULT NULL COMMENT '²Ù×÷ʱ¼ä'," +
                "  `spare_num` int(11) DEFAULT NULL COMMENT 'µ±Ç°µÄ±¸¼þÊýÁ¿'," +
                "  PRIMARY KEY (`id`)" +
                ") ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COMMENT='µç³Ø±¸¼þ³öÈë¿â¼Ç¼';";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            if(true == recreate) {            
                sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
 
    private static void createBattscrap_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battscrap_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battscrap_TABLE + " (" + 
                "  `num` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," +
                "  `battProducer` varchar(15) DEFAULT 'ÀíÊ¿' COMMENT 'µç³ØÆ·ÅÆ'," +
                "  `BattModel` varchar(15) DEFAULT 'DJ300' COMMENT 'µç³ØÐͺÅ'," +
                "  `battspare_time` date DEFAULT '2021-08-01' COMMENT 'Èë¿âʱ¼ä'," +
                "  `MonCount` int(11) DEFAULT '24' COMMENT 'µ¥ÌåÊýÁ¿'," +
                "  `baojiGroup_id` int(11) DEFAULT NULL COMMENT 'ËùÊô°ü»ú×éid'," +
                "  PRIMARY KEY (`num`)" +
                ") ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            if(true == recreate) {            
                sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
 
    private static void createBattspare_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battspare_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battspare_TABLE + " (" + 
                "  `num` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Ö÷¼ü'," +
                "  `battProducer` varchar(15) DEFAULT 'ÀíÊ¿' COMMENT 'µç³ØÆ·ÅÆ'," +
                "  `BattModel` varchar(15) DEFAULT 'DJ300' COMMENT 'µç³ØÐͺÅ'," +
                "  `battinuse_time` date DEFAULT '2021-08-01' COMMENT 'ͶÈëʹÓÃʱ¼ä'," +
                "  `battscrap_time` date DEFAULT '2021-08-01' COMMENT '±¨·Ïʱ¼ä'," +
                "  `stationName` varchar(128) DEFAULT '' COMMENT 'ԭʹÓûú·¿'," +
                "  `battGroupName` varchar(128) DEFAULT '' COMMENT 'Ô­µç³Ø×éÃû'," +
                "  PRIMARY KEY (`num`)" +
                ") ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            if(true == recreate) {            
                sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
 
    /**
     *     ´´½¨     db_battinf Êý¾Ý¿â
     * @param pool
     */
    public static void createDB_battinf(MysqlConnPool pool) {
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            sql.sqlMysqlExecute("CREATE DATABASE IF NOT EXISTS " + Sql_Mysql.DB_BATT_INF);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    /**
     *    ´´½¨»ú·¿°²×°ÉóÅú±í
     */
    public static void createBattinfApply_table(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattinfApply_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattinfApply_TABLE + " (" + 
                            "  num int(11) NOT NULL AUTO_INCREMENT," + 
                            "  apply_uid int(11) NOT NULL DEFAULT '0'," + 
                            "  confrim_uid int(11) NOT NULL DEFAULT '0'," + 
                            "  apply_date datetime NOT NULL DEFAULT '2018-01-01 00:00:00'," + 
                            "  apply_en int(11) NOT NULL DEFAULT '0'," + 
                            "  apply_note varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationid varchar(64) NOT NULL DEFAULT '0'," + 
                            "  stationname varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname1 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname2 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname3 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname4 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname5 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname6 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname7 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname8 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationname9 varchar(256) NOT NULL DEFAULT ''," + 
                            "  stationip varchar(64) NOT NULL DEFAULT '127.0.0.1'," + 
                            "  FbsDeviceId int(11) NOT NULL DEFAULT '0'," + 
                            "  FbsDeviceIp varchar(64) NOT NULL DEFAULT '127.000.000.001'," + 
                            "  FbsDeviceIp_YM varchar(64) NOT NULL DEFAULT '255.255.255.0'," + 
                            "  FbsDeviceIp_WG varchar(64) NOT NULL DEFAULT '127.0.0.1'," + 
                            "  FBSDeviceName varchar(64) NOT NULL DEFAULT 'É豸Ãû³Æ'," + 
                            "  GroupIndexInFBSDevice int(11) NOT NULL DEFAULT '1'," + 
                            "  BattGroupId int(11) NOT NULL DEFAULT '0'," + 
                            "  BattGroupNum int(11) NOT NULL DEFAULT '2'," + 
                            "  BattGroupName varchar(64) NOT NULL DEFAULT 'µç³Ø×é1'," + 
                            "  FloatVolLevel float NOT NULL DEFAULT '54'," + 
                            "  OfflineVolLevel float NOT NULL DEFAULT '42.9'," + 
                            "  BattFloatCurrent float NOT NULL DEFAULT '5'," + 
                            "  MonCount int(11) NOT NULL DEFAULT '24'," + 
                            "  MonCapStd float NOT NULL DEFAULT '300'," + 
                            "  MonVolStd float NOT NULL DEFAULT '2'," + 
                            "  MonResStd float NOT NULL DEFAULT '0.2'," + 
                            "  MonSerStd float NOT NULL DEFAULT '5000'," + 
                            "  MonVolLowToAvg float NOT NULL DEFAULT '0.05'," + 
                            "  Load_curr float NOT NULL DEFAULT '15'," + 
                            "  DisCurrMax float NOT NULL DEFAULT '0'," + 
                            "  station_phone varchar(64) NOT NULL DEFAULT ''," + 
                            "  BattProducer varchar(64) NOT NULL DEFAULT ''," + 
                            "  BattModel varchar(64) NOT NULL DEFAULT ''," + 
                            "  BattProductDate datetime NOT NULL DEFAULT '2018-09-18 00:00:00'," + 
                            "  BattInUseDate datetime NOT NULL DEFAULT '2018-09-18 00:00:00'," + 
                            "  install_user varchar(64) NOT NULL DEFAULT ''," + 
                            "  check_en int(11) NOT NULL DEFAULT '0'," + 
                            "  check_uid int(11) NOT NULL DEFAULT '0'," + 
                            "  longitude double NOT NULL DEFAULT '0'," + 
                            "  latitude double NOT NULL DEFAULT '0'," + 
                            "  address varchar(256) NOT NULL DEFAULT ''," + 
                            "  PRIMARY KEY (num)," + 
                            "  UNIQUE KEY BattGroupId_index (BattGroupId) USING BTREE," + 
                            "  KEY FbsDeviceId_index (FbsDeviceId)" + 
                            ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);        
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     *    ´´½¨»ùÕ¾ÐÅÏ¢±í
     */
    public static void createBattinfEx_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattinfEx_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattinfEx_TABLE + " (" + 
                "  num int(11) NOT NULL AUTO_INCREMENT," + 
                "  StationId varchar(20) NOT NULL DEFAULT '0' COMMENT '»ú·¿id'," + 
                "  FBSDeviceId bigint(20) NOT NULL DEFAULT '0' COMMENT 'É豸id'," + 
                "  StationName varchar(100) NOT NULL DEFAULT '' COMMENT '»ú·¿Ãû³Æ'," + 
                "  stationCode varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·±àÂë'," + 
                "  stationRegion varchar(100) NOT NULL DEFAULT '' COMMENT 'ËùÊôÇøÓò'," + 
                "  keyWords varchar(100) NOT NULL DEFAULT '' COMMENT '¹Ø¼ü×Ö'," + 
                "  affiliation varchar(100) NOT NULL DEFAULT '' COMMENT 'ËùÊô×éÖ¯'," + 
                "  dataSources varchar(100) NOT NULL DEFAULT '' COMMENT 'Êý¾ÝÀ´Ô´'," + 
                "  stationType varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·ÀàÐÍ'," + 
                "  longitude double NOT NULL DEFAULT '0' COMMENT '¾­¶È'," + 
                "  latitude double NOT NULL DEFAULT '0' COMMENT 'γ¶È'," + 
                "  stationAddr varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·µØÖ·'," + 
                "  stationLevel varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·µÈ¼¶'," + 
                "  maintenanceState varchar(100) NOT NULL DEFAULT '' COMMENT 'ά»¤×´Ì¬'," + 
                "  blockedState tinyint(4) NOT NULL DEFAULT '0' COMMENT '·âËø×´Ì¬'," + 
                "  maintenanceCompany varchar(100) NOT NULL DEFAULT '' COMMENT 'ά»¤µ¥Î»'," + 
                "  businessScenario varchar(100) NOT NULL DEFAULT '' COMMENT 'ÒµÎñ³¡¾°'," + 
                "  CoverScenario varchar(100) NOT NULL DEFAULT '' COMMENT '¸²¸Ç³¡¾°'," + 
                "  siteTerrain varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·µØÐÎ'," + 
                "  propertyRights varchar(100) NOT NULL DEFAULT '' COMMENT '²úȨÐÔÖÊ'," + 
                "  propertyUnit varchar(100) NOT NULL DEFAULT '' COMMENT '²úȨµ¥Î»'," + 
                "  isShare tinyint(4) NOT NULL DEFAULT '0' COMMENT 'ÊÇ·ñ¹²Ïí'," + 
                "  useUnit varchar(100) NOT NULL DEFAULT '' COMMENT 'ʹÓõ¥Î»'," + 
                "  siteCode varchar(100) NOT NULL DEFAULT '' COMMENT 'ÎïÀíÕ¾Ö·±àÂë'," + 
                "  historySiteCode varchar(100) NOT NULL DEFAULT '' COMMENT 'ÀúÊ·ÎïÀíÕ¾Ö·±àÂë'," + 
                "  siteInternalNumber varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·ÄÚ²¿±àÂë'," + 
                "  sitePinyinReferred varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·Æ´Òô¼ò³Æ'," + 
                "  siteChineseReferred varchar(100) NOT NULL DEFAULT '' COMMENT 'ÖÐÎļò³Æ'," + 
                "  siteMergeRecord varchar(100) NOT NULL DEFAULT '' COMMENT 'Õ¾Ö·ºÏ²¢¼Ç¼'," + 
                "  isOpenBusiness varchar(16) NOT NULL DEFAULT '' COMMENT 'ÊÇ·ñ¿ªÍ¨ÒµÎñ'," + 
                "  schoolPersonnel varchar(64) NOT NULL DEFAULT '' COMMENT '¼ÈëÈËÔ±'," + 
                "  entryTime varchar(64) NOT NULL DEFAULT '' COMMENT '¼Èëʱ¼ä'," + 
                "  modifyPeople varchar(64) NOT NULL DEFAULT '' COMMENT 'ÐÞ¸ÄÈË'," + 
                "  modifyTime varchar(64) NOT NULL DEFAULT '' COMMENT 'ÐÞ¸Äʱ¼ä'," + 
                "  note varchar(255) NOT NULL DEFAULT '' COMMENT '±¸×¢'," + 
                "  siteReceivesMark tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Õ¾Ö·½ÓÊÕ±ê¼Ç'," + 
                "  siteValidity tinyint(4) NOT NULL DEFAULT '0' COMMENT 'ÊÇ·ñÓÐЧ'," + 
                "  siteNameCMCC varchar(100) NOT NULL DEFAULT '' COMMENT 'ÒÆ¶¯Õ¾Ö·Ãû³Æ'," + 
                "  siteNameCUCC varchar(100) NOT NULL DEFAULT '' COMMENT 'ÁªÍ¨Õ¾Ö·Ãû³Æ'," + 
                "  siteNameCTC varchar(100) NOT NULL DEFAULT '' COMMENT 'µçÐÅÕ¾Ö·Ãû³Æ'," + 
                "  producer varchar(100) NOT NULL DEFAULT '' COMMENT 'µç³Ø²úÉÌ'," + 
                "  lastTimeLong float NOT NULL DEFAULT '0' COMMENT 'Ðøº½²âËãʱ³¤'," + 
                "  lastTimeType varchar(100) NOT NULL DEFAULT '' COMMENT 'Ðøº½²âËãÀà±ð'," + 
                "  lastTimeDate datetime NOT NULL DEFAULT '1970-10-01 00:00:00' COMMENT 'Ðøº½·¢Éúʱ¼ä'," + 
                "  shareInfo varchar(100) NOT NULL DEFAULT '' COMMENT '¹²ÏíÇé¿ö'," + 
                "  electPowerCMCC tinyint(4) NOT NULL DEFAULT '0' COMMENT 'ÒÆ¶¯ÊÇ·ñ¹ºÂò·¢µç·þÎñ'," + 
                "  electPowerCUCC tinyint(4) NOT NULL DEFAULT '0' COMMENT 'ÁªÍ¨ÊÇ·ñ¹ºÂò·¢µç·þÎñ'," + 
                "  electPowerCTC tinyint(4) NOT NULL DEFAULT '0' COMMENT 'µçÐÅÊÇ·ñ¹ºÂò·¢µç·þÎñ'," + 
                "  isCanElectPower tinyint(4) NOT NULL DEFAULT '0' COMMENT 'ÊÇ·ñ¾ß±¸·¢µçÌõ¼þ'," + 
                "  upperStationRoute float NOT NULL DEFAULT '0' COMMENT 'ÉÏվ·³Ì'," + 
                "  upperStationDifficult varchar(100) NOT NULL DEFAULT '' COMMENT 'ÉÏÕ¾ÄÑÒ׳̶È'," + 
                "  clienteleErrorService varchar(255) NOT NULL DEFAULT '' COMMENT '¿Í»§ÎÊÌâ¿âδÍê³ÉÐîµç³ØÎ¬ÐÞ'," + 
                "  PRIMARY KEY (num)," + 
                "  KEY index_station_id (StationId)," + 
                "  KEY index_battgroup_id (FBSDeviceId)," + 
                "  KEY index_station_name (StationName)" + 
                ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);        
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    /**
     *    ´´½¨»ú·¿ÎÊÌâ¼Ç¼±í
     */
    public static void createDeverrorRecord_Table(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.DeverrorRecord_Table;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.DeverrorRecord_Table + " (" + 
                "  num int(11) NOT NULL AUTO_INCREMENT," + 
                "  stationid varchar(64) NOT NULL DEFAULT '42000001'," + 
                "  record_time datetime NOT NULL DEFAULT '2018-01-01 00:00:00'," + 
                "  error_descript longtext NOT NULL," + 
                "  uid int(11) NOT NULL DEFAULT '1002'," + 
                "  uname varchar(64) NOT NULL DEFAULT ''," + 
                "  error_en int(11) NOT NULL DEFAULT '0'," + 
                "  error_dispose longtext NOT NULL," + 
                "  note varchar(64) NOT NULL DEFAULT ''," + 
                "  picture_one longblob," + 
                "  picture_two longblob," + 
                "  picture_three longblob," + 
                "  picture_four longblob," + 
                "  picture_num int(11) NOT NULL DEFAULT '0'," + 
                "  solve_picture_one longblob," + 
                "  solve_picture_two longblob," + 
                "  solve_picture_three longblob," + 
                "  solve_picture_four longblob," + 
                "  solve_picture_num int(11) NOT NULL DEFAULT '0'," + 
                "  solve_uid int(11) NOT NULL DEFAULT '1002'," + 
                "  solve_uname varchar(64) NOT NULL DEFAULT ''," + 
                "  solve_record_time datetime NOT NULL DEFAULT '2018-01-01 00:00:00'," + 
                "  error_state int(11) NOT NULL DEFAULT '8'," + 
                "  PRIMARY KEY (num)," + 
                "  KEY stationid_index (stationid)" + 
                ") ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
            //Ìí¼ÓÉ豸¸æ¾¯ÁÐ
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_deverror_record'"
                    + " AND column_name='error_state'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.DeverrorRecord_Table 
                                + " ADD COLUMN error_state int(11) NOT NULL DEFAULT '8'");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    
    /**
     *    ´´½¨»ú·¿Åä×é¼Ç¼±í
     */
    public static void createBattinfRebuild_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattinfRebuild_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattinfRebuild_TABLE + " (" + 
                            "  num int(11) NOT NULL AUTO_INCREMENT," + 
                            "  old_stationname varchar(64) NOT NULL DEFAULT ''," + 
                            "  old_battgroupname varchar(64) NOT NULL DEFAULT ''," + 
                            "  old_battproducer varchar(64) NOT NULL DEFAULT ''," + 
                            "  old_stationid varchar(64) NOT NULL DEFAULT '42000000'," + 
                            "  old_battgroupid int(11) NOT NULL DEFAULT '910000000'," + 
                            "  old_monum int(11) NOT NULL DEFAULT '0'," + 
                            "  new_stationname varchar(64) NOT NULL DEFAULT ''," + 
                            "  new_battgroupname varchar(64) NOT NULL DEFAULT ''," + 
                            "  new_battproducer varchar(64) NOT NULL DEFAULT ''," + 
                            "  new_stationid varchar(64) NOT NULL DEFAULT '42000000'," + 
                            "  new_battgroupid int(11) NOT NULL DEFAULT '910000000'," + 
                            "  new_monum int(11) NOT NULL DEFAULT '0'," + 
                            "  rebuild_time datetime NOT NULL DEFAULT '2018-09-30 00:00:00'," + 
                            "  rebuild_uid int(11) NOT NULL DEFAULT '1002'," + 
                            "  rebuild_address varchar(256) NOT NULL DEFAULT ''," + 
                            "  rebuild_clear_type int(11) NOT NULL DEFAULT '0'," + 
                            "  PRIMARY KEY (num)," + 
                            "  KEY index_new_battgroupid (new_battgroupid)," + 
                            "  KEY index_new_stationid (new_stationid)" + 
                            ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    /**
     *    ´´½¨±ê×¼²âÊÔÇúÏ߼Ǽ±í
     */
    public static void createBattmonTestcap_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattmonTestcap_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattmonTestcap_TABLE + " (" + 
                "  num int(11) NOT NULL AUTO_INCREMENT," + 
                "  monvolstd float NOT NULL DEFAULT '0'," + 
                "  moncapstd float NOT NULL DEFAULT '0'," + 
                "  battproducer varchar(64) NOT NULL DEFAULT ''," + 
                "  battmodel varchar(64) NOT NULL DEFAULT ''," + 
                "  test_cap double NOT NULL DEFAULT '0'," + 
                "  mon_vol double NOT NULL DEFAULT '0'," + 
                "  note varchar(64) NOT NULL DEFAULT ''," + 
                "  PRIMARY KEY (num)," + 
                "  KEY test_cap_index (test_cap)" + 
                ") ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    /**
     *    ´´½¨ tb_battcurr_inf ±í
     * @param pool
     * @param recreate
     */
    public static void createBattcurr_Inf_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Battcurr_Inf_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Battcurr_Inf_TABLE + " (" + 
                "  num int(11) NOT NULL AUTO_INCREMENT," + 
                "  StationId varchar(20) NOT NULL DEFAULT '0'," + 
                "  BattGroupId varchar(20) NOT NULL DEFAULT '0'," + 
                "  BattGroupName varchar(100) NOT NULL DEFAULT '0'," + 
                "  CurrDeviceId varchar(20) NOT NULL DEFAULT '0'," + 
                "  CurrDeviceName varchar(100) NOT NULL DEFAULT '0'," + 
                "  CurrValueId varchar(20) NOT NULL DEFAULT '0'," + 
                "  CurrValueName varchar(100) NOT NULL DEFAULT '0'," + 
                "  PRIMARY KEY (num)" + 
                ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    /**
     *    ´´½¨ tb_batt_maint_process ±í
     * @param pool
     * @param recreate
     */
    public static void createBatt_Maint_Process_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Batt_Maint_Process_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Batt_Maint_Process_TABLE + " (" + 
                "  num bigint(20) NOT NULL AUTO_INCREMENT," + 
                "  batt_maint_rec_id bigint(20) NOT NULL DEFAULT '0'," + 
                "  usr_id int(11) NOT NULL DEFAULT '0'," + 
                "  work_caption varchar(200) NOT NULL DEFAULT ' '," + 
                "  work_caption_time datetime DEFAULT '2005-01-01 00:00:00'," + 
                "  PRIMARY KEY (num)," + 
                "  KEY index_batt_maint_rec_id (batt_maint_rec_id)" + 
                ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    /**
     *    ´´½¨ tb_batt_maint_inf ±í
     * @param pool
     * @param recreate
     */
    public static void createBatt_Maint_Inf_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Batt_Maint_Inf_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Batt_Maint_Inf_TABLE + " (" + 
                "  num bigint(20) NOT NULL AUTO_INCREMENT," + 
                "  BattGroupId int(11) NOT NULL DEFAULT '0'," + 
                "  usr_id int(11) NOT NULL DEFAULT '0'," + 
                "  fault_type_id int(11) NOT NULL DEFAULT '0'," + 
                "  fault_type varchar(50) NOT NULL DEFAULT ' '," + 
                "  fault_level int(11) NOT NULL DEFAULT '0'," + 
                "  fault_caption varchar(200) NOT NULL DEFAULT ' '," + 
                "  fault_time datetime NOT NULL DEFAULT '2005-01-01 00:00:00'," + 
                "  record_uid int(11) NOT NULL DEFAULT '0'," + 
                "  record_time datetime NOT NULL DEFAULT '2005-01-01 00:00:00'," + 
                "  maint_time_limit datetime NOT NULL DEFAULT '2005-01-01 00:00:00'," + 
                "  maint_type_id int(11) NOT NULL DEFAULT '0'," + 
                "  maint_type varchar(50) NOT NULL DEFAULT ' '," + 
                "  maint_result varchar(100) NOT NULL DEFAULT ' '," + 
                "  maint_done tinyint(1) NOT NULL DEFAULT '0'," + 
                "  maint_done_time datetime DEFAULT '2005-01-01 00:00:00'," + 
                "  maint_close tinyint(1) NOT NULL DEFAULT '0'," + 
                "  master_id int(11) NOT NULL DEFAULT '0'," + 
                "  master_audit int(11) NOT NULL DEFAULT '0'," + 
                "  appoint_uid int(11) NOT NULL DEFAULT '0'," + 
                "  copy_uids varchar(200) NOT NULL DEFAULT ' '," + 
                "  master_check varchar(100) NOT NULL DEFAULT ' '," + 
                "  remark varchar(200) NOT NULL DEFAULT ' '," + 
                "  PRIMARY KEY (num)," + 
                "  KEY index_battgroup_id (BattGroupId)," + 
                "  KEY index_user_id (usr_id)," + 
                "  KEY index_fault_type_id (fault_type_id)," + 
                "  KEY index_maint_type_id (maint_type_id)" + 
                ") ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    /**
     *    ´´½¨ tb_batt_alm_param ±í
     * @param pool
     * @param recreate
     */
    public static void createBatt_Alm_Param_TABLE(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.Batt_Alm_Param_TABLE;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.Batt_Alm_Param_TABLE + " (" + 
                "  num bigint(20) NOT NULL AUTO_INCREMENT," + 
                "  param_id int(11) NOT NULL DEFAULT '2020001' COMMENT '²ÎÊýid'," + 
                "  mon_vol_low float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåµçѹµÍ¸æ¾¯'," + 
                "  mon_vol_high float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåµçѹ¸ß¸æ¾¯'," + 
                "  mon_res_low float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÄÚ×èµÍ'," + 
                "  mon_res_high float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåÄÚ×è¸ß'," + 
                "  mon_tmp_low float NOT NULL DEFAULT '0' COMMENT 'µ¥ÌåζȵÍ'," + 
                "  mon_tmp_high float NOT NULL DEFAULT '0' COMMENT 'µ¥Ìåζȸß'," + 
                "  note varchar(255) NOT NULL DEFAULT ''," + 
                "  PRIMARY KEY (num)," + 
                "  UNIQUE KEY index_param_id (param_id) USING BTREE" + 
                ") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
    
    /**
     *    ´´½¨ tb_batt_alm_param ±í
     * @param pool
     * @param recreate
     */
    public static void createBattInf_Table(MysqlConnPool pool, boolean recreate) {
        String sql_str01 = " DROP TABLE IF EXISTS "+Sql_Mysql.BattInf_Table;
        String sql_str02 = "CREATE TABLE IF NOT EXISTS " + Sql_Mysql.BattInf_Table + " (" + 
                "  `num` int(11) NOT NULL AUTO_INCREMENT," + 
                "  `StationId` varchar(20) NOT NULL DEFAULT '0'," + 
                "  `charge_curr_max` float DEFAULT '20'," + 
                "  `StationId_ex` varchar(20) DEFAULT '0'," + 
                "  `StationName` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName1` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName2` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName3` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName4` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName5` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName6` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName7` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName8` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationName9` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `StationIP` varchar(20) NOT NULL DEFAULT '0'," + 
                "  `FBSDeviceId` bigint(11) NOT NULL DEFAULT '0'," + 
                "  `FBSDeviceIp` varchar(50) NOT NULL DEFAULT '192.168.0.88'," + 
                "  `FBSDeviceName` varchar(100) NOT NULL DEFAULT '0'," + 
                "  `GroupIndexInFBSDevice` int(11) NOT NULL DEFAULT '0'," + 
                "  `BattModel` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `BattGroupId` int(11) NOT NULL DEFAULT '0'," + 
                "  `BattGroupNum` int(11) NOT NULL DEFAULT '0'," + 
                "  `BattGroupName` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `BattGroupName1` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `BattGroupName2` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `BattGroupName3` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `BattGroupName4` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `BattGroupName5` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `BattGroupName6` varchar(100) NOT NULL DEFAULT ' '," + 
                "  `FloatVolLevel` float NOT NULL DEFAULT '1.12'," + 
                "  `OfflineVolLevel` float NOT NULL DEFAULT '1.06'," + 
                "  `BattFloatCurrent` float NOT NULL DEFAULT '0'," + 
                "  `DeviceId` varchar(20) NOT NULL DEFAULT '0'," + 
                "  `DeviceName` varchar(100) NOT NULL DEFAULT '0'," + 
                "  `MonCount` int(11) NOT NULL DEFAULT '0'," + 
                "  `MonCapStd` float NOT NULL DEFAULT '0'," + 
                "  `MonVolStd` float NOT NULL DEFAULT '0'," + 
                "  `MonResStd` float NOT NULL DEFAULT '0'," + 
                "  `MonSerStd` float NOT NULL DEFAULT '0'," + 
                "  `MonTmpStd` float NOT NULL DEFAULT '0'," + 
                "  `MonVolLowToAvg` float NOT NULL DEFAULT '0'," + 
                "  `MonNum` int(11) NOT NULL DEFAULT '0'," + 
                "  `BattProducer` varchar(45) NOT NULL DEFAULT '0'," + 
                "  `BattProductDate` date NOT NULL DEFAULT '2006-07-06'," + 
                "  `BattInUseDate` date NOT NULL DEFAULT '2006-07-06'," + 
                "  `BattGuarantDayCount` int(11) NOT NULL DEFAULT '1095'," + 
                "  `SignalId` varchar(20) NOT NULL DEFAULT '0'," + 
                "  `CInterFaceId` int(11) NOT NULL DEFAULT '0'," + 
                "  `SignalName` varchar(50) NOT NULL DEFAULT '0'," + 
                "  `Load_curr` float NOT NULL DEFAULT '15'," + 
                "  `disCurrMax` float NOT NULL DEFAULT '0'," + 
                "  `FbsDeviceIp_YM` varchar(50) NOT NULL DEFAULT '255.255.255.0'," + 
                "  `FbsDeviceIp_WG` varchar(50) NOT NULL DEFAULT '127.0.0.1'," + 
                "  `station_phone` varchar(32) DEFAULT ''," + 
                "  `station_install` tinyint(1) NOT NULL DEFAULT '0'," + 
                "  `install_user` varchar(64) DEFAULT ''," + 
                "  `Vol_grade` float DEFAULT '0'," + 
                "  `Manufacturers` varchar(64) DEFAULT ''," + 
                "  `Assetequipment` varchar(64) DEFAULT ''," + 
                "  `Deviceclasspath` varchar(64) DEFAULT ''," + 
                "  `DeviceOperationDepartment` varchar(64) DEFAULT ''," + 
                "  `PropertyRightUnit` varchar(64) DEFAULT ''," + 
                "  `PropertyAttribute` varchar(64) DEFAULT ''," + 
                "  `FactoryNumber` varchar(64) DEFAULT ''," + 
                "  `OperationTeam` varchar(64) DEFAULT ''," + 
                "  `DeviceIdentityCode` varchar(64) DEFAULT ''," + 
                "  `ProjectType` varchar(64) DEFAULT ''," + 
                "  `BatteryApplicationType` varchar(64) DEFAULT ''," + 
                "  `SingleRatedVoltage` float DEFAULT '0'," + 
                "  `RemoteMonitor` varchar(64) DEFAULT ''," + 
                "  `BatttIndependentPlaced` varchar(64) DEFAULT ''," + 
                "  `JunChargeVoltageValue` float DEFAULT '0'," + 
                "  `PublicKeyX` varchar(200) NOT NULL DEFAULT ''," + 
                "  `PublicKeyY` varchar(200) NOT NULL DEFAULT ''," + 
                "  `KeyID` varchar(200) NOT NULL DEFAULT ''," + 
                "  `SerialNumber` varchar(200) NOT NULL DEFAULT ''," + 
                "  `video_url` varchar(200) DEFAULT NULL," + 
                "  PRIMARY KEY (`num`)," + 
                "  UNIQUE KEY `index_battgroup_id` (`BattGroupId`) USING BTREE," + 
                "  KEY `index_station_id` (`StationId`)," + 
                "  KEY `index_station_name` (`StationName`)," + 
                "  KEY `index_battgroup_name` (`BattGroupName`)" + 
                ") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;";
        Sql_Mysql sql = new Sql_Mysql(pool.getConn());
        ResultSet res = null;
        try {
            if(true == recreate) {            
                //sql.sqlMysqlExecute(sql_str01);
            }
            sql.sqlMysqlExecute(sql_str02);
            //Ìí¼ÓLoad_curr
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='Load_curr'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `Load_curr` float NOT NULL DEFAULT '15';");
            }
            //Ìí¼ÓdisCurrMax
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='disCurrMax'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `disCurrMax` float NOT NULL DEFAULT '0';");
            }
            //Ìí¼ÓFbsDeviceIp_YM
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='FbsDeviceIp_YM'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `FbsDeviceIp_YM` varchar(50) NOT NULL DEFAULT '255.255.255.0';");
            }
            //Ìí¼ÓFbsDeviceIp_WG
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='FbsDeviceIp_WG'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `FbsDeviceIp_WG` varchar(50) NOT NULL DEFAULT '127.0.0.1';");
            }
            //Ìí¼Óstation_phone
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='station_phone'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `station_phone` varchar(32) DEFAULT '';");
            }
            //Ìí¼Óstation_install
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='station_install'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `station_install` tinyint(1) NOT NULL DEFAULT '0';");
            }
            //Ìí¼Óinstall_user
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='install_user'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `install_user` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓVol_grade
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='Vol_grade'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `Vol_grade` float DEFAULT '0';");
            }
            //Ìí¼ÓManufacturers
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='Manufacturers'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `Manufacturers` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓAssetequipment
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='Assetequipment'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `Assetequipment` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓDeviceclasspath
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='Deviceclasspath'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `Deviceclasspath` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓDeviceOperationDepartment
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='DeviceOperationDepartment'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                                + " ADD COLUMN `DeviceOperationDepartment` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓPropertyRightUnit
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='PropertyRightUnit'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `PropertyRightUnit` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓPropertyAttribute
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='PropertyAttribute'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `PropertyAttribute` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓFactoryNumber
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='FactoryNumber'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `FactoryNumber` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓOperationTeam
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='OperationTeam'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `OperationTeam` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓDeviceIdentityCode
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='DeviceIdentityCode'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `DeviceIdentityCode` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓProjectType
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='ProjectType'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `ProjectType` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓBatteryApplicationType
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='BatteryApplicationType'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `BatteryApplicationType` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓSingleRatedVoltage
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='SingleRatedVoltage'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `SingleRatedVoltage` float DEFAULT '0';");
            }
            //Ìí¼ÓRemoteMonitor
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='RemoteMonitor'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `RemoteMonitor` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓBatttIndependentPlaced
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='BatttIndependentPlaced'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `BatttIndependentPlaced` varchar(64) DEFAULT '';");
            }
            //Ìí¼ÓJunChargeVoltageValue
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='JunChargeVoltageValue'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `JunChargeVoltageValue` float DEFAULT '0';");
            }
            //Ìí¼ÓPublicKeyX
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='PublicKeyX'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `PublicKeyX` varchar(200) NOT NULL DEFAULT '';");
            }
            //Ìí¼ÓPublicKeyY
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='PublicKeyY'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `PublicKeyY` varchar(200) NOT NULL DEFAULT '';");
            }
            //Ìí¼ÓKeyID
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='KeyID'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `KeyID` varchar(200) NOT NULL DEFAULT '';");
            }
            //Ìí¼ÓSerialNumber
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='SerialNumber'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `SerialNumber` varchar(200) NOT NULL DEFAULT '';");
            }        
            //Ìí¼ÓSerialNumber
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='video_url'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `video_url` varchar(200) DEFAULT NULL;");
            }
            
            //Ìí¼Ócharge_type
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='charge_type'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `charge_type` int(11) NOT NULL DEFAULT '1' COMMENT '³ä·Åµç״̬£º1:ÏÞÁ÷³äµç£»2£»Äæ±ä³äµç';");
            }
            
            //Ìí¼Óbuscouple_state
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='buscouple_state'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `buscouple_state` int(11) NOT NULL DEFAULT '0' COMMENT 'ĸÁª×´Ì¬£º0£ºÎÞĸÁª£»1:ÓÐĸÁª';");
            }
            
            //Ìí¼Ótmp_id
            res = sql.sqlMysqlQuery("SELECT * FROM information_schema.columns"
                    + " WHERE table_schema='db_battinf'"
                    + " AND table_name='tb_battinf'"
                    + " AND column_name='tmp_id'");
            if(false == res.next()) {
                sql.sqlMysqlExecute("ALTER TABLE " + Sql_Mysql.BattInf_Table 
                        + " ADD COLUMN `tmp_id` int(11) DEFAULT '0';");
            }
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            sql.close_con();
        }
    }
}