create_table.db 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. -- m_menu
  2. create table m_menu(
  3. m_id INT NOT NULL AUTO_INCREMENT KEY COMMENT '菜单ID',
  4. name varchar(10) not null comment '菜单名称',
  5. level varchar(2) not null comment '菜单级别 一级菜单 为 1 二级菜单为2',
  6. parent_id int not null comment '父类菜单id 如果是一类菜单则写为-1 如果是二类菜单则写父类的菜单id',
  7. menu_group varchar(10) not null comment '菜单组 left 显示在页面左边的菜单',
  8. user_id varchar(12) not null comment '创建菜单的用户id',
  9. remark VARCHAR(200) COMMENT '描述',
  10. seq INT NOT NULL COMMENT '列顺序',
  11. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  12. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
  13. );
  14. -- m_menu_ctg
  15. create table m_menu_ctg(
  16. m_ctg_id INT NOT NULL AUTO_INCREMENT KEY COMMENT '菜单配置ID',
  17. m_id INT NOT NULL COMMENT '菜单ID',
  18. url varchar(100) not null comment '菜单打开地址',
  19. template varchar(50) comment '页面模板 模板名称',
  20. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  21. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
  22. );
  23. -- m_menu_2_user
  24. create table m_menu_2_user(
  25. m_user_id INT NOT NULL AUTO_INCREMENT KEY COMMENT '菜单用户ID',
  26. m_id int not null comment '菜单id',
  27. user_id varchar(30) not null comment '用户id',
  28. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  29. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
  30. );
  31. insert into m_menu(name,level,parent_id,menu_group,user_id,remark,seq) values('系统配置','1','-1','LEFT','10001','',1);
  32. insert into m_menu(name,level,parent_id,menu_group,user_id,remark,seq) values('映射管理','2','1','LEFT','10001','',2);
  33. insert into m_menu(name,level,parent_id,menu_group,user_id,remark,seq) values('外部应用','2','1','LEFT','10001','',3);
  34. insert into m_menu(name,level,parent_id,menu_group,user_id,remark,seq) values('路由管理','2','1','LEFT','10001','',4);
  35. insert into m_menu(name,level,parent_id,menu_group,user_id,remark,seq) values('服务管理','2','1','LEFT','10001','',5);
  36. insert into m_menu(name,level,parent_id,menu_group,user_id,remark,seq) values('缓存管理','1','-1','LEFT','10001','',1);
  37. insert into m_menu(name,level,parent_id,menu_group,user_id,remark,seq) values('刷新缓存','2','1','LEFT','10001','',2);
  38. insert into m_menu_ctg(m_id,url,template) values(1,'#','');
  39. insert into m_menu_ctg(m_id,url,template) values(2,'/console/list?templateCode=mapping','');
  40. insert into m_menu_ctg(m_id,url,template) values(3,'/console/list?templateCode=app','');
  41. insert into m_menu_ctg(m_id,url,template) values(4,'/console/list?templateCode=service','');
  42. insert into m_menu_ctg(m_id,url,template) values(5,'/console/list?templateCode=route','');
  43. insert into m_menu_ctg(m_id,url,template) values(6,'#','');
  44. insert into m_menu_ctg(m_id,url,template) values(7,'/','');
  45. insert into m_menu_2_user(m_id,user_id) values(1,'10001');
  46. insert into m_menu_2_user(m_id,user_id) values(2,'10001');
  47. insert into m_menu_2_user(m_id,user_id) values(3,'10001');
  48. insert into m_menu_2_user(m_id,user_id) values(4,'10001');
  49. insert into m_menu_2_user(m_id,user_id) values(5,'10001');
  50. insert into m_menu_2_user(m_id,user_id) values(6,'10001');
  51. insert into m_menu_2_user(m_id,user_id) values(7,'10001');
  52. -- c_template
  53. create table c_template(
  54. id INT NOT NULL AUTO_INCREMENT KEY COMMENT '模板ID',
  55. template_code varchar(20) not null UNIQUE comment '模板编码 模板英文名',
  56. name varchar(50) not null comment '模板名称',
  57. html_name varchar(20) not null comment '对应HTML文件名称',
  58. url varchar(200) not null comment '查询数据,修改数据url 其真实地址对应于mapping表中 LIST->key 对应 查询多条数据 QUERY->key 对应单条数据 UPDATE-> 对应修改数据 DELETE->key 对应删除数据 多条之间用 ; 分隔',
  59. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  60. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
  61. );
  62. -- c_template_col
  63. create table c_template_col(
  64. id INT NOT NULL AUTO_INCREMENT KEY COMMENT '模板ID',
  65. template_code varchar(20) not null comment '模板编码 模板英文名',
  66. col_name varchar(50) not null comment '前台显示名称',
  67. col_code varchar(20) not null comment '字段的编码',
  68. col_model longtext not null comment 'jqgrid的colmodel',
  69. seq INT NOT NULL COMMENT '列顺序',
  70. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  71. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
  72. );
  73. insert into c_template(template_code,name,html_name,url) values('mapping','映射管理','list_template','LIST->query.center.mapping;QUERY->mapping_query_url;INSERT->save.center.mapping;UPDATE->update.center.mapping;DELETE->delete.center.mapping');
  74. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('mapping','列ID','id','{ "name": "id","index": "id","width": "90",
  75. "editable": true,
  76. "sorttype": "int" }',1);
  77. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('mapping','域','domain','{ "name": "domain","index": "domain","width": "90",
  78. "editable": true,
  79. "formatoptions": { "defaultValue": "DOMAIN.COMMON" }
  80. }',2);
  81. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('mapping','名称','name','{ "name": "name","index": "name","width": "90",
  82. "editable": true }',3);
  83. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('mapping','键','key','{ "name": "key","index": "key","width": "90",
  84. "editable": true }',4);
  85. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('mapping','值','value','{ "name": "value","index": "value","width": "90",
  86. "editable": true }',5);
  87. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('mapping','备注','value','{ "name": "remark","index": "remark","width": "90",
  88. "editable": true }',6);
  89. INSERT INTO c_template_col(template_code,col_name,col_code,col_model,seq) VALUES('mapping','BUTTON','BUTTON','{
  90. "name": "detail",
  91. "index": "",
  92. "width": "40",
  93. "fixed": "true",
  94. "sortable": "false",
  95. "resize": "false",
  96. "formatter": "function(cellvalue, options, rowObject){\n var temp =\"<div style=''margin-left:8px;''><div title=''详情记录'' style=''float:left;cursor:pointer;'' class=''ui-pg-div'' id=''jEditButton_3'' onclick=''detail(\"+rowObject+\")'' onmouseover=''jQuery(this).addClass(''ui-state-hover'');'' onmouseout=''jQuery(this).removeClass(''ui-state-hover'');''><span class=''ui-icon fa-search-plus''/></div></div>\";\n return temp; \n}"
  97. }',7);
  98. /** 如果BUTTON 报错不显示,则直接粘贴到col_model中
  99. {
  100. "name": "detail",
  101. "index": "",
  102. "width": "40",
  103. "fixed": true,
  104. "sortable": "false",
  105. "resize": "false",
  106. "formatter": "function(cellvalue, options, rowObject){ var temp =\"<div style='margin-left:8px;'><div title='详情记录' style='float:left;cursor:pointer;' class='ui-pg-div' id='jEditButton_3' onclick='detail(\" + rowObject + \")' onmouseover='jQuery(this).addClass('ui-state-hover');' onmouseout='jQuery(this).removeClass('ui-state-hover');'><span class='ui-icon fa-search-plus'/></div></div>\";return temp; }"
  107. }
  108. **/
  109. insert into c_template(template_code,name,html_name,url) values('app','外部应用','list_template','LIST->query.center.apps;QUERY->query.center.app');
  110. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('app','列ID','id','{ "name": "id","index": "id","width": "20",
  111. "editable": true,
  112. "sorttype": "int" }',1);
  113. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('app','AppId','domain','{ "name": "appId","index": "appId","width": "40",
  114. "editable": true
  115. }',2);
  116. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('app','名称','name','{ "name": "name","index": "name","width": "50",
  117. "editable": true }',3);
  118. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('app','秘钥','securityCode','{ "name": "securityCode","index": "securityCode","width": "50",
  119. "editable": true }',4);
  120. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('app','白名单','whileListIp','{ "name": "whileListIp","index": "whileListIp","width": "90",
  121. "editable": true }',5);
  122. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('app','黑名单','blackListIp','{ "name": "blackListIp","index": "blackListIp","width": "40",
  123. "editable": true }',6);
  124. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('app','备注','value','{ "name": "remark","index": "remark","width": "90",
  125. "editable": true }',7);
  126. INSERT INTO c_template_col(template_code,col_name,col_code,col_model,seq) VALUES('app','BUTTON','BUTTON','{
  127. "name": "detail",
  128. "index": "",
  129. "width": "40",
  130. "fixed": "true",
  131. "sortable": "false",
  132. "resize": "false",
  133. "formatter": "function(cellvalue, options, rowObject){\n var temp =\"<div style=''margin-left:8px;''><div title=''详情记录'' style=''float:left;cursor:pointer;'' class=''ui-pg-div'' id=''jEditButton_3'' onclick=''detail(\"+rowObject+\")'' onmouseover=''jQuery(this).addClass(''ui-state-hover'');'' onmouseout=''jQuery(this).removeClass(''ui-state-hover'');''><span class=''ui-icon fa-search-plus''/></div></div>\";\n return temp; \n}"
  134. }',8);
  135. insert into c_template(template_code,name,html_name,url) values('service','服务管理','list_template','LIST->query.center.services;QUERY->query.center.service');
  136. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','服务ID','serviceId','{ "name": "serviceId","index": "serviceId","width": "20",
  137. "editable": true,
  138. "sorttype": "int" }',1);
  139. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','服务编码','serviceCode','{ "name": "serviceCode","index": "serviceCode","width": "40",
  140. "editable": true
  141. }',2);
  142. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','业务类型','businessTypeCd','{ "name": "businessTypeCd","index": "businessTypeCd","width": "50",
  143. "editable": true }',3);
  144. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','名称','name','{ "name": "name","index": "name","width": "40",
  145. "editable": true }',4);
  146. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','消息队列','messageQueueName','{ "name": "messageQueueName","index": "messageQueueName","width": "10",
  147. "editable": true }',5);
  148. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','需要Instance','isInstance','{ "name": "isInstance","index": "isInstance","width": "10",
  149. "editable": true }',6);
  150. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','URL','url','{ "name": "url","index": "url","width": "60",
  151. "editable": true }',7);
  152. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('service','提供者AppId','provideAppId','{ "name": "provideAppId","index": "provideAppId","width": "10",
  153. "editable": true }',8);
  154. INSERT INTO c_template_col(template_code,col_name,col_code,col_model,seq) VALUES('service','BUTTON','BUTTON','{
  155. "name": "detail",
  156. "index": "",
  157. "width": "40",
  158. "fixed": "true",
  159. "sortable": "false",
  160. "resize": "false",
  161. "formatter": "function(cellvalue, options, rowObject){\n var temp =\"<div style=''margin-left:8px;''><div title=''详情记录'' style=''float:left;cursor:pointer;'' class=''ui-pg-div'' id=''jEditButton_3'' onclick=''detail(\"+rowObject+\")'' onmouseover=''jQuery(this).addClass(''ui-state-hover'');'' onmouseout=''jQuery(this).removeClass(''ui-state-hover'');''><span class=''ui-icon fa-search-plus''/></div></div>\";\n return temp; \n}"
  162. }',9);
  163. insert into c_template(template_code,name,html_name,url) values('route','路由管理','list_template','LIST->query.center.routes;QUERY->query.center.route');
  164. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','路由ID','id','{ "name": "id","index": "id","width": "10",
  165. "editable": true,
  166. "sorttype": "int" }',1);
  167. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','AppId','appId','{ "name": "appId","index": "appId","width": "30",
  168. "editable": true
  169. }',2);
  170. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','服务ID','serviceId','{ "name": "serviceId","index": "serviceId","width": "30",
  171. "editable": true }',3);
  172. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','调用方式','invokeModel','{ "name": "invokeModel","index": "invokeModel","width": "50",
  173. "editable": true }',4);
  174. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','服务名称','serviceName','{ "name": "serviceName","index": "serviceName","width": "30",
  175. "editable": true }',5);
  176. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','服务编码','serviceCode','{ "name": "serviceCode","index": "serviceCode","width": "30",
  177. "editable": true }',6);
  178. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','订单类型','orderTypeCd','{ "name": "orderTypeCd","index": "orderTypeCd","width": "30",
  179. "editable": true }',7);
  180. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('route','调用次数限制','invokelimitTimes','{ "name": "invokelimitTimes","index": "invokelimitTimes","width": "40",
  181. "editable": true }',8);
  182. INSERT INTO c_template_col(template_code,col_name,col_code,col_model,seq) VALUES('route','BUTTON','BUTTON','{
  183. "name": "detail",
  184. "index": "",
  185. "width": "40",
  186. "fixed": "true",
  187. "sortable": "false",
  188. "resize": "false",
  189. "formatter": "function(cellvalue, options, rowObject){\n var temp =\"<div style=''margin-left:8px;''><div title=''详情记录'' style=''float:left;cursor:pointer;'' class=''ui-pg-div'' id=''jEditButton_3'' onclick=''detail(\"+rowObject+\")'' onmouseover=''jQuery(this).addClass(''ui-state-hover'');'' onmouseout=''jQuery(this).removeClass(''ui-state-hover'');''><span class=''ui-icon fa-search-plus''/></div></div>\";\n return temp; \n}"
  190. insert into c_template(template_code,name,html_name,url) values('cache','刷新缓存','list_template_cache','LIST->query.center.caches;QUERY->query.center.cacheOne');
  191. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('cache','缓存ID','id','{ "name": "id","index": "id","width": "10",
  192. "editable": true,
  193. "sorttype": "int" }',1);
  194. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('cache','缓存编码','cacheCode','{ "name": "cacheCode","index": "cacheCode","width": "30",
  195. "editable": true }',2);
  196. insert into c_template_col(template_code,col_name,col_code,col_model,seq) values('cache','缓存名称','cacheName','{ "name": "cacheName","index": "cacheName","width": "30",
  197. "editable": true }',3);
  198. INSERT INTO c_template_col(template_code,col_name,col_code,col_model,seq) VALUES('cache','BUTTON','BUTTON','{
  199. "name": "detail",
  200. "index": "",
  201. "width": "40",
  202. "fixed": "true",
  203. "sortable": "false",
  204. "resize": "false",
  205. "formatter": ""function(cellvalue, options, rowObject){ var temp =\"<div style='margin-left:8px;'><button type='button' class='btn btn-warning' style='border-radius: .25rem;' onclick='flush(this,\"+rowObject.cacheCode+\")'>刷新缓存</button></div>\";return temp; }"
  206. }',4);
  207. /** 如果BUTTON 报错不显示,则直接粘贴到col_model中
  208. {
  209. "name": "detail",
  210. "index": "",
  211. "width": "40",
  212. "fixed": "true",
  213. "sortable": "false",
  214. "resize": "false",
  215. "formatter": "function(cellvalue, options, rowObject){ var temp =\"<div style='margin-left:8px;'><button type='button' class='btn btn-warning' style='border-radius: .25rem;' onclick='flush(this,\"+rowObject.cacheCode+\")'>刷新缓存</button></div>\";return temp; }"
  216. }
  217. **/
  218. -- 缓存配置表
  219. CREATE TABLE c_cache(
  220. id INT NOT NULL AUTO_INCREMENT KEY COMMENT '缓存ID',
  221. cache_code VARCHAR(10) NOT NULL UNIQUE COMMENT '缓存编码 开始于1001',
  222. service_code VARCHAR(50) NOT NULL COMMENT '调用服务编码 对应 c_service',
  223. `name` VARCHAR(50) NOT NULL COMMENT '前台显示名称',
  224. param LONGTEXT NOT NULL COMMENT '请求缓存系统时的参数',
  225. seq INT NOT NULL COMMENT '列顺序',
  226. `group` VARCHAR(10) NOT NULL DEFAULT 'COMMON' COMMENT '组,缓存属于哪个组',
  227. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  228. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
  229. );
  230. -- 缓存用户表
  231. create table c_cache_2_user(
  232. id INT NOT NULL AUTO_INCREMENT KEY COMMENT '缓存用户ID',
  233. cache_code int not null comment '缓存编码',
  234. user_id varchar(30) not null comment '用户id',
  235. create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  236. status_cd VARCHAR(2) NOT NULL DEFAULT '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
  237. );
  238. insert into c_cache (cache_code,service_code,`name`,param,seq) values('1001','flush.center.cache','映射缓存(c_mapping表)','{"cacheName":"MAPPING"}',1);
  239. insert into c_cache (cache_code,service_code,`name`,param,seq) values('1002','flush.center.cache','业务配置缓存(c_app,c_service,c_route表)','{"cacheName":"APP_ROUTE_SERVICE"}',2);
  240. insert into c_cache (cache_code,service_code,`name`,param,seq) values('1003','flush.center.cache','公用服务缓存(c_service_sql表)','{"cacheName":"SERVICE_SQL"}',3);
  241. insert into c_cache_2_user(cache_code,user_id) values('1001','10001');
  242. insert into c_cache_2_user(cache_code,user_id) values('1002','10001');
  243. insert into c_cache_2_user(cache_code,user_id) values('1003','10001');