admin 管理员组

文章数量: 887021


2024年1月11日发(作者:void有没有返回值)

/** * 获取创建表后缀 * @param tableName * @return */ public String getTableSuffix(String tableName) { StringBuilder tableSuffix = new StringBuilder(); (" `create_time` DATETIME DEFAULT NULL, rn"); ("PRIMARY KEY (`id`), rn"); ("KEY `index_user_id` (`user_id`) USING BTREE rn"); (") ENGINE=InnoDB DEFAULT CHARSET=UTF8; rn"); (" rn"); return ng(); } /** * 根据表名以及列名称创建表结构 * @param tableName * @param columnNames * @return */ public String createSql(String tableName, List columnNames) {

boolean isSplit = isSplitToTables(());

StringBuilder sqlAll = new StringBuilder(); (getTablePrefix(tableName, 0)); for (int i = 0; i < (); i++) { if ((i).contains(":")) { String str[] = (i).split(":"); String columnType = buildColumnType(str[1]); (" `"+str[0]+"` "+columnType+" DEFAULT NULL, rn"); }else { (" `"+(i)+"` LONGTEXT DEFAULT NULL, rn"); } if (isSplit) { if (i > 0 && i % 50 == 0) { (getTableSuffix(tableName)); (getTablePrefix(tableName, i / 50)); } } } (getTableSuffix(tableName)); return ng(); }


本文标签: 创建 名称 返回值 有没有 作者