| | |
| | | |
| | | mapColumnDesc.put(name, ParameterUtil.dealNullStr(desc)); |
| | | |
| | | sql += "\t\"" + name + "\" " + GenCodeGauss.mysqlType2Gauss(type); |
| | | sql += "\t\"" + name + "\" " + GenCodeGauss.dbType2Gauss(type); |
| | | switch (type) { |
| | | case "char": |
| | | case "varchar": |
| | |
| | | } |
| | | sql += "\n"; |
| | | } |
| | | sql += ")\n" + |
| | | ";\n"; |
| | | sql += ");\n"; |
| | | list.add(sql); |
| | | sql = ""; |
| | | |
| | |
| | | return list; |
| | | } |
| | | |
| | | private static String mysqlType2Gauss(String type) { |
| | | private static String dbType2Gauss(String type) { |
| | | String result = ""; |
| | | switch (type) { |
| | | case "char": |
| | |
| | | |
| | | public static List<String> insertAll(List<Map<String, Object>> list, String tableName, Integer onceCount) { |
| | | List<String> result = new ArrayList<>(); |
| | | String insertSql = "INSERT INTO public." + tableName + "(\""; |
| | | String insertSql = "INSERT INTO public.\"" + tableName + "\"(\""; |
| | | List<String> listColumn = new ArrayList<>(); |
| | | for (String column : list.get(0).keySet()) { |
| | | if ("update_time".equalsIgnoreCase(column)) { |
| | | continue; |
| | | } |
| | | listColumn.add(column); |
| | | listColumn.add("\"" + column + "\""); |
| | | } |
| | | insertSql += StringUtil.join(listColumn, "\",\"") + "\") VALUES"; |
| | | |