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
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 SPARE_PART 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("cate_id", "String");
        KEYS.put("link_delivery_id", "String");
        KEYS.put("link_storage_id", "String");
        KEYS.put("link_apply_id", "String");
        KEYS.put("name", "String");
        KEYS.put("entity_no", "String");
        KEYS.put("asset_no", "String");
        KEYS.put("model_no", "String");
        KEYS.put("location", "String");
        KEYS.put("cost_price", "Double");
        KEYS.put("sale_price", "Double");
        KEYS.put("supplier_id", "String");
        KEYS.put("supplier_name", "String");
        KEYS.put("warranty_start", "Long");
        KEYS.put("warranty_cycle", "Integer");
        KEYS.put("warranty_end", "Long");
        KEYS.put("create_id", "String");
        KEYS.put("create_name", "String");
        KEYS.put("gmt_create", "Long");
        KEYS.put("modified_id", "String");
        KEYS.put("modified_name", "String");
        KEYS.put("gmt_modified", "Long");
        KEYS.put("state", "Integer");
    }
    public Map getColumnMap(){
        return KEYS;
    }
 
    private String id;
    private Boolean isSetted_id = false;;
    
    private String cate_id;
    private Boolean isSetted_cate_id = false;
    private String link_delivery_id;
    private Boolean isSetted_link_delivery_id = false;
    private String link_storage_id;
    private Boolean isSetted_link_storage_id = false;
    private String link_apply_id;
    private Boolean isSetted_link_apply_id = false;
    private String name;
    private Boolean isSetted_name = false;
    private String entity_no;
    private Boolean isSetted_entity_no = false;
    private String asset_no;
    private Boolean isSetted_asset_no = false;
    private String model_no;
    private Boolean isSetted_model_no = false;
    private String location;
    private Boolean isSetted_location = false;
    private Double cost_price;
    private Boolean isSetted_cost_price = false;
    private Double sale_price;
    private Boolean isSetted_sale_price = false;
    private String supplier_id;
    private Boolean isSetted_supplier_id = false;
    private String supplier_name;
    private Boolean isSetted_supplier_name = false;
    private Long warranty_start;
    private Boolean isSetted_warranty_start = false;
    private Integer warranty_cycle;
    private Boolean isSetted_warranty_cycle = false;
    private Long warranty_end;
    private Boolean isSetted_warranty_end = false;
    private String create_id;
    private Boolean isSetted_create_id = false;
    private String create_name;
    private Boolean isSetted_create_name = false;
    private Long gmt_create;
    private Boolean isSetted_gmt_create = false;
    private String modified_id;
    private Boolean isSetted_modified_id = false;
    private String modified_name;
    private Boolean isSetted_modified_name = false;
    private Long gmt_modified;
    private Boolean isSetted_gmt_modified = 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("cate_id", null);
            BEAN_VALUES.put("link_delivery_id", null);
            BEAN_VALUES.put("link_storage_id", null);
            BEAN_VALUES.put("link_apply_id", null);
            BEAN_VALUES.put("name", null);
            BEAN_VALUES.put("entity_no", null);
            BEAN_VALUES.put("asset_no", null);
            BEAN_VALUES.put("model_no", null);
            BEAN_VALUES.put("location", null);
            BEAN_VALUES.put("cost_price", null);
            BEAN_VALUES.put("sale_price", null);
            BEAN_VALUES.put("supplier_id", null);
            BEAN_VALUES.put("supplier_name", null);
            BEAN_VALUES.put("warranty_start", null);
            BEAN_VALUES.put("warranty_cycle", null);
            BEAN_VALUES.put("warranty_end", null);
            BEAN_VALUES.put("create_id", null);
            BEAN_VALUES.put("create_name", null);
            BEAN_VALUES.put("gmt_create", null);
            BEAN_VALUES.put("modified_id", null);
            BEAN_VALUES.put("modified_name", null);
            BEAN_VALUES.put("gmt_modified", null);
            BEAN_VALUES.put("state", null);
    }
    
    public SPARE_PART() {
        initBeanValues();
    }
    
    public SPARE_PART(String id) {
        super();
        this.id = id;
        initBeanValues();
        BEAN_VALUES.put("id",id);
    }
 
    /**
     * 获取ID
     */
    public String getId() {
        return this.id;
    }
    /**
     * 设置ID
     */
    public SPARE_PART 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 SPARE_PART set ");
            if (isSetted_cate_id) {
                sBuffer.append("cate_id=:cate_id,");
            }
            if (isSetted_link_delivery_id) {
                sBuffer.append("link_delivery_id=:link_delivery_id,");
            }
            if (isSetted_link_storage_id) {
                sBuffer.append("link_storage_id=:link_storage_id,");
            }
            if (isSetted_link_apply_id) {
                sBuffer.append("link_apply_id=:link_apply_id,");
            }
            if (isSetted_name) {
                sBuffer.append("name=:name,");
            }
            if (isSetted_entity_no) {
                sBuffer.append("entity_no=:entity_no,");
            }
            if (isSetted_asset_no) {
                sBuffer.append("asset_no=:asset_no,");
            }
            if (isSetted_model_no) {
                sBuffer.append("model_no=:model_no,");
            }
            if (isSetted_location) {
                sBuffer.append("location=:location,");
            }
            if (isSetted_cost_price) {
                sBuffer.append("cost_price=:cost_price,");
            }
            if (isSetted_sale_price) {
                sBuffer.append("sale_price=:sale_price,");
            }
            if (isSetted_supplier_id) {
                sBuffer.append("supplier_id=:supplier_id,");
            }
            if (isSetted_supplier_name) {
                sBuffer.append("supplier_name=:supplier_name,");
            }
            if (isSetted_warranty_start) {
                sBuffer.append("warranty_start=:warranty_start,");
            }
            if (isSetted_warranty_cycle) {
                sBuffer.append("warranty_cycle=:warranty_cycle,");
            }
            if (isSetted_warranty_end) {
                sBuffer.append("warranty_end=:warranty_end,");
            }
            if (isSetted_create_id) {
                sBuffer.append("create_id=:create_id,");
            }
            if (isSetted_create_name) {
                sBuffer.append("create_name=:create_name,");
            }
            if (isSetted_gmt_create) {
                sBuffer.append("gmt_create=:gmt_create,");
            }
            if (isSetted_modified_id) {
                sBuffer.append("modified_id=:modified_id,");
            }
            if (isSetted_modified_name) {
                sBuffer.append("modified_name=:modified_name,");
            }
            if (isSetted_gmt_modified) {
                sBuffer.append("gmt_modified=:gmt_modified,");
            }
            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 SPARE_PART(");
        StringBuffer fileds = new StringBuffer("id,");
        StringBuffer values = new StringBuffer(":id,");        
            fileds.append("cate_id,");
            values.append(":cate_id,");
            fileds.append("link_delivery_id,");
            values.append(":link_delivery_id,");
            fileds.append("link_storage_id,");
            values.append(":link_storage_id,");
            fileds.append("link_apply_id,");
            values.append(":link_apply_id,");
            fileds.append("name,");
            values.append(":name,");
            fileds.append("entity_no,");
            values.append(":entity_no,");
            fileds.append("asset_no,");
            values.append(":asset_no,");
            fileds.append("model_no,");
            values.append(":model_no,");
            fileds.append("location,");
            values.append(":location,");
            fileds.append("cost_price,");
            values.append(":cost_price,");
            fileds.append("sale_price,");
            values.append(":sale_price,");
            fileds.append("supplier_id,");
            values.append(":supplier_id,");
            fileds.append("supplier_name,");
            values.append(":supplier_name,");
            fileds.append("warranty_start,");
            values.append(":warranty_start,");
            fileds.append("warranty_cycle,");
            values.append(":warranty_cycle,");
            fileds.append("warranty_end,");
            values.append(":warranty_end,");
            fileds.append("create_id,");
            values.append(":create_id,");
            fileds.append("create_name,");
            values.append(":create_name,");
            fileds.append("gmt_create,");
            values.append(":gmt_create,");
            fileds.append("modified_id,");
            values.append(":modified_id,");
            fileds.append("modified_name,");
            values.append(":modified_name,");
            fileds.append("gmt_modified,");
            values.append(":gmt_modified,");
            fileds.append("state,");
            values.append(":state,");
        sBuffer.append(StringUtils.removeEnd(fileds.toString(), ",") + ") values("+StringUtils.removeEnd(values.toString(), ",")+")");
        return sBuffer.toString();
    }
    
 
        /**
         * 获取分类ID(三级)<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getCate_id() {
            return cate_id;
        }
        /**
         * 设置分类ID(三级)<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setCate_id(String cate_id) {
            this.cate_id = cate_id;
            this.isSetted_cate_id = true;
            BEAN_VALUES.put("cate_id",cate_id);
            return this;
        }
        /**
         * 获取关联出库工单ID<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getLink_delivery_id() {
            return link_delivery_id;
        }
        /**
         * 设置关联出库工单ID<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setLink_delivery_id(String link_delivery_id) {
            this.link_delivery_id = link_delivery_id;
            this.isSetted_link_delivery_id = true;
            BEAN_VALUES.put("link_delivery_id",link_delivery_id);
            return this;
        }
        /**
         * 获取关联入库工单ID<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getLink_storage_id() {
            return link_storage_id;
        }
        /**
         * 设置关联入库工单ID<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setLink_storage_id(String link_storage_id) {
            this.link_storage_id = link_storage_id;
            this.isSetted_link_storage_id = true;
            BEAN_VALUES.put("link_storage_id",link_storage_id);
            return this;
        }
        /**
         * 获取关联备件申请工单ID<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getLink_apply_id() {
            return link_apply_id;
        }
        /**
         * 设置关联备件申请工单ID<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setLink_apply_id(String link_apply_id) {
            this.link_apply_id = link_apply_id;
            this.isSetted_link_apply_id = true;
            BEAN_VALUES.put("link_apply_id",link_apply_id);
            return this;
        }
        /**
         * 获取备件名称<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getName() {
            return name;
        }
        /**
         * 设置备件名称<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setName(String name) {
            this.name = name;
            this.isSetted_name = true;
            BEAN_VALUES.put("name",name);
            return this;
        }
        /**
         * 获取实物编码<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getEntity_no() {
            return entity_no;
        }
        /**
         * 设置实物编码<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setEntity_no(String entity_no) {
            this.entity_no = entity_no;
            this.isSetted_entity_no = true;
            BEAN_VALUES.put("entity_no",entity_no);
            return this;
        }
        /**
         * 获取资产编码<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getAsset_no() {
            return asset_no;
        }
        /**
         * 设置资产编码<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setAsset_no(String asset_no) {
            this.asset_no = asset_no;
            this.isSetted_asset_no = true;
            BEAN_VALUES.put("asset_no",asset_no);
            return this;
        }
        /**
         * 获取型号<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getModel_no() {
            return model_no;
        }
        /**
         * 设置型号<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setModel_no(String model_no) {
            this.model_no = model_no;
            this.isSetted_model_no = true;
            BEAN_VALUES.put("model_no",model_no);
            return this;
        }
        /**
         * 获取货位<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getLocation() {
            return location;
        }
        /**
         * 设置货位<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setLocation(String location) {
            this.location = location;
            this.isSetted_location = true;
            BEAN_VALUES.put("location",location);
            return this;
        }
        /**
         * 获取成本价<BR/>
         * 䣺2017-30-16 hh:05
         */
        public Double getCost_price() {
            return cost_price;
        }
        /**
         * 设置成本价<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setCost_price(Double cost_price) {
            this.cost_price = cost_price;
            this.isSetted_cost_price = true;
            BEAN_VALUES.put("cost_price",cost_price);
            return this;
        }
        /**
         * 获取销售价<BR/>
         * 䣺2017-30-16 hh:05
         */
        public Double getSale_price() {
            return sale_price;
        }
        /**
         * 设置销售价<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setSale_price(Double sale_price) {
            this.sale_price = sale_price;
            this.isSetted_sale_price = true;
            BEAN_VALUES.put("sale_price",sale_price);
            return this;
        }
        /**
         * 获取供应商ID<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getSupplier_id() {
            return supplier_id;
        }
        /**
         * 设置供应商ID<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setSupplier_id(String supplier_id) {
            this.supplier_id = supplier_id;
            this.isSetted_supplier_id = true;
            BEAN_VALUES.put("supplier_id",supplier_id);
            return this;
        }
        /**
         * 获取供应商<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getSupplier_name() {
            return supplier_name;
        }
        /**
         * 设置供应商<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setSupplier_name(String supplier_name) {
            this.supplier_name = supplier_name;
            this.isSetted_supplier_name = true;
            BEAN_VALUES.put("supplier_name",supplier_name);
            return this;
        }
        /**
         * 获取起保日期<BR/>
         * 䣺2017-30-16 hh:05
         */
        public Long getWarranty_start() {
            return warranty_start;
        }
        /**
         * 设置起保日期<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setWarranty_start(Long warranty_start) {
            this.warranty_start = warranty_start;
            this.isSetted_warranty_start = true;
            BEAN_VALUES.put("warranty_start",warranty_start);
            return this;
        }
        /**
         * 获取保质周期【天】<BR/>
         * 䣺2017-30-16 hh:05
         */
        public Integer getWarranty_cycle() {
            return warranty_cycle;
        }
        /**
         * 设置保质周期【天】<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setWarranty_cycle(Integer warranty_cycle) {
            this.warranty_cycle = warranty_cycle;
            this.isSetted_warranty_cycle = true;
            BEAN_VALUES.put("warranty_cycle",warranty_cycle);
            return this;
        }
        /**
         * 获取出保日期<BR/>
         * 䣺2017-30-16 hh:05
         */
        public Long getWarranty_end() {
            return warranty_end;
        }
        /**
         * 设置出保日期<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setWarranty_end(Long warranty_end) {
            this.warranty_end = warranty_end;
            this.isSetted_warranty_end = true;
            BEAN_VALUES.put("warranty_end",warranty_end);
            return this;
        }
        /**
         * 获取创建人ID<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getCreate_id() {
            return create_id;
        }
        /**
         * 设置创建人ID<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART 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/>
         * 䣺2017-30-16 hh:05
         */
        public String getCreate_name() {
            return create_name;
        }
        /**
         * 设置创建人<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART 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/>
         * 䣺2017-30-16 hh:05
         */
        public Long getGmt_create() {
            return gmt_create;
        }
        /**
         * 设置创建时间<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setGmt_create(Long gmt_create) {
            this.gmt_create = gmt_create;
            this.isSetted_gmt_create = true;
            BEAN_VALUES.put("gmt_create",gmt_create);
            return this;
        }
        /**
         * 获取修改人ID<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getModified_id() {
            return modified_id;
        }
        /**
         * 设置修改人ID<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setModified_id(String modified_id) {
            this.modified_id = modified_id;
            this.isSetted_modified_id = true;
            BEAN_VALUES.put("modified_id",modified_id);
            return this;
        }
        /**
         * 获取修改人<BR/>
         * 䣺2017-30-16 hh:05
         */
        public String getModified_name() {
            return modified_name;
        }
        /**
         * 设置修改人<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setModified_name(String modified_name) {
            this.modified_name = modified_name;
            this.isSetted_modified_name = true;
            BEAN_VALUES.put("modified_name",modified_name);
            return this;
        }
        /**
         * 获取修改时间<BR/>
         * 䣺2017-30-16 hh:05
         */
        public Long getGmt_modified() {
            return gmt_modified;
        }
        /**
         * 设置修改时间<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART setGmt_modified(Long gmt_modified) {
            this.gmt_modified = gmt_modified;
            this.isSetted_gmt_modified = true;
            BEAN_VALUES.put("gmt_modified",gmt_modified);
            return this;
        }
        /**
         * 获取状态【0 删除,1正常 2 废弃 3 已出库】<BR/>
         * 䣺2017-30-16 hh:05
         */
        public Integer getState() {
            return state;
        }
        /**
         * 设置状态【0 删除,1正常 2 废弃 3 已出库】<BR/>
         * 2017-30-16 hh:05
         */
        public SPARE_PART 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 SPARE_PART getInstanceById() {
            if (StringUtils.isBlank(id)) {
                throw new RuntimeException("获取Bean时ID不能为空");
            }
            return dao.queryForBean("select * from " + getTableName() + " where id=:id", BEAN_VALUES, this);
        }
    
        
        
        @Override
        public SPARE_PART queryForBean() {
            StringBuffer sBuffer = new StringBuffer("select * from SPARE_PART where ");
            if(isSetted_id){
                sBuffer.append("id=:id and ");
            }
                if (isSetted_cate_id) {
                    sBuffer.append("cate_id=:cate_id and ");
                }
                if (isSetted_link_delivery_id) {
                    sBuffer.append("link_delivery_id=:link_delivery_id and ");
                }
                if (isSetted_link_storage_id) {
                    sBuffer.append("link_storage_id=:link_storage_id and ");
                }
                if (isSetted_link_apply_id) {
                    sBuffer.append("link_apply_id=:link_apply_id and ");
                }
                if (isSetted_name) {
                    sBuffer.append("name=:name and ");
                }
                if (isSetted_entity_no) {
                    sBuffer.append("entity_no=:entity_no and ");
                }
                if (isSetted_asset_no) {
                    sBuffer.append("asset_no=:asset_no and ");
                }
                if (isSetted_model_no) {
                    sBuffer.append("model_no=:model_no and ");
                }
                if (isSetted_location) {
                    sBuffer.append("location=:location and ");
                }
                if (isSetted_cost_price) {
                    sBuffer.append("cost_price=:cost_price and ");
                }
                if (isSetted_sale_price) {
                    sBuffer.append("sale_price=:sale_price and ");
                }
                if (isSetted_supplier_id) {
                    sBuffer.append("supplier_id=:supplier_id and ");
                }
                if (isSetted_supplier_name) {
                    sBuffer.append("supplier_name=:supplier_name and ");
                }
                if (isSetted_warranty_start) {
                    sBuffer.append("warranty_start=:warranty_start and ");
                }
                if (isSetted_warranty_cycle) {
                    sBuffer.append("warranty_cycle=:warranty_cycle and ");
                }
                if (isSetted_warranty_end) {
                    sBuffer.append("warranty_end=:warranty_end 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_gmt_create) {
                    sBuffer.append("gmt_create=:gmt_create and ");
                }
                if (isSetted_modified_id) {
                    sBuffer.append("modified_id=:modified_id and ");
                }
                if (isSetted_modified_name) {
                    sBuffer.append("modified_name=:modified_name and ");
                }
                if (isSetted_gmt_modified) {
                    sBuffer.append("gmt_modified=:gmt_modified 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 "SPARE_PART";
        }
        
        
        public Map getBeanValues(){
            return this.BEAN_VALUES;
        }
    
        @Override
        public SPARE_PART insert() {
            if (StringUtils.isBlank(id)) {
                this.setId(StringUtil.getUUID());
            }
            dao.execute(getInsertSql(),BEAN_VALUES);
            return this;
        }
    
        @Override
        public SPARE_PART update() {
            if (StringUtils.isBlank(id)) {
                throw new RuntimeException("更新Bean时ID不能为空");
            }
            dao.execute(getUpdateSql(),BEAN_VALUES);
            return this;
        }  
        
        public SPARE_PART 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 SPARE_PART 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("CATE_ID");
            BEAN_VALUES.put("cate_id",obj);
                this.setCate_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LINK_DELIVERY_ID");
            BEAN_VALUES.put("link_delivery_id",obj);
                this.setLink_delivery_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LINK_STORAGE_ID");
            BEAN_VALUES.put("link_storage_id",obj);
                this.setLink_storage_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LINK_APPLY_ID");
            BEAN_VALUES.put("link_apply_id",obj);
                this.setLink_apply_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("NAME");
            BEAN_VALUES.put("name",obj);
                this.setName(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("ENTITY_NO");
            BEAN_VALUES.put("entity_no",obj);
                this.setEntity_no(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("ASSET_NO");
            BEAN_VALUES.put("asset_no",obj);
                this.setAsset_no(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("MODEL_NO");
            BEAN_VALUES.put("model_no",obj);
                this.setModel_no(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("LOCATION");
            BEAN_VALUES.put("location",obj);
                this.setLocation(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("COST_PRICE");
            BEAN_VALUES.put("cost_price",obj);
                this.setCost_price(ConvertUtil.obj2Double(obj));
            obj = rs.getObject("SALE_PRICE");
            BEAN_VALUES.put("sale_price",obj);
                this.setSale_price(ConvertUtil.obj2Double(obj));
            obj = rs.getObject("SUPPLIER_ID");
            BEAN_VALUES.put("supplier_id",obj);
                this.setSupplier_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("SUPPLIER_NAME");
            BEAN_VALUES.put("supplier_name",obj);
                this.setSupplier_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("WARRANTY_START");
            BEAN_VALUES.put("warranty_start",obj);
                this.setWarranty_start(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("WARRANTY_CYCLE");
            BEAN_VALUES.put("warranty_cycle",obj);
                this.setWarranty_cycle(ConvertUtil.obj2Integer(obj));
            obj = rs.getObject("WARRANTY_END");
            BEAN_VALUES.put("warranty_end",obj);
                this.setWarranty_end(ConvertUtil.obj2Long(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("GMT_CREATE");
            BEAN_VALUES.put("gmt_create",obj);
                this.setGmt_create(ConvertUtil.obj2Long(obj));
            obj = rs.getObject("MODIFIED_ID");
            BEAN_VALUES.put("modified_id",obj);
                this.setModified_id(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("MODIFIED_NAME");
            BEAN_VALUES.put("modified_name",obj);
                this.setModified_name(ConvertUtil.obj2Str(obj));
            obj = rs.getObject("GMT_MODIFIED");
            BEAN_VALUES.put("gmt_modified",obj);
                this.setGmt_modified(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 SPARE_PART newInstance(){
            return new SPARE_PART();
        }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
}