cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
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
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
package cn.ksource.beans;
 
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
 
import org.apache.commons.lang.StringUtils;
 
 
import cn.ksource.core.dao.BaseBean;
import cn.ksource.core.util.ConvertUtil;
import cn.ksource.core.util.StringUtil;
 
/**
 * 配置表
 */
public class CMDB_CI_BASE extends BaseBean{
 
    public final static Map<String, String> KEYS = new HashMap<String, String>();
    private Map BEAN_VALUES = null;
    
    static {
        KEYS.put("id", "String");
        KEYS.put("cus_id", "String");
        KEYS.put("cus_name", "String");
        KEYS.put("sub_cus_id", "String");
        KEYS.put("sub_cus_name", "String");
        KEYS.put("bus_id", "String");
        KEYS.put("ciname", "String");
        KEYS.put("searchcode", "String");
        KEYS.put("code", "String");
        KEYS.put("sn_no", "String");
        KEYS.put("zr_name", "String");
        KEYS.put("zr_dept", "String");
        KEYS.put("lv1_id", "String");
        KEYS.put("lv1_name", "String");
        KEYS.put("lv2_id", "String");
        KEYS.put("lv2_name", "String");
        KEYS.put("lv3_id", "String");
        KEYS.put("lv3_name", "String");
        KEYS.put("mft_id", "String");
        KEYS.put("mft_name", "String");
        KEYS.put("igt_id", "String");
        KEYS.put("igt_name", "String");
        KEYS.put("create_id", "String");
        KEYS.put("create_name", "String");
        KEYS.put("create_time", "Long");
        KEYS.put("admin_id", "String");
        KEYS.put("position", "String");
        KEYS.put("last_up_time", "Long");
        KEYS.put("note", "String");
        KEYS.put("buy_time", "Long");
        KEYS.put("gb_time", "Long");
        KEYS.put("xb_time", "Long");
        KEYS.put("xbgb_time", "Long");
        KEYS.put("state", "Integer");
    }
    public Map getColumnMap(){
        return KEYS;
    }
 
    private String id;
    private Boolean isSetted_id = false;;
    
    private String cus_id;
    private Boolean isSetted_cus_id = false;
    private String cus_name;
    private Boolean isSetted_cus_name = false;
    private String sub_cus_id;
    private Boolean isSetted_sub_cus_id = false;
    private String sub_cus_name;
    private Boolean isSetted_sub_cus_name = false;
    private String bus_id;
    private Boolean isSetted_bus_id = false;
    private String ciname;
    private Boolean isSetted_ciname = false;
    private String searchcode;
    private Boolean isSetted_searchcode = false;
    private String code;
    private Boolean isSetted_code = false;
    private String sn_no;
    private Boolean isSetted_sn_no = false;
    private String zr_name;
    private Boolean isSetted_zr_name = false;
    private String zr_dept;
    private Boolean isSetted_zr_dept = false;
    private String lv1_id;
    private Boolean isSetted_lv1_id = false;
    private String lv1_name;
    private Boolean isSetted_lv1_name = false;
    private String lv2_id;
    private Boolean isSetted_lv2_id = false;
    private String lv2_name;
    private Boolean isSetted_lv2_name = false;
    private String lv3_id;
    private Boolean isSetted_lv3_id = false;
    private String lv3_name;
    private Boolean isSetted_lv3_name = false;
    private String mft_id;
    private Boolean isSetted_mft_id = false;
    private String mft_name;
    private Boolean isSetted_mft_name = false;
    private String igt_id;
    private Boolean isSetted_igt_id = false;
    private String igt_name;
    private Boolean isSetted_igt_name = false;
    private String create_id;
    private Boolean isSetted_create_id = false;
    private String create_name;
    private Boolean isSetted_create_name = false;
    private Long create_time;
    private Boolean isSetted_create_time = false;
    private String admin_id;
    private Boolean isSetted_admin_id = false;
    private String position;
    private Boolean isSetted_position = false;
    private Long last_up_time;
    private Boolean isSetted_last_up_time = false;
    private String note;
    private Boolean isSetted_note = false;
    private Long buy_time;
    private Boolean isSetted_buy_time = false;
    private Long gb_time;
    private Boolean isSetted_gb_time = false;
    private Long xb_time;
    private Boolean isSetted_xb_time = false;
    private Long xbgb_time;
    private Boolean isSetted_xbgb_time = false;
    private Integer state;
    private Boolean isSetted_state = false;
 
    private void initBeanValues(){
        BEAN_VALUES = new HashMap<String, Object>();
        BEAN_VALUES.put("id",id);
            BEAN_VALUES.put("cus_id", null);
            BEAN_VALUES.put("cus_name", null);
            BEAN_VALUES.put("sub_cus_id", null);
            BEAN_VALUES.put("sub_cus_name", null);
            BEAN_VALUES.put("bus_id", null);
            BEAN_VALUES.put("ciname", null);
            BEAN_VALUES.put("searchcode", null);
            BEAN_VALUES.put("code", null);
            BEAN_VALUES.put("sn_no", null);
            BEAN_VALUES.put("zr_name", null);
            BEAN_VALUES.put("zr_dept", null);
            BEAN_VALUES.put("lv1_id", null);
            BEAN_VALUES.put("lv1_name", null);
            BEAN_VALUES.put("lv2_id", null);
            BEAN_VALUES.put("lv2_name", null);
            BEAN_VALUES.put("lv3_id", null);
            BEAN_VALUES.put("lv3_name", null);
            BEAN_VALUES.put("mft_id", null);
            BEAN_VALUES.put("mft_name", null);
            BEAN_VALUES.put("igt_id", null);
            BEAN_VALUES.put("igt_name", null);
            BEAN_VALUES.put("create_id", null);
            BEAN_VALUES.put("create_name", null);
            BEAN_VALUES.put("create_time", null);
            BEAN_VALUES.put("admin_id", null);
            BEAN_VALUES.put("position", null);
            BEAN_VALUES.put("last_up_time", null);
            BEAN_VALUES.put("note", null);
            BEAN_VALUES.put("buy_time", null);
            BEAN_VALUES.put("gb_time", null);
            BEAN_VALUES.put("xb_time", null);
            BEAN_VALUES.put("xbgb_time", null);
            BEAN_VALUES.put("state", null);
    }
    
    public CMDB_CI_BASE() {
        initBeanValues();
    }
    
    public CMDB_CI_BASE(String id) {
        super();
        this.id = id;
        initBeanValues();
        BEAN_VALUES.put("id",id);
    }
 
    /**
     * 获取ID
     */
    public String getId() {
        return this.id;
    }
    /**
     * 设置ID
     */
    public CMDB_CI_BASE setId(String id) {
        this.id = id;
        this.isSetted_id = true;
        BEAN_VALUES.put("id",id);
        return this;
    }
    
    @Override
    public String getUpdateSql() {
        StringBuffer sBuffer = new StringBuffer("update CMDB_CI_BASE set ");
            if (isSetted_cus_id) {
                sBuffer.append("cus_id=:cus_id,");
            }
            if (isSetted_cus_name) {
                sBuffer.append("cus_name=:cus_name,");
            }
            if (isSetted_sub_cus_id) {
                sBuffer.append("sub_cus_id=:sub_cus_id,");
            }
            if (isSetted_sub_cus_name) {
                sBuffer.append("sub_cus_name=:sub_cus_name,");
            }
            if (isSetted_bus_id) {
                sBuffer.append("bus_id=:bus_id,");
            }
            if (isSetted_ciname) {
                sBuffer.append("ciname=:ciname,");
            }
            if (isSetted_searchcode) {
                sBuffer.append("searchcode=:searchcode,");
            }
            if (isSetted_code) {
                sBuffer.append("code=:code,");
            }
            if (isSetted_sn_no) {
                sBuffer.append("sn_no=:sn_no,");
            }
            if (isSetted_zr_name) {
                sBuffer.append("zr_name=:zr_name,");
            }
            if (isSetted_zr_dept) {
                sBuffer.append("zr_dept=:zr_dept,");
            }
            if (isSetted_lv1_id) {
                sBuffer.append("lv1_id=:lv1_id,");
            }
            if (isSetted_lv1_name) {
                sBuffer.append("lv1_name=:lv1_name,");
            }
            if (isSetted_lv2_id) {
                sBuffer.append("lv2_id=:lv2_id,");
            }
            if (isSetted_lv2_name) {
                sBuffer.append("lv2_name=:lv2_name,");
            }
            if (isSetted_lv3_id) {
                sBuffer.append("lv3_id=:lv3_id,");
            }
            if (isSetted_lv3_name) {
                sBuffer.append("lv3_name=:lv3_name,");
            }
            if (isSetted_mft_id) {
                sBuffer.append("mft_id=:mft_id,");
            }
            if (isSetted_mft_name) {
                sBuffer.append("mft_name=:mft_name,");
            }
            if (isSetted_igt_id) {
                sBuffer.append("igt_id=:igt_id,");
            }
            if (isSetted_igt_name) {
                sBuffer.append("igt_name=:igt_name,");
            }
            if (isSetted_create_id) {
                sBuffer.append("create_id=:create_id,");
            }
            if (isSetted_create_name) {
                sBuffer.append("create_name=:create_name,");
            }
            if (isSetted_create_time) {
                sBuffer.append("create_time=:create_time,");
            }
            if (isSetted_admin_id) {
                sBuffer.append("admin_id=:admin_id,");
            }
            if (isSetted_position) {
                sBuffer.append("position=:position,");
            }
            if (isSetted_last_up_time) {
                sBuffer.append("last_up_time=:last_up_time,");
            }
            if (isSetted_note) {
                sBuffer.append("note=:note,");
            }
            if (isSetted_buy_time) {
                sBuffer.append("buy_time=:buy_time,");
            }
            if (isSetted_gb_time) {
                sBuffer.append("gb_time=:gb_time,");
            }
            if (isSetted_xb_time) {
                sBuffer.append("xb_time=:xb_time,");
            }
            if (isSetted_xbgb_time) {
                sBuffer.append("xbgb_time=:xbgb_time,");
            }
            if (isSetted_state) {
                sBuffer.append("state=:state,");
            }
        String sql = sBuffer.toString();
        return StringUtils.removeEnd(sql, ",") + " where id=:id";
    }
    
    
    @Override
    public String getInsertSql() {
        StringBuffer sBuffer = new StringBuffer("insert into CMDB_CI_BASE(");
        StringBuffer fileds = new StringBuffer("id,");
        StringBuffer values = new StringBuffer(":id,");        
            fileds.append("cus_id,");
            values.append(":cus_id,");
            fileds.append("cus_name,");
            values.append(":cus_name,");
            fileds.append("sub_cus_id,");
            values.append(":sub_cus_id,");
            fileds.append("sub_cus_name,");
            values.append(":sub_cus_name,");
            fileds.append("bus_id,");
            values.append(":bus_id,");
            fileds.append("ciname,");
            values.append(":ciname,");
            fileds.append("searchcode,");
            values.append(":searchcode,");
            fileds.append("code,");
            values.append(":code,");
            fileds.append("sn_no,");
            values.append(":sn_no,");
            fileds.append("zr_name,");
            values.append(":zr_name,");
            fileds.append("zr_dept,");
            values.append(":zr_dept,");
            fileds.append("lv1_id,");
            values.append(":lv1_id,");
            fileds.append("lv1_name,");
            values.append(":lv1_name,");
            fileds.append("lv2_id,");
            values.append(":lv2_id,");
            fileds.append("lv2_name,");
            values.append(":lv2_name,");
            fileds.append("lv3_id,");
            values.append(":lv3_id,");
            fileds.append("lv3_name,");
            values.append(":lv3_name,");
            fileds.append("mft_id,");
            values.append(":mft_id,");
            fileds.append("mft_name,");
            values.append(":mft_name,");
            fileds.append("igt_id,");
            values.append(":igt_id,");
            fileds.append("igt_name,");
            values.append(":igt_name,");
            fileds.append("create_id,");
            values.append(":create_id,");
            fileds.append("create_name,");
            values.append(":create_name,");
            fileds.append("create_time,");
            values.append(":create_time,");
            fileds.append("admin_id,");
            values.append(":admin_id,");
            fileds.append("position,");
            values.append(":position,");
            fileds.append("last_up_time,");
            values.append(":last_up_time,");
            fileds.append("note,");
            values.append(":note,");
            fileds.append("buy_time,");
            values.append(":buy_time,");
            fileds.append("gb_time,");
            values.append(":gb_time,");
            fileds.append("xb_time,");
            values.append(":xb_time,");
            fileds.append("xbgb_time,");
            values.append(":xbgb_time,");
            fileds.append("state,");
            values.append(":state,");
        sBuffer.append(StringUtils.removeEnd(fileds.toString(), ",") + ") values("+StringUtils.removeEnd(values.toString(), ",")+")");
        return sBuffer.toString();
    }
    
 
        /**
         * 获取<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getCus_id() {
            return cus_id;
        }
        /**
         * 设置<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setCus_id(String cus_id) {
            this.cus_id = cus_id;
            this.isSetted_cus_id = true;
            BEAN_VALUES.put("cus_id",cus_id);
            return this;
        }
        /**
         * 获取<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getCus_name() {
            return cus_name;
        }
        /**
         * 设置<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setCus_name(String cus_name) {
            this.cus_name = cus_name;
            this.isSetted_cus_name = true;
            BEAN_VALUES.put("cus_name",cus_name);
            return this;
        }
        /**
         * 获取<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getSub_cus_id() {
            return sub_cus_id;
        }
        /**
         * 设置<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setSub_cus_id(String sub_cus_id) {
            this.sub_cus_id = sub_cus_id;
            this.isSetted_sub_cus_id = true;
            BEAN_VALUES.put("sub_cus_id",sub_cus_id);
            return this;
        }
        /**
         * 获取<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getSub_cus_name() {
            return sub_cus_name;
        }
        /**
         * 设置<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setSub_cus_name(String sub_cus_name) {
            this.sub_cus_name = sub_cus_name;
            this.isSetted_sub_cus_name = true;
            BEAN_VALUES.put("sub_cus_name",sub_cus_name);
            return this;
        }
        /**
         * 获取业务ID<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getBus_id() {
            return bus_id;
        }
        /**
         * 设置业务ID<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setBus_id(String bus_id) {
            this.bus_id = bus_id;
            this.isSetted_bus_id = true;
            BEAN_VALUES.put("bus_id",bus_id);
            return this;
        }
        /**
         * 获取名称<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getCiname() {
            return ciname;
        }
        /**
         * 设置名称<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setCiname(String ciname) {
            this.ciname = ciname;
            this.isSetted_ciname = true;
            BEAN_VALUES.put("ciname",ciname);
            return this;
        }
        /**
         * 获取搜索代码<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getSearchcode() {
            return searchcode;
        }
        /**
         * 设置搜索代码<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setSearchcode(String searchcode) {
            this.searchcode = searchcode;
            this.isSetted_searchcode = true;
            BEAN_VALUES.put("searchcode",searchcode);
            return this;
        }
        /**
         * 获取配置编号<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getCode() {
            return code;
        }
        /**
         * 设置配置编号<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setCode(String code) {
            this.code = code;
            this.isSetted_code = true;
            BEAN_VALUES.put("code",code);
            return this;
        }
        /**
         * 获取SN编号<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getSn_no() {
            return sn_no;
        }
        /**
         * 设置SN编号<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setSn_no(String sn_no) {
            this.sn_no = sn_no;
            this.isSetted_sn_no = true;
            BEAN_VALUES.put("sn_no",sn_no);
            return this;
        }
        /**
         * 获取责任人<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getZr_name() {
            return zr_name;
        }
        /**
         * 设置责任人<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setZr_name(String zr_name) {
            this.zr_name = zr_name;
            this.isSetted_zr_name = true;
            BEAN_VALUES.put("zr_name",zr_name);
            return this;
        }
        /**
         * 获取负责科室<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getZr_dept() {
            return zr_dept;
        }
        /**
         * 设置负责科室<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setZr_dept(String zr_dept) {
            this.zr_dept = zr_dept;
            this.isSetted_zr_dept = true;
            BEAN_VALUES.put("zr_dept",zr_dept);
            return this;
        }
        /**
         * 获取一级编号<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getLv1_id() {
            return lv1_id;
        }
        /**
         * 设置一级编号<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setLv1_id(String lv1_id) {
            this.lv1_id = lv1_id;
            this.isSetted_lv1_id = true;
            BEAN_VALUES.put("lv1_id",lv1_id);
            return this;
        }
        /**
         * 获取一级分类<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getLv1_name() {
            return lv1_name;
        }
        /**
         * 设置一级分类<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setLv1_name(String lv1_name) {
            this.lv1_name = lv1_name;
            this.isSetted_lv1_name = true;
            BEAN_VALUES.put("lv1_name",lv1_name);
            return this;
        }
        /**
         * 获取二级编号<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getLv2_id() {
            return lv2_id;
        }
        /**
         * 设置二级编号<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setLv2_id(String lv2_id) {
            this.lv2_id = lv2_id;
            this.isSetted_lv2_id = true;
            BEAN_VALUES.put("lv2_id",lv2_id);
            return this;
        }
        /**
         * 获取二级分类<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getLv2_name() {
            return lv2_name;
        }
        /**
         * 设置二级分类<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setLv2_name(String lv2_name) {
            this.lv2_name = lv2_name;
            this.isSetted_lv2_name = true;
            BEAN_VALUES.put("lv2_name",lv2_name);
            return this;
        }
        /**
         * 获取三级编号<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getLv3_id() {
            return lv3_id;
        }
        /**
         * 设置三级编号<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setLv3_id(String lv3_id) {
            this.lv3_id = lv3_id;
            this.isSetted_lv3_id = true;
            BEAN_VALUES.put("lv3_id",lv3_id);
            return this;
        }
        /**
         * 获取三级分类<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getLv3_name() {
            return lv3_name;
        }
        /**
         * 设置三级分类<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setLv3_name(String lv3_name) {
            this.lv3_name = lv3_name;
            this.isSetted_lv3_name = true;
            BEAN_VALUES.put("lv3_name",lv3_name);
            return this;
        }
        /**
         * 获取厂商编号<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getMft_id() {
            return mft_id;
        }
        /**
         * 设置厂商编号<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setMft_id(String mft_id) {
            this.mft_id = mft_id;
            this.isSetted_mft_id = true;
            BEAN_VALUES.put("mft_id",mft_id);
            return this;
        }
        /**
         * 获取厂商名称<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getMft_name() {
            return mft_name;
        }
        /**
         * 设置厂商名称<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setMft_name(String mft_name) {
            this.mft_name = mft_name;
            this.isSetted_mft_name = true;
            BEAN_VALUES.put("mft_name",mft_name);
            return this;
        }
        /**
         * 获取集成商编号<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getIgt_id() {
            return igt_id;
        }
        /**
         * 设置集成商编号<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setIgt_id(String igt_id) {
            this.igt_id = igt_id;
            this.isSetted_igt_id = true;
            BEAN_VALUES.put("igt_id",igt_id);
            return this;
        }
        /**
         * 获取集成商名称<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getIgt_name() {
            return igt_name;
        }
        /**
         * 设置集成商名称<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setIgt_name(String igt_name) {
            this.igt_name = igt_name;
            this.isSetted_igt_name = true;
            BEAN_VALUES.put("igt_name",igt_name);
            return this;
        }
        /**
         * 获取创建人ID<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getCreate_id() {
            return create_id;
        }
        /**
         * 设置创建人ID<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setCreate_id(String create_id) {
            this.create_id = create_id;
            this.isSetted_create_id = true;
            BEAN_VALUES.put("create_id",create_id);
            return this;
        }
        /**
         * 获取创建人<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getCreate_name() {
            return create_name;
        }
        /**
         * 设置创建人<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setCreate_name(String create_name) {
            this.create_name = create_name;
            this.isSetted_create_name = true;
            BEAN_VALUES.put("create_name",create_name);
            return this;
        }
        /**
         * 获取创建时间<BR/>
         * 䣺2016-31-18 hh:07
         */
        public Long getCreate_time() {
            return create_time;
        }
        /**
         * 设置创建时间<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setCreate_time(Long create_time) {
            this.create_time = create_time;
            this.isSetted_create_time = true;
            BEAN_VALUES.put("create_time",create_time);
            return this;
        }
        /**
         * 获取CI管理员<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getAdmin_id() {
            return admin_id;
        }
        /**
         * 设置CI管理员<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setAdmin_id(String admin_id) {
            this.admin_id = admin_id;
            this.isSetted_admin_id = true;
            BEAN_VALUES.put("admin_id",admin_id);
            return this;
        }
        /**
         * 获取存放位置<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getPosition() {
            return position;
        }
        /**
         * 设置存放位置<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setPosition(String position) {
            this.position = position;
            this.isSetted_position = true;
            BEAN_VALUES.put("position",position);
            return this;
        }
        /**
         * 获取最后更新时间<BR/>
         * 䣺2016-31-18 hh:07
         */
        public Long getLast_up_time() {
            return last_up_time;
        }
        /**
         * 设置最后更新时间<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setLast_up_time(Long last_up_time) {
            this.last_up_time = last_up_time;
            this.isSetted_last_up_time = true;
            BEAN_VALUES.put("last_up_time",last_up_time);
            return this;
        }
        /**
         * 获取备注<BR/>
         * 䣺2016-31-18 hh:07
         */
        public String getNote() {
            return note;
        }
        /**
         * 设置备注<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setNote(String note) {
            this.note = note;
            this.isSetted_note = true;
            BEAN_VALUES.put("note",note);
            return this;
        }
        /**
         * 获取购买时间<BR/>
         * 䣺2016-31-18 hh:07
         */
        public Long getBuy_time() {
            return buy_time;
        }
        /**
         * 设置购买时间<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setBuy_time(Long buy_time) {
            this.buy_time = buy_time;
            this.isSetted_buy_time = true;
            BEAN_VALUES.put("buy_time",buy_time);
            return this;
        }
        /**
         * 获取过保时间<BR/>
         * 䣺2016-31-18 hh:07
         */
        public Long getGb_time() {
            return gb_time;
        }
        /**
         * 设置过保时间<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setGb_time(Long gb_time) {
            this.gb_time = gb_time;
            this.isSetted_gb_time = true;
            BEAN_VALUES.put("gb_time",gb_time);
            return this;
        }
        /**
         * 获取续保时间<BR/>
         * 䣺2016-31-18 hh:07
         */
        public Long getXb_time() {
            return xb_time;
        }
        /**
         * 设置续保时间<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setXb_time(Long xb_time) {
            this.xb_time = xb_time;
            this.isSetted_xb_time = true;
            BEAN_VALUES.put("xb_time",xb_time);
            return this;
        }
        /**
         * 获取续保过保时间<BR/>
         * 䣺2016-31-18 hh:07
         */
        public Long getXbgb_time() {
            return xbgb_time;
        }
        /**
         * 设置续保过保时间<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setXbgb_time(Long xbgb_time) {
            this.xbgb_time = xbgb_time;
            this.isSetted_xbgb_time = true;
            BEAN_VALUES.put("xbgb_time",xbgb_time);
            return this;
        }
        /**
         * 获取状态(0未启用 1正常;2废弃;3维护中; 4备用;)<BR/>
         * 䣺2016-31-18 hh:07
         */
        public Integer getState() {
            return state;
        }
        /**
         * 设置状态(0未启用 1正常;2废弃;3维护中; 4备用;)<BR/>
         * 2016-31-18 hh:07
         */
        public CMDB_CI_BASE setState(Integer state) {
            this.state = state;
            this.isSetted_state = true;
            BEAN_VALUES.put("state",state);
            return this;
        }
 
        /**
         * 使用ID删除Bean<BR/>
         */
        public void deleteById() {
            if (StringUtils.isBlank(id)) {
                throw new RuntimeException("删除bean时ID不能为空");
            }
            dao.execute("delete from " + getTableName() + " where id = :id", BEAN_VALUES);
        }
    
        @Override
        public CMDB_CI_BASE getInstanceById() {
            if (StringUtils.isBlank(id)) {
                throw new RuntimeException("获取Bean时ID不能为空");
            }
            return dao.queryForBean("select * from " + getTableName() + " where id=:id", BEAN_VALUES, this);
        }
    
        
        
        @Override
        public CMDB_CI_BASE queryForBean() {
            StringBuffer sBuffer = new StringBuffer("select * from CMDB_CI_BASE where ");
            if(isSetted_id){
                sBuffer.append("id=:id and ");
            }
                if (isSetted_cus_id) {
                    sBuffer.append("cus_id=:cus_id and ");
                }
                if (isSetted_cus_name) {
                    sBuffer.append("cus_name=:cus_name and ");
                }
                if (isSetted_sub_cus_id) {
                    sBuffer.append("sub_cus_id=:sub_cus_id and ");
                }
                if (isSetted_sub_cus_name) {
                    sBuffer.append("sub_cus_name=:sub_cus_name and ");
                }
                if (isSetted_bus_id) {
                    sBuffer.append("bus_id=:bus_id and ");
                }
                if (isSetted_ciname) {
                    sBuffer.append("ciname=:ciname and ");
                }
                if (isSetted_searchcode) {
                    sBuffer.append("searchcode=:searchcode and ");
                }
                if (isSetted_code) {
                    sBuffer.append("code=:code and ");
                }
                if (isSetted_sn_no) {
                    sBuffer.append("sn_no=:sn_no and ");
                }
                if (isSetted_zr_name) {
                    sBuffer.append("zr_name=:zr_name and ");
                }
                if (isSetted_zr_dept) {
                    sBuffer.append("zr_dept=:zr_dept and ");
                }
                if (isSetted_lv1_id) {
                    sBuffer.append("lv1_id=:lv1_id and ");
                }
                if (isSetted_lv1_name) {
                    sBuffer.append("lv1_name=:lv1_name and ");
                }
                if (isSetted_lv2_id) {
                    sBuffer.append("lv2_id=:lv2_id and ");
                }
                if (isSetted_lv2_name) {
                    sBuffer.append("lv2_name=:lv2_name and ");
                }
                if (isSetted_lv3_id) {
                    sBuffer.append("lv3_id=:lv3_id and ");
                }
                if (isSetted_lv3_name) {
                    sBuffer.append("lv3_name=:lv3_name and ");
                }
                if (isSetted_mft_id) {
                    sBuffer.append("mft_id=:mft_id and ");
                }
                if (isSetted_mft_name) {
                    sBuffer.append("mft_name=:mft_name and ");
                }
                if (isSetted_igt_id) {
                    sBuffer.append("igt_id=:igt_id and ");
                }
                if (isSetted_igt_name) {
                    sBuffer.append("igt_name=:igt_name and ");
                }
                if (isSetted_create_id) {
                    sBuffer.append("create_id=:create_id and ");
                }
                if (isSetted_create_name) {
                    sBuffer.append("create_name=:create_name and ");
                }
                if (isSetted_create_time) {
                    sBuffer.append("create_time=:create_time and ");
                }
                if (isSetted_admin_id) {
                    sBuffer.append("admin_id=:admin_id and ");
                }
                if (isSetted_position) {
                    sBuffer.append("position=:position and ");
                }
                if (isSetted_last_up_time) {
                    sBuffer.append("last_up_time=:last_up_time and ");
                }
                if (isSetted_note) {
                    sBuffer.append("note=:note and ");
                }
                if (isSetted_buy_time) {
                    sBuffer.append("buy_time=:buy_time and ");
                }
                if (isSetted_gb_time) {
                    sBuffer.append("gb_time=:gb_time and ");
                }
                if (isSetted_xb_time) {
                    sBuffer.append("xb_time=:xb_time and ");
                }
                if (isSetted_xbgb_time) {
                    sBuffer.append("xbgb_time=:xbgb_time and ");
                }
                if (isSetted_state) {
                    sBuffer.append("state=:state and ");
                }
            String sql = sBuffer.toString();
            sql = StringUtils.removeEnd(sql, " and ");
            return dao.queryForBean(sql,this);
        }
    
        @Override
        public String getTableName() {
            return "CMDB_CI_BASE";
        }
        
        
        public Map getBeanValues(){
            return this.BEAN_VALUES;
        }
    
        @Override
        public CMDB_CI_BASE insert() {
            if (StringUtils.isBlank(id)) {
                this.setId(StringUtil.getUUID());
            }
            dao.execute(getInsertSql(),BEAN_VALUES);
            return this;
        }
    
        @Override
        public CMDB_CI_BASE update() {
            if (StringUtils.isBlank(id)) {
                throw new RuntimeException("更新Bean时ID不能为空");
            }
            dao.execute(getUpdateSql(),BEAN_VALUES);
            return this;
        }  
        
        public CMDB_CI_BASE insertOrUpdate(){
            if (StringUtils.isNotBlank(id)) {
                return update();
            } else {
                return insert();
            }
        }
        
        /**
         * 通过ID获取该条信息的Map结构
         */
        public Map getBeanMapById() {
            
            if (StringUtils.isBlank(id)) {
                throw new RuntimeException("ID不能为空!");
            }
            
            return dao.queryForMap("select * from CMDB_CI_BASE where id=:id",BEAN_VALUES);
        }
 
        public Object mapRow(ResultSet rs, int rownum) throws SQLException {
            Object id = rs.getObject("ID");
            this.setId(ConvertUtil.obj2Str(id));
            BEAN_VALUES.put("id",id);
            Object obj = null;
            obj = rs.getObject("CUS_ID");
            BEAN_VALUES.put("cus_id",obj);
                this.setCus_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("CUS_NAME");
            BEAN_VALUES.put("cus_name",obj);
                this.setCus_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("SUB_CUS_ID");
            BEAN_VALUES.put("sub_cus_id",obj);
                this.setSub_cus_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("SUB_CUS_NAME");
            BEAN_VALUES.put("sub_cus_name",obj);
                this.setSub_cus_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("BUS_ID");
            BEAN_VALUES.put("bus_id",obj);
                this.setBus_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("CINAME");
            BEAN_VALUES.put("ciname",obj);
                this.setCiname(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("SEARCHCODE");
            BEAN_VALUES.put("searchcode",obj);
                this.setSearchcode(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("CODE");
            BEAN_VALUES.put("code",obj);
                this.setCode(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("SN_NO");
            BEAN_VALUES.put("sn_no",obj);
                this.setSn_no(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("ZR_NAME");
            BEAN_VALUES.put("zr_name",obj);
                this.setZr_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("ZR_DEPT");
            BEAN_VALUES.put("zr_dept",obj);
                this.setZr_dept(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LV1_ID");
            BEAN_VALUES.put("lv1_id",obj);
                this.setLv1_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LV1_NAME");
            BEAN_VALUES.put("lv1_name",obj);
                this.setLv1_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LV2_ID");
            BEAN_VALUES.put("lv2_id",obj);
                this.setLv2_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LV2_NAME");
            BEAN_VALUES.put("lv2_name",obj);
                this.setLv2_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LV3_ID");
            BEAN_VALUES.put("lv3_id",obj);
                this.setLv3_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LV3_NAME");
            BEAN_VALUES.put("lv3_name",obj);
                this.setLv3_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("MFT_ID");
            BEAN_VALUES.put("mft_id",obj);
                this.setMft_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("MFT_NAME");
            BEAN_VALUES.put("mft_name",obj);
                this.setMft_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("IGT_ID");
            BEAN_VALUES.put("igt_id",obj);
                this.setIgt_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("IGT_NAME");
            BEAN_VALUES.put("igt_name",obj);
                this.setIgt_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("CREATE_ID");
            BEAN_VALUES.put("create_id",obj);
                this.setCreate_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("CREATE_NAME");
            BEAN_VALUES.put("create_name",obj);
                this.setCreate_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("CREATE_TIME");
            BEAN_VALUES.put("create_time",obj);
                this.setCreate_time(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("ADMIN_ID");
            BEAN_VALUES.put("admin_id",obj);
                this.setAdmin_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("POSITION");
            BEAN_VALUES.put("position",obj);
                this.setPosition(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LAST_UP_TIME");
            BEAN_VALUES.put("last_up_time",obj);
                this.setLast_up_time(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("NOTE");
            BEAN_VALUES.put("note",obj);
                this.setNote(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("BUY_TIME");
            BEAN_VALUES.put("buy_time",obj);
                this.setBuy_time(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("GB_TIME");
            BEAN_VALUES.put("gb_time",obj);
                this.setGb_time(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("XB_TIME");
            BEAN_VALUES.put("xb_time",obj);
                this.setXb_time(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("XBGB_TIME");
            BEAN_VALUES.put("xbgb_time",obj);
                this.setXbgb_time(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("STATE");
            BEAN_VALUES.put("state",obj);
                this.setState(ConvertUtil.obj2Integer(obj));
            return this;
        }
        
        
        public String toString() {
            StringBuffer sb = new StringBuffer("[");
            for (Iterator iterator = KEYS.keySet().iterator(); iterator.hasNext();) {
                String key = (String) iterator.next();
                sb.append(key+"=" + BEAN_VALUES.get(key)+",");
            }
            sb.append("]");
            return sb.toString();
        }
        
        public CMDB_CI_BASE newInstance(){
            return new CMDB_CI_BASE();
        }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}