提交 ec4a65ff authored 作者: ww1xhqc's avatar ww1xhqc

[数据模型] 增加hutool工具

上级 7ca1f467
...@@ -146,7 +146,7 @@ public class ModelController { ...@@ -146,7 +146,7 @@ public class ModelController {
return ResultUtil.failed("表已经存在!"); return ResultUtil.failed("表已经存在!");
} }
} }
return ResultUtil.success("表不存在新建成功!"); return ResultUtil.success("新建成功!");
} }
/** /**
......
...@@ -18,5 +18,6 @@ import lombok.NoArgsConstructor; ...@@ -18,5 +18,6 @@ import lombok.NoArgsConstructor;
public class SearchColumnInfoVo extends JpaCustomPage { public class SearchColumnInfoVo extends JpaCustomPage {
private Integer dbId; private Integer dbId;
private String dbName; private String dbName;
} }
...@@ -17,6 +17,8 @@ import lombok.NoArgsConstructor; ...@@ -17,6 +17,8 @@ import lombok.NoArgsConstructor;
@Data @Data
public class SearchTableInfoVo extends JpaCustomPage { public class SearchTableInfoVo extends JpaCustomPage {
private Integer id;
private String tableName; private String tableName;
private String tableCnName; private String tableCnName;
......
package com.tykj.workflowcore.model_layer.entity.vo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @ClassName UpdateTableInfoVO
* @Description TODO
* @Author WWW
* @Date 2021/3/16 13:43
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UpdateTableInfoVO {
private Integer dbId;
private TableVO tableVO;
}
...@@ -3,10 +3,7 @@ package com.tykj.workflowcore.model_layer.service; ...@@ -3,10 +3,7 @@ package com.tykj.workflowcore.model_layer.service;
import com.tykj.workflowcore.model_layer.entity.ColumnInfo; import com.tykj.workflowcore.model_layer.entity.ColumnInfo;
import com.tykj.workflowcore.model_layer.entity.TableInfo; import com.tykj.workflowcore.model_layer.entity.TableInfo;
import com.tykj.workflowcore.model_layer.entity.vo.QueryCondition; import com.tykj.workflowcore.model_layer.entity.vo.*;
import com.tykj.workflowcore.model_layer.entity.vo.SearchColumnInfoVo;
import com.tykj.workflowcore.model_layer.entity.vo.SearchTableInfoVo;
import com.tykj.workflowcore.model_layer.entity.vo.TableVO;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -85,4 +82,10 @@ public interface ModelService { ...@@ -85,4 +82,10 @@ public interface ModelService {
* @return * @return
*/ */
List complexQuery(String tableName, List<QueryCondition> queryConditions); List complexQuery(String tableName, List<QueryCondition> queryConditions);
void updateTable(UpdateTableInfoVO updateTableInfoVO);
} }
...@@ -15,15 +15,15 @@ public class ClassTypeLength { ...@@ -15,15 +15,15 @@ public class ClassTypeLength {
private static String Integer="class java.lang.Integer"; private static String Integer="class java.lang.Integer";
private static String Double="class java.lang.Double"; private static String Double="class java.lang.Double";
public static void setLength(ColumnInfo columnInfo , java.lang.reflect.Type genericType){ public static void setLength(ColumnInfo columnInfo , String genericType){
if (STRING.equals(genericType.toString())){ if (STRING.equals(genericType)){
columnInfo.setLength(255); columnInfo.setLength(255);
} else if (Integer.equals(genericType.toString())) { } else if (Integer.equals(genericType)) {
columnInfo.setLength(11); columnInfo.setLength(11);
} else if (Double.equals(genericType.toString())) { } else if (Double.equals(genericType)) {
columnInfo.setLength(10); columnInfo.setLength(10);
} }
else { else {
......
...@@ -42,7 +42,7 @@ public class CreateTableUtil { ...@@ -42,7 +42,7 @@ public class CreateTableUtil {
"\" column=\"" + columnVO.getFieldName() + "\"/>\n"; "\" column=\"" + columnVO.getFieldName() + "\"/>\n";
} }
xmlMapping += " </class>" + xmlMapping += " </class>" +
"</hibernate-mapping>"; "</hibernate-mapping>";
return xmlMapping; return xmlMapping;
......
...@@ -9,4 +9,4 @@ spring: ...@@ -9,4 +9,4 @@ spring:
hibernate: hibernate:
ddl-auto: update ddl-auto: update
server: server:
port: 8900 port: 8800
## db.setting文件
url = jdbc:mysql://47.106.142.73:3306/www2?useSSL=false&serverTimezone=UTC&characterEncoding=utf-8&nullCatalogMeansCurrent=true
user = root
pass = Huang123+
## 可选配置
# 是否在日志中显示执行的SQL
showSql = true
# 是否格式化显示的SQL
formatSql = true
# 是否显示SQL参数
showParams = true
# 打印SQL的日志等级,默认debug,可以是info、warn、error
sqlLevel = info
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论