|
|
|
|
@ -9,99 +9,105 @@ import java.util.Map;
|
|
|
|
|
@Data
|
|
|
|
|
@AllArgsConstructor
|
|
|
|
|
public class AddressDataType {
|
|
|
|
|
private static Map<String,String> tdDataTypeMap = new HashMap<>();
|
|
|
|
|
private static Map<String,String> mysqlDataTypeMap = new HashMap<>();
|
|
|
|
|
private static Map<String,Integer> gatewayDataTypeMap = new HashMap<>();
|
|
|
|
|
private static Map<String, String> tdDataTypeMap = new HashMap<>();
|
|
|
|
|
private static Map<String, String> mysqlDataTypeMap = new HashMap<>();
|
|
|
|
|
private static Map<String, Integer> gatewayDataTypeMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
static {
|
|
|
|
|
tdDataTypeMap.put("bool","BOOL");
|
|
|
|
|
tdDataTypeMap.put("int8","INT");
|
|
|
|
|
tdDataTypeMap.put("int16","INT");
|
|
|
|
|
tdDataTypeMap.put("int32","INT");
|
|
|
|
|
tdDataTypeMap.put("int64","BIGINT");
|
|
|
|
|
tdDataTypeMap.put("uint8","INT");
|
|
|
|
|
tdDataTypeMap.put("uint16","INT");
|
|
|
|
|
tdDataTypeMap.put("uint32","BIGINT");
|
|
|
|
|
tdDataTypeMap.put("uint64","BIGINT");
|
|
|
|
|
tdDataTypeMap.put("float32","float");
|
|
|
|
|
tdDataTypeMap.put("float64","float");
|
|
|
|
|
tdDataTypeMap.put("string","NCHAR(255)");
|
|
|
|
|
tdDataTypeMap.put("date","TIMESTAMP");
|
|
|
|
|
tdDataTypeMap.put("bcd","BINARY(64)");
|
|
|
|
|
tdDataTypeMap.put("bool", "BOOL");
|
|
|
|
|
tdDataTypeMap.put("int8", "INT");
|
|
|
|
|
tdDataTypeMap.put("int16", "INT");
|
|
|
|
|
tdDataTypeMap.put("int32", "INT");
|
|
|
|
|
tdDataTypeMap.put("int64", "BIGINT");
|
|
|
|
|
tdDataTypeMap.put("uint8", "INT");
|
|
|
|
|
tdDataTypeMap.put("uint16", "INT");
|
|
|
|
|
tdDataTypeMap.put("uint32", "BIGINT");
|
|
|
|
|
tdDataTypeMap.put("uint64", "BIGINT");
|
|
|
|
|
tdDataTypeMap.put("float32", "float");
|
|
|
|
|
tdDataTypeMap.put("float64", "float");
|
|
|
|
|
tdDataTypeMap.put("string", "NCHAR(255)");
|
|
|
|
|
tdDataTypeMap.put("date", "TIMESTAMP");
|
|
|
|
|
tdDataTypeMap.put("bcd", "BINARY(64)");
|
|
|
|
|
|
|
|
|
|
gatewayDataTypeMap.put("bool",1);
|
|
|
|
|
gatewayDataTypeMap.put("int8",2);
|
|
|
|
|
gatewayDataTypeMap.put("uint8",3);
|
|
|
|
|
gatewayDataTypeMap.put("int16",4);
|
|
|
|
|
gatewayDataTypeMap.put("uint16",5);
|
|
|
|
|
gatewayDataTypeMap.put("int32",6);
|
|
|
|
|
gatewayDataTypeMap.put("uint32",7);
|
|
|
|
|
gatewayDataTypeMap.put("int64",8);
|
|
|
|
|
gatewayDataTypeMap.put("uint64",9);
|
|
|
|
|
gatewayDataTypeMap.put("float32",10);
|
|
|
|
|
gatewayDataTypeMap.put("float64",11);
|
|
|
|
|
gatewayDataTypeMap.put("string",12);
|
|
|
|
|
gatewayDataTypeMap.put("date",13);
|
|
|
|
|
gatewayDataTypeMap.put("bcd",14);
|
|
|
|
|
gatewayDataTypeMap.put("bool", 1);
|
|
|
|
|
gatewayDataTypeMap.put("int8", 2);
|
|
|
|
|
gatewayDataTypeMap.put("uint8", 3);
|
|
|
|
|
gatewayDataTypeMap.put("int16", 4);
|
|
|
|
|
gatewayDataTypeMap.put("uint16", 5);
|
|
|
|
|
gatewayDataTypeMap.put("int32", 6);
|
|
|
|
|
gatewayDataTypeMap.put("uint32", 7);
|
|
|
|
|
gatewayDataTypeMap.put("int64", 8);
|
|
|
|
|
gatewayDataTypeMap.put("uint64", 9);
|
|
|
|
|
gatewayDataTypeMap.put("float32", 10);
|
|
|
|
|
gatewayDataTypeMap.put("float64", 11);
|
|
|
|
|
gatewayDataTypeMap.put("string", 12);
|
|
|
|
|
gatewayDataTypeMap.put("date", 13);
|
|
|
|
|
gatewayDataTypeMap.put("bcd", 14);
|
|
|
|
|
|
|
|
|
|
gatewayDataTypeMap.put("Bool",1);
|
|
|
|
|
gatewayDataTypeMap.put("Int8",2);
|
|
|
|
|
gatewayDataTypeMap.put("Uint8",3);
|
|
|
|
|
gatewayDataTypeMap.put("Int16",4);
|
|
|
|
|
gatewayDataTypeMap.put("Uint16",5);
|
|
|
|
|
gatewayDataTypeMap.put("Int32",6);
|
|
|
|
|
gatewayDataTypeMap.put("Uint32",7);
|
|
|
|
|
gatewayDataTypeMap.put("Int64",8);
|
|
|
|
|
gatewayDataTypeMap.put("Uint64",9);
|
|
|
|
|
gatewayDataTypeMap.put("Float32",10);
|
|
|
|
|
gatewayDataTypeMap.put("Float64",11);
|
|
|
|
|
gatewayDataTypeMap.put("String",12);
|
|
|
|
|
gatewayDataTypeMap.put("Date",13);
|
|
|
|
|
gatewayDataTypeMap.put("Bcd",14);
|
|
|
|
|
gatewayDataTypeMap.put("Bool", 1);
|
|
|
|
|
gatewayDataTypeMap.put("Int8", 2);
|
|
|
|
|
gatewayDataTypeMap.put("Uint8", 3);
|
|
|
|
|
gatewayDataTypeMap.put("Int16", 4);
|
|
|
|
|
gatewayDataTypeMap.put("Uint16", 5);
|
|
|
|
|
gatewayDataTypeMap.put("Int32", 6);
|
|
|
|
|
gatewayDataTypeMap.put("Uint32", 7);
|
|
|
|
|
gatewayDataTypeMap.put("Int64", 8);
|
|
|
|
|
gatewayDataTypeMap.put("Uint64", 9);
|
|
|
|
|
gatewayDataTypeMap.put("Float32", 10);
|
|
|
|
|
gatewayDataTypeMap.put("Float64", 11);
|
|
|
|
|
gatewayDataTypeMap.put("String", 12);
|
|
|
|
|
gatewayDataTypeMap.put("Date", 13);
|
|
|
|
|
gatewayDataTypeMap.put("Bcd", 14);
|
|
|
|
|
|
|
|
|
|
gatewayDataTypeMap.put("BOOL",1);
|
|
|
|
|
gatewayDataTypeMap.put("INT8",2);
|
|
|
|
|
gatewayDataTypeMap.put("UINT8",3);
|
|
|
|
|
gatewayDataTypeMap.put("INT16",4);
|
|
|
|
|
gatewayDataTypeMap.put("UINT16",5);
|
|
|
|
|
gatewayDataTypeMap.put("INT32",6);
|
|
|
|
|
gatewayDataTypeMap.put("UINT32",7);
|
|
|
|
|
gatewayDataTypeMap.put("INT64",8);
|
|
|
|
|
gatewayDataTypeMap.put("UINT64",9);
|
|
|
|
|
gatewayDataTypeMap.put("FLOAT32",10);
|
|
|
|
|
gatewayDataTypeMap.put("FLOAT64",11);
|
|
|
|
|
gatewayDataTypeMap.put("STRING",12);
|
|
|
|
|
gatewayDataTypeMap.put("DATE",13);
|
|
|
|
|
gatewayDataTypeMap.put("BCD",14);
|
|
|
|
|
gatewayDataTypeMap.put("BOOL", 1);
|
|
|
|
|
gatewayDataTypeMap.put("INT8", 2);
|
|
|
|
|
gatewayDataTypeMap.put("UINT8", 3);
|
|
|
|
|
gatewayDataTypeMap.put("INT16", 4);
|
|
|
|
|
gatewayDataTypeMap.put("UINT16", 5);
|
|
|
|
|
gatewayDataTypeMap.put("INT32", 6);
|
|
|
|
|
gatewayDataTypeMap.put("UINT32", 7);
|
|
|
|
|
gatewayDataTypeMap.put("INT64", 8);
|
|
|
|
|
gatewayDataTypeMap.put("UINT64", 9);
|
|
|
|
|
gatewayDataTypeMap.put("FLOAT32", 10);
|
|
|
|
|
gatewayDataTypeMap.put("FLOAT64", 11);
|
|
|
|
|
gatewayDataTypeMap.put("STRING", 12);
|
|
|
|
|
gatewayDataTypeMap.put("DATE", 13);
|
|
|
|
|
gatewayDataTypeMap.put("BCD", 14);
|
|
|
|
|
|
|
|
|
|
mysqlDataTypeMap.put("bool","BOOL");
|
|
|
|
|
mysqlDataTypeMap.put("int8","INT");
|
|
|
|
|
mysqlDataTypeMap.put("int16","INT");
|
|
|
|
|
mysqlDataTypeMap.put("int32","INT");
|
|
|
|
|
mysqlDataTypeMap.put("int64","BIGINT");
|
|
|
|
|
mysqlDataTypeMap.put("uint8","INT");
|
|
|
|
|
mysqlDataTypeMap.put("uint16","INT");
|
|
|
|
|
mysqlDataTypeMap.put("uint32","BIGINT");
|
|
|
|
|
mysqlDataTypeMap.put("uint64","BIGINT");
|
|
|
|
|
mysqlDataTypeMap.put("float32","float");
|
|
|
|
|
mysqlDataTypeMap.put("float64","float");
|
|
|
|
|
mysqlDataTypeMap.put("string","varchar(255)");
|
|
|
|
|
mysqlDataTypeMap.put("date","TIMESTAMP");
|
|
|
|
|
mysqlDataTypeMap.put("bcd","double");
|
|
|
|
|
mysqlDataTypeMap.put("bool", "BOOL");
|
|
|
|
|
mysqlDataTypeMap.put("int8", "INT");
|
|
|
|
|
mysqlDataTypeMap.put("int16", "INT");
|
|
|
|
|
mysqlDataTypeMap.put("int32", "INT");
|
|
|
|
|
mysqlDataTypeMap.put("int64", "BIGINT");
|
|
|
|
|
mysqlDataTypeMap.put("uint8", "INT");
|
|
|
|
|
mysqlDataTypeMap.put("uint16", "INT");
|
|
|
|
|
mysqlDataTypeMap.put("uint32", "BIGINT");
|
|
|
|
|
mysqlDataTypeMap.put("uint64", "BIGINT");
|
|
|
|
|
mysqlDataTypeMap.put("float32", "float");
|
|
|
|
|
mysqlDataTypeMap.put("float64", "float");
|
|
|
|
|
mysqlDataTypeMap.put("string", "varchar(255)");
|
|
|
|
|
mysqlDataTypeMap.put("date", "TIMESTAMP");
|
|
|
|
|
mysqlDataTypeMap.put("bcd", "double");
|
|
|
|
|
}
|
|
|
|
|
public static Map<String,String> getDataTypeMap(){
|
|
|
|
|
|
|
|
|
|
public static Map<String, String> getDataTypeMap() {
|
|
|
|
|
return tdDataTypeMap;
|
|
|
|
|
}
|
|
|
|
|
public static String getTdDataType(String originDataType){
|
|
|
|
|
|
|
|
|
|
public static String getTdDataType(String originDataType) {
|
|
|
|
|
return tdDataTypeMap.get(originDataType);
|
|
|
|
|
}
|
|
|
|
|
public static String getTMysqlDataType(String originDataType){
|
|
|
|
|
|
|
|
|
|
public static String getTMysqlDataType(String originDataType) {
|
|
|
|
|
//return mysqlDataTypeMap.get(originDataType);
|
|
|
|
|
return "double(8,4)";
|
|
|
|
|
}
|
|
|
|
|
public static Map<String,Integer> getGatewayDataTypeMap(){
|
|
|
|
|
|
|
|
|
|
public static Map<String, Integer> getGatewayDataTypeMap() {
|
|
|
|
|
return gatewayDataTypeMap;
|
|
|
|
|
}
|
|
|
|
|
public static Integer getGatewayDataTypeMap(String originDataType){
|
|
|
|
|
|
|
|
|
|
public static Integer getGatewayDataTypeMap(String originDataType) {
|
|
|
|
|
return gatewayDataTypeMap.get(originDataType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|