From c2b88a03f3d0d5ebe92949e64d17ee4d0ac3f6b7 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 09 九月 2025 15:14:00 +0800
Subject: [PATCH] 发货清空缓存站点
---
zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/utils/GeneratorUtils.java | 320 ++++++++++++++++++++++++++--------------------------
1 files changed, 160 insertions(+), 160 deletions(-)
diff --git a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/utils/GeneratorUtils.java b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/utils/GeneratorUtils.java
index b691779..bc7fc77 100644
--- a/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/utils/GeneratorUtils.java
+++ b/zy-asrs-framework/src/main/java/com/zy/asrs/framework/generators/utils/GeneratorUtils.java
@@ -1,160 +1,160 @@
-package com.zy.asrs.framework.generators.utils;
-
-import com.zy.asrs.framework.common.Cools;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import static java.sql.Types.*;
-
-/**
- * Created by vincent on 2019-06-18
- */
-public class GeneratorUtils {
-
- public static final List<String> FILTER_FIELD = new ArrayList<String>(){{
- add("deleted");
- add("tenantId");
- add("createBy");
- add("createTime");
- add("updateBy");
- add("updateTime");
- }};
-
- /**
- * 涓嬪垝绾� ===>> 椹煎嘲鍛藉悕
- * @param smallHump 灏忛┘宄板懡鍚�
- */
- public static String _convert(String str, boolean smallHump){
- String[] split = str.split("_");
- StringBuilder sb = new StringBuilder();
- for (int i=0;i<split.length;i++){
- sb.append(i==0&&smallHump?split[i]:split[i].substring(0, 1).toUpperCase()+split[i].substring(1));
- }
- return sb.toString();
- }
-
- public static String _convert(String str){
- return _convert(str, true);
- }
-
- // sql绫诲瀷 ===>> java绫诲瀷
- public static String getType(int type){
- switch (type){
- case BIT:
- return "Boolean";
- case TINYINT:
- return "Short";
- case SMALLINT:
- return "Short";
- case INTEGER:
- return "Integer";
- case BIGINT:
- return "Long";
- case DOUBLE:
- return "Double";
- case DECIMAL:
- return "Double";
- case NCHAR:
- return "String";
- case NVARCHAR:
- return "String";
- case CHAR:
- return "String";
- case VARCHAR:
- return "String";
- case DATE:
- return "Date";
- case TIMESTAMP:
- return "Date";
- case BLOB:
- return "String";
- case LONGVARCHAR:
- return "String";
- default:
- return null;
- }
- }
-
- // sql琛ㄥ悕 ===>> 鍘诲墠缂� 澶ч┘宄�
- public static String getNameSpace(String tableName){
- String[] strings = tableName.split("_");
- StringBuilder sb = new StringBuilder();
- for (int i=1;i<strings.length;i++){
- if (i!=1){
- sb.append("_");
- }
- sb.append(strings[i]);
- }
- return _convert(sb.toString(), false);
- }
-
- // htmlDetail 瀛楃閫傞厤
- public static String supportHtmlName(String comment){
- if (Cools.isEmpty(comment)){
- return "";
- }
- if (comment.length() == 2){
- return comment.charAt(0) + "銆�銆�" + comment.charAt(1);
- } else if (comment.length() == 3){
- return comment.charAt(0) + " " + comment.charAt(1) + " " +comment.charAt(2);
- }
- return comment;
- }
-
- /**
- * 鑾峰彇mysql琛ㄥ瓧娈甸暱搴�
- */
- public static Integer getColumnLength(String typeMsg){
- if (Cools.isEmpty(typeMsg)){
- return null;
- }
- Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))");
- Matcher matcher = pattern.matcher(typeMsg);
- if (matcher.find()){
- String group = matcher.group();
- if (group.contains(",")) {
- group = group.split(",")[0];
- }
- return Integer.parseInt(group);
- }
- return null;
- }
-
- /**
- * 瀛楃涓查瀛楁瘝澶у皬鍐欒浆鎹�
- * @param str 瀛楃涓�
- * @param low true锛氬皬鍐� / false锛氬ぇ鍐�
- * @return the result
- */
- public static String firstCharConvert(String str, boolean low){
- if (Cools.isEmpty(str)){
- return "";
- }
- String firstChar = str.substring(0, 1);
- if (low){
- firstChar = firstChar.toLowerCase();
- } else {
- firstChar = firstChar.toUpperCase();
- }
- return firstChar + str.substring(1);
- }
-
- public static String firstCharConvert(String str){
- return firstCharConvert(str, true);
- }
-
- /** 椹煎嘲杞笅鍒掔嚎 */
- public static String humpToLine(String str) {
- Matcher matcher = Pattern.compile("[A-Z]").matcher(str);
- StringBuffer sb = new StringBuffer();
- while (matcher.find()) {
- matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
- }
- matcher.appendTail(sb);
- return sb.toString();
- }
-
-}
+package com.zy.asrs.framework.generators.utils;
+
+import com.zy.asrs.framework.common.Cools;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static java.sql.Types.*;
+
+/**
+ * Created by vincent on 2019-06-18
+ */
+public class GeneratorUtils {
+
+ public static final List<String> FILTER_FIELD = new ArrayList<String>(){{
+ add("deleted");
+ add("tenantId");
+ add("createBy");
+ add("createTime");
+ add("updateBy");
+ add("updateTime");
+ }};
+
+ /**
+ * 涓嬪垝绾� ===>> 椹煎嘲鍛藉悕
+ * @param smallHump 灏忛┘宄板懡鍚�
+ */
+ public static String _convert(String str, boolean smallHump){
+ String[] split = str.split("_");
+ StringBuilder sb = new StringBuilder();
+ for (int i=0;i<split.length;i++){
+ sb.append(i==0&&smallHump?split[i]:split[i].substring(0, 1).toUpperCase()+split[i].substring(1));
+ }
+ return sb.toString();
+ }
+
+ public static String _convert(String str){
+ return _convert(str, true);
+ }
+
+ // sql绫诲瀷 ===>> java绫诲瀷
+ public static String getType(int type){
+ switch (type){
+ case BIT:
+ return "Boolean";
+ case TINYINT:
+ return "Short";
+ case SMALLINT:
+ return "Short";
+ case INTEGER:
+ return "Integer";
+ case BIGINT:
+ return "Long";
+ case DOUBLE:
+ return "Double";
+ case DECIMAL:
+ return "Double";
+ case NCHAR:
+ return "String";
+ case NVARCHAR:
+ return "String";
+ case CHAR:
+ return "String";
+ case VARCHAR:
+ return "String";
+ case DATE:
+ return "Date";
+ case TIMESTAMP:
+ return "Date";
+ case BLOB:
+ return "String";
+ case LONGVARCHAR:
+ return "String";
+ default:
+ return null;
+ }
+ }
+
+ // sql琛ㄥ悕 ===>> 鍘诲墠缂� 澶ч┘宄�
+ public static String getNameSpace(String tableName){
+ String[] strings = tableName.split("_");
+ StringBuilder sb = new StringBuilder();
+ for (int i=1;i<strings.length;i++){
+ if (i!=1){
+ sb.append("_");
+ }
+ sb.append(strings[i]);
+ }
+ return _convert(sb.toString(), false);
+ }
+
+ // htmlDetail 瀛楃閫傞厤
+ public static String supportHtmlName(String comment){
+ if (Cools.isEmpty(comment)){
+ return "";
+ }
+ if (comment.length() == 2){
+ return comment.charAt(0) + "銆�銆�" + comment.charAt(1);
+ } else if (comment.length() == 3){
+ return comment.charAt(0) + " " + comment.charAt(1) + " " +comment.charAt(2);
+ }
+ return comment;
+ }
+
+ /**
+ * 鑾峰彇mysql琛ㄥ瓧娈甸暱搴�
+ */
+ public static Integer getColumnLength(String typeMsg){
+ if (Cools.isEmpty(typeMsg)){
+ return null;
+ }
+ Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))");
+ Matcher matcher = pattern.matcher(typeMsg);
+ if (matcher.find()){
+ String group = matcher.group();
+ if (group.contains(",")) {
+ group = group.split(",")[0];
+ }
+ return Integer.parseInt(group);
+ }
+ return null;
+ }
+
+ /**
+ * 瀛楃涓查瀛楁瘝澶у皬鍐欒浆鎹�
+ * @param str 瀛楃涓�
+ * @param low true锛氬皬鍐� / false锛氬ぇ鍐�
+ * @return the result
+ */
+ public static String firstCharConvert(String str, boolean low){
+ if (Cools.isEmpty(str)){
+ return "";
+ }
+ String firstChar = str.substring(0, 1);
+ if (low){
+ firstChar = firstChar.toLowerCase();
+ } else {
+ firstChar = firstChar.toUpperCase();
+ }
+ return firstChar + str.substring(1);
+ }
+
+ public static String firstCharConvert(String str){
+ return firstCharConvert(str, true);
+ }
+
+ /** 椹煎嘲杞笅鍒掔嚎 */
+ public static String humpToLine(String str) {
+ Matcher matcher = Pattern.compile("[A-Z]").matcher(str);
+ StringBuffer sb = new StringBuffer();
+ while (matcher.find()) {
+ matcher.appendReplacement(sb, "_" + matcher.group(0).toLowerCase());
+ }
+ matcher.appendTail(sb);
+ return sb.toString();
+ }
+
+}
--
Gitblit v1.9.1