| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.core.client.RestTemplate; |
| | | import com.java110.db.dao.IQueryServiceDAO; |
| | | import com.java110.utils.factory.ApplicationContextFactory; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.BeansException; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.web.client.RestTemplateBuilder; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.ApplicationContextAware; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | |
| | | import java.nio.charset.Charset; |
| | | |
| | | public class TableToJson { |
| | | |
| | | //show create table c_orders 用这个语句获取 |
| | | public static final String createTableSql = "CREATE TABLE `report_custom_component_footer` (\n" + |
| | | " `footer_id` varchar(30) NOT NULL COMMENT '报表底部同步ID',\n" + |
| | | " `component_id` varchar(30) NOT NULL COMMENT '组件ID',\n" + |
| | | " `name` varchar(64) NOT NULL COMMENT '名称',\n" + |
| | | " `query_model` varchar(1) NOT NULL COMMENT '查询方式 1、sql,2、java',\n" + |
| | | " `java_script` longtext(1024) COMMENT '执行java脚本代码',\n" + |
| | | " `component_sql` longtext(1024) COMMENT '执行sql',\n" + |
| | | " `remark` varchar(512) DEFAULT NULL COMMENT '描述',\n" + |
| | | public static final String createTableSql = "CREATE TABLE `m_menu_group_community` (\n" + |
| | | " `gc_id` varchar(30) NOT NULL COMMENT '主键ID',\n" + |
| | | " `g_id` varchar(30) NOT NULL COMMENT '菜单组ID',\n" + |
| | | " `name` varchar(10) NOT NULL COMMENT '菜单组名称',\n" + |
| | | " `community_id` varchar(30) NOT NULL COMMENT '小区ID',\n" + |
| | | " `community_name` varchar(64) NOT NULL COMMENT '小区名称',\n" + |
| | | " `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',\n" + |
| | | " `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,S 保存,0, 在用 1失效'\n" + |
| | | " `status_cd` varchar(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'\n" + |
| | | ")"; |
| | | |
| | | public static void main(String[] args) { |
| | | String desc = "底部统计"; |
| | | String id = "footerId"; |
| | | String name = "reportCustomComponentFooter"; |
| | | String shareName = "report"; //生成到那个服务下 |
| | | String shareColumn = "footer_id"; |
| | | String shareParam = "footerId"; |
| | | String desc = "小区功能"; |
| | | String id = "gcId"; |
| | | String name = "menuGroupCommunity"; |
| | | String shareName = "user"; //生成到那个服务下 |
| | | String shareColumn = "community_id"; |
| | | String shareParam = "communityId"; |
| | | //业务名称 desc 业务编码名称生成后类名 name 主键 id 需要放到那个服务 shareName |
| | | String newSql = createTableSql.substring(createTableSql.indexOf("(") + 1, createTableSql.lastIndexOf(")")); |
| | | String tableName = createTableSql.substring(createTableSql.indexOf("TABLE") + 5, createTableSql.indexOf("(")); |
| | |
| | | if ("KEY".equals(key)) { |
| | | continue; |
| | | } |
| | | if ("PRIMARY".equals(key)) { |
| | | continue; |
| | | } |
| | | if ("b_id".equals(key)) { |
| | | continue; |
| | | } |
| | |
| | | param.put("required", requireds); |
| | | System.out.println(param.toJSONString()); |
| | | } |
| | | |
| | | } |