structure.sql 96 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163
  1. SET NAMES utf8;
  2. SET FOREIGN_KEY_CHECKS = 0;
  3. -- ----------------------------
  4. -- Table structure for t_achievements
  5. -- ----------------------------
  6. DROP TABLE IF EXISTS `t_achievements`;
  7. CREATE TABLE `t_achievements` (
  8. `achievements_id` int(11) NOT NULL AUTO_INCREMENT,
  9. `total_goal` double(22, 0) NOT NULL,
  10. `no_customer_tag` double(5, 2) NULL DEFAULT 0.00,
  11. `customer_tag` text NULL DEFAULT NULL,
  12. `ctime` datetime(0) NULL DEFAULT NULL,
  13. `utime` datetime(0) NULL DEFAULT NULL,
  14. `dtime` datetime(0) NULL DEFAULT NULL,
  15. PRIMARY KEY (`achievements_id`) USING BTREE
  16. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  17. -- ----------------------------
  18. -- Table structure for t_achievements_group
  19. -- ----------------------------
  20. DROP TABLE IF EXISTS `t_achievements_group`;
  21. CREATE TABLE `t_achievements_group` (
  22. `achievements_group_id` int(11) NOT NULL AUTO_INCREMENT,
  23. `group_total_goal` double(22, 0) NOT NULL,
  24. `achievements_group_title` varchar(20) NOT NULL DEFAULT '',
  25. `achievements_group_users` text NULL DEFAULT NULL,
  26. PRIMARY KEY (`achievements_group_id`) USING BTREE
  27. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  28. -- ----------------------------
  29. -- Table structure for t_affair
  30. -- ----------------------------
  31. DROP TABLE IF EXISTS `t_affair`;
  32. CREATE TABLE `t_affair` (
  33. `affair_id` int(11) NOT NULL AUTO_INCREMENT,
  34. `affair_name` varchar(255) NOT NULL,
  35. `affair_icon` varchar(255) NULL DEFAULT NULL,
  36. `affair_tablename` varchar(255) NULL DEFAULT NULL,
  37. `affair_is_buildin` tinyint(255) NULL DEFAULT NULL,
  38. `affair_group_id` int(11) NULL DEFAULT NULL,
  39. `version` int(11) NULL DEFAULT NULL,
  40. `lock_time` varchar(25) NULL DEFAULT NULL,
  41. `lock_user` int(11) NULL DEFAULT NULL,
  42. PRIMARY KEY (`affair_id`) USING BTREE,
  43. INDEX `affair_group_id`(`affair_group_id`) USING BTREE,
  44. CONSTRAINT `t_affair_ibfk_1` FOREIGN KEY (`affair_group_id`) REFERENCES `t_affair_group` (`affair_group_id`) ON DELETE SET NULL ON UPDATE CASCADE
  45. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  46. -- ----------------------------
  47. -- Table structure for t_affair_bar
  48. -- ----------------------------
  49. DROP TABLE IF EXISTS `t_affair_bar`;
  50. CREATE TABLE `t_affair_bar` (
  51. `bar_id` int(11) NOT NULL AUTO_INCREMENT,
  52. `user_id` int(11) NOT NULL,
  53. `affairIds` text NULL DEFAULT NULL,
  54. `utime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  55. `affair_category` tinyint(1) NULL DEFAULT 0,
  56. PRIMARY KEY (`bar_id`) USING BTREE,
  57. INDEX `user_id`(`user_id`) USING BTREE,
  58. CONSTRAINT `t_affair_bar_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  59. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  60. -- ----------------------------
  61. -- Table structure for t_affair_calculation
  62. -- ----------------------------
  63. DROP TABLE IF EXISTS `t_affair_calculation`;
  64. CREATE TABLE `t_affair_calculation` (
  65. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  66. `affair_id` int(11) NOT NULL,
  67. `calculation_formula` text NULL DEFAULT NULL,
  68. `calculation_formula_title` text NULL DEFAULT NULL,
  69. `calculation_result` varchar(50) NULL DEFAULT '',
  70. `calculation_result_title` varchar(50) NULL DEFAULT '',
  71. `calculation_result_accuracy` tinyint(1) NULL DEFAULT 0,
  72. `all_algebras` text NULL DEFAULT NULL,
  73. `calculation_steps` longtext NULL,
  74. PRIMARY KEY (`calculation_id`) USING BTREE,
  75. INDEX `affair_id`(`affair_id`) USING BTREE,
  76. CONSTRAINT `t_affair_calculation_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  77. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  78. -- ----------------------------
  79. -- Table structure for t_affair_frequently
  80. -- ----------------------------
  81. DROP TABLE IF EXISTS `t_affair_frequently`;
  82. CREATE TABLE `t_affair_frequently` (
  83. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  84. `user_id` int(11) NOT NULL,
  85. `affair_id` int(11) NOT NULL,
  86. `ctime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  87. PRIMARY KEY (`frequently_id`) USING BTREE,
  88. INDEX `affair_id`(`affair_id`) USING BTREE,
  89. INDEX `user_id`(`user_id`) USING BTREE,
  90. CONSTRAINT `t_affair_frequently_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  91. CONSTRAINT `t_affair_frequently_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  92. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  93. -- ----------------------------
  94. -- Table structure for t_affair_group
  95. -- ----------------------------
  96. DROP TABLE IF EXISTS `t_affair_group`;
  97. CREATE TABLE `t_affair_group` (
  98. `affair_group_id` int(11) NOT NULL AUTO_INCREMENT,
  99. `affair_group_title` varchar(255) NOT NULL,
  100. `affair_group_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  101. `status` int(11) NULL DEFAULT 99,
  102. `ctime` datetime(0) NULL DEFAULT NULL,
  103. `utime` datetime(0) NULL DEFAULT NULL,
  104. `dtime` datetime(0) NULL DEFAULT NULL,
  105. PRIMARY KEY (`affair_group_id`) USING BTREE
  106. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  107. -- ----------------------------
  108. -- Table structure for t_affair_modify_record
  109. -- ----------------------------
  110. DROP TABLE IF EXISTS `t_affair_modify_record`;
  111. CREATE TABLE `t_affair_modify_record` (
  112. `record_id` int(11) NOT NULL AUTO_INCREMENT,
  113. `data_id` varchar(25) NOT NULL,
  114. `affair_id` int(11) NOT NULL,
  115. `user_id` int(11) NOT NULL,
  116. `record_data` text NOT NULL,
  117. `ctime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  118. `type` tinyint(1) NULL DEFAULT 0,
  119. PRIMARY KEY (`record_id`) USING BTREE,
  120. INDEX `user_id`(`user_id`) USING BTREE,
  121. CONSTRAINT `t_affair_modify_record_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  122. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  123. -- ----------------------------
  124. -- Table structure for t_affair_rule
  125. -- ----------------------------
  126. DROP TABLE IF EXISTS `t_affair_rule`;
  127. CREATE TABLE `t_affair_rule` (
  128. `rule_id` int(11) NOT NULL AUTO_INCREMENT,
  129. `affair_id` int(11) NULL DEFAULT NULL,
  130. `sheet_id` int(11) NULL DEFAULT NULL,
  131. `user_id` int(11) NULL DEFAULT NULL,
  132. `rule_allow_use` tinyint(1) NULL DEFAULT 0,
  133. `rule_allow_view` tinyint(1) NULL DEFAULT 0,
  134. PRIMARY KEY (`rule_id`) USING BTREE,
  135. INDEX `sheet_id`(`sheet_id`) USING BTREE,
  136. CONSTRAINT `t_affair_rule_ibfk_1` FOREIGN KEY (`sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE RESTRICT
  137. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  138. -- ----------------------------
  139. -- Table structure for t_affair_sheet
  140. -- ----------------------------
  141. DROP TABLE IF EXISTS `t_affair_sheet`;
  142. CREATE TABLE `t_affair_sheet` (
  143. `sheet_id` int(11) NOT NULL AUTO_INCREMENT,
  144. `sheet_prev_id` int(11) NULL DEFAULT NULL,
  145. `sheet_next_id` int(11) NULL DEFAULT NULL,
  146. `affair_id` int(11) NOT NULL,
  147. `sheet_name` varchar(255) NOT NULL,
  148. `sheet_tablename` varchar(255) NOT NULL,
  149. `sheet_rule_use_option` tinyint(1) NULL DEFAULT NULL,
  150. `sheet_rule_view_option` tinyint(1) NULL DEFAULT NULL,
  151. `sheet_join_order` tinyint(1) NULL DEFAULT 0,
  152. PRIMARY KEY (`sheet_id`) USING BTREE,
  153. INDEX `affair_id`(`affair_id`) USING BTREE,
  154. CONSTRAINT `t_affair_sheet_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  155. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  156. -- ----------------------------
  157. -- Table structure for t_affair_sheet_column
  158. -- ----------------------------
  159. DROP TABLE IF EXISTS `t_affair_sheet_column`;
  160. CREATE TABLE `t_affair_sheet_column` (
  161. `sheet_column_id` int(11) NOT NULL AUTO_INCREMENT,
  162. `sheet_column_pid` int(11) NULL DEFAULT 0,
  163. `column_id` int(11) NULL DEFAULT NULL,
  164. `sheet_id` int(11) NULL DEFAULT NULL,
  165. `sheet_group_id` int(11) NULL DEFAULT NULL,
  166. `column_is_require` tinyint(1) NULL DEFAULT 0,
  167. `column_is_summary` tinyint(1) NULL DEFAULT 0,
  168. `column_order` int(11) NULL DEFAULT 0,
  169. PRIMARY KEY (`sheet_column_id`) USING BTREE,
  170. INDEX `sheet_id`(`sheet_id`) USING BTREE,
  171. INDEX `column_id`(`column_id`) USING BTREE,
  172. CONSTRAINT `t_affair_sheet_column_ibfk_1` FOREIGN KEY (`sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  173. CONSTRAINT `t_affair_sheet_column_ibfk_2` FOREIGN KEY (`column_id`) REFERENCES `t_affair_system_column` (`column_id`) ON DELETE CASCADE ON UPDATE CASCADE
  174. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  175. -- ----------------------------
  176. -- Table structure for t_affair_sheet_column_group
  177. -- ----------------------------
  178. DROP TABLE IF EXISTS `t_affair_sheet_column_group`;
  179. CREATE TABLE `t_affair_sheet_column_group` (
  180. `sheet_group_id` int(11) NOT NULL AUTO_INCREMENT,
  181. `sheet_group_name` varchar(255) NULL DEFAULT NULL,
  182. `sheet_id` int(11) NULL DEFAULT NULL,
  183. PRIMARY KEY (`sheet_group_id`) USING BTREE,
  184. INDEX `sheet_id`(`sheet_id`) USING BTREE,
  185. CONSTRAINT `t_affair_sheet_column_group_ibfk_1` FOREIGN KEY (`sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE RESTRICT
  186. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  187. -- ----------------------------
  188. -- Table structure for t_affair_system_column
  189. -- ----------------------------
  190. DROP TABLE IF EXISTS `t_affair_system_column`;
  191. CREATE TABLE `t_affair_system_column` (
  192. `column_id` int(11) NOT NULL AUTO_INCREMENT,
  193. `column_pid` int(11) NULL DEFAULT 0,
  194. `group_id` int(11) NULL DEFAULT NULL,
  195. `column_order` int(11) NULL DEFAULT NULL,
  196. `column_title` varchar(50) NULL DEFAULT NULL,
  197. `column_name` varchar(50) NULL DEFAULT NULL,
  198. `column_unit` varchar(500) NULL DEFAULT '[]',
  199. `column_type` varchar(255) NULL DEFAULT '',
  200. `column_control` tinyint(1) NULL DEFAULT 0,
  201. `column_rule` varchar(255) NULL DEFAULT NULL,
  202. `column_is_virtual` tinyint(1) NULL DEFAULT 0,
  203. `column_unit_symbiosis` varchar(50) NULL DEFAULT NULL,
  204. `column_detachable` tinyint(1) NULL DEFAULT 0,
  205. `column_branch_calculation` text COLLATE utf8_bin DEFAULT NULL,
  206. `status` tinyint(255) NULL DEFAULT NULL,
  207. PRIMARY KEY (`column_id`) USING BTREE,
  208. INDEX `group_id`(`group_id`) USING BTREE
  209. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  210. -- ----------------------------
  211. -- Table structure for t_affair_system_column_group
  212. -- ----------------------------
  213. DROP TABLE IF EXISTS `t_affair_system_column_group`;
  214. CREATE TABLE `t_affair_system_column_group` (
  215. `group_id` int(11) NOT NULL AUTO_INCREMENT,
  216. `group_name` varchar(255) NULL DEFAULT NULL,
  217. PRIMARY KEY (`group_id`) USING BTREE
  218. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  219. -- ----------------------------
  220. -- Table structure for t_bill
  221. -- ----------------------------
  222. DROP TABLE IF EXISTS `t_bill`;
  223. CREATE TABLE `t_bill` (
  224. `bill_id` int(11) NOT NULL AUTO_INCREMENT,
  225. `bill_name` varchar(255) NULL DEFAULT NULL,
  226. `bill_number_user_defined` varchar(255) NULL,
  227. `bill_title` varchar(255) NULL DEFAULT NULL,
  228. `bill_desc` text NULL DEFAULT NULL,
  229. `bill_count` int(11) NULL DEFAULT 0,
  230. `status` int(2) NULL DEFAULT 99,
  231. `ctime` datetime(0) NULL DEFAULT NULL,
  232. `utime` datetime(0) NULL DEFAULT NULL,
  233. `permission` int(1) NULL DEFAULT 1,
  234. `order_data` text NULL DEFAULT NULL,
  235. `bill_limit` text NULL DEFAULT NULL,
  236. `bill_url` varchar(255) NULL DEFAULT NULL,
  237. `bill_affair_Ids` text NULL DEFAULT NULL,
  238. `bill_type` tinyint(1) NULL DEFAULT 0,
  239. `bill_template` text NULL DEFAULT NULL,
  240. `bill_merge_condition` varchar(255) NULL DEFAULT '',
  241. `bill_set_explain` varchar(255) NULL DEFAULT '0',
  242. `bill_use_template` text NULL,
  243. `permission_view` tinyint(1) NULL DEFAULT 1,
  244. PRIMARY KEY (`bill_id`) USING BTREE
  245. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  246. -- ----------------------------
  247. -- Table structure for t_bill_order
  248. -- ----------------------------
  249. DROP TABLE IF EXISTS `t_bill_order`;
  250. CREATE TABLE `t_bill_order` (
  251. `bill_order_id` int(11) NOT NULL AUTO_INCREMENT,
  252. `bill_id` int(11) NULL DEFAULT NULL,
  253. `user_name` varchar(255) NULL DEFAULT NULL,
  254. `bill_order_number` varchar(255) NULL DEFAULT NULL,
  255. `bill_order_unit` varchar(255) NULL DEFAULT NULL,
  256. `bill_affair_data_Ids` text NULL,
  257. `status` int(2) NULL DEFAULT 99,
  258. `ctime` datetime(0) NULL DEFAULT NULL,
  259. `ptime` datetime(0) NULL DEFAULT NULL,
  260. `bill_data` longtext NULL,
  261. `printer_status` int(1) NULL DEFAULT 0,
  262. `bill_order_supplement` text NULL DEFAULT NULL,
  263. `bill_order_header` varchar(255) NULL,
  264. `bill_explain` varchar(255) NULL DEFAULT NULL,
  265. `bill_object` varchar(13) NULL,
  266. `bill_amount` decimal(18, 3) NULL DEFAULT NULL,
  267. `bill_pnames` text NULL,
  268. `order_first_time` datetime NULL,
  269. `order_last_time` datetime NULL,
  270. `stime` datetime NULL DEFAULT NULL,
  271. `share_user_id` int(11) NULL DEFAULT NULL,
  272. `order_user_id` int(11) NULL DEFAULT NULL,
  273. `create_bill_order_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
  274. PRIMARY KEY (`bill_order_id`) USING BTREE,
  275. INDEX `bill_id`(`bill_id`) USING BTREE,
  276. INDEX `status`(`status`, `bill_id`) USING BTREE,
  277. INDEX `printer_status`(`printer_status`, `bill_id`) USING BTREE,
  278. CONSTRAINT `t_bill_order_ibfk_1` FOREIGN KEY (`bill_id`) REFERENCES `t_bill` (`bill_id`) ON DELETE CASCADE ON UPDATE CASCADE
  279. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  280. -- ----------------------------
  281. -- Table structure for t_bill_permission
  282. -- ----------------------------
  283. DROP TABLE IF EXISTS `t_bill_permission`;
  284. CREATE TABLE `t_bill_permission` (
  285. `bill_per_id` int(11) NOT NULL AUTO_INCREMENT,
  286. `bill_id` int(11) NOT NULL,
  287. `user_id` int(11) NOT NULL DEFAULT 0,
  288. `allow` tinyint(1) NULL DEFAULT 0,
  289. PRIMARY KEY (`bill_per_id`) USING BTREE,
  290. INDEX `user_id`(`user_id`) USING BTREE,
  291. INDEX `bill_per_id`(`bill_per_id`) USING BTREE,
  292. INDEX `bill_id`(`bill_id`) USING BTREE,
  293. CONSTRAINT `t_bill_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  294. CONSTRAINT `t_bill_permission_ibfk_3` FOREIGN KEY (`bill_id`) REFERENCES `t_bill` (`bill_id`) ON DELETE CASCADE ON UPDATE CASCADE
  295. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  296. -- ----------------------------
  297. -- Table structure for t_bill_subtitle
  298. -- ----------------------------
  299. DROP TABLE IF EXISTS `t_bill_subtitle`;
  300. CREATE TABLE `t_bill_subtitle` (
  301. `bill_subtitle_id` int(11) NOT NULL AUTO_INCREMENT,
  302. `bill_id` int(11) NOT NULL,
  303. `user_ids` text NULL DEFAULT NULL,
  304. `bill_subtitle_name` varchar(20) NULL DEFAULT NULL,
  305. PRIMARY KEY (`bill_subtitle_id`) USING BTREE,
  306. INDEX `bill_id`(`bill_id`) USING BTREE,
  307. CONSTRAINT `t_bill_subtitle_ibfk_2` FOREIGN KEY (`bill_id`) REFERENCES `t_bill` (`bill_id`) ON DELETE CASCADE ON UPDATE CASCADE
  308. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  309. -- ----------------------------
  310. -- Table structure for t_cas_st
  311. -- ----------------------------
  312. DROP TABLE IF EXISTS `t_cas_st`;
  313. CREATE TABLE `t_cas_st` (
  314. `st_id` varchar(23) NOT NULL,
  315. `user_id` int(11) NULL DEFAULT NULL,
  316. `tgt_id` varchar(24) NULL DEFAULT NULL,
  317. `st_service` varchar(255) NULL DEFAULT NULL,
  318. `st_device` varchar(255) NULL DEFAULT NULL,
  319. `deviceId` varchar(255) NULL DEFAULT NULL,
  320. `deviceToken` varchar(255) NULL DEFAULT NULL,
  321. `user_agent` varchar(255) NULL DEFAULT NULL,
  322. `st_ip` varchar(255) NULL DEFAULT NULL,
  323. `st_last_used` datetime(0) NULL DEFAULT NULL,
  324. `st_use_times` int(11) NULL DEFAULT NULL,
  325. `ctime` datetime(0) NULL DEFAULT NULL,
  326. `utime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  327. `dtime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  328. `status` int(11) NULL DEFAULT NULL,
  329. PRIMARY KEY (`st_id`) USING BTREE,
  330. INDEX `tgt_id`(`tgt_id`) USING BTREE,
  331. CONSTRAINT `t_cas_st_ibfk_1` FOREIGN KEY (`tgt_id`) REFERENCES `t_cas_tgt` (`tgt_id`) ON DELETE CASCADE ON UPDATE CASCADE
  332. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  333. -- ----------------------------
  334. -- Table structure for t_cas_tgt
  335. -- ----------------------------
  336. DROP TABLE IF EXISTS `t_cas_tgt`;
  337. CREATE TABLE `t_cas_tgt` (
  338. `tgt_id` varchar(24) NOT NULL,
  339. `user_id` int(11) NULL DEFAULT NULL,
  340. `tgt_last_used` datetime(0) NULL DEFAULT NULL,
  341. `tgt_use_times` int(11) NULL DEFAULT NULL,
  342. `tgt_platform` varchar(255) NULL DEFAULT NULL,
  343. `tgt_kick_step` int(255) NULL DEFAULT NULL,
  344. `ctime` varchar(255) NULL DEFAULT NULL,
  345. PRIMARY KEY (`tgt_id`) USING BTREE
  346. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  347. -- ----------------------------
  348. -- Table structure for t_collection
  349. -- ----------------------------
  350. DROP TABLE IF EXISTS `t_collection`;
  351. CREATE TABLE `t_collection` (
  352. `collection_id` int(11) NOT NULL AUTO_INCREMENT,
  353. `user_id` int(11) NULL DEFAULT NULL,
  354. `company_id` int(11) NOT NULL,
  355. `image_id` int(11) NULL DEFAULT NULL,
  356. `product_id` int(11) NULL DEFAULT NULL,
  357. `collection_image_id` int(11) NULL DEFAULT NULL,
  358. `collection_image` varchar(255) NULL DEFAULT NULL,
  359. `collection_pname` varchar(255) NOT NULL,
  360. `collection_cname` varchar(255) NOT NULL,
  361. `collection_type` tinyint(2) NOT NULL DEFAULT 0,
  362. `collection_state` tinyint(2) NULL DEFAULT 0,
  363. `collection_price` varchar(255) NULL DEFAULT NULL,
  364. `collection_price_unit` varchar(255) NULL DEFAULT NULL,
  365. `collection_inventory` decimal(13, 3) NULL DEFAULT NULL,
  366. `collection_inventory_unit` varchar(255) NULL DEFAULT NULL,
  367. `collection_width` decimal(13, 2) NULL DEFAULT NULL,
  368. `collection_width_unit` varchar(255) NULL DEFAULT NULL,
  369. `collection_height` decimal(13, 2) NULL DEFAULT NULL,
  370. `collection_height_unit` varchar(255) NULL DEFAULT NULL,
  371. `collection_freeheight` decimal(13, 2) NULL DEFAULT NULL,
  372. `collection_freeheight_unit` varchar(255) NULL DEFAULT NULL,
  373. `collection_weight` varchar(255) NULL DEFAULT NULL,
  374. `collection_weight_unit` varchar(255) NULL DEFAULT '',
  375. `collection_elasticity` varchar(255) NULL DEFAULT '',
  376. `collection_mtype` varchar(255) NULL DEFAULT NULL,
  377. `collection_material` varchar(255) NULL DEFAULT NULL,
  378. `collection_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  379. `collection_gram_weight` decimal(13,2) NULL DEFAULT NULL,
  380. `collection_gram_weight_unit` varchar(255) NULL DEFAULT 'g/m2',
  381. `collection_tag_ids` text NULL DEFAULT NULL,
  382. `product_cloth_price_unit` varchar(255) NULL DEFAULT '',
  383. `product_product_price_unit` varchar(255) NULL DEFAULT '',
  384. `product_cloth_price` decimal(13, 2) NULL DEFAULT NULL,
  385. `product_product_price` decimal(13, 2) NULL DEFAULT NULL,
  386. `push_result` longtext NULL,
  387. `recv_result` longtext NULL,
  388. `search_id` int(11) NULL,
  389. `search_status` int(11) NULL,
  390. `ctime` datetime(0) NOT NULL,
  391. `utime` datetime(0) NULL DEFAULT NULL,
  392. `dtime` datetime(0) NULL DEFAULT NULL,
  393. `status` tinyint(2) NOT NULL DEFAULT 99,
  394. PRIMARY KEY (`collection_id`) USING BTREE,
  395. INDEX `image_id`(`image_id`) USING BTREE,
  396. INDEX `user_id`(`user_id`) USING BTREE,
  397. INDEX `company_id`(`company_id`) USING BTREE,
  398. FULLTEXT INDEX `collection_pname`(`collection_pname`),
  399. FULLTEXT INDEX `collection_cname`(`collection_cname`),
  400. CONSTRAINT `t_collection_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  401. CONSTRAINT `t_collection_ibfk_3` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE
  402. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  403. -- ----------------------------
  404. -- Table structure for t_company
  405. -- ----------------------------
  406. DROP TABLE IF EXISTS `t_company`;
  407. CREATE TABLE `t_company` (
  408. `company_id` int(11) NOT NULL AUTO_INCREMENT,
  409. `location_id` int(11) NULL DEFAULT NULL,
  410. `company_type` tinyint(1) NULL DEFAULT 0,
  411. `company_name` varchar(50) NOT NULL,
  412. `company_shortname` varchar(10) NULL DEFAULT NULL,
  413. `company_major` varchar(255) NULL DEFAULT NULL,
  414. `company_urlname` varchar(10) NULL DEFAULT NULL,
  415. `company_cert` varchar(255) NULL DEFAULT NULL,
  416. `company_tel` varchar(255) NULL DEFAULT NULL,
  417. `company_fax` varchar(255) NULL DEFAULT NULL,
  418. `company_qq` varchar(255) NULL DEFAULT '',
  419. `company_email` varchar(255) NULL DEFAULT NULL,
  420. `company_ctime` date NULL DEFAULT NULL,
  421. `company_addr` varchar(255) NULL DEFAULT NULL,
  422. `company_corporation` varchar(255) NULL DEFAULT NULL,
  423. `company_copy` varchar(255) NULL DEFAULT NULL,
  424. `company_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  425. `viewtimes` int(11) NULL DEFAULT 0,
  426. `company_follows` int(255) NULL DEFAULT 0,
  427. `is_vip` tinyint(1) NULL DEFAULT 0,
  428. `status` int(255) NULL DEFAULT 0,
  429. `ctime` datetime(0) NOT NULL,
  430. `utime` datetime(0) NULL DEFAULT NULL,
  431. `dtime` datetime(0) NULL DEFAULT NULL,
  432. `tagIds` text NULL DEFAULT NULL,
  433. `customerGroupId` int(11) NULL DEFAULT 0,
  434. `company_program` varchar(100) NULL DEFAULT '',
  435. `version` int(11) NULL DEFAULT NULL,
  436. `company_phone` varchar(255) NULL,
  437. PRIMARY KEY (`company_id`) USING BTREE,
  438. INDEX `location_id`(`location_id`) USING BTREE,
  439. INDEX `customerGroupId`(`customerGroupId`) USING BTREE,
  440. INDEX `company_name`(`company_name`) USING BTREE,
  441. INDEX `company_shortname`(`company_shortname`) USING BTREE,
  442. INDEX `company_urlname`(`company_urlname`) USING BTREE,
  443. CONSTRAINT `FK_Reference_29` FOREIGN KEY (`location_id`) REFERENCES `t_location` (`location_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  444. CONSTRAINT `t_company_ibfk_1` FOREIGN KEY (`customerGroupId`) REFERENCES `t_customer_group` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
  445. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  446. -- ----------------------------
  447. -- Table structure for t_customer
  448. -- ----------------------------
  449. DROP TABLE IF EXISTS `t_customer`;
  450. CREATE TABLE `t_customer` (
  451. `id` int(11) NOT NULL AUTO_INCREMENT,
  452. `companyId` int(11) NOT NULL DEFAULT 0,
  453. `addUserId` int(11) NOT NULL,
  454. `customerCompanyId` int(11) NULL DEFAULT NULL,
  455. `avatarImageId` int(11) NULL DEFAULT NULL,
  456. `avatarImage` varchar(255) NULL DEFAULT NULL,
  457. `customer_name` varchar(255) NULL DEFAULT NULL,
  458. `customer_phone` varchar(255) NULL DEFAULT NULL,
  459. `customer_qq` varchar(255) NULL DEFAULT NULL,
  460. `customer_email` varchar(255) NULL DEFAULT NULL,
  461. `customer_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  462. `tagIds` text NULL DEFAULT NULL,
  463. `visitUserIds` text NULL DEFAULT NULL,
  464. `state` int(11) NULL DEFAULT 0,
  465. `status` int(11) NULL DEFAULT 99,
  466. `createAt` datetime(0) NULL DEFAULT NULL,
  467. `updateAt` datetime(0) NULL DEFAULT NULL,
  468. `deleteAt` datetime(0) NULL DEFAULT NULL,
  469. `groupId` int(11) NULL DEFAULT NULL,
  470. `card1ImageId` int(11) NULL DEFAULT NULL,
  471. `card2ImageId` int(11) NULL DEFAULT NULL,
  472. `card3ImageId` int(11) NULL DEFAULT NULL,
  473. `representative` tinyint(1) NULL DEFAULT 0,
  474. `customer_add` text NULL DEFAULT NULL,
  475. `customer_phone2` varchar(255) NULL DEFAULT '',
  476. `customer_phone3` varchar(255) NULL DEFAULT '',
  477. PRIMARY KEY (`id`) USING BTREE,
  478. INDEX `companyId`(`companyId`) USING BTREE,
  479. INDEX `customerCompanyId`(`customerCompanyId`) USING BTREE,
  480. INDEX `id`(`id`, `customerCompanyId`) USING BTREE,
  481. INDEX `groupId`(`groupId`) USING BTREE,
  482. CONSTRAINT `t_customer_ibfk_1` FOREIGN KEY (`companyId`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  483. CONSTRAINT `t_customer_ibfk_2` FOREIGN KEY (`customerCompanyId`) REFERENCES `t_company` (`company_id`) ON DELETE SET NULL ON UPDATE RESTRICT,
  484. CONSTRAINT `t_customer_ibfk_3` FOREIGN KEY (`groupId`) REFERENCES `t_customer_group` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
  485. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  486. -- ----------------------------
  487. -- Table structure for t_customer_group
  488. -- ----------------------------
  489. DROP TABLE IF EXISTS `t_customer_group`;
  490. CREATE TABLE `t_customer_group` (
  491. `id` int(11) NOT NULL AUTO_INCREMENT,
  492. `companyId` int(11) NOT NULL,
  493. `userId` int(11) NOT NULL,
  494. `title` varchar(255) NOT NULL,
  495. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  496. `usedCount` int(11) NULL DEFAULT 0,
  497. `status` int(11) NULL DEFAULT 99,
  498. `createAt` datetime(0) NULL DEFAULT NULL,
  499. `updateAt` datetime(0) NULL DEFAULT NULL,
  500. `deleteAt` datetime(0) NULL DEFAULT NULL,
  501. `permission` tinyint(1) NULL DEFAULT 1,
  502. `user_ids` text NULL,
  503. `customer_category_id` int(11) NULL DEFAULT NULL,
  504. PRIMARY KEY (`id`) USING BTREE,
  505. INDEX `companyId`(`companyId`) USING BTREE,
  506. INDEX `userId`(`userId`) USING BTREE,
  507. CONSTRAINT `t_customer_group_ibfk_1` FOREIGN KEY (`companyId`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  508. CONSTRAINT `t_customer_group_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  509. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  510. -- ----------------------------
  511. -- Table structure for t_customer_group
  512. -- ----------------------------
  513. DROP TABLE IF EXISTS `t_customer_category`;
  514. CREATE TABLE IF NOT EXISTS `t_customer_category` (
  515. `customer_category_id` int(11) NOT NULL AUTO_INCREMENT,
  516. `companyId` int(11) NOT NULL,
  517. `userId` int(11) NOT NULL,
  518. `customer_category_title` varchar(50) CHARACTER SET utf8mb4 NOT NULL,
  519. `customer_category_notes` varchar(255) CHARACTER SET utf8mb4 DEFAULT '',
  520. `usedCount` int(11) DEFAULT 0,
  521. `status` int(11) DEFAULT 99,
  522. `createAt` datetime DEFAULT NULL,
  523. `updateAt` datetime DEFAULT NULL,
  524. `deleteAt` datetime DEFAULT NULL,
  525. `permission` tinyint(1) DEFAULT 1,
  526. `user_ids` text CHARACTER SET utf8mb4 DEFAULT NULL,
  527. PRIMARY KEY (`customer_category_id`) USING BTREE,
  528. KEY `companyId` (`companyId`) USING BTREE,
  529. KEY `userId` (`userId`) USING BTREE,
  530. CONSTRAINT `t_customer_category_ibfk_1` FOREIGN KEY (`companyId`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  531. CONSTRAINT `t_customer_category_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  532. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
  533. -- ----------------------------
  534. -- Table structure for t_department
  535. -- ----------------------------
  536. DROP TABLE IF EXISTS `t_department`;
  537. CREATE TABLE `t_department` (
  538. `department_id` int(255) NOT NULL AUTO_INCREMENT,
  539. `department_name` varchar(255) NULL DEFAULT '',
  540. `department_pid` int(255) NULL DEFAULT 0,
  541. PRIMARY KEY (`department_id`) USING BTREE
  542. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  543. -- ----------------------------
  544. -- Table structure for t_documentary
  545. -- ----------------------------
  546. DROP TABLE IF EXISTS `t_documentary`;
  547. CREATE TABLE `t_documentary` (
  548. `documentary_id` int(11) NOT NULL AUTO_INCREMENT,
  549. `documentary_number` varchar(50) NOT NULL DEFAULT '',
  550. `documentary_number_pid` varchar(50) NULL DEFAULT '',
  551. `documentary_product_id` int(11) NULL DEFAULT NULL,
  552. `documentary_object` varchar(13) NOT NULL DEFAULT '',
  553. `documentary_summary` varchar(50) NULL DEFAULT NULL,
  554. `documentary_state` tinyint(1) NULL DEFAULT 0,
  555. `data_id` varchar(25) NULL DEFAULT '',
  556. `companyId` int(11) NULL DEFAULT NULL,
  557. `user_id` int(11) NULL DEFAULT NULL,
  558. `ctime` datetime(0) NULL DEFAULT NULL,
  559. `utime` datetime(0) NULL DEFAULT NULL,
  560. `status` tinyint(2) NULL DEFAULT 99,
  561. PRIMARY KEY (`documentary_id`) USING BTREE,
  562. UNIQUE INDEX `documentary_number_pid` (`documentary_number_pid`, `documentary_number`) USING BTREE
  563. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  564. -- ----------------------------
  565. -- Table structure for t_documentary_report
  566. -- ----------------------------
  567. DROP TABLE IF EXISTS `t_documentary_report`;
  568. CREATE TABLE `t_documentary_report` (
  569. `report_id` int(11) NOT NULL AUTO_INCREMENT,
  570. `documentary_data_id` varchar(50) NOT NULL,
  571. `reply_user_id` int(11) NULL DEFAULT NULL,
  572. `reply_txt` varchar(255) NULL DEFAULT NULL,
  573. `reply_image` varchar(255) NULL DEFAULT NULL,
  574. `reply_voice` varchar(255) NULL DEFAULT NULL,
  575. `reply_time` datetime(0) NULL DEFAULT NULL,
  576. PRIMARY KEY (`report_id`) USING BTREE
  577. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  578. -- ----------------------------
  579. -- Table structure for t_file_list
  580. -- ----------------------------
  581. DROP TABLE IF EXISTS `t_file_list`;
  582. CREATE TABLE `t_file_list` (
  583. `id` int(11) NOT NULL AUTO_INCREMENT,
  584. `pid` int(11) NULL DEFAULT NULL,
  585. `name` varchar(255) NULL DEFAULT NULL,
  586. `md5` varchar(255) NULL DEFAULT NULL,
  587. `crop` varchar(255) NULL DEFAULT NULL,
  588. `url` varchar(255) NULL DEFAULT NULL,
  589. `category` int(255) NULL DEFAULT NULL,
  590. `props` varchar(255) NULL DEFAULT NULL,
  591. `mime` varchar(255) NULL DEFAULT NULL,
  592. `extension` varchar(255) NULL DEFAULT NULL,
  593. `size` int(11) NULL DEFAULT NULL,
  594. `type` int(255) NULL DEFAULT NULL,
  595. `icat` int(255) NULL DEFAULT NULL,
  596. `icatmp` int(255) NULL DEFAULT NULL,
  597. `visitimes` int(11) NULL DEFAULT NULL,
  598. `ctime` datetime(0) NULL DEFAULT NULL,
  599. `utime` datetime(0) NULL DEFAULT NULL,
  600. `dtime` datetime(0) NULL DEFAULT NULL,
  601. `status` int(255) NULL DEFAULT NULL,
  602. `user_id` int(11) NULL DEFAULT NULL,
  603. `template_number` varchar(50) NULL DEFAULT '',
  604. PRIMARY KEY (`id`) USING BTREE,
  605. UNIQUE INDEX `md5`(`md5`, `type`, `category`) USING BTREE
  606. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  607. -- ----------------------------
  608. -- Table structure for t_group_position
  609. -- ----------------------------
  610. DROP TABLE IF EXISTS `t_group_position`;
  611. CREATE TABLE `t_group_position` (
  612. `position_id` int(11) NOT NULL AUTO_INCREMENT,
  613. `user_id` int(11) NOT NULL,
  614. `groupIds` text NULL DEFAULT NULL,
  615. `utime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  616. `position_type` tinyint(1) NULL DEFAULT 0,
  617. PRIMARY KEY (`position_id`) USING BTREE,
  618. INDEX `user_id` (`user_id`, `position_type`) USING BTREE,
  619. CONSTRAINT `t_group_position_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  620. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  621. -- ----------------------------
  622. -- Table structure for t_inventory
  623. -- ----------------------------
  624. DROP TABLE IF EXISTS `t_inventory`;
  625. CREATE TABLE `t_inventory` (
  626. `inventory_id` int(11) NOT NULL AUTO_INCREMENT,
  627. `warehouse_product_id` int(11) NULL DEFAULT NULL,
  628. `warehouse_product_color` varchar(255) NULL DEFAULT '',
  629. `warehouse_product_color_number` varchar(255) NULL DEFAULT '',
  630. `warehouse_product_height` double(22, 2) NULL DEFAULT NULL,
  631. `warehouse_product_width` double(22, 2) NULL DEFAULT NULL,
  632. `warehouse_material_composition` varchar(255) NULL DEFAULT '',
  633. `warehouse_machine_id` int(11) NULL DEFAULT NULL,
  634. `warehouse_storage_area` varchar(255) NULL DEFAULT '',
  635. `inventory_quantity_unit` int(1) NULL DEFAULT 0,
  636. `warehouse_other_description` varchar(255) NULL DEFAULT '',
  637. `status` int(2) NULL DEFAULT 99,
  638. `ctime` datetime(0) NULL DEFAULT NULL,
  639. `utime` datetime(0) NULL DEFAULT NULL,
  640. `inventory_price_unit` tinyint(1) NULL,
  641. `warehouse_collection_id` int(11) NULL DEFAULT NULL,
  642. PRIMARY KEY (`inventory_id`) USING BTREE,
  643. INDEX `warehouse_product_id`(`warehouse_product_id`) USING BTREE,
  644. INDEX `warehouse_machine_id`(`warehouse_machine_id`) USING BTREE,
  645. CONSTRAINT `t_inventory_ibfk_1` FOREIGN KEY (`warehouse_product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  646. CONSTRAINT `t_inventory_ibfk_2` FOREIGN KEY (`warehouse_machine_id`) REFERENCES `t_machine` (`machine_id`) ON DELETE CASCADE ON UPDATE CASCADE
  647. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  648. -- ----------------------------
  649. -- Table structure for t_inventory_calculation
  650. -- ----------------------------
  651. DROP TABLE IF EXISTS `t_inventory_calculation`;
  652. CREATE TABLE `t_inventory_calculation` (
  653. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  654. `data_id` varchar(25) NOT NULL,
  655. `affair_id` int(11) NOT NULL,
  656. `tagIds` varchar(100) NOT NULL,
  657. `calculation_key` int(11) NOT NULL,
  658. `calculation_time` datetime(0) NOT NULL,
  659. `calculation_value` decimal(22, 6) NOT NULL,
  660. `calculation_value2` decimal(22, 6) NOT NULL,
  661. `calculation_condition` varchar(120) NOT NULL,
  662. `calculation_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  663. `call_time` datetime(0) NOT NULL,
  664. `from_affair_id` int(11) NOT NULL,
  665. `self_built_source` varchar(255) NOT NULL,
  666. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  667. `from_data_id` varchar(25) NULL DEFAULT '',
  668. `offer_price` decimal(22,6) NULL DEFAULT -1,
  669. `offer_product_total_cost` decimal(22,6) NULL,
  670. `calculation_ctime` datetime NULL DEFAULT NULL,
  671. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  672. INDEX `call_time`(`call_time`) USING BTREE,
  673. UNIQUE INDEX `data_id` (`data_id`) USING BTREE,
  674. INDEX `calculation_value`(`calculation_key`, `calculation_time`, `calculation_value`, `calculation_value2`, `calculation_condition`, `tagIds`) USING BTREE
  675. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  676. -- ----------------------------
  677. -- Table structure for t_inventory_record
  678. -- ----------------------------
  679. DROP TABLE IF EXISTS `t_inventory_record`;
  680. CREATE TABLE `t_inventory_record` (
  681. `inventory_record_id` int(11) NOT NULL AUTO_INCREMENT,
  682. `inventory_id` int(11) NOT NULL,
  683. `record_time` datetime(0) NOT NULL,
  684. `inventory_quantity` double(22, 2) NOT NULL,
  685. `inventory_quantity_reserve` double(22, 2) NULL DEFAULT 0.00,
  686. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  687. `status` int(2) NULL DEFAULT 99,
  688. `ctime` datetime(0) NULL DEFAULT NULL,
  689. `utime` datetime(0) NULL DEFAULT NULL,
  690. `user_id` int(11) NULL,
  691. PRIMARY KEY (`inventory_record_id`) USING BTREE,
  692. INDEX `inventory_id`(`inventory_id`) USING BTREE,
  693. CONSTRAINT `t_inventory_record_ibfk_1` FOREIGN KEY (`inventory_id`) REFERENCES `t_inventory` (`inventory_id`) ON DELETE CASCADE ON UPDATE CASCADE
  694. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  695. -- ----------------------------
  696. -- Table structure for t_keyword_log
  697. -- ----------------------------
  698. DROP TABLE IF EXISTS `t_keyword_log`;
  699. CREATE TABLE `t_keyword_log` (
  700. `keyword_id` int(11) NOT NULL AUTO_INCREMENT,
  701. `user_id` int(11) NULL DEFAULT NULL,
  702. `company_id` int(11) NULL DEFAULT NULL,
  703. `keyword_category` int(11) NULL DEFAULT NULL,
  704. `keyword_text` varchar(255) NULL DEFAULT NULL,
  705. `keyword_values` text NULL DEFAULT NULL,
  706. `status` int(11) NULL DEFAULT 99,
  707. `ctime` datetime(0) NULL DEFAULT NULL,
  708. `dtime` datetime(0) NULL DEFAULT NULL,
  709. PRIMARY KEY (`keyword_id`) USING BTREE,
  710. INDEX `user_id`(`user_id`) USING BTREE,
  711. INDEX `company_id`(`company_id`) USING BTREE,
  712. CONSTRAINT `t_keyword_log_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  713. CONSTRAINT `t_keyword_log_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE
  714. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  715. -- ----------------------------
  716. -- Table structure for t_location
  717. -- ----------------------------
  718. DROP TABLE IF EXISTS `t_location`;
  719. CREATE TABLE `t_location` (
  720. `location_id` int(11) NOT NULL AUTO_INCREMENT,
  721. `location_pid` int(11) NULL DEFAULT NULL,
  722. `location_name` varchar(40) NOT NULL,
  723. `location_postnum` varchar(6) NULL DEFAULT NULL,
  724. `location_level` tinyint(1) NULL DEFAULT NULL,
  725. `location_phonenum` varchar(5) NULL DEFAULT NULL,
  726. PRIMARY KEY (`location_id`) USING BTREE,
  727. INDEX `location_pid`(`location_pid`) USING BTREE,
  728. CONSTRAINT `FK_Reference_28` FOREIGN KEY (`location_pid`) REFERENCES `t_location` (`location_id`) ON DELETE SET NULL ON UPDATE CASCADE
  729. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  730. -- ----------------------------
  731. -- Table structure for t_log_edit
  732. -- ----------------------------
  733. DROP TABLE IF EXISTS `t_log_edit`;
  734. CREATE TABLE `t_log_edit` (
  735. `log_edit_id` int(11) NOT NULL AUTO_INCREMENT,
  736. `log_company_id` int(11) NULL DEFAULT NULL,
  737. `log_user_id` int(11) NULL DEFAULT NULL,
  738. `log_edit_clazz` varchar(255) NULL DEFAULT NULL,
  739. `log_edit_oldvalue` longtext NULL,
  740. `log_edit_newvalue` longtext NULL,
  741. `log_action` tinyint(1) NULL DEFAULT NULL,
  742. `ctime` datetime(0) NULL DEFAULT NULL,
  743. PRIMARY KEY (`log_edit_id`) USING BTREE
  744. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  745. -- ----------------------------
  746. -- Table structure for t_machine
  747. -- ----------------------------
  748. DROP TABLE IF EXISTS `t_machine`;
  749. CREATE TABLE `t_machine` (
  750. `machine_id` int(11) NOT NULL AUTO_INCREMENT,
  751. `machine_number` varchar(255) NOT NULL,
  752. `machine_horse` int(11) NULL DEFAULT 0,
  753. `machine_des` varchar(255) NULL DEFAULT NULL,
  754. `machine_state` int(2) NOT NULL DEFAULT 0,
  755. `affair_data_id` varchar(25) NULL DEFAULT NULL,
  756. `pause_affair_data_id` varchar(25) NULL DEFAULT '',
  757. `model_name` varchar(255) NOT NULL,
  758. `status` int(2) NOT NULL DEFAULT 99,
  759. `ctime` datetime(0) NOT NULL,
  760. `utime` datetime(0) NULL DEFAULT NULL,
  761. `dtime` datetime(0) NULL DEFAULT NULL,
  762. PRIMARY KEY (`machine_id`) USING BTREE,
  763. INDEX `machine_id`(`machine_id`) USING BTREE,
  764. INDEX `model_name`(`model_name`) USING BTREE,
  765. CONSTRAINT `t_machine_ibfk_1` FOREIGN KEY (`model_name`) REFERENCES `t_machine_model` (`model_name`) ON DELETE CASCADE ON UPDATE CASCADE
  766. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  767. -- ----------------------------
  768. -- Table structure for t_machine_model
  769. -- ----------------------------
  770. DROP TABLE IF EXISTS `t_machine_model`;
  771. CREATE TABLE `t_machine_model` (
  772. `model_id` int(11) NOT NULL AUTO_INCREMENT,
  773. `model_name` varchar(255) NOT NULL,
  774. `model_des` text NULL DEFAULT NULL,
  775. `status` int(11) NULL DEFAULT 99,
  776. `ctime` datetime(0) NOT NULL,
  777. `utime` datetime(0) NULL DEFAULT NULL,
  778. PRIMARY KEY (`model_id`) USING BTREE,
  779. INDEX `model_name`(`model_name`) USING BTREE
  780. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  781. -- ----------------------------
  782. -- Table structure for t_machine_record
  783. -- ----------------------------
  784. DROP TABLE IF EXISTS `t_machine_record`;
  785. CREATE TABLE `t_machine_record` (
  786. `record_id` int(11) NOT NULL AUTO_INCREMENT,
  787. `machine_id` int(11) NOT NULL,
  788. `record_des` text NULL DEFAULT NULL,
  789. `affair_data_id` varchar(25) NULL DEFAULT NULL,
  790. `change_time` varchar(50) NULL DEFAULT NULL,
  791. `production_time` varchar(50) NULL DEFAULT NULL,
  792. `stop_time` varchar(50) NULL DEFAULT NULL,
  793. `utime` datetime(0) NOT NULL,
  794. `ctime` datetime(0) NOT NULL,
  795. PRIMARY KEY (`record_id`) USING BTREE
  796. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  797. -- ----------------------------
  798. -- Table structure for t_machine_settings
  799. -- ----------------------------
  800. DROP TABLE IF EXISTS `t_machine_settings`;
  801. CREATE TABLE `t_machine_settings` (
  802. `id` int(11) NOT NULL AUTO_INCREMENT,
  803. `produced_affair_id` int(11) NULL DEFAULT NULL,
  804. `produced_sheet_id` int(11) NULL DEFAULT NULL,
  805. `produced_affair_tag_ids` text NULL DEFAULT NULL,
  806. `produced_user_ids` text NULL DEFAULT NULL,
  807. `produced_affair_summary` text NULL DEFAULT NULL,
  808. `produced_affair_summary_permission` tinyint(1) NULL DEFAULT 1,
  809. `utime` datetime(0) NULL DEFAULT NULL,
  810. PRIMARY KEY (`id`) USING BTREE,
  811. INDEX `produced_sheet`(`produced_sheet_id`) USING BTREE,
  812. INDEX `produced_affair_id`(`produced_affair_id`) USING BTREE,
  813. CONSTRAINT `t_machine_settings_ibfk_3` FOREIGN KEY (`produced_sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  814. CONSTRAINT `t_machine_settings_ibfk_4` FOREIGN KEY (`produced_affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  815. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  816. -- ----------------------------
  817. -- Table structure for t_pattribute
  818. -- ----------------------------
  819. DROP TABLE IF EXISTS `t_pattribute`;
  820. CREATE TABLE `t_pattribute` (
  821. `pattribute_id` int(11) NOT NULL AUTO_INCREMENT,
  822. `user_id` int(11) NULL DEFAULT NULL,
  823. `company_id` int(11) NULL DEFAULT NULL,
  824. `product_id` int(11) NOT NULL,
  825. `image_id` int(11) NULL DEFAULT NULL,
  826. `pattribute_image_id` int(11) NULL DEFAULT NULL,
  827. `pattribute_image` varchar(255) NULL DEFAULT NULL,
  828. `pattribute_pname` varchar(255) NOT NULL,
  829. `pattribute_cname` varchar(255) NOT NULL,
  830. `pattribute_type` int(255) NULL DEFAULT NULL,
  831. `pattribute_price` varchar(255) NULL DEFAULT NULL,
  832. `pattribute_price_unit` varchar(255) NULL DEFAULT NULL,
  833. `pattribute_inventory` decimal(13, 3) NULL DEFAULT NULL,
  834. `pattribute_inventory_unit` varchar(255) NULL DEFAULT NULL,
  835. `pattribute_width` decimal(13, 2) NULL DEFAULT NULL,
  836. `pattribute_width_unit` varchar(255) NULL DEFAULT NULL,
  837. `pattribute_height` decimal(13, 2) NULL DEFAULT NULL,
  838. `pattribute_height_unit` varchar(255) NULL DEFAULT NULL,
  839. `pattribute_freeheight` decimal(13, 2) NULL DEFAULT NULL,
  840. `pattribute_freeheight_unit` varchar(255) NULL DEFAULT NULL,
  841. `pattribute_weight` varchar(255) NULL DEFAULT NULL,
  842. `pattribute_weight_unit` varchar(255) NULL DEFAULT NULL,
  843. `pattribute_elasticity` varchar(255) NULL DEFAULT NULL,
  844. `pattribute_mtype` varchar(255) NULL DEFAULT NULL,
  845. `pattribute_material` varchar(255) NULL DEFAULT NULL,
  846. `pattribute_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  847. `pattribute_address` varchar(255) NULL DEFAULT NULL,
  848. `pattribute_from` tinyint(1) NULL DEFAULT NULL,
  849. `ctime` datetime(0) NULL DEFAULT NULL,
  850. PRIMARY KEY (`pattribute_id`) USING BTREE,
  851. UNIQUE INDEX `pattribute_id`(`pattribute_id`) USING BTREE,
  852. INDEX `product_id`(`product_id`) USING BTREE,
  853. INDEX `image_id`(`image_id`) USING BTREE,
  854. CONSTRAINT `t_pattribute_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE
  855. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  856. -- ----------------------------
  857. -- Table structure for t_pattribute_linkman
  858. -- ----------------------------
  859. DROP TABLE IF EXISTS `t_pattribute_linkman`;
  860. CREATE TABLE `t_pattribute_linkman` (
  861. `linkman_id` int(11) NOT NULL AUTO_INCREMENT,
  862. `user_id` int(11) NULL DEFAULT NULL,
  863. `pattribute_id` int(11) NULL DEFAULT NULL,
  864. `linkman_realname` varchar(255) NULL DEFAULT NULL,
  865. `linkman_phone` varchar(255) NULL DEFAULT NULL,
  866. `linkman_qq` varchar(255) NULL DEFAULT NULL,
  867. `linkman_email` varchar(255) NULL DEFAULT NULL,
  868. `linkman_rolename` varchar(255) NULL DEFAULT NULL,
  869. `ctime` datetime(0) NULL DEFAULT NULL,
  870. PRIMARY KEY (`linkman_id`) USING BTREE,
  871. UNIQUE INDEX `linkman_id`(`linkman_id`) USING BTREE,
  872. INDEX `pattribute_id`(`pattribute_id`) USING BTREE,
  873. INDEX `user_id`(`user_id`) USING BTREE,
  874. CONSTRAINT `t_pattribute_linkman_ibfk_1` FOREIGN KEY (`pattribute_id`) REFERENCES `t_pattribute` (`pattribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  875. CONSTRAINT `t_pattribute_linkman_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE SET NULL ON UPDATE CASCADE
  876. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  877. -- ----------------------------
  878. -- Table structure for t_printer
  879. -- ----------------------------
  880. DROP TABLE IF EXISTS `t_printer`;
  881. CREATE TABLE `t_printer` (
  882. `printer_id` int(11) NOT NULL AUTO_INCREMENT,
  883. `need_user_id` int(11) NULL DEFAULT NULL,
  884. `printer_user_id` int(11) NULL DEFAULT NULL,
  885. `printer_type` int(11) NULL DEFAULT NULL,
  886. `printer_from_id` int(11) NULL DEFAULT NULL,
  887. `printer_data` text NULL DEFAULT NULL,
  888. `printer_state` int(11) NULL DEFAULT 0,
  889. `ctime` varchar(25) NULL DEFAULT '',
  890. `ptime` varchar(25) NULL DEFAULT '',
  891. `ttime` varchar(25) NULL DEFAULT '',
  892. `printer_page` int(11) NULL,
  893. `version` int(11) NULL,
  894. PRIMARY KEY (`printer_id`) USING BTREE,
  895. UNIQUE INDEX `printer_id`(`printer_id`) USING BTREE,
  896. INDEX `need_user_id`(`need_user_id`) USING BTREE,
  897. INDEX `printer_user_id`(`printer_user_id`) USING BTREE,
  898. CONSTRAINT `t_printer_ibfk_1` FOREIGN KEY (`need_user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  899. CONSTRAINT `t_printer_ibfk_2` FOREIGN KEY (`printer_user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  900. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  901. -- ----------------------------
  902. -- Table structure for t_printer_frequently
  903. -- ----------------------------
  904. DROP TABLE IF EXISTS `t_printer_frequently`;
  905. CREATE TABLE `t_printer_frequently` (
  906. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  907. `user_id` int(11) NULL DEFAULT NULL,
  908. `printer_user_ids` text NULL DEFAULT NULL,
  909. `utime` varchar(25) NULL DEFAULT '',
  910. UNIQUE INDEX `frequently_id`(`frequently_id`) USING BTREE,
  911. INDEX `user_id`(`user_id`) USING BTREE,
  912. CONSTRAINT `t_printer_frequently_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  913. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  914. -- ----------------------------
  915. -- Table structure for t_product
  916. -- ----------------------------
  917. DROP TABLE IF EXISTS `t_product`;
  918. CREATE TABLE `t_product` (
  919. `product_id` int(11) NOT NULL AUTO_INCREMENT,
  920. `user_id` int(11) NULL DEFAULT NULL,
  921. `company_id` int(11) NOT NULL,
  922. `company_type` int(11) NULL DEFAULT NULL,
  923. `image_id` int(11) NULL DEFAULT NULL,
  924. `product_image_id` int(11) NULL DEFAULT NULL,
  925. `product_image` varchar(255) NULL DEFAULT NULL,
  926. `product_pname` varchar(255) NOT NULL,
  927. `product_cname` varchar(255) NOT NULL,
  928. `product_type` tinyint(2) NULL DEFAULT NULL,
  929. `product_state` tinyint(2) NULL DEFAULT 0,
  930. `product_price` varchar(13) NULL DEFAULT NULL,
  931. `product_price_unit` varchar(255) NULL DEFAULT NULL,
  932. `product_cloth_price` varchar(255) NULL DEFAULT NULL,
  933. `product_cloth_price_unit` varchar(255) NULL DEFAULT NULL,
  934. `product_product_price` varchar(255) NULL DEFAULT NULL,
  935. `product_product_price_unit` varchar(255) NULL DEFAULT NULL,
  936. `product_inventory` decimal(13, 3) NULL DEFAULT NULL,
  937. `product_inventory_unit` varchar(255) NULL DEFAULT NULL,
  938. `product_width` decimal(13, 2) NULL DEFAULT NULL,
  939. `product_width_unit` varchar(255) NULL DEFAULT NULL,
  940. `product_height` decimal(13, 2) NULL DEFAULT NULL,
  941. `product_height_unit` varchar(255) NULL DEFAULT NULL,
  942. `product_freeheight` decimal(13, 2) NULL DEFAULT NULL,
  943. `product_freeheight_unit` varchar(255) NULL DEFAULT NULL,
  944. `product_weight` varchar(255) NULL DEFAULT NULL,
  945. `product_weight_unit` varchar(255) NULL DEFAULT NULL,
  946. `product_elasticity` varchar(255) NULL DEFAULT NULL,
  947. `product_mtype` varchar(255) NULL DEFAULT NULL,
  948. `product_material` varchar(255) NULL DEFAULT NULL,
  949. `product_uptime` text NULL DEFAULT NULL,
  950. `product_uptime_density` varchar(255) NULL DEFAULT NULL,
  951. `product_uptime_density_unit` varchar(255) NULL DEFAULT NULL,
  952. `product_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  953. `product_chart` varchar(255) NULL DEFAULT NULL,
  954. `chart_image_id` int(11) NULL DEFAULT NULL,
  955. `chart_image` varchar(255) NULL DEFAULT NULL,
  956. `product_hits` int(255) NULL DEFAULT 0,
  957. `product_tag_ids` text NULL DEFAULT NULL,
  958. `ctime` datetime(0) NOT NULL,
  959. `utime` datetime(0) NULL DEFAULT NULL,
  960. `dtime` datetime(0) NULL DEFAULT NULL,
  961. `status` tinyint(2) NOT NULL DEFAULT 99,
  962. `product_exhibition_id` int(11) NULL DEFAULT NULL,
  963. `product_partially_id` int(11) NULL DEFAULT NULL,
  964. `product_beginning_id` int(11) NULL DEFAULT NULL,
  965. `product_gram_weight` decimal(13, 2) NULL DEFAULT NULL,
  966. `product_gram_weight_unit` varchar(255) NULL DEFAULT 'g/m2',
  967. `push_result` longtext NULL,
  968. `recv_result` longtext NULL,
  969. `product_public_notes` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL,
  970. `search_id` int(11) NULL,
  971. `search_status` int(11) NULL,
  972. `product_cabinet_id` int(11) NULL,
  973. `product_partially` text CHARACTER SET utf8 NULL,
  974. PRIMARY KEY (`product_id`) USING BTREE,
  975. UNIQUE INDEX `product_id`(`product_id`) USING BTREE,
  976. INDEX `user_id`(`user_id`) USING BTREE,
  977. INDEX `ctime`(`ctime`) USING BTREE,
  978. INDEX `status`(`status`) USING BTREE,
  979. INDEX `company_id`(`company_id`) USING BTREE,
  980. INDEX `image_id`(`image_id`) USING BTREE,
  981. INDEX `product_pname`(`product_pname`, `product_cname`, `product_type`, `status`) USING BTREE,
  982. CONSTRAINT `t_product_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  983. CONSTRAINT `t_product_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  984. CONSTRAINT `t_product_ibfk_4` FOREIGN KEY (`product_cabinet_id`) REFERENCES `t_confidential_cabinet` (`cabinet_id`) ON DELETE SET NULL ON UPDATE CASCADE
  985. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  986. -- ----------------------------
  987. -- Table structure for t_product_share
  988. -- ----------------------------
  989. DROP TABLE IF EXISTS `t_product_share`;
  990. CREATE TABLE `t_product_share` (
  991. `share_id` varchar(50) NOT NULL,
  992. `product_ids` longtext NULL,
  993. `user_id` int(11) NULL DEFAULT NULL,
  994. `company_id` int(11) NULL DEFAULT NULL,
  995. `title` varchar(50) NULL DEFAULT '',
  996. `ctime` datetime NULL,
  997. `share_time` varchar(25) NULL DEFAULT NULL,
  998. `desc` varchar(255) NULL DEFAULT NULL,
  999. `imgUrl` varchar(255) NULL DEFAULT NULL,
  1000. `share_type` varchar(25) NULL DEFAULT NULL,
  1001. `share_password` varchar(50) NULL DEFAULT NULL,
  1002. `hits` int(11) NULL DEFAULT 0,
  1003. `permission` int(1) NULL DEFAULT 2,
  1004. `permission_view` int(1) NULL DEFAULT 2,
  1005. INDEX `share_id`(`share_id`),
  1006. PRIMARY KEY (`share_id`) USING BTREE
  1007. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1008. -- ----------------------------
  1009. -- Table structure for t_product_template
  1010. -- ----------------------------
  1011. DROP TABLE IF EXISTS `t_product_template`;
  1012. CREATE TABLE `t_product_template` (
  1013. `template_md5` varchar(50) NOT NULL,
  1014. `user_id` int(11) DEFAULT NULL,
  1015. `company_id` int(11) DEFAULT NULL,
  1016. `ctime` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  1017. `template_imgUrl` varchar(255) DEFAULT '',
  1018. `template_number` varchar(25) DEFAULT '',
  1019. `template_color` varchar(50) DEFAULT '',
  1020. PRIMARY KEY (`template_md5`)
  1021. ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
  1022. -- ----------------------------
  1023. -- Table structure for t_r_product_collection
  1024. -- ----------------------------
  1025. DROP TABLE IF EXISTS `t_r_product_collection`;
  1026. CREATE TABLE `t_r_product_collection` (
  1027. `collection_id` int(11) NOT NULL,
  1028. `product_id` int(11) NOT NULL,
  1029. PRIMARY KEY (`collection_id`, `product_id`) USING BTREE,
  1030. INDEX `product_id`(`product_id`) USING BTREE,
  1031. INDEX `collection_id`(`collection_id`) USING BTREE,
  1032. CONSTRAINT `t_r_product_collection_ibfk_1` FOREIGN KEY (`collection_id`) REFERENCES `t_collection` (`collection_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1033. CONSTRAINT `t_r_product_collection_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1034. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1035. -- ----------------------------
  1036. -- Table structure for t_report_forms
  1037. -- ----------------------------
  1038. DROP TABLE IF EXISTS `t_report_forms`;
  1039. CREATE TABLE `t_report_forms` (
  1040. `report_forms_id` int(11) NOT NULL AUTO_INCREMENT,
  1041. `report_forms_name` varchar(255) NULL DEFAULT NULL,
  1042. `report_forms_title` varchar(255) NULL DEFAULT NULL,
  1043. `report_forms_desc` text NULL DEFAULT NULL,
  1044. `report_forms_count` int(11) NULL DEFAULT 0,
  1045. `status` int(2) NULL DEFAULT 99,
  1046. `ctime` datetime(0) NULL DEFAULT NULL,
  1047. `utime` datetime(0) NULL DEFAULT NULL,
  1048. `forms_data` text NULL DEFAULT NULL,
  1049. `report_forms_limit` text NULL DEFAULT NULL,
  1050. `report_forms_url` varchar(255) NULL DEFAULT NULL,
  1051. `forms_affair_Ids` text NULL DEFAULT NULL,
  1052. `tag_limit` text NULL DEFAULT NULL,
  1053. `set_begin` tinyint(1) NULL DEFAULT 2,
  1054. `set_inventory` tinyint(1) NULL DEFAULT 2,
  1055. `report_forms_pid` int(11) NULL DEFAULT NULL,
  1056. `report_forms_prompt` varchar(255) NULL DEFAULT '',
  1057. `print_forms_data` text NULL DEFAULT NULL,
  1058. `report_forms_group_id` int(11) NULL DEFAULT NULL,
  1059. `set_seal_account` tinyint(1) NULL DEFAULT 2,
  1060. `set_achievements` tinyint(1) NULL DEFAULT 2,
  1061. `set_company_account` tinyint(1) NULL DEFAULT 2,
  1062. PRIMARY KEY (`report_forms_id`) USING BTREE,
  1063. INDEX `report_forms_group_id`(`report_forms_group_id`) USING BTREE,
  1064. CONSTRAINT `t_report_forms_ibfk_1` FOREIGN KEY (`report_forms_group_id`) REFERENCES `t_report_forms_group` (`report_forms_group_id`) ON DELETE SET NULL ON UPDATE NO ACTION
  1065. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1066. -- ----------------------------
  1067. -- Table structure for t_report_forms_begin
  1068. -- ----------------------------
  1069. DROP TABLE IF EXISTS `t_report_forms_begin`;
  1070. CREATE TABLE `t_report_forms_begin` (
  1071. `begin_id` int(11) NOT NULL AUTO_INCREMENT,
  1072. `user_id` int(11) NULL DEFAULT NULL,
  1073. `report_forms_id` int(11) NULL DEFAULT NULL,
  1074. `begin_customer` varchar(20) NULL DEFAULT NULL,
  1075. `status` int(2) NULL DEFAULT 99,
  1076. `ctime` datetime(0) NULL DEFAULT NULL,
  1077. `utime` datetime(0) NULL DEFAULT NULL,
  1078. `begin_cumulative` double(16, 2) NULL DEFAULT NULL,
  1079. `admission` tinyint(1) NULL DEFAULT 0,
  1080. PRIMARY KEY (`begin_id`) USING BTREE,
  1081. INDEX `user_id`(`user_id`) USING BTREE,
  1082. INDEX `report_forms_id`(`report_forms_id`) USING BTREE,
  1083. CONSTRAINT `t_report_forms_begin_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1084. CONSTRAINT `t_report_forms_begin_ibfk_2` FOREIGN KEY (`report_forms_id`) REFERENCES `t_report_forms` (`report_forms_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1085. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1086. -- ----------------------------
  1087. -- Table structure for t_report_forms_group
  1088. -- ----------------------------
  1089. DROP TABLE IF EXISTS `t_report_forms_group`;
  1090. CREATE TABLE `t_report_forms_group` (
  1091. `report_forms_group_id` int(11) NOT NULL AUTO_INCREMENT,
  1092. `report_forms_group_title` varchar(255) NOT NULL,
  1093. `report_forms_group_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1094. `status` int(11) NULL DEFAULT 99,
  1095. `ctime` datetime(0) NULL DEFAULT NULL,
  1096. `utime` datetime(0) NULL DEFAULT NULL,
  1097. `dtime` datetime(0) NULL DEFAULT NULL,
  1098. PRIMARY KEY (`report_forms_group_id`) USING BTREE
  1099. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1100. -- ----------------------------
  1101. -- Table structure for t_report_forms_permission
  1102. -- ----------------------------
  1103. DROP TABLE IF EXISTS `t_report_forms_permission`;
  1104. CREATE TABLE `t_report_forms_permission` (
  1105. `report_forms_per_id` int(11) NOT NULL AUTO_INCREMENT,
  1106. `report_forms_id` int(11) NOT NULL,
  1107. `user_id` int(11) NOT NULL DEFAULT 0,
  1108. PRIMARY KEY (`report_forms_per_id`) USING BTREE,
  1109. INDEX `user_id`(`user_id`) USING BTREE,
  1110. INDEX `bill_per_id`(`report_forms_per_id`) USING BTREE,
  1111. INDEX `bill_id`(`report_forms_id`) USING BTREE,
  1112. CONSTRAINT `t_report_forms_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1113. CONSTRAINT `t_report_forms_permission_ibfk_2` FOREIGN KEY (`report_forms_id`) REFERENCES `t_report_forms` (`report_forms_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1114. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1115. -- ----------------------------
  1116. -- Table structure for t_role
  1117. -- ----------------------------
  1118. DROP TABLE IF EXISTS `t_role`;
  1119. CREATE TABLE `t_role` (
  1120. `role_id` int(11) NOT NULL AUTO_INCREMENT,
  1121. `role_name` varchar(50) NOT NULL,
  1122. `role_desc` varchar(255) NULL DEFAULT NULL,
  1123. PRIMARY KEY (`role_id`) USING BTREE
  1124. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1125. -- ----------------------------
  1126. -- Table structure for t_rule_new
  1127. -- ----------------------------
  1128. DROP TABLE IF EXISTS `t_rule_new`;
  1129. CREATE TABLE `t_rule_new` (
  1130. `rule_new_id` int(11) NOT NULL AUTO_INCREMENT,
  1131. `user_id` int(11) NULL DEFAULT NULL,
  1132. `product_modular` tinyint(1) NULL DEFAULT 0,
  1133. `product_modular_delete` tinyint(1) NULL DEFAULT 0,
  1134. `product_modular_add` tinyint(1) NULL DEFAULT 0,
  1135. `product_modular_public` tinyint(1) NULL DEFAULT 0,
  1136. `product_modular_private` tinyint(1) NULL DEFAULT 0,
  1137. `product_modular_supplier` tinyint(1) NULL DEFAULT 0,
  1138. `product_modular_push` tinyint(1) NULL DEFAULT 0,
  1139. `product_modular_template` tinyint(1) NULL DEFAULT 0,
  1140. `product_modular_batch_share` tinyint(1) NULL DEFAULT 0,
  1141. `material_modular` tinyint(1) NULL DEFAULT 0,
  1142. `material_modular_edit` tinyint(1) NULL DEFAULT 0,
  1143. `material_modular_delete` tinyint(1) NULL DEFAULT 0,
  1144. `material_modular_push` tinyint(1) NULL DEFAULT 0,
  1145. `documentary_modular_statistics` tinyint(1) NULL DEFAULT 0,
  1146. `documentary_modular_remove` tinyint(1) NULL DEFAULT 0,
  1147. `product_modular_internal_price` tinyint(1) NULL DEFAULT 0,
  1148. `product_cost_accounting` tinyint(1) NULL DEFAULT 0,
  1149. `product_cost_view` tinyint(1) NULL DEFAULT 0,
  1150. `product_confidential_set` tinyint(1) NULL DEFAULT 0,
  1151. `product_confidential_use` tinyint(1) NULL DEFAULT 0,
  1152. `customer_modular_group_secrecy` tinyint(1) NULL DEFAULT 0,
  1153. `customer_modular_group` tinyint(1) NULL DEFAULT 0,
  1154. `product_watermark` tinyint(1) NULL DEFAULT 0,
  1155. `customer_modular` tinyint(1) NULL DEFAULT 0,
  1156. `customer_modular_delete` tinyint(1) NULL DEFAULT 0,
  1157. `customer_modular_customer_edit` tinyint(1) NULL DEFAULT 0,
  1158. `customer_modular_company_edit` tinyint(1) NULL DEFAULT 0,
  1159. `customer_modular_add` tinyint(1) NULL DEFAULT 0,
  1160. `customer_modular_transfer` tinyint(1) NULL DEFAULT 0,
  1161. `customer_modular_set_visible` tinyint(1) NULL DEFAULT 0,
  1162. `machine_modular` tinyint(1) NULL DEFAULT 0,
  1163. `machine_modular_add` tinyint(1) NULL DEFAULT 0,
  1164. `machine_modular_edit` tinyint(1) NULL DEFAULT 0,
  1165. `machine_modular_record` tinyint(1) NULL DEFAULT 0,
  1166. `machine_modular_wait` tinyint(1) NULL DEFAULT 0,
  1167. `machine_modular_pause` tinyint(1) NULL DEFAULT 0,
  1168. `shop_modular` tinyint(1) NULL DEFAULT 0,
  1169. `shop_modular_update` tinyint(1) NULL DEFAULT 0,
  1170. `bill_modular` tinyint(1) NULL DEFAULT 0,
  1171. `bill_modular_waste` tinyint(1) NULL DEFAULT 0,
  1172. `bill_modular_set` tinyint(1) NULL DEFAULT 0,
  1173. `affair_modular` tinyint(1) NULL DEFAULT 0,
  1174. `employee_modular` tinyint(1) NULL DEFAULT 0,
  1175. `tag_modular` tinyint(1) NULL DEFAULT 0,
  1176. `report_modular` tinyint(1) NULL DEFAULT 0,
  1177. `report_modular_download` tinyint(1) NULL DEFAULT 0,
  1178. `company_modular` tinyint(1) NULL DEFAULT 0,
  1179. `company_modular_authentication` tinyint(1) NULL DEFAULT 0,
  1180. `affair_recycle_bin` tinyint(1) NULL DEFAULT 0,
  1181. `documentary_modular` tinyint(1) NULL DEFAULT 0,
  1182. `documentary_modular_control` tinyint(1) NULL DEFAULT 0,
  1183. `documentary_modular_report` tinyint(1) NULL DEFAULT 0,
  1184. `print_modular` tinyint(1) NULL DEFAULT 0,
  1185. `documentary_modular_adjustment` tinyint(1) NULL DEFAULT 0,
  1186. `product_modular_public_see` tinyint(1) NULL DEFAULT 0,
  1187. `product_modular_private_see` tinyint(1) NULL DEFAULT 0,
  1188. `affair_all_modify_record_see` tinyint(1) NULL DEFAULT 0,
  1189. `inventory_modular_edit` tinyint(1) NULL DEFAULT 0,
  1190. `image_search` tinyint(1) NULL DEFAULT 0,
  1191. PRIMARY KEY (`rule_new_id`) USING BTREE,
  1192. UNIQUE INDEX `rule_new_id`(`rule_new_id`) USING BTREE,
  1193. INDEX `user_id`(`user_id`) USING BTREE,
  1194. CONSTRAINT `t_rule_new_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1195. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1196. -- ----------------------------
  1197. -- Table structure for t_seal_account
  1198. -- ----------------------------
  1199. DROP TABLE IF EXISTS `t_seal_account`;
  1200. CREATE TABLE `t_seal_account` (
  1201. `seal_id` int(11) NOT NULL AUTO_INCREMENT,
  1202. `user_id` int(11) NULL DEFAULT NULL,
  1203. `content_id` int(11) NULL DEFAULT NULL,
  1204. `content_type` tinyint(1) NULL DEFAULT 0,
  1205. `content_time` varchar(25) NULL DEFAULT NULL,
  1206. PRIMARY KEY (`seal_id`) USING BTREE,
  1207. INDEX `user_id`(`user_id`) USING BTREE,
  1208. CONSTRAINT `t_seal_account_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1209. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1210. -- ----------------------------
  1211. -- Table structure for t_shop
  1212. -- ----------------------------
  1213. DROP TABLE IF EXISTS `t_shop`;
  1214. CREATE TABLE `t_shop` (
  1215. `shop_id` int(11) NOT NULL AUTO_INCREMENT,
  1216. `company_id` int(11) NULL DEFAULT NULL,
  1217. `shop_name` varchar(255) NULL DEFAULT NULL,
  1218. `shop_urlname` varchar(255) NULL DEFAULT NULL,
  1219. `shop_intro` varchar(255) NULL DEFAULT NULL,
  1220. `shop_allow_subdomain` smallint(6) NULL DEFAULT 0,
  1221. `shop_open_time` datetime(0) NULL DEFAULT NULL,
  1222. `shop_hits` int(255) NULL DEFAULT 0,
  1223. `shop_wechat_hits` int(255) NULL DEFAULT 0,
  1224. PRIMARY KEY (`shop_id`) USING BTREE
  1225. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1226. -- ----------------------------
  1227. -- Table structure for t_shop_product
  1228. -- ----------------------------
  1229. DROP TABLE IF EXISTS `t_shop_product`;
  1230. CREATE TABLE `t_shop_product` (
  1231. `product_id` int(11) NOT NULL,
  1232. `company_id` int(11) NULL DEFAULT NULL,
  1233. `user_id` int(11) NULL DEFAULT NULL,
  1234. `shop_id` int(11) NULL DEFAULT NULL,
  1235. `product_shop_pname` varchar(255) NULL DEFAULT NULL,
  1236. `product_shop_material` varchar(255) NULL DEFAULT NULL,
  1237. `product_shop_height` varchar(255) NULL DEFAULT NULL,
  1238. `product_shop_height_unit` varchar(255) NULL DEFAULT NULL,
  1239. `product_shop_width` varchar(255) NULL DEFAULT NULL,
  1240. `product_shop_width_unit` varchar(255) NULL DEFAULT NULL,
  1241. `product_shop_elasticity` varchar(255) NULL DEFAULT NULL,
  1242. `product_shop_price_origin` varchar(255) NULL DEFAULT NULL,
  1243. `product_shop_price_origin_unit` varchar(255) NULL DEFAULT NULL,
  1244. `product_shop_price_on_sale` varchar(255) NULL DEFAULT NULL,
  1245. `product_shop_price_on_sale_unit` varchar(255) NULL DEFAULT NULL,
  1246. `product_shop_inventory` varchar(255) NULL DEFAULT NULL,
  1247. `product_shop_inventory_unit` varchar(255) NULL DEFAULT NULL,
  1248. `product_intro` varchar(255) NULL DEFAULT NULL,
  1249. `product_is_promotion` int(11) NULL DEFAULT NULL,
  1250. `product_is_order` int(255) NULL DEFAULT NULL,
  1251. `product_on_time` datetime(0) NULL DEFAULT NULL,
  1252. `product_tag_ids` text NULL DEFAULT NULL,
  1253. `product_order` int(255) NULL DEFAULT 0,
  1254. `product_promotion` tinyint(1) NULL DEFAULT NULL,
  1255. `product_promotion_start` datetime(0) NULL DEFAULT NULL,
  1256. `product_promotion_end` datetime(0) NULL DEFAULT NULL,
  1257. `product_shop_hits` int(255) UNSIGNED NULL DEFAULT 0,
  1258. `product_shop_hits_weight` int(11) NULL DEFAULT 0,
  1259. PRIMARY KEY (`product_id`) USING BTREE,
  1260. UNIQUE INDEX `product_id`(`product_id`) USING BTREE,
  1261. CONSTRAINT `t_shop_product_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE RESTRICT
  1262. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1263. -- ----------------------------
  1264. -- Table structure for t_statement_calculation
  1265. -- ----------------------------
  1266. DROP TABLE IF EXISTS `t_statement_calculation`;
  1267. CREATE TABLE `t_statement_calculation` (
  1268. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1269. `data_id` varchar(25) NOT NULL DEFAULT '',
  1270. `affair_id` int(11) NOT NULL,
  1271. `user_id` int(11) NOT NULL,
  1272. `tagIds` varchar(100) NOT NULL DEFAULT '',
  1273. `bill_order_id` int(11) NOT NULL,
  1274. `calculation_key` varchar(13) NOT NULL DEFAULT '',
  1275. `calculation_time` datetime(0) NOT NULL,
  1276. `calculation_product_specification` varchar(255) NOT NULL,
  1277. `calculation_product_color` varchar(255) NOT NULL,
  1278. `calculation_account_category_out` varchar(255) NOT NULL,
  1279. `calculation_receivables_payment_category` varchar(255) NOT NULL,
  1280. `receivables_mode` tinyint(1) NOT NULL,
  1281. `bill_order_number` varchar(255) NOT NULL DEFAULT '',
  1282. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1283. `bill_ids` text NULL,
  1284. `calculation_value` decimal(22, 6) NOT NULL DEFAULT 0.000000,
  1285. `calculation_condition` varchar(120) NOT NULL,
  1286. `calculation_supplement` varchar(50) NOT NULL DEFAULT '',
  1287. `call_time` datetime(0) NOT NULL,
  1288. `calculation_senior_screen` varchar(50) NOT NULL,
  1289. `calculation_account_category` varchar(50) NOT NULL,
  1290. `calculation_product_id` int(11) NOT NULL,
  1291. `calculation_collection_id` int(11) NOT NULL,
  1292. `day` INT ( 11 ) NULL,
  1293. `calculation_ctime` datetime(0) NULL DEFAULT NULL,
  1294. `calculation_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1295. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  1296. INDEX `bill_order_number`(`bill_order_number`) USING BTREE,
  1297. INDEX `bill_order_id`(`bill_order_id`) USING BTREE,
  1298. INDEX `call_time`(`call_time`) USING BTREE,
  1299. UNIQUE INDEX `data_id` (`data_id`) USING BTREE,
  1300. INDEX `calculation_value`(`calculation_key`, `affair_id`, `calculation_time`, `calculation_value`, `calculation_condition`, `tagIds`) USING BTREE,
  1301. INDEX `calculation_time`(`calculation_time`, `affair_id`, `calculation_condition`, `tagIds`) USING BTREE
  1302. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1303. -- ----------------------------
  1304. -- Table structure for t_statement_calculation
  1305. -- ----------------------------
  1306. DROP TABLE IF EXISTS `t_product_share_permission`;
  1307. CREATE TABLE IF NOT EXISTS `t_product_share_permission` (
  1308. `per_id` int(11) NOT NULL AUTO_INCREMENT,
  1309. `share_id` varchar(50) NOT NULL,
  1310. `user_id` int(11) NOT NULL DEFAULT 0,
  1311. `allow` int(1) DEFAULT 1,
  1312. PRIMARY KEY (`per_id`) USING BTREE,
  1313. KEY `per_id` (`per_id`) USING BTREE,
  1314. KEY `user_id` (`user_id`,`share_id`) USING BTREE,
  1315. KEY `share_id` (`share_id`,`user_id`),
  1316. CONSTRAINT `t_product_share_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1317. CONSTRAINT `t_product_share_permission_ibfk_3` FOREIGN KEY (`share_id`) REFERENCES `t_product_share` (`share_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1318. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  1319. -- ----------------------------
  1320. -- Table structure for t_tag_frequently
  1321. -- ----------------------------
  1322. DROP TABLE IF EXISTS `t_tag_frequently`;
  1323. CREATE TABLE `t_tag_frequently` (
  1324. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  1325. `user_id` int(11) NOT NULL,
  1326. `tag_id` int(11) NOT NULL,
  1327. `ctime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  1328. PRIMARY KEY (`frequently_id`) USING BTREE,
  1329. INDEX `user_id`(`user_id`) USING BTREE,
  1330. INDEX `tag_id`(`tag_id`) USING BTREE,
  1331. CONSTRAINT `t_tag_frequently_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1332. CONSTRAINT `t_tag_frequently_ibfk_3` FOREIGN KEY (`tag_id`) REFERENCES `t_tag_list` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1333. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1334. -- ----------------------------
  1335. -- Table structure for t_tag_list
  1336. -- ----------------------------
  1337. DROP TABLE IF EXISTS `t_tag_list`;
  1338. CREATE TABLE `t_tag_list` (
  1339. `tag_id` int(11) NOT NULL AUTO_INCREMENT,
  1340. `company_id` int(11) NULL DEFAULT NULL,
  1341. `user_id` int(11) NULL DEFAULT NULL,
  1342. `tag_category` int(11) NULL DEFAULT 0,
  1343. `tag_image_id` int(11) NULL DEFAULT NULL,
  1344. `tag_image` varchar(255) NULL DEFAULT NULL,
  1345. `tag_title` varchar(255) NULL DEFAULT NULL,
  1346. `tag_desc` varchar(255) NULL DEFAULT NULL,
  1347. `used_count` int(11) NULL DEFAULT 0,
  1348. `status` int(2) NULL DEFAULT 99,
  1349. `ctime` datetime(0) NULL DEFAULT NULL,
  1350. `utime` datetime(0) NULL DEFAULT NULL,
  1351. `permission` int(1) NULL DEFAULT 1,
  1352. `necessary` int(1) NULL DEFAULT 0,
  1353. `data_protection` int(1) NULL DEFAULT 0,
  1354. `position` int(11) NULL DEFAULT 0,
  1355. `permission_view` INT ( 1 ) NULL DEFAULT 1,
  1356. `tag_group_id` int(11) NULL DEFAULT 0,
  1357. PRIMARY KEY (`tag_id`) USING BTREE,
  1358. INDEX `tag_image_id`(`tag_image_id`) USING BTREE
  1359. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1360. -- ----------------------------
  1361. -- Table structure for t_tag_list_rel
  1362. -- ----------------------------
  1363. DROP TABLE IF EXISTS `t_tag_list_rel`;
  1364. CREATE TABLE `t_tag_list_rel` (
  1365. `rel_id` int(11) NOT NULL AUTO_INCREMENT,
  1366. `user_id` int(11) NOT NULL,
  1367. `tag_category` int(11) NULL DEFAULT NULL,
  1368. `content_id` varchar(25) NULL DEFAULT NULL,
  1369. `content_type` int(11) NULL DEFAULT 0,
  1370. `tag_id` int(11) NULL DEFAULT NULL,
  1371. `ctime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  1372. PRIMARY KEY (`rel_id`) USING BTREE,
  1373. INDEX `tag_id`(`tag_id`) USING BTREE,
  1374. CONSTRAINT `t_tag_list_rel_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES `t_tag_list` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1375. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1376. -- ----------------------------
  1377. -- Table structure for t_tag_permission
  1378. -- ----------------------------
  1379. DROP TABLE IF EXISTS `t_tag_permission`;
  1380. CREATE TABLE `t_tag_permission` (
  1381. `per_id` int(11) NOT NULL AUTO_INCREMENT,
  1382. `tag_id` int(11) NOT NULL,
  1383. `user_id` int(11) NOT NULL DEFAULT 0,
  1384. PRIMARY KEY (`per_id`) USING BTREE,
  1385. INDEX `per_id`(`per_id`) USING BTREE,
  1386. INDEX `tag_id`(`tag_id`) USING BTREE,
  1387. INDEX `user_id`(`user_id`) USING BTREE,
  1388. `allow` INT ( 1 ) NULL DEFAULT 1,
  1389. CONSTRAINT `t_tag_permission_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES `t_tag_list` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1390. CONSTRAINT `t_tag_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1391. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1392. -- ----------------------------
  1393. -- Table structure for t_user
  1394. -- ----------------------------
  1395. DROP TABLE IF EXISTS `t_user`;
  1396. CREATE TABLE `t_user` (
  1397. `user_id` int(11) NOT NULL AUTO_INCREMENT,
  1398. `company_id` int(11) NULL DEFAULT NULL,
  1399. `role_id` int(11) NOT NULL,
  1400. `location_id` int(11) NULL DEFAULT NULL,
  1401. `department_id` int(11) NULL DEFAULT NULL,
  1402. `user_addr` varchar(255) NULL DEFAULT NULL,
  1403. `user_company_name` varchar(255) NULL DEFAULT NULL,
  1404. `user_name` varchar(255) NOT NULL,
  1405. `user_password` varchar(32) NOT NULL,
  1406. `user_pwdhash` varchar(255) NULL DEFAULT NULL,
  1407. `user_realname` varchar(10) NOT NULL,
  1408. `user_gender` tinyint(1) NULL DEFAULT 1,
  1409. `user_avatar` varchar(100) NULL DEFAULT NULL,
  1410. `user_phonenum` varchar(11) NULL DEFAULT NULL,
  1411. `user_state` tinyint(1) NULL DEFAULT 0,
  1412. `user_qq` varchar(15) NULL DEFAULT NULL,
  1413. `user_email` varchar(255) NULL DEFAULT NULL,
  1414. `user_uid` varchar(18) NULL DEFAULT NULL,
  1415. `user_region` varchar(255) NULL DEFAULT NULL,
  1416. `visible` tinyint(255) NULL DEFAULT NULL,
  1417. `ctime` datetime(0) NOT NULL,
  1418. `utime` datetime(0) NULL DEFAULT NULL,
  1419. `dtime` datetime(0) NULL DEFAULT NULL,
  1420. `status` decimal(2, 0) NOT NULL DEFAULT 99,
  1421. `user_logtimes` int(11) NULL DEFAULT NULL,
  1422. `user_lastip` varchar(255) NULL DEFAULT NULL,
  1423. `user_lastlogintime` datetime(0) NULL DEFAULT NULL,
  1424. `user_lastackqstring` varchar(255) NULL DEFAULT NULL,
  1425. `user_lastackurl` varchar(255) NULL DEFAULT NULL,
  1426. `avos_session_token` varchar(50) NULL DEFAULT NULL,
  1427. `user_lastacktime` datetime(0) NULL DEFAULT NULL,
  1428. `user_lastackdevice` varchar(255) NULL DEFAULT NULL,
  1429. `user_signup_user_agent` varchar(255) NULL DEFAULT NULL,
  1430. `auth_key` varchar(255) NULL DEFAULT NULL,
  1431. `access_token` varchar(255) NULL DEFAULT NULL,
  1432. `tgt` varchar(255) NULL DEFAULT NULL,
  1433. `st` varchar(255) NULL DEFAULT NULL,
  1434. `sid` varchar(255) NULL DEFAULT NULL,
  1435. `avos_token` varchar(255) NULL DEFAULT NULL,
  1436. `referral_code` int(6) NULL DEFAULT NULL,
  1437. `user_lastaddress` varchar(255) NULL DEFAULT NULL,
  1438. `necessary` tinyint(1) NULL DEFAULT 0,
  1439. `work_time` varchar(60) NULL DEFAULT NULL,
  1440. `attendance_id` int(11) NULL DEFAULT NULL,
  1441. `bill_header` varchar(255) NULL,
  1442. `report_header` varchar(255) NULL,
  1443. `report_password` varchar(32) NULL,
  1444. `report_password_type` tinyint(1) NULL DEFAULT 0,
  1445. `second_token` varchar(50) CHARACTER SET utf8mb4 NULL DEFAULT '',
  1446. PRIMARY KEY (`user_id`) USING BTREE,
  1447. INDEX `role_id`(`role_id`) USING BTREE,
  1448. INDEX `company_id`(`company_id`) USING BTREE,
  1449. INDEX `department_id`(`department_id`) USING BTREE,
  1450. INDEX `user_name`(`user_name`) USING BTREE,
  1451. INDEX `referral_code`(`referral_code`) USING BTREE,
  1452. INDEX `referral_code_2`(`referral_code`) USING BTREE,
  1453. INDEX `user_phonenum`(`user_phonenum`) USING BTREE,
  1454. CONSTRAINT `FK_Relationship_2` FOREIGN KEY (`role_id`) REFERENCES `t_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1455. CONSTRAINT `t_user_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1456. CONSTRAINT `t_user_ibfk_3` FOREIGN KEY (`department_id`) REFERENCES `t_department` (`department_id`) ON DELETE SET NULL ON UPDATE CASCADE
  1457. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1458. -- ----------------------------
  1459. -- Table structure for t_user_attendance
  1460. -- ----------------------------
  1461. DROP TABLE IF EXISTS `t_user_attendance`;
  1462. CREATE TABLE `t_user_attendance` (
  1463. `attendance_id` int(11) NOT NULL AUTO_INCREMENT,
  1464. `attendance_name` varchar(20) NOT NULL,
  1465. `attendance_time` varchar(60) NOT NULL DEFAULT '',
  1466. `monday` varchar(60) NULL DEFAULT '',
  1467. `tuesday` varchar(60) NULL DEFAULT '',
  1468. `wednesday` varchar(60) NULL DEFAULT '',
  1469. `thursday` varchar(60) NULL DEFAULT '',
  1470. `friday` varchar(60) NULL DEFAULT '',
  1471. `saturday` varchar(60) NULL DEFAULT '',
  1472. `sunday` varchar(60) NULL DEFAULT '',
  1473. PRIMARY KEY (`attendance_id`) USING BTREE
  1474. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1475. -- ----------------------------
  1476. -- Table structure for t_work
  1477. -- ----------------------------
  1478. DROP TABLE IF EXISTS `t_work`;
  1479. CREATE TABLE `t_work` (
  1480. `work_id` int(11) NOT NULL AUTO_INCREMENT,
  1481. `work_pid` int(11) NULL DEFAULT NULL,
  1482. `work_children_ids` varchar(255) NULL DEFAULT NULL,
  1483. `affair_id` int(11) NULL DEFAULT NULL,
  1484. `user_id` int(11) NULL DEFAULT NULL,
  1485. `work_type` int(11) NULL DEFAULT NULL,
  1486. `reminder_id` int(11) NULL DEFAULT NULL,
  1487. `image_ids` varchar(255) NULL DEFAULT NULL,
  1488. `voice_ids` varchar(255) NULL DEFAULT NULL,
  1489. `content_text` varchar(255) NULL DEFAULT NULL,
  1490. `ctime` datetime(0) NULL DEFAULT NULL,
  1491. `utime` datetime(0) NULL DEFAULT NULL,
  1492. `work_data_id` varchar(50) NULL DEFAULT NULL,
  1493. `work_object_type` tinyint(1) NULL DEFAULT 1,
  1494. `work_object_ids` text NULL DEFAULT NULL,
  1495. `work_theme` varchar(255) NULL DEFAULT NULL,
  1496. `affair_data_id` varchar(50) NULL DEFAULT NULL,
  1497. PRIMARY KEY (`work_id`) USING BTREE
  1498. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1499. -- ----------------------------
  1500. -- Table structure for t_work_frequently
  1501. -- ----------------------------
  1502. DROP TABLE IF EXISTS `t_work_frequently`;
  1503. CREATE TABLE `t_work_frequently` (
  1504. `work_frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  1505. `user_id` int(11) NOT NULL,
  1506. `affair_id` int(11) NOT NULL,
  1507. `ctime` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  1508. `work_type_notice` tinyint(1) NULL DEFAULT 0,
  1509. `work_type_instructions` tinyint(1) NULL DEFAULT 0,
  1510. `work_type_Assign` tinyint(1) NULL DEFAULT 0,
  1511. PRIMARY KEY (`work_frequently_id`) USING BTREE,
  1512. INDEX `affair_id`(`affair_id`) USING BTREE,
  1513. INDEX `user_id`(`user_id`) USING BTREE,
  1514. CONSTRAINT `t_work_frequently_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1515. CONSTRAINT `t_work_frequently_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1516. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1517. -- ----------------------------
  1518. -- Table structure for t_work_reminder
  1519. -- ----------------------------
  1520. DROP TABLE IF EXISTS `t_work_reminder`;
  1521. CREATE TABLE `t_work_reminder` (
  1522. `work_id` int(11) NOT NULL AUTO_INCREMENT,
  1523. `reply_id` int(11) NULL DEFAULT NULL,
  1524. `set_object_type` tinyint(1) NULL DEFAULT NULL,
  1525. `set_object_ids` text NULL DEFAULT NULL,
  1526. `set_frequency` int(11) NULL DEFAULT 0,
  1527. `set_interval` int(11) NULL DEFAULT NULL,
  1528. `set_interval_unit` tinyint(1) NULL DEFAULT NULL,
  1529. `reminder_object_ids` text NULL DEFAULT NULL,
  1530. `reminder_frequency` int(11) NULL DEFAULT 0,
  1531. `reminder_time` datetime(0) NULL DEFAULT NULL,
  1532. `is_reminder` tinyint(1) NULL DEFAULT 0,
  1533. PRIMARY KEY (`work_id`) USING BTREE,
  1534. CONSTRAINT `t_work_reminder_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `t_work` (`work_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1535. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1536. -- ----------------------------
  1537. -- Table structure for t_work_reply
  1538. -- ----------------------------
  1539. DROP TABLE IF EXISTS `t_work_reply`;
  1540. CREATE TABLE `t_work_reply` (
  1541. `reply_id` int(11) NOT NULL AUTO_INCREMENT,
  1542. `reply_pid` int(11) NULL DEFAULT NULL,
  1543. `work_id` int(11) NULL DEFAULT NULL,
  1544. `reply_user_id` int(11) NULL DEFAULT NULL,
  1545. `reply_txt` varchar(255) NULL DEFAULT NULL,
  1546. `reply_affair_old_data` text NULL DEFAULT NULL,
  1547. `reply_affair_new_data` text NULL DEFAULT NULL,
  1548. `reply_time` datetime(0) NULL DEFAULT NULL,
  1549. `reply_object_ids` text NULL DEFAULT NULL,
  1550. `reply_image` varchar(255) NULL DEFAULT NULL,
  1551. `reply_voice` varchar(255) NULL DEFAULT NULL,
  1552. `reply_content` varchar(255) NULL DEFAULT NULL,
  1553. PRIMARY KEY (`reply_id`) USING BTREE,
  1554. INDEX `work_id`(`work_id`) USING BTREE,
  1555. CONSTRAINT `t_work_reply_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `t_work` (`work_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1556. ) ENGINE = InnoDB AUTO_INCREMENT = 1 ROW_FORMAT = Dynamic;
  1557. -- ----------------------------
  1558. -- Table structure for t_process_in_calculation
  1559. -- ----------------------------
  1560. DROP TABLE IF EXISTS `t_process_in_calculation`;
  1561. CREATE TABLE `t_process_in_calculation` (
  1562. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1563. `data_id` varchar(25) NOT NULL,
  1564. `affair_id` int(11) NOT NULL,
  1565. `tagIds` varchar(100) NOT NULL,
  1566. `calculation_key` varchar(15) NOT NULL,
  1567. `calculation_time` datetime(0) NOT NULL,
  1568. `product_id` int(11) NOT NULL,
  1569. `collection_id` int(11) NOT NULL,
  1570. `product_color` varchar(255) NOT NULL,
  1571. `product_color_number` varchar(255) NOT NULL,
  1572. `sale_object` varchar(15) NOT NULL,
  1573. `product_width` decimal(14, 2) NOT NULL,
  1574. `product_height` decimal(14, 2) NOT NULL,
  1575. `machining_price` decimal(15, 3) NOT NULL,
  1576. `calculation_condition` varchar(120) NOT NULL,
  1577. `actual_in_storehouse_quantity` decimal(22, 2) NOT NULL,
  1578. `call_time` datetime(0) NOT NULL,
  1579. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1580. `user_id` int(11) NOT NULL,
  1581. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  1582. INDEX `call_time`(`call_time`) USING BTREE,
  1583. UNIQUE INDEX `data_id` (`data_id`) USING BTREE,
  1584. INDEX `affair_id`(`affair_id`, `calculation_time`, `calculation_condition`, `tagIds`, `calculation_key`, `product_id`, `product_color`, `sale_object`) USING BTREE
  1585. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1586. -- ----------------------------
  1587. -- Table structure for t_process_out_calculation
  1588. -- ----------------------------
  1589. DROP TABLE IF EXISTS `t_process_out_calculation`;
  1590. CREATE TABLE `t_process_out_calculation` (
  1591. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1592. `data_id` varchar(25) NOT NULL,
  1593. `affair_id` int(11) NOT NULL,
  1594. `tagIds` varchar(100) NOT NULL,
  1595. `calculation_condition` varchar(120) NOT NULL,
  1596. `calculation_time` datetime(0) NOT NULL,
  1597. `machining_price` decimal(15, 3) NOT NULL,
  1598. `machining_quantity` decimal(15, 2) NOT NULL,
  1599. `machining_total_amount` decimal(15, 3) NOT NULL,
  1600. `out_storehouse_quantity` decimal(22, 2) NOT NULL,
  1601. `from_data_id` varchar(25) NOT NULL,
  1602. `is_complete` int(1) NOT NULL DEFAULT 0,
  1603. `call_time` datetime(0) NOT NULL,
  1604. `clearing_storehouse` int(1) NOT NULL DEFAULT 0,
  1605. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1606. `user_id` int(11) NOT NULL,
  1607. PRIMARY KEY (`calculation_id`, `data_id`, `from_data_id`) USING BTREE,
  1608. INDEX `call_time`(`call_time`) USING BTREE,
  1609. UNIQUE INDEX `data_id` (`data_id`) USING BTREE,
  1610. INDEX `affair_id`(`affair_id`, `calculation_time`, `calculation_condition`, `tagIds`, `from_data_id`) USING BTREE
  1611. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1612. -- ----------------------------
  1613. -- Table structure for t_machine_calculation
  1614. -- ----------------------------
  1615. DROP TABLE IF EXISTS `t_machine_calculation`;
  1616. CREATE TABLE `t_machine_calculation` (
  1617. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1618. `data_id` varchar(25) NOT NULL DEFAULT '',
  1619. `affair_id` int(11) NOT NULL,
  1620. `tagIds` varchar(100) NOT NULL DEFAULT '',
  1621. `calculation_condition` varchar(120) NOT NULL ,
  1622. `call_time` datetime(0) NOT NULL,
  1623. `calculation_key` varchar(13) NOT NULL DEFAULT '',
  1624. `calculation_time` datetime(0) NOT NULL ,
  1625. `calculation_time2` datetime(0) NOT NULL ,
  1626. `product_id` int(11) NOT NULL DEFAULT 0,
  1627. `single_weight` decimal(22, 2) NULL DEFAULT 0.00 ,
  1628. `pipe_weight` decimal(22, 2) NULL DEFAULT 0.00 ,
  1629. `machine_horse` bigint(22) NULL DEFAULT NULL,
  1630. `pan_head_type` varchar(255) NULL DEFAULT NULL,
  1631. `public_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1632. `stop_reason_id` int(11) NULL,
  1633. `object_key` varchar(25) NULL,
  1634. `calculation_value` decimal(22,2) NULL,
  1635. `needle_position` int(11) NULL,
  1636. `net_needle` int(11) NULL,
  1637. `product_specification` varchar(255) NULL DEFAULT '',
  1638. `machine_production_state` tinyint(1) NULL DEFAULT 0,
  1639. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  1640. INDEX `call_time`(`call_time`) USING BTREE,
  1641. UNIQUE INDEX `data_id` (`data_id`) USING BTREE,
  1642. INDEX `calculation_value`(`affair_id`, `calculation_key`, `calculation_condition`, `calculation_time`, `product_id`, `tagIds`, `calculation_time2`) USING BTREE
  1643. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1644. -- ----------------------------
  1645. -- Table structure for t_ticket_calculation
  1646. -- ----------------------------
  1647. DROP TABLE IF EXISTS `t_ticket_calculation`;
  1648. CREATE TABLE `t_ticket_calculation` (
  1649. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1650. `data_id` varchar(25) NOT NULL DEFAULT '',
  1651. `affair_id` int(11) NOT NULL,
  1652. `tagIds` varchar(100) NOT NULL DEFAULT '',
  1653. `calculation_condition` varchar(120) NOT NULL ,
  1654. `calculation_key` varchar(13) NOT NULL DEFAULT '',
  1655. `calculation_time` datetime(0) NOT NULL ,
  1656. `calculation_value` decimal(22, 6) NOT NULL DEFAULT 0.000000 ,
  1657. `call_time` datetime(0) NOT NULL,
  1658. `calculation_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1659. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1660. `ticket_key` varchar(13) NOT NULL DEFAULT '',
  1661. `ticket_time` datetime(0) NOT NULL ,
  1662. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  1663. INDEX `call_time`(`call_time`) USING BTREE,
  1664. UNIQUE INDEX `data_id` (`data_id`) USING BTREE,
  1665. INDEX `calculation_value`(`affair_id`, `calculation_key`, `calculation_condition`, `calculation_time`, `tagIds`, `ticket_key`, `ticket_time`) USING BTREE
  1666. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1667. -- ----------------------------
  1668. -- Table structure for t_customer_given
  1669. -- ----------------------------
  1670. DROP TABLE IF EXISTS `t_customer_given`;
  1671. CREATE TABLE `t_customer_given` (
  1672. `id` int(11) NOT NULL AUTO_INCREMENT,
  1673. `givenKey` varchar(50) NOT NULL,
  1674. `companyId` int(11) DEFAULT NULL,
  1675. PRIMARY KEY (`id`)
  1676. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1677. -- ----------------------------
  1678. -- Table structure for t_customer_visible
  1679. -- ----------------------------
  1680. DROP TABLE IF EXISTS `t_customer_visible`;
  1681. CREATE TABLE `t_customer_visible` (
  1682. `id` int(20) NOT NULL AUTO_INCREMENT,
  1683. `userId` int(11) NOT NULL,
  1684. `objectKey` varchar(50) NOT NULL,
  1685. `companyId` int(11) DEFAULT NULL,
  1686. PRIMARY KEY (`id`),
  1687. KEY `userId` (`userId`,`objectKey`) USING BTREE,
  1688. CONSTRAINT `t_customer_visible_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1689. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1690. -- ----------------------------
  1691. -- Table structure for t_documentary_statistics
  1692. -- ----------------------------
  1693. DROP TABLE IF EXISTS `t_documentary_statistics`;
  1694. CREATE TABLE `t_documentary_statistics` (
  1695. `statistics_id` int(11) NOT NULL AUTO_INCREMENT,
  1696. `statistics_name` varchar(20) NOT NULL DEFAULT '',
  1697. `statistics_number` int(11) NOT NULL DEFAULT 0,
  1698. `permission` tinyint(1) NULL DEFAULT 0,
  1699. `user_ids` text NULL DEFAULT NULL,
  1700. `companyId` int(11) NULL DEFAULT NULL,
  1701. PRIMARY KEY (`statistics_id`) USING BTREE
  1702. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1703. -- ----------------------------
  1704. -- Table structure for t_documentary_step
  1705. -- ----------------------------
  1706. DROP TABLE IF EXISTS `t_documentary_step`;
  1707. CREATE TABLE `t_documentary_step` (
  1708. `step_id` int(11) NOT NULL AUTO_INCREMENT,
  1709. `step_name` varchar(20) NULL DEFAULT '',
  1710. `step_number` int(11) NOT NULL,
  1711. `affairIds` text NULL DEFAULT NULL,
  1712. `companyId` int(11) NULL DEFAULT 0,
  1713. `ctime` datetime(0) NULL DEFAULT NULL,
  1714. `utime` datetime(0) NULL DEFAULT NULL,
  1715. `tag_ids` text NULL DEFAULT NULL,
  1716. PRIMARY KEY (`step_id`) USING BTREE
  1717. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1718. -- ----------------------------
  1719. -- Table structure for t_report_account
  1720. -- ----------------------------
  1721. DROP TABLE IF EXISTS `t_report_account`;
  1722. CREATE TABLE `t_report_account` (
  1723. `account_id` int(11) NOT NULL AUTO_INCREMENT,
  1724. `account_name` varchar(255) NOT NULL,
  1725. `account_bank_name` varchar(255) NULL DEFAULT '',
  1726. `account_bank_number` varchar(255) NULL DEFAULT '',
  1727. `account_cumulative` double(13, 2) NULL DEFAULT 0,
  1728. `ctime` datetime(0) NULL DEFAULT NULL,
  1729. `utime` datetime(0) NULL DEFAULT NULL,
  1730. `user_id` int(11) NULL DEFAULT NULL,
  1731. `permission` tinyint(1) NULL DEFAULT 1,
  1732. `see_user_ids` text NULL DEFAULT NULL,
  1733. PRIMARY KEY (`account_id`) USING BTREE
  1734. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1735. -- ----------------------------
  1736. -- Table structure for t_inventory_frequently
  1737. -- ----------------------------
  1738. DROP TABLE IF EXISTS `t_inventory_frequently`;
  1739. CREATE TABLE `t_inventory_frequently` (
  1740. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  1741. `user_id` int(11) NULL DEFAULT NULL,
  1742. `inventory_user_ids` text NULL DEFAULT NULL,
  1743. `utime` varchar(25) NULL DEFAULT '',
  1744. UNIQUE INDEX `frequently_id`(`frequently_id`) USING BTREE
  1745. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1746. -- ----------------------------
  1747. -- Table structure for t_inventory_notice
  1748. -- ----------------------------
  1749. DROP TABLE IF EXISTS `t_inventory_notice`;
  1750. CREATE TABLE `t_inventory_notice` (
  1751. `notice_id` int(11) NOT NULL AUTO_INCREMENT,
  1752. `user_id` int(11) NULL DEFAULT NULL,
  1753. `data_ids` text NULL DEFAULT NULL,
  1754. `ctime` varchar(25) NULL DEFAULT '',
  1755. `content` varchar(255) NULL DEFAULT NULL,
  1756. `data_count` int(11) NULL DEFAULT NULL,
  1757. PRIMARY KEY (`notice_id`) USING BTREE,
  1758. UNIQUE INDEX `frequently_id`(`notice_id`) USING BTREE
  1759. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1760. -- ----------------------------
  1761. -- Table structure for t_inventory_notice_user
  1762. -- ----------------------------
  1763. DROP TABLE IF EXISTS `t_inventory_notice_user`;
  1764. CREATE TABLE `t_inventory_notice_user` (
  1765. `id` int(11) NOT NULL AUTO_INCREMENT,
  1766. `notice_id` int(11) NOT NULL,
  1767. `user_id` int(11) NOT NULL,
  1768. `ctime` varchar(25) NULL DEFAULT '',
  1769. `notice_state` tinyint(1) NULL DEFAULT NULL,
  1770. PRIMARY KEY (`id`) USING BTREE,
  1771. UNIQUE INDEX `id`(`id`) USING BTREE
  1772. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1773. -- ----------------------------
  1774. -- Table structure for t_screen
  1775. -- ----------------------------
  1776. DROP TABLE IF EXISTS `t_screen`;
  1777. CREATE TABLE `t_screen` (
  1778. `screen_id` int(11) NOT NULL AUTO_INCREMENT,
  1779. `user_id` int(11) NULL DEFAULT NULL,
  1780. `column_ids` text NULL DEFAULT NULL,
  1781. `utime` varchar(25) NULL DEFAULT '',
  1782. `screen_type` tinyint(1) NULL DEFAULT 1,
  1783. UNIQUE INDEX `frequently_id`(`screen_id`) USING BTREE
  1784. ) ENGINE = InnoDB ROW_FORMAT = Dynamic;
  1785. -- ----------------------------
  1786. -- Table structure for t_user_reminder
  1787. -- ----------------------------
  1788. DROP TABLE IF EXISTS `t_user_reminder`;
  1789. CREATE TABLE `t_user_reminder` (
  1790. `user_id` int(11) NOT NULL,
  1791. `sale_price_reminder` tinyint(1) DEFAULT 0,
  1792. `purchase_price_reminder` tinyint(1) DEFAULT 0,
  1793. `documentary_add_reminder` tinyint(1) DEFAULT 0,
  1794. `documentary_add_son_reminder` tinyint(1) DEFAULT 0,
  1795. `documentary_join_reminder` tinyint(1) DEFAULT 0,
  1796. `documentary_new_affair_join_reminder` tinyint(1) NULL DEFAULT 0,
  1797. `product_image_shear` tinyint(1) NULL DEFAULT 0,
  1798. `documentary_copy_order` tinyint(1) NULL DEFAULT 0,
  1799. `customer_tag_reminder` tinyint(1) NULL DEFAULT 0,
  1800. PRIMARY KEY (`user_id`),
  1801. UNIQUE KEY `user_id` (`user_id`) USING BTREE
  1802. ) ENGINE=InnoDB ROW_FORMAT=Dynamic;
  1803. -- ----------------------------
  1804. -- Table structure for t_notification
  1805. -- ----------------------------
  1806. DROP TABLE IF EXISTS `t_notification`;
  1807. CREATE TABLE `t_notification` (
  1808. `notification_id` int(0) UNSIGNED NOT NULL AUTO_INCREMENT,
  1809. `notification_code` int(11) NULL,
  1810. `is_read` int(2) NULL,
  1811. `ctime` datetime(0) NULL,
  1812. PRIMARY KEY (`notification_id`)
  1813. )ENGINE=InnoDB ROW_FORMAT=Dynamic;;
  1814. -- ----------------------------
  1815. -- Table structure for t_confidential_cabinet
  1816. -- ----------------------------
  1817. DROP TABLE IF EXISTS `t_confidential_cabinet`;
  1818. CREATE TABLE `t_confidential_cabinet` (
  1819. `cabinet_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '公司单号ID',
  1820. `cabinet_name` varchar(20) NOT NULL DEFAULT '',
  1821. `permission` tinyint(1) DEFAULT 0,
  1822. `user_ids` text DEFAULT NULL,
  1823. `user_id` int(11) DEFAULT NULL,
  1824. `company_id` int(11) DEFAULT NULL,
  1825. `ctime` datetime DEFAULT NULL,
  1826. `utime` datetime DEFAULT NULL,
  1827. PRIMARY KEY (`cabinet_id`)
  1828. ) ENGINE=InnoDB;
  1829. -- ----------------------------
  1830. -- Table structure for t_confidential_lock
  1831. -- ----------------------------
  1832. DROP TABLE IF EXISTS `t_confidential_lock`;
  1833. CREATE TABLE `t_confidential_lock` (
  1834. `lock_id` int(11) NOT NULL AUTO_INCREMENT,
  1835. `lock_name` varchar(20) NOT NULL DEFAULT '',
  1836. `lock_password` varchar(50) NOT NULL DEFAULT '',
  1837. `lock_time` varchar(25) DEFAULT '',
  1838. `user_id` int(11) DEFAULT NULL,
  1839. `company_id` int(11) DEFAULT NULL,
  1840. `ctime` datetime DEFAULT NULL,
  1841. `utime` datetime DEFAULT NULL,
  1842. PRIMARY KEY (`lock_id`)
  1843. ) ENGINE=InnoDB;
  1844. -- ----------------------------
  1845. -- Table structure for t_confidential_relation
  1846. -- ----------------------------
  1847. DROP TABLE IF EXISTS `t_confidential_relation`;
  1848. CREATE TABLE `t_confidential_relation` (
  1849. `relation_id` int(11) NOT NULL AUTO_INCREMENT,
  1850. `lock_id` int(11) NOT NULL,
  1851. `cabinet_id` int(11) NOT NULL,
  1852. PRIMARY KEY (`relation_id`),
  1853. KEY `lock_id` (`lock_id`),
  1854. KEY `cabinet_id` (`cabinet_id`),
  1855. CONSTRAINT `t_confidential_relation_ibfk_1` FOREIGN KEY (`lock_id`) REFERENCES `t_confidential_lock` (`lock_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1856. CONSTRAINT `t_confidential_relation_ibfk_2` FOREIGN KEY (`cabinet_id`) REFERENCES `t_confidential_cabinet` (`cabinet_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1857. ) ENGINE=InnoDB;
  1858. -- ----------------------------
  1859. -- Table structure for t_product_share_error
  1860. -- ----------------------------
  1861. DROP TABLE IF EXISTS `t_product_share_error`;
  1862. CREATE TABLE `t_product_share_error` (
  1863. `error_id` int(11) NOT NULL AUTO_INCREMENT,
  1864. `error_ip` varchar(30) NOT NULL DEFAULT '',
  1865. `error_number` tinyint(1) DEFAULT NULL,
  1866. `error_time` datetime DEFAULT NULL,
  1867. PRIMARY KEY (`error_id`)
  1868. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1869. -- ----------------------------
  1870. -- Table structure for t_customized
  1871. -- ----------------------------
  1872. DROP TABLE IF EXISTS `t_customized`;
  1873. CREATE TABLE `t_customized` (
  1874. `customized_id` int(11) NOT NULL AUTO_INCREMENT,
  1875. `customized_name` varchar(255) NOT NULL DEFAULT '',
  1876. `customized_shortname` varchar(255) DEFAULT '',
  1877. `customized_title` varchar(255) NOT NULL DEFAULT '',
  1878. `customized_class` varchar(255) DEFAULT '',
  1879. `customized_content` varchar(255) DEFAULT '',
  1880. `customized_type` tinyint(1) DEFAULT NULL,
  1881. `permission` tinyint(1) DEFAULT 0,
  1882. `user_ids` text DEFAULT NULL,
  1883. `ctime` datetime DEFAULT NULL,
  1884. `utime` datetime DEFAULT NULL,
  1885. `company_id` int(11) DEFAULT NULL,
  1886. `customized_other` text DEFAULT NULL,
  1887. `view_permission` tinyint(1) NULL DEFAULT 2,
  1888. `view_user_ids` text NULL,
  1889. PRIMARY KEY (`customized_id`)
  1890. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1891. -- ----------------------------
  1892. -- Table structure for t_fast_input
  1893. -- ----------------------------
  1894. DROP TABLE IF EXISTS `t_fast_input`;
  1895. CREATE TABLE `t_fast_input` (
  1896. `fast_input_id` int(11) NOT NULL AUTO_INCREMENT,
  1897. `customized_id` int(11) NOT NULL,
  1898. `fast_input_number` varchar(50) NOT NULL DEFAULT '',
  1899. `fast_input_state` tinyint(1) DEFAULT 0,
  1900. `fast_input_data_ids` text NOT NULL,
  1901. `fast_input_content` text DEFAULT NULL,
  1902. `fast_input_other` longtext NULL,
  1903. `ctime` datetime DEFAULT NULL,
  1904. `utime` datetime DEFAULT NULL,
  1905. `company_id` int(11) DEFAULT NULL,
  1906. `user_id` int(11) DEFAULT NULL,
  1907. `status` int(2) NULL DEFAULT 99,
  1908. PRIMARY KEY (`fast_input_id`),
  1909. INDEX `user_id`(`status`, `customized_id`, `user_id`)
  1910. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1911. -- ----------------------------
  1912. -- Table structure for t_inventory_price_record
  1913. -- ----------------------------
  1914. DROP TABLE IF EXISTS `t_inventory_price_record`;
  1915. CREATE TABLE `t_inventory_price_record` (
  1916. `inventory_price_record_id` int(11) NOT NULL AUTO_INCREMENT,
  1917. `inventory_id` int(11) NOT NULL,
  1918. `record_time` datetime NOT NULL,
  1919. `inventory_price` double(22,6) NOT NULL,
  1920. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  1921. `status` int(2) DEFAULT 99,
  1922. `ctime` datetime DEFAULT NULL,
  1923. `utime` datetime DEFAULT NULL,
  1924. `user_id` int(11) DEFAULT NULL,
  1925. PRIMARY KEY (`inventory_price_record_id`),
  1926. KEY `inventory_id` (`inventory_id`),
  1927. CONSTRAINT `t_inventory_price_record_ibfk_1` FOREIGN KEY (`inventory_id`) REFERENCES `t_inventory` (`inventory_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1928. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1929. -- ----------------------------
  1930. -- Table structure for t_machine_pause
  1931. -- ----------------------------
  1932. DROP TABLE IF EXISTS `t_machine_pause`;
  1933. CREATE TABLE `t_machine_pause` (
  1934. `machine_id` int(11) NOT NULL,
  1935. `ctime` datetime DEFAULT NULL,
  1936. `utime` datetime DEFAULT NULL,
  1937. `user_id` int(11) DEFAULT NULL,
  1938. `permission` tinyint(1) DEFAULT 1,
  1939. `pause_user_ids` text DEFAULT NULL,
  1940. PRIMARY KEY (`machine_id`) USING BTREE
  1941. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1942. -- ----------------------------
  1943. -- Table structure for t_machine_stop_reason
  1944. -- ----------------------------
  1945. DROP TABLE IF EXISTS `t_machine_stop_reason`;
  1946. CREATE TABLE `t_machine_stop_reason` (
  1947. `stop_reason_id` int(11) NOT NULL AUTO_INCREMENT,
  1948. `stop_reason_name` varchar(255) NOT NULL,
  1949. `ctime` datetime DEFAULT NULL,
  1950. `utime` datetime DEFAULT NULL,
  1951. `user_id` int(11) DEFAULT NULL,
  1952. `permission` tinyint(1) DEFAULT 1,
  1953. `stop_reason_user_ids` text DEFAULT NULL,
  1954. PRIMARY KEY (`stop_reason_id`) USING BTREE
  1955. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1956. -- ----------------------------
  1957. -- Table structure for t_offer_cost_float
  1958. -- ----------------------------
  1959. DROP TABLE IF EXISTS `t_offer_cost_float`;
  1960. CREATE TABLE `t_offer_cost_float` (
  1961. `offer_cost_float_id` int(11) NOT NULL AUTO_INCREMENT,
  1962. `offer_cost_float_number` double(13,2) DEFAULT 0.00,
  1963. `product_ids` text DEFAULT NULL,
  1964. `ctime` datetime DEFAULT NULL,
  1965. `utime` datetime DEFAULT NULL,
  1966. `user_id` int(11) DEFAULT NULL,
  1967. PRIMARY KEY (`offer_cost_float_id`) USING BTREE
  1968. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1969. -- ----------------------------
  1970. -- Table structure for t_offer_price
  1971. -- ----------------------------
  1972. DROP TABLE IF EXISTS `t_offer_price`;
  1973. CREATE TABLE `t_offer_price` (
  1974. `offer_price_id` int(11) NOT NULL AUTO_INCREMENT,
  1975. `offer_price_des` varchar(255) NOT NULL,
  1976. `offer_price_number` double(13,2) DEFAULT 0.00,
  1977. `ctime` datetime DEFAULT NULL,
  1978. `utime` datetime DEFAULT NULL,
  1979. `user_id` int(11) DEFAULT NULL,
  1980. `permission` tinyint(1) DEFAULT 1,
  1981. `see_user_ids` text DEFAULT NULL,
  1982. PRIMARY KEY (`offer_price_id`) USING BTREE
  1983. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1984. -- ----------------------------
  1985. -- Table structure for t_user_report_password
  1986. -- ----------------------------
  1987. DROP TABLE IF EXISTS `t_user_report_password`;
  1988. CREATE TABLE `t_user_report_password` (
  1989. `user_id` int(11) NOT NULL,
  1990. `report_password` varchar(32) NOT NULL DEFAULT '',
  1991. `report_password_type` tinyint(1) NOT NULL DEFAULT 0,
  1992. `report_password_interval` int(11) DEFAULT 0,
  1993. `use_time` datetime DEFAULT NULL,
  1994. `ctime` datetime DEFAULT NULL,
  1995. PRIMARY KEY (`user_id`) USING BTREE,
  1996. CONSTRAINT `t_user_report_password_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1997. ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
  1998. -- ----------------------------
  1999. -- Table structure for t_user_report_password
  2000. -- ----------------------------
  2001. DROP TABLE IF EXISTS `t_product_watermark`;
  2002. CREATE TABLE `t_product_watermark` (
  2003. `watermark_id` int(11) NOT NULL AUTO_INCREMENT,
  2004. `product_id` int(11) NOT NULL,
  2005. `user_id` int(11) DEFAULT NULL,
  2006. `company_id` int(11) DEFAULT NULL,
  2007. `ctime` datetime DEFAULT NULL,
  2008. `utime` datetime DEFAULT NULL,
  2009. `watermark_name` varchar(50) DEFAULT '',
  2010. `logo_image_id` int(11) DEFAULT NULL,
  2011. `watermark_title` varchar(50) DEFAULT '',
  2012. `font_type` tinyint(1) DEFAULT 0,
  2013. `watermark_colour` varchar(50) DEFAULT '',
  2014. `transparency` int(11) DEFAULT 0,
  2015. `font_szie` int(11) DEFAULT 0,
  2016. `row_number` int(11) DEFAULT 0,
  2017. `row_spacing` int(11) DEFAULT 0,
  2018. `column_number` int(11) DEFAULT 0,
  2019. `column_spacing` int(11) DEFAULT 0,
  2020. `angle` int(11) DEFAULT 0,
  2021. PRIMARY KEY (`watermark_id`,`product_id`),
  2022. UNIQUE KEY `watermark_id` (`watermark_id`) USING BTREE,
  2023. UNIQUE KEY `product_id` (`product_id`) USING BTREE
  2024. ) ENGINE=InnoDB AUTO_INCREMENT=1 ROW_FORMAT=DYNAMIC;
  2025. -- ----------------------------
  2026. -- Table structure for t_tag_group
  2027. -- ----------------------------
  2028. DROP TABLE IF EXISTS `t_tag_group`;
  2029. CREATE TABLE `t_tag_group` (
  2030. `tag_group_id` int(11) NOT NULL AUTO_INCREMENT,
  2031. `tag_group_title` varchar(255) NOT NULL,
  2032. `tag_group_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  2033. `tag_category` tinyint(1) DEFAULT NULL,
  2034. `status` tinyint(1) DEFAULT 99,
  2035. `ctime` datetime DEFAULT NULL,
  2036. `utime` datetime DEFAULT NULL,
  2037. `dtime` datetime DEFAULT NULL,
  2038. PRIMARY KEY (`tag_group_id`) USING BTREE
  2039. ) ENGINE=InnoDB AUTO_INCREMENT=1 ROW_FORMAT=DYNAMIC;
  2040. -- ----------------------------
  2041. -- Table structure for t_tag_group
  2042. -- ----------------------------
  2043. DROP TABLE IF EXISTS `t_home`;
  2044. CREATE TABLE IF NOT EXISTS `t_home` (
  2045. `id` int(11) NOT NULL AUTO_INCREMENT,
  2046. `home_type_ids` longtext NOT NULL,
  2047. `user_id` int(11) DEFAULT 99,
  2048. `utime` datetime DEFAULT NULL,
  2049. PRIMARY KEY (`id`) USING BTREE
  2050. ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  2051. -- ----------------------------
  2052. -- Function structure for Fun_GetPY
  2053. -- ----------------------------
  2054. SET GLOBAL log_bin_trust_function_creators = 1;
  2055. delimiter ;;
  2056. CREATE FUNCTION IF NOT EXISTS `Fun_GetPY`(in_string VARCHAR(255) CHARSET utf8mb4)
  2057. RETURNS varchar(255) CHARSET utf8mb4
  2058. BEGIN
  2059. DECLARE tmp_str VARCHAR(255) CHARSET utf8mb4 DEFAULT '' ;
  2060. DECLARE tmp_len SMALLINT DEFAULT 0;
  2061. DECLARE tmp_loc SMALLINT DEFAULT 0;
  2062. DECLARE tmp_char VARCHAR(2) CHARSET utf8mb4 DEFAULT '';
  2063. DECLARE tmp_rs VARCHAR(255) CHARSET utf8mb4 DEFAULT '';
  2064. DECLARE tmp_cc VARCHAR(2) CHARSET utf8mb4 DEFAULT '';
  2065. SET tmp_str = in_string;
  2066. SET tmp_len = LENGTH(tmp_str);
  2067. WHILE tmp_len > 0 DO
  2068. SET tmp_char = LEFT(tmp_str,1);
  2069. SET tmp_cc = tmp_char;
  2070. SET tmp_loc=INTERVAL(CONV(HEX(tmp_char),16,10),0xB0A1,0xB0C5,0xB2C1,0xB4EE,0xB6EA,0xB7A2,0xB8C1,0xB9FE,0xBBF7,0xBFA6,0xC0AC
  2071. ,0xC2E8,0xC4C3,0xC5B6,0xC5BE,0xC6DA,0xC8BB,0xC8F6,0xCBFA,0xCDDA ,0xCEF4,0xD1B9,0xD4D1);
  2072. IF (LENGTH(tmp_char)>1 AND tmp_loc>0 AND tmp_loc<24) THEN
  2073. SELECT ELT(tmp_loc,'a','b','c','d','e','f','g','h','j','k','l','m','n','o','p','q','r','s','t','w','x','y','z') INTO tmp_cc;
  2074. END IF;
  2075. IF ASCII(tmp_cc)>96 AND ASCII(tmp_cc) <123
  2076. THEN
  2077. SET tmp_rs = CONCAT(tmp_rs,tmp_cc);
  2078. ELSE
  2079. SET tmp_rs = CONCAT(tmp_rs,tmp_char);
  2080. END IF;
  2081. SET tmp_str = SUBSTRING(tmp_str,2);
  2082. SET tmp_len = LENGTH(tmp_str);
  2083. END WHILE;
  2084. RETURN tmp_rs;
  2085. END
  2086. ;;
  2087. delimiter ;
  2088. SET FOREIGN_KEY_CHECKS = 1;