shikeyin
2024-01-11 65da8373531677b1c37a98f53eaa30c892f35e5a
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
package com.iplatform.gather;
 
import com.walker.infrastructure.utils.StringUtils;
 
/**
 * 等待被采集的表信息对象
 * @author shikeying
 * @date 2016年1月11日
 *
 */
public class WaitingTableInfo {
 
    private String customerCode;
//    private String dpcode;
    private String tableName;
    private String versionName;
    private String verName; //每个学校可能有对“版本号字段”的覆盖
    public void setVerName(String verName) {
        this.verName = verName;
    }
 
    private boolean updateData = false;
    private String[] keyNames;
    
    private int gatherTimes = 0;
    private int index = 0;
    
    private String sqlContent;
    
    public String getSqlContent() {
        return sqlContent;
    }
    public void setSqlContent(String sqlContent) {
        this.sqlContent = sqlContent;
    }
    /**
     * 该对象在等待缓存列表中的索引值
     * @return
     */
    public int getIndex() {
        return index;
    }
    public void setIndex(int index) {
        this.index = index;
    }
    public int getGatherTimes() {
        return gatherTimes;
    }
    public void setGatherTimes(int gatherTimes) {
        this.gatherTimes = gatherTimes;
    }
    public String getCustomerCode() {
        return customerCode;
    }
    public void setCustomerCode(String customerCode) {
        this.customerCode = customerCode;
    }
//    public String getDpcode() {
//        return dpcode;
//    }
//    public void setDpcode(String dpcode) {
//        this.dpcode = dpcode;
//    }
    public String getTableName() {
        return tableName;
    }
    public void setTableName(String tableName) {
        this.tableName = tableName;
    }
    
    /**
     * 返回一卡通表中版本号字段名,优先从学校配置中获取
     * @return
     */
    public String getVersionName() {
        if(StringUtils.isEmpty(this.verName)){
            return versionName;
        }
        return verName;
    }
    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }
    public boolean isUpdateData() {
        return updateData;
    }
    public void setUpdateData(boolean updateData) {
        this.updateData = updateData;
    }
    public String[] getKeyNames() {
        return keyNames;
    }
    public String getKey(){
        return keyNames[0];
    }
    public void setKeyNames(String[] keyNames) {
        this.keyNames = keyNames;
    }
    
    public boolean isMultiKeys(){
        if(keyNames != null && keyNames.length > 1){
            return true;
        }
        return false;
    }
    
    @Override
    public String toString(){
        return new StringBuilder().append("WaitingTableInfo:[customerCode=").append(customerCode)
//                .append(", dpcode=").append(dpcode)
                .append(", tableName=").append(tableName)
                .append(", verName=").append(versionName)
                .append(", updateData=").append(updateData)
                .append(", keyNames=").append(keyNames)
                .append(", gatherTimes=").append(gatherTimes)
                .append(", index=").append(index)
                .append("]").toString();
    }
    
    @Override
    public boolean equals(Object obj){
        if(obj != null && (obj instanceof WaitingTableInfo)){
            WaitingTableInfo wti = (WaitingTableInfo)obj;
            if(wti.customerCode.equals(this.customerCode) 
                    && wti.tableName.equals(this.tableName)){
                return true;
            }
        }
        return false;
    }
    
    @Override
    public int hashCode(){
        return 31 + this.customerCode.hashCode() + this.tableName.hashCode();
    }
}