structure.sql 155 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847
  1. /*
  2. Navicat Premium Dump SQL
  3. Source Server : dev32&dev4.hlace.com-mariadb
  4. Source Server Type : MariaDB
  5. Source Server Version : 110602 (11.6.2-MariaDB)
  6. Source Host : localhost:3306
  7. Source Schema : dev4
  8. Target Server Type : MariaDB
  9. Target Server Version : 110602 (11.6.2-MariaDB)
  10. File Encoding : 65001
  11. Date: 20/03/2025 10:37:52
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for t_achievements
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `t_achievements`;
  19. CREATE TABLE `t_achievements` (
  20. `achievements_id` int(11) NOT NULL AUTO_INCREMENT,
  21. `total_goal` double(22, 0) NOT NULL,
  22. `no_customer_tag` double(5, 2) NULL DEFAULT 0.00,
  23. `customer_tag` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  24. `ctime` datetime NULL DEFAULT NULL,
  25. `utime` datetime NULL DEFAULT NULL,
  26. `dtime` datetime NULL DEFAULT NULL,
  27. PRIMARY KEY (`achievements_id`) USING BTREE
  28. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  29. -- ----------------------------
  30. -- Table structure for t_achievements_group
  31. -- ----------------------------
  32. DROP TABLE IF EXISTS `t_achievements_group`;
  33. CREATE TABLE `t_achievements_group` (
  34. `achievements_group_id` int(11) NOT NULL AUTO_INCREMENT,
  35. `group_total_goal` double(22, 0) NOT NULL,
  36. `achievements_group_title` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  37. `achievements_group_users` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  38. PRIMARY KEY (`achievements_group_id`) USING BTREE
  39. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  40. -- ----------------------------
  41. -- Table structure for t_affair
  42. -- ----------------------------
  43. DROP TABLE IF EXISTS `t_affair`;
  44. CREATE TABLE `t_affair` (
  45. `affair_id` int(11) NOT NULL AUTO_INCREMENT,
  46. `affair_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  47. `affair_icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  48. `affair_tablename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  49. `affair_is_buildin` tinyint(1) NULL DEFAULT 0,
  50. `affair_group_id` int(11) NULL DEFAULT NULL,
  51. `version` int(11) NULL DEFAULT NULL,
  52. `lock_time` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  53. `lock_user` int(11) NULL DEFAULT NULL,
  54. PRIMARY KEY (`affair_id`) USING BTREE,
  55. UNIQUE INDEX `affair_name`(`affair_name` ASC) USING BTREE,
  56. INDEX `affair_group_id`(`affair_group_id` ASC) USING BTREE,
  57. CONSTRAINT `t_affair_ibfk_1` FOREIGN KEY (`affair_group_id`) REFERENCES `t_affair_group` (`affair_group_id`) ON DELETE SET NULL ON UPDATE CASCADE
  58. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  59. -- ----------------------------
  60. -- Table structure for t_affair_bar
  61. -- ----------------------------
  62. DROP TABLE IF EXISTS `t_affair_bar`;
  63. CREATE TABLE `t_affair_bar` (
  64. `bar_id` int(11) NOT NULL AUTO_INCREMENT,
  65. `user_id` int(11) NOT NULL,
  66. `affairIds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  67. `utime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  68. `affair_category` tinyint(1) NULL DEFAULT 0,
  69. `affair_category_id` int(11) NULL DEFAULT 0,
  70. `affair_selected` int(11) NULL DEFAULT NULL,
  71. PRIMARY KEY (`bar_id`) USING BTREE,
  72. INDEX `user_id`(`user_id` ASC) USING BTREE,
  73. CONSTRAINT `t_affair_bar_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  74. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  75. -- ----------------------------
  76. -- Table structure for t_affair_calculation
  77. -- ----------------------------
  78. DROP TABLE IF EXISTS `t_affair_calculation`;
  79. CREATE TABLE `t_affair_calculation` (
  80. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  81. `affair_id` int(11) NOT NULL,
  82. `calculation_formula` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  83. `calculation_formula_title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  84. `calculation_result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  85. `calculation_result_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  86. `calculation_result_accuracy` tinyint(1) NULL DEFAULT 0,
  87. `all_algebras` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  88. `calculation_steps` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  89. `calculation_rounding` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  90. PRIMARY KEY (`calculation_id`) USING BTREE,
  91. INDEX `affair_id`(`affair_id` ASC) USING BTREE,
  92. CONSTRAINT `t_affair_calculation_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  93. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  94. -- ----------------------------
  95. -- Table structure for t_affair_detail
  96. -- ----------------------------
  97. DROP TABLE IF EXISTS `t_affair_detail`;
  98. CREATE TABLE `t_affair_detail` (
  99. `detail_id` int(11) NOT NULL AUTO_INCREMENT,
  100. `detail_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  101. `affair_id` int(11) NOT NULL,
  102. `column_id` int(11) NOT NULL,
  103. `is_manual` int(1) NULL DEFAULT 0,
  104. `is_system` int(1) NULL DEFAULT 0,
  105. PRIMARY KEY (`detail_id`) USING BTREE,
  106. INDEX `affair_id`(`affair_id` ASC) USING BTREE,
  107. CONSTRAINT `t_affair_detail_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  108. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  109. -- ----------------------------
  110. -- Table structure for t_affair_detail_calculation
  111. -- ----------------------------
  112. DROP TABLE IF EXISTS `t_affair_detail_calculation`;
  113. CREATE TABLE `t_affair_detail_calculation` (
  114. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  115. `detail_sub_id` int(11) NOT NULL,
  116. `calculation_formula` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  117. `calculation_formula_title` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  118. `calculation_result` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  119. `calculation_result_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  120. `calculation_result_accuracy` tinyint(1) NULL DEFAULT 0,
  121. `all_algebras` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  122. `calculation_steps` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  123. PRIMARY KEY (`calculation_id`) USING BTREE,
  124. INDEX `detail_sub_id`(`detail_sub_id` ASC) USING BTREE,
  125. CONSTRAINT `t_affair_detail_calculation_ibfk_2` FOREIGN KEY (`detail_sub_id`) REFERENCES `t_affair_detail_sub` (`detail_sub_id`) ON DELETE CASCADE ON UPDATE CASCADE
  126. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  127. -- ----------------------------
  128. -- Table structure for t_affair_detail_sub
  129. -- ----------------------------
  130. DROP TABLE IF EXISTS `t_affair_detail_sub`;
  131. CREATE TABLE `t_affair_detail_sub` (
  132. `detail_sub_id` int(11) NOT NULL AUTO_INCREMENT,
  133. `detail_sub_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  134. `detail_id` int(11) NOT NULL,
  135. `detail_sub_column_names` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  136. `result_column_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  137. `result_column_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  138. `detail_sub_order` int(11) NULL DEFAULT 0,
  139. `is_horizontal` tinyint(1) NULL DEFAULT 0,
  140. `subscript_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  141. PRIMARY KEY (`detail_sub_id`) USING BTREE,
  142. INDEX `detail_id`(`detail_id` ASC) USING BTREE,
  143. CONSTRAINT `t_affair_detail_sub_ibfk_1` FOREIGN KEY (`detail_id`) REFERENCES `t_affair_detail` (`detail_id`) ON DELETE CASCADE ON UPDATE CASCADE
  144. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  145. -- ----------------------------
  146. -- Table structure for t_affair_detail_system_column
  147. -- ----------------------------
  148. DROP TABLE IF EXISTS `t_affair_detail_system_column`;
  149. CREATE TABLE `t_affair_detail_system_column` (
  150. `column_id` int(11) NOT NULL AUTO_INCREMENT,
  151. `column_pid` int(11) NULL DEFAULT 0,
  152. `group_id` int(11) NULL DEFAULT NULL,
  153. `column_order` int(11) NULL DEFAULT NULL,
  154. `column_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  155. `column_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  156. `column_unit` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '[]',
  157. `column_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  158. `column_control` tinyint(1) NULL DEFAULT 0,
  159. `column_rule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  160. `column_is_virtual` tinyint(1) NULL DEFAULT 0,
  161. `column_unit_symbiosis` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  162. `column_detachable` tinyint(1) NULL DEFAULT 0,
  163. `column_branch_calculation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  164. `status` tinyint(2) NULL DEFAULT NULL,
  165. PRIMARY KEY (`column_id`) USING BTREE,
  166. UNIQUE INDEX `column_name`(`column_name` ASC) USING BTREE,
  167. INDEX `group_id`(`group_id` ASC) USING BTREE
  168. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  169. -- ----------------------------
  170. -- Table structure for t_affair_detail_system_column_group
  171. -- ----------------------------
  172. DROP TABLE IF EXISTS `t_affair_detail_system_column_group`;
  173. CREATE TABLE `t_affair_detail_system_column_group` (
  174. `group_id` int(11) NOT NULL AUTO_INCREMENT,
  175. `group_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  176. PRIMARY KEY (`group_id`) USING BTREE
  177. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  178. -- ----------------------------
  179. -- Table structure for t_affair_frequently
  180. -- ----------------------------
  181. DROP TABLE IF EXISTS `t_affair_frequently`;
  182. CREATE TABLE `t_affair_frequently` (
  183. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  184. `user_id` int(11) NOT NULL,
  185. `affair_id` int(11) NOT NULL,
  186. `affair_category` tinyint(1) NULL DEFAULT 0,
  187. `affair_category_id` int(11) NULL DEFAULT 0,
  188. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  189. PRIMARY KEY (`frequently_id`) USING BTREE,
  190. INDEX `affair_id`(`affair_id` ASC) USING BTREE,
  191. INDEX `user_id`(`user_id` ASC) USING BTREE,
  192. CONSTRAINT `t_affair_frequently_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  193. CONSTRAINT `t_affair_frequently_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  194. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  195. -- ----------------------------
  196. -- Table structure for t_affair_group
  197. -- ----------------------------
  198. DROP TABLE IF EXISTS `t_affair_group`;
  199. CREATE TABLE `t_affair_group` (
  200. `affair_group_id` int(11) NOT NULL AUTO_INCREMENT,
  201. `affair_group_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  202. `affair_group_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  203. `status` int(11) NULL DEFAULT 99,
  204. `ctime` datetime NULL DEFAULT NULL,
  205. `utime` datetime NULL DEFAULT NULL,
  206. `dtime` datetime NULL DEFAULT NULL,
  207. PRIMARY KEY (`affair_group_id`) USING BTREE
  208. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  209. -- ----------------------------
  210. -- Table structure for t_affair_modify_record
  211. -- ----------------------------
  212. DROP TABLE IF EXISTS `t_affair_modify_record`;
  213. CREATE TABLE `t_affair_modify_record` (
  214. `record_id` int(11) NOT NULL AUTO_INCREMENT,
  215. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  216. `affair_id` int(11) NOT NULL,
  217. `user_id` int(11) NOT NULL,
  218. `record_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  219. `ctime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  220. `type` tinyint(1) NULL DEFAULT 0,
  221. PRIMARY KEY (`record_id`) USING BTREE,
  222. INDEX `user_id`(`user_id` ASC) USING BTREE,
  223. INDEX `type`(`type` ASC) USING BTREE,
  224. CONSTRAINT `t_affair_modify_record_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  225. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  226. -- ----------------------------
  227. -- Table structure for t_affair_rule
  228. -- ----------------------------
  229. DROP TABLE IF EXISTS `t_affair_rule`;
  230. CREATE TABLE `t_affair_rule` (
  231. `rule_id` int(11) NOT NULL AUTO_INCREMENT,
  232. `affair_id` int(11) NULL DEFAULT NULL,
  233. `sheet_id` int(11) NULL DEFAULT NULL,
  234. `user_id` int(11) NULL DEFAULT NULL,
  235. `rule_allow_use` tinyint(1) NULL DEFAULT 0,
  236. `rule_allow_view` tinyint(1) NULL DEFAULT 0,
  237. `rule_allow_view_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  238. PRIMARY KEY (`rule_id`) USING BTREE,
  239. INDEX `sheet_id`(`sheet_id` ASC) USING BTREE,
  240. CONSTRAINT `t_affair_rule_ibfk_1` FOREIGN KEY (`sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE RESTRICT
  241. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  242. -- ----------------------------
  243. -- Table structure for t_affair_sheet
  244. -- ----------------------------
  245. DROP TABLE IF EXISTS `t_affair_sheet`;
  246. CREATE TABLE `t_affair_sheet` (
  247. `sheet_id` int(11) NOT NULL AUTO_INCREMENT,
  248. `sheet_prev_id` int(11) NULL DEFAULT NULL,
  249. `sheet_next_id` int(11) NULL DEFAULT NULL,
  250. `affair_id` int(11) NOT NULL,
  251. `sheet_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  252. `sheet_tablename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  253. `sheet_rule_use_option` tinyint(1) NULL DEFAULT NULL,
  254. `sheet_rule_view_option` tinyint(1) NULL DEFAULT NULL,
  255. `sheet_join_order` tinyint(1) NULL DEFAULT 0,
  256. PRIMARY KEY (`sheet_id`) USING BTREE,
  257. INDEX `affair_id`(`affair_id` ASC) USING BTREE,
  258. CONSTRAINT `t_affair_sheet_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  259. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  260. -- ----------------------------
  261. -- Table structure for t_affair_sheet_column
  262. -- ----------------------------
  263. DROP TABLE IF EXISTS `t_affair_sheet_column`;
  264. CREATE TABLE `t_affair_sheet_column` (
  265. `sheet_column_id` int(11) NOT NULL AUTO_INCREMENT,
  266. `sheet_column_pid` int(11) NULL DEFAULT 0,
  267. `column_id` int(11) NULL DEFAULT NULL,
  268. `sheet_id` int(11) NULL DEFAULT NULL,
  269. `sheet_group_id` int(11) NULL DEFAULT NULL,
  270. `column_is_require` tinyint(1) NULL DEFAULT 0,
  271. `column_is_summary` tinyint(1) NULL DEFAULT 0,
  272. `column_order` int(11) NULL DEFAULT 0,
  273. `column_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  274. `detail_id` int(11) NULL DEFAULT NULL,
  275. PRIMARY KEY (`sheet_column_id`) USING BTREE,
  276. INDEX `sheet_id`(`sheet_id` ASC) USING BTREE,
  277. INDEX `system_column_id`(`column_id` ASC) USING BTREE,
  278. CONSTRAINT `t_affair_sheet_column_ibfk_1` FOREIGN KEY (`sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  279. CONSTRAINT `t_affair_sheet_column_ibfk_2` FOREIGN KEY (`column_id`) REFERENCES `t_affair_system_column` (`column_id`) ON DELETE CASCADE ON UPDATE CASCADE
  280. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  281. -- ----------------------------
  282. -- Table structure for t_affair_sheet_column_group
  283. -- ----------------------------
  284. DROP TABLE IF EXISTS `t_affair_sheet_column_group`;
  285. CREATE TABLE `t_affair_sheet_column_group` (
  286. `sheet_group_id` int(11) NOT NULL AUTO_INCREMENT,
  287. `sheet_group_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  288. `sheet_id` int(11) NULL DEFAULT NULL,
  289. PRIMARY KEY (`sheet_group_id`) USING BTREE,
  290. INDEX `sheet_id`(`sheet_id` ASC) USING BTREE,
  291. CONSTRAINT `t_affair_sheet_column_group_ibfk_1` FOREIGN KEY (`sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE RESTRICT
  292. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  293. -- ----------------------------
  294. -- Table structure for t_affair_statistic
  295. -- ----------------------------
  296. DROP TABLE IF EXISTS `t_affair_statistic`;
  297. CREATE TABLE `t_affair_statistic` (
  298. `statistic_id` int(11) NOT NULL AUTO_INCREMENT,
  299. `affair_id` int(11) NOT NULL,
  300. `column_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  301. `statistic_type` tinyint(1) NOT NULL DEFAULT 1,
  302. `statistic_accuracy` tinyint(1) NULL DEFAULT 0,
  303. PRIMARY KEY (`statistic_id`) USING BTREE,
  304. INDEX `affair_id`(`affair_id` ASC) USING BTREE,
  305. CONSTRAINT `t_affair_statistic_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  306. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  307. -- ----------------------------
  308. -- Table structure for t_affair_system_column
  309. -- ----------------------------
  310. DROP TABLE IF EXISTS `t_affair_system_column`;
  311. CREATE TABLE `t_affair_system_column` (
  312. `column_id` int(11) NOT NULL AUTO_INCREMENT,
  313. `column_pid` int(11) NULL DEFAULT 0,
  314. `group_id` int(11) NULL DEFAULT NULL,
  315. `column_order` int(11) NULL DEFAULT NULL,
  316. `column_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  317. `column_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  318. `column_unit` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '[]',
  319. `column_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  320. `column_control` tinyint(4) NULL DEFAULT 0,
  321. `column_pid_control` tinyint(4) NULL DEFAULT 0,
  322. `column_rule` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  323. `column_is_virtual` tinyint(1) NULL DEFAULT 0,
  324. `column_unit_symbiosis` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  325. `column_detachable` tinyint(1) NULL DEFAULT 0,
  326. `column_branch_calculation` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  327. `status` tinyint(255) NULL DEFAULT NULL,
  328. PRIMARY KEY (`column_id`) USING BTREE,
  329. UNIQUE INDEX `column_name`(`column_name` ASC) USING BTREE,
  330. INDEX `group_id`(`group_id` ASC) USING BTREE
  331. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  332. -- ----------------------------
  333. -- Table structure for t_affair_system_column_group
  334. -- ----------------------------
  335. DROP TABLE IF EXISTS `t_affair_system_column_group`;
  336. CREATE TABLE `t_affair_system_column_group` (
  337. `group_id` int(11) NOT NULL AUTO_INCREMENT,
  338. `group_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  339. PRIMARY KEY (`group_id`) USING BTREE
  340. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  341. -- ----------------------------
  342. -- Table structure for t_bill
  343. -- ----------------------------
  344. DROP TABLE IF EXISTS `t_bill`;
  345. CREATE TABLE `t_bill` (
  346. `bill_id` int(11) NOT NULL AUTO_INCREMENT,
  347. `bill_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  348. `bill_number_user_defined` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  349. `bill_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  350. `bill_desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  351. `bill_count` int(11) NULL DEFAULT 0,
  352. `status` int(2) NULL DEFAULT 99,
  353. `ctime` datetime NULL DEFAULT NULL,
  354. `utime` datetime NULL DEFAULT NULL,
  355. `permission` int(1) NULL DEFAULT 1,
  356. `order_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  357. `bill_limit` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  358. `bill_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  359. `bill_affair_Ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  360. `bill_type` tinyint(1) NULL DEFAULT 0,
  361. `bill_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  362. `bill_merge_condition` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  363. `bill_set_explain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '0',
  364. `bill_use_template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  365. `permission_view` tinyint(1) NULL DEFAULT 1,
  366. PRIMARY KEY (`bill_id`) USING BTREE
  367. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  368. -- ----------------------------
  369. -- Table structure for t_bill_order
  370. -- ----------------------------
  371. DROP TABLE IF EXISTS `t_bill_order`;
  372. CREATE TABLE `t_bill_order` (
  373. `bill_order_id` int(11) NOT NULL AUTO_INCREMENT,
  374. `bill_id` int(11) NULL DEFAULT NULL,
  375. `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  376. `bill_order_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  377. `bill_order_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  378. `bill_affair_data_Ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  379. `status` int(2) NULL DEFAULT 99,
  380. `ctime` datetime NULL DEFAULT NULL,
  381. `ptime` datetime NULL DEFAULT NULL,
  382. `bill_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  383. `printer_status` int(1) NULL DEFAULT 0,
  384. `bill_order_supplement` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  385. `bill_order_header` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  386. `bill_explain` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  387. `bill_object` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  388. `bill_amount` decimal(18, 3) NULL DEFAULT NULL,
  389. `bill_pnames` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  390. `order_first_time` datetime NULL DEFAULT NULL,
  391. `order_last_time` datetime NULL DEFAULT NULL,
  392. `stime` datetime NULL DEFAULT NULL,
  393. `share_user_id` int(11) NULL DEFAULT NULL,
  394. `order_user_id` int(11) NULL DEFAULT NULL,
  395. `create_bill_order_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  396. `total_affair_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  397. `waste_user_id` int(11) NULL DEFAULT NULL,
  398. `wtime` datetime NULL DEFAULT NULL,
  399. PRIMARY KEY (`bill_order_id`) USING BTREE,
  400. UNIQUE INDEX `bill_order_number`(`bill_order_number` ASC) USING BTREE,
  401. INDEX `bill_id`(`bill_id` ASC) USING BTREE,
  402. INDEX `status`(`status` ASC, `bill_id` ASC) USING BTREE,
  403. INDEX `printer_status`(`printer_status` ASC, `bill_id` ASC) USING BTREE,
  404. CONSTRAINT `t_bill_order_ibfk_1` FOREIGN KEY (`bill_id`) REFERENCES `t_bill` (`bill_id`) ON DELETE CASCADE ON UPDATE CASCADE
  405. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  406. -- ----------------------------
  407. -- Table structure for t_bill_permission
  408. -- ----------------------------
  409. DROP TABLE IF EXISTS `t_bill_permission`;
  410. CREATE TABLE `t_bill_permission` (
  411. `bill_per_id` int(11) NOT NULL AUTO_INCREMENT,
  412. `bill_id` int(11) NOT NULL,
  413. `user_id` int(11) NOT NULL DEFAULT 0,
  414. `allow` tinyint(1) NULL DEFAULT 0,
  415. PRIMARY KEY (`bill_per_id`) USING BTREE,
  416. INDEX `user_id`(`user_id` ASC) USING BTREE,
  417. INDEX `bill_per_id`(`bill_per_id` ASC) USING BTREE,
  418. INDEX `bill_id`(`bill_id` ASC) USING BTREE,
  419. CONSTRAINT `t_bill_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  420. CONSTRAINT `t_bill_permission_ibfk_3` FOREIGN KEY (`bill_id`) REFERENCES `t_bill` (`bill_id`) ON DELETE CASCADE ON UPDATE CASCADE
  421. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  422. -- ----------------------------
  423. -- Table structure for t_bill_subtitle
  424. -- ----------------------------
  425. DROP TABLE IF EXISTS `t_bill_subtitle`;
  426. CREATE TABLE `t_bill_subtitle` (
  427. `bill_subtitle_id` int(11) NOT NULL AUTO_INCREMENT,
  428. `bill_id` int(11) NOT NULL,
  429. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  430. `bill_subtitle_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  431. PRIMARY KEY (`bill_subtitle_id`) USING BTREE,
  432. INDEX `bill_id`(`bill_id` ASC) USING BTREE,
  433. CONSTRAINT `t_bill_subtitle_ibfk_2` FOREIGN KEY (`bill_id`) REFERENCES `t_bill` (`bill_id`) ON DELETE CASCADE ON UPDATE CASCADE
  434. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  435. -- ----------------------------
  436. -- Table structure for t_cas_tgt
  437. -- ----------------------------
  438. DROP TABLE IF EXISTS `t_cas_tgt`;
  439. CREATE TABLE `t_cas_tgt` (
  440. `tgt_id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  441. `user_id` int(11) NULL DEFAULT NULL,
  442. `tgt_last_used` datetime NULL DEFAULT NULL,
  443. `tgt_use_times` int(11) NULL DEFAULT NULL,
  444. `tgt_platform` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  445. `tgt_kick_step` int(255) NULL DEFAULT NULL,
  446. `ctime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  447. PRIMARY KEY (`tgt_id`) USING BTREE
  448. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  449. -- ----------------------------
  450. -- Table structure for t_cas_st
  451. -- ----------------------------
  452. DROP TABLE IF EXISTS `t_cas_st`;
  453. CREATE TABLE `t_cas_st` (
  454. `st_id` varchar(23) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  455. `user_id` int(11) NULL DEFAULT NULL,
  456. `tgt_id` varchar(24) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  457. `st_service` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  458. `st_device` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  459. `deviceId` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  460. `deviceToken` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  461. `user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  462. `st_ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  463. `st_last_used` datetime NULL DEFAULT NULL,
  464. `st_use_times` int(11) NULL DEFAULT NULL,
  465. `ctime` datetime NULL DEFAULT NULL,
  466. `utime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  467. `dtime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  468. `status` int(11) NULL DEFAULT NULL,
  469. PRIMARY KEY (`st_id`) USING BTREE,
  470. INDEX `tgt_id`(`tgt_id` ASC) USING BTREE,
  471. CONSTRAINT `t_cas_st_ibfk_1` FOREIGN KEY (`tgt_id`) REFERENCES `t_cas_tgt` (`tgt_id`) ON DELETE CASCADE ON UPDATE CASCADE
  472. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  473. -- ----------------------------
  474. -- Table structure for t_collection
  475. -- ----------------------------
  476. DROP TABLE IF EXISTS `t_collection`;
  477. CREATE TABLE `t_collection` (
  478. `collection_id` int(11) NOT NULL AUTO_INCREMENT,
  479. `user_id` int(11) NULL DEFAULT NULL,
  480. `company_id` int(11) NOT NULL,
  481. `image_id` int(11) NULL DEFAULT NULL,
  482. `product_id` int(11) NULL DEFAULT NULL,
  483. `collection_image_id` int(11) NULL DEFAULT NULL,
  484. `collection_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  485. `collection_pname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  486. `collection_cname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  487. `collection_type` tinyint(2) NOT NULL DEFAULT 0,
  488. `collection_state` tinyint(2) NULL DEFAULT 0,
  489. `collection_price` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  490. `collection_price_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  491. `collection_inventory` decimal(13, 3) NULL DEFAULT NULL,
  492. `collection_inventory_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  493. `collection_width` decimal(13, 2) NULL DEFAULT NULL,
  494. `collection_width_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  495. `collection_height` decimal(13, 2) NULL DEFAULT NULL,
  496. `collection_height_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  497. `collection_freeheight` decimal(13, 2) NULL DEFAULT NULL,
  498. `collection_freeheight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  499. `collection_weight` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  500. `collection_weight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  501. `collection_elasticity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  502. `collection_mtype` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  503. `collection_material` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  504. `collection_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  505. `ctime` datetime NOT NULL,
  506. `utime` datetime NULL DEFAULT NULL,
  507. `dtime` datetime NULL DEFAULT NULL,
  508. `status` tinyint(2) NOT NULL DEFAULT 99,
  509. `collection_gram_weight` decimal(13, 2) NULL DEFAULT NULL,
  510. `collection_gram_weight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT 'g/m2',
  511. `collection_tag_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  512. `product_cloth_price_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  513. `product_product_price_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  514. `product_cloth_price` decimal(13, 2) NULL DEFAULT NULL,
  515. `product_product_price` decimal(13, 2) NULL DEFAULT NULL,
  516. `push_result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  517. `recv_result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  518. `search_id` int(10) UNSIGNED NULL DEFAULT NULL,
  519. `search_status` int(1) NULL DEFAULT NULL,
  520. PRIMARY KEY (`collection_id`) USING BTREE,
  521. INDEX `image_id`(`image_id` ASC) USING BTREE,
  522. INDEX `user_id`(`user_id` ASC) USING BTREE,
  523. INDEX `company_id`(`company_id` ASC) USING BTREE,
  524. FULLTEXT INDEX `collection_pname`(`collection_pname`),
  525. FULLTEXT INDEX `collection_cname`(`collection_cname`),
  526. CONSTRAINT `t_collection_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  527. CONSTRAINT `t_collection_ibfk_3` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE
  528. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  529. -- ----------------------------
  530. -- Table structure for t_company
  531. -- ----------------------------
  532. DROP TABLE IF EXISTS `t_company`;
  533. CREATE TABLE `t_company` (
  534. `company_id` int(11) NOT NULL AUTO_INCREMENT,
  535. `location_id` int(11) NULL DEFAULT NULL,
  536. `company_type` tinyint(1) NULL DEFAULT 0,
  537. `company_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  538. `company_shortname` varchar(12) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  539. `company_major` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  540. `company_urlname` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  541. `company_cert` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  542. `company_tel` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  543. `company_fax` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  544. `company_qq` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  545. `company_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  546. `company_ctime` date NULL DEFAULT NULL,
  547. `company_addr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  548. `company_corporation` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  549. `company_copy` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  550. `company_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  551. `viewtimes` int(11) NULL DEFAULT 0,
  552. `company_follows` int(11) NULL DEFAULT 0,
  553. `is_vip` tinyint(1) NULL DEFAULT 0,
  554. `status` int(11) NULL DEFAULT 0,
  555. `ctime` datetime NOT NULL,
  556. `utime` datetime NULL DEFAULT NULL,
  557. `dtime` datetime NULL DEFAULT NULL,
  558. `tagIds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  559. `customerGroupId` int(11) NULL DEFAULT 0,
  560. `company_program` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  561. `version` int(11) NULL DEFAULT NULL,
  562. `company_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  563. PRIMARY KEY (`company_id`) USING BTREE,
  564. INDEX `FK_Reference_29`(`location_id` ASC) USING BTREE,
  565. INDEX `customerGroupId`(`customerGroupId` ASC) USING BTREE,
  566. INDEX `company_name`(`company_name` ASC) USING BTREE,
  567. INDEX `company_shortname`(`company_shortname` ASC) USING BTREE,
  568. INDEX `company_urlname`(`company_urlname` ASC) USING BTREE,
  569. CONSTRAINT `FK_Reference_29` FOREIGN KEY (`location_id`) REFERENCES `t_location` (`location_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  570. CONSTRAINT `t_company_ibfk_1` FOREIGN KEY (`customerGroupId`) REFERENCES `t_customer_group` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
  571. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  572. -- ----------------------------
  573. -- Table structure for t_confidential_cabinet
  574. -- ----------------------------
  575. DROP TABLE IF EXISTS `t_confidential_cabinet`;
  576. CREATE TABLE `t_confidential_cabinet` (
  577. `cabinet_id` int(11) NOT NULL AUTO_INCREMENT,
  578. `cabinet_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  579. `permission` tinyint(1) NULL DEFAULT 0,
  580. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  581. `user_id` int(11) NULL DEFAULT NULL,
  582. `company_id` int(11) NULL DEFAULT NULL,
  583. `ctime` datetime NULL DEFAULT NULL,
  584. `utime` datetime NULL DEFAULT NULL,
  585. PRIMARY KEY (`cabinet_id`) USING BTREE
  586. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  587. -- ----------------------------
  588. -- Table structure for t_confidential_lock
  589. -- ----------------------------
  590. DROP TABLE IF EXISTS `t_confidential_lock`;
  591. CREATE TABLE `t_confidential_lock` (
  592. `lock_id` int(11) NOT NULL AUTO_INCREMENT,
  593. `lock_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  594. `lock_password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  595. `lock_time` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  596. `user_id` int(11) NULL DEFAULT NULL,
  597. `company_id` int(11) NULL DEFAULT NULL,
  598. `ctime` datetime NULL DEFAULT NULL,
  599. `utime` datetime NULL DEFAULT NULL,
  600. PRIMARY KEY (`lock_id`) USING BTREE
  601. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  602. -- ----------------------------
  603. -- Table structure for t_confidential_relation
  604. -- ----------------------------
  605. DROP TABLE IF EXISTS `t_confidential_relation`;
  606. CREATE TABLE `t_confidential_relation` (
  607. `relation_id` int(11) NOT NULL AUTO_INCREMENT,
  608. `lock_id` int(11) NOT NULL,
  609. `cabinet_id` int(11) NOT NULL,
  610. PRIMARY KEY (`relation_id`) USING BTREE,
  611. INDEX `lock_id`(`lock_id` ASC) USING BTREE,
  612. INDEX `cabinet_id`(`cabinet_id` ASC) USING BTREE,
  613. CONSTRAINT `t_confidential_relation_ibfk_1` FOREIGN KEY (`lock_id`) REFERENCES `t_confidential_lock` (`lock_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  614. CONSTRAINT `t_confidential_relation_ibfk_2` FOREIGN KEY (`cabinet_id`) REFERENCES `t_confidential_cabinet` (`cabinet_id`) ON DELETE CASCADE ON UPDATE CASCADE
  615. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  616. -- ----------------------------
  617. -- Table structure for t_customer
  618. -- ----------------------------
  619. DROP TABLE IF EXISTS `t_customer`;
  620. CREATE TABLE `t_customer` (
  621. `id` int(11) NOT NULL AUTO_INCREMENT,
  622. `companyId` int(11) NOT NULL DEFAULT 0,
  623. `addUserId` int(11) NOT NULL,
  624. `customerCompanyId` int(11) NULL DEFAULT NULL,
  625. `avatarImageId` int(11) NULL DEFAULT NULL,
  626. `avatarImage` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  627. `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  628. `customer_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  629. `customer_qq` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  630. `customer_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  631. `customer_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  632. `tagIds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  633. `visitUserIds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  634. `state` int(11) NULL DEFAULT 0,
  635. `status` int(11) NULL DEFAULT 99,
  636. `createAt` datetime NULL DEFAULT NULL,
  637. `updateAt` datetime NULL DEFAULT NULL,
  638. `deleteAt` datetime NULL DEFAULT NULL,
  639. `groupId` int(11) NULL DEFAULT NULL,
  640. `card1ImageId` int(11) NULL DEFAULT NULL,
  641. `card2ImageId` int(11) NULL DEFAULT NULL,
  642. `card3ImageId` int(11) NULL DEFAULT NULL,
  643. `representative` tinyint(1) NULL DEFAULT 0,
  644. `customer_add` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  645. `customer_phone2` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  646. `customer_phone3` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  647. `customer_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  648. PRIMARY KEY (`id`) USING BTREE,
  649. INDEX `companyId`(`companyId` ASC) USING BTREE,
  650. INDEX `t_customer_ibfk_2`(`customerCompanyId` ASC) USING BTREE,
  651. INDEX `id`(`id` ASC, `customerCompanyId` ASC) USING BTREE,
  652. INDEX `groupId`(`groupId` ASC) USING BTREE,
  653. CONSTRAINT `t_customer_ibfk_1` FOREIGN KEY (`companyId`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  654. CONSTRAINT `t_customer_ibfk_2` FOREIGN KEY (`customerCompanyId`) REFERENCES `t_company` (`company_id`) ON DELETE SET NULL ON UPDATE RESTRICT,
  655. CONSTRAINT `t_customer_ibfk_3` FOREIGN KEY (`groupId`) REFERENCES `t_customer_group` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
  656. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  657. -- ----------------------------
  658. -- Table structure for t_customer_category
  659. -- ----------------------------
  660. DROP TABLE IF EXISTS `t_customer_category`;
  661. CREATE TABLE `t_customer_category` (
  662. `customer_category_id` int(11) NOT NULL AUTO_INCREMENT,
  663. `companyId` int(11) NOT NULL,
  664. `userId` int(11) NOT NULL,
  665. `customer_category_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  666. `customer_category_notes` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  667. `usedCount` int(11) NULL DEFAULT 0,
  668. `status` int(11) NULL DEFAULT 99,
  669. `createAt` datetime NULL DEFAULT NULL,
  670. `updateAt` datetime NULL DEFAULT NULL,
  671. `deleteAt` datetime NULL DEFAULT NULL,
  672. `permission` tinyint(1) NULL DEFAULT 1,
  673. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  674. PRIMARY KEY (`customer_category_id`) USING BTREE,
  675. INDEX `companyId`(`companyId` ASC) USING BTREE,
  676. INDEX `userId`(`userId` ASC) USING BTREE,
  677. CONSTRAINT `t_customer_category_ibfk_1` FOREIGN KEY (`companyId`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  678. CONSTRAINT `t_customer_category_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  679. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  680. -- ----------------------------
  681. -- Table structure for t_customer_given
  682. -- ----------------------------
  683. DROP TABLE IF EXISTS `t_customer_given`;
  684. CREATE TABLE `t_customer_given` (
  685. `id` int(11) NOT NULL AUTO_INCREMENT,
  686. `givenKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  687. `companyId` int(11) NULL DEFAULT NULL,
  688. PRIMARY KEY (`id`) USING BTREE
  689. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  690. -- ----------------------------
  691. -- Table structure for t_customer_group
  692. -- ----------------------------
  693. DROP TABLE IF EXISTS `t_customer_group`;
  694. CREATE TABLE `t_customer_group` (
  695. `id` int(11) NOT NULL AUTO_INCREMENT,
  696. `companyId` int(11) NOT NULL,
  697. `userId` int(11) NOT NULL,
  698. `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  699. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  700. `usedCount` int(11) NULL DEFAULT 0,
  701. `status` int(11) NULL DEFAULT 99,
  702. `createAt` datetime NULL DEFAULT NULL,
  703. `updateAt` datetime NULL DEFAULT NULL,
  704. `deleteAt` datetime NULL DEFAULT NULL,
  705. `permission` tinyint(1) NULL DEFAULT 1,
  706. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  707. `customer_category_id` int(11) NULL DEFAULT NULL,
  708. PRIMARY KEY (`id`) USING BTREE,
  709. INDEX `companyId`(`companyId` ASC) USING BTREE,
  710. INDEX `userId`(`userId` ASC) USING BTREE,
  711. CONSTRAINT `t_customer_group_ibfk_1` FOREIGN KEY (`companyId`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  712. CONSTRAINT `t_customer_group_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  713. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  714. -- ----------------------------
  715. -- Table structure for t_customer_visible
  716. -- ----------------------------
  717. DROP TABLE IF EXISTS `t_customer_visible`;
  718. CREATE TABLE `t_customer_visible` (
  719. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  720. `userId` int(11) NOT NULL,
  721. `objectKey` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  722. `companyId` int(11) NULL DEFAULT NULL,
  723. PRIMARY KEY (`id`) USING BTREE,
  724. INDEX `userId`(`userId` ASC, `objectKey` ASC) USING BTREE,
  725. CONSTRAINT `t_customer_visible_ibfk_2` FOREIGN KEY (`userId`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  726. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  727. -- ----------------------------
  728. -- Table structure for t_customized
  729. -- ----------------------------
  730. DROP TABLE IF EXISTS `t_customized`;
  731. CREATE TABLE `t_customized` (
  732. `customized_id` int(11) NOT NULL AUTO_INCREMENT,
  733. `customized_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  734. `customized_shortname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  735. `customized_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  736. `customized_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  737. `customized_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  738. `customized_type` tinyint(1) NULL DEFAULT NULL,
  739. `permission` tinyint(1) NULL DEFAULT 0,
  740. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  741. `ctime` datetime NULL DEFAULT NULL,
  742. `utime` datetime NULL DEFAULT NULL,
  743. `company_id` int(11) NULL DEFAULT NULL,
  744. `customized_other` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  745. `view_permission` tinyint(1) NULL DEFAULT 2,
  746. `view_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  747. `customized_template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  748. `status` int(2) NULL DEFAULT 99,
  749. PRIMARY KEY (`customized_id`) USING BTREE
  750. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  751. -- ----------------------------
  752. -- Table structure for t_department
  753. -- ----------------------------
  754. DROP TABLE IF EXISTS `t_department`;
  755. CREATE TABLE `t_department` (
  756. `department_id` int(255) NOT NULL AUTO_INCREMENT,
  757. `department_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  758. `department_pid` int(255) NULL DEFAULT 0,
  759. PRIMARY KEY (`department_id`) USING BTREE
  760. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  761. -- ----------------------------
  762. -- Table structure for t_documentary
  763. -- ----------------------------
  764. DROP TABLE IF EXISTS `t_documentary`;
  765. CREATE TABLE `t_documentary` (
  766. `documentary_id` int(11) NOT NULL AUTO_INCREMENT,
  767. `documentary_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  768. `documentary_number_pid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  769. `documentary_product_id` int(11) NULL DEFAULT NULL,
  770. `documentary_object` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  771. `documentary_state` tinyint(1) NULL DEFAULT 0,
  772. `documentary_type` int(11) NULL DEFAULT 1,
  773. `receive_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  774. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  775. `companyId` int(11) NULL DEFAULT NULL,
  776. `user_id` int(11) NULL DEFAULT NULL,
  777. `ctime` datetime NULL DEFAULT NULL,
  778. `utime` datetime NULL DEFAULT NULL,
  779. PRIMARY KEY (`documentary_id`, `documentary_number`) USING BTREE,
  780. UNIQUE INDEX `documentary_number`(`documentary_number_pid` ASC, `documentary_number` ASC) USING BTREE,
  781. UNIQUE INDEX `documentary_number_2`(`documentary_number` ASC) USING BTREE,
  782. INDEX `documentary_number_pid`(`documentary_number_pid` ASC, `documentary_state` ASC) USING BTREE
  783. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  784. -- ----------------------------
  785. -- Table structure for t_documentary_reply
  786. -- ----------------------------
  787. DROP TABLE IF EXISTS `t_documentary_reply`;
  788. CREATE TABLE `t_documentary_reply` (
  789. `reply_id` int(11) NOT NULL AUTO_INCREMENT,
  790. `documentary_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  791. `documentary_number_pid` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  792. `documentary_type` int(11) NULL DEFAULT 1,
  793. `reply_user_id` int(11) NULL DEFAULT NULL,
  794. `reply_time` datetime NULL DEFAULT NULL,
  795. `reply_txt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  796. `reply_image` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  797. `reply_voice` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  798. `reply_notice` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  799. `viewed_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  800. `notice_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  801. PRIMARY KEY (`reply_id`, `documentary_number`) USING BTREE,
  802. INDEX `documentary_number`(`documentary_number` ASC) USING BTREE,
  803. CONSTRAINT `t_documentary_reply_ibfk_1` FOREIGN KEY (`documentary_number`) REFERENCES `t_documentary` (`documentary_number`) ON DELETE CASCADE ON UPDATE CASCADE
  804. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  805. -- ----------------------------
  806. -- Table structure for t_documentary_reply_frequently
  807. -- ----------------------------
  808. DROP TABLE IF EXISTS `t_documentary_reply_frequently`;
  809. CREATE TABLE `t_documentary_reply_frequently` (
  810. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  811. `frequently_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  812. `user_id` int(11) NULL DEFAULT NULL,
  813. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  814. PRIMARY KEY (`frequently_id`) USING BTREE
  815. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  816. -- ----------------------------
  817. -- Table structure for t_documentary_statistics
  818. -- ----------------------------
  819. DROP TABLE IF EXISTS `t_documentary_statistics`;
  820. CREATE TABLE `t_documentary_statistics` (
  821. `statistics_id` int(11) NOT NULL AUTO_INCREMENT,
  822. `statistics_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  823. `statistics_number` int(11) NOT NULL DEFAULT 0,
  824. `documentary_type` int(11) NULL DEFAULT 1,
  825. `permission` tinyint(1) NULL DEFAULT 0,
  826. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  827. `companyId` int(11) NULL DEFAULT NULL,
  828. PRIMARY KEY (`statistics_id`) USING BTREE
  829. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  830. -- ----------------------------
  831. -- Table structure for t_documentary_step
  832. -- ----------------------------
  833. DROP TABLE IF EXISTS `t_documentary_step`;
  834. CREATE TABLE `t_documentary_step` (
  835. `step_id` int(11) NOT NULL AUTO_INCREMENT,
  836. `step_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  837. `step_number` int(11) NOT NULL,
  838. `step_is_system` tinyint(1) NULL DEFAULT 0,
  839. `documentary_type` int(11) NULL DEFAULT 1,
  840. `affairIds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  841. `tag_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  842. `ctime` datetime NULL DEFAULT NULL,
  843. `utime` datetime NULL DEFAULT NULL,
  844. `companyId` int(11) NULL DEFAULT 0,
  845. PRIMARY KEY (`step_id`) USING BTREE
  846. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  847. -- ----------------------------
  848. -- Table structure for t_documentary_type
  849. -- ----------------------------
  850. DROP TABLE IF EXISTS `t_documentary_type`;
  851. CREATE TABLE `t_documentary_type` (
  852. `documentary_type` int(11) NOT NULL AUTO_INCREMENT,
  853. `documentary_name` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  854. `documentary_title` varchar(8) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  855. `plan_affair_id` int(11) NULL DEFAULT NULL,
  856. `affair_id` int(11) NULL DEFAULT NULL,
  857. `column_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  858. `permission` tinyint(1) NULL DEFAULT 0,
  859. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  860. `ignore_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  861. `is_system` tinyint(1) NULL DEFAULT 0,
  862. `is_multiple` tinyint(1) NULL DEFAULT 1,
  863. PRIMARY KEY (`documentary_type`) USING BTREE
  864. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  865. -- ----------------------------
  866. -- Table structure for t_early_warning
  867. -- ----------------------------
  868. DROP TABLE IF EXISTS `t_early_warning`;
  869. CREATE TABLE `t_early_warning` (
  870. `warning_id` int(11) NOT NULL AUTO_INCREMENT,
  871. `warning_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  872. `warning_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  873. `warning_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  874. `warning_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  875. `warning_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  876. `warning_other` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  877. `permission` tinyint(1) NULL DEFAULT 0,
  878. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  879. `view_permission` tinyint(1) NULL DEFAULT 2,
  880. `view_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  881. `ctime` datetime NULL DEFAULT NULL,
  882. `utime` datetime NULL DEFAULT NULL,
  883. PRIMARY KEY (`warning_id`) USING BTREE
  884. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  885. -- ----------------------------
  886. -- Table structure for t_early_warning_credit
  887. -- ----------------------------
  888. DROP TABLE IF EXISTS `t_early_warning_credit`;
  889. CREATE TABLE `t_early_warning_credit` (
  890. `credit_id` int(11) NOT NULL AUTO_INCREMENT,
  891. `objectKey` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  892. `credit_value` double(18, 2) NULL DEFAULT NULL,
  893. `period_value` int(18) NULL DEFAULT NULL,
  894. `status` int(2) NULL DEFAULT 99,
  895. `user_id` int(11) NULL DEFAULT NULL,
  896. `ctime` datetime NULL DEFAULT NULL,
  897. `utime` datetime NULL DEFAULT NULL,
  898. PRIMARY KEY (`credit_id`) USING BTREE,
  899. INDEX `user_id`(`user_id` ASC) USING BTREE,
  900. CONSTRAINT `t_early_warning_credit_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  901. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  902. -- ----------------------------
  903. -- Table structure for t_early_warning_personal
  904. -- ----------------------------
  905. DROP TABLE IF EXISTS `t_early_warning_personal`;
  906. CREATE TABLE `t_early_warning_personal` (
  907. `id` int(11) NOT NULL AUTO_INCREMENT,
  908. `user_id` int(11) NOT NULL,
  909. `entry_key` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  910. `entry_value` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  911. `ctime` datetime NULL DEFAULT NULL,
  912. `utime` datetime NULL DEFAULT NULL,
  913. PRIMARY KEY (`id`) USING BTREE,
  914. UNIQUE INDEX `user_id`(`user_id` ASC, `entry_key` ASC) USING BTREE
  915. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  916. -- ----------------------------
  917. -- Table structure for t_edge_distribution
  918. -- ----------------------------
  919. DROP TABLE IF EXISTS `t_edge_distribution`;
  920. CREATE TABLE `t_edge_distribution` (
  921. `edge_distribution_id` int(11) NOT NULL AUTO_INCREMENT,
  922. `notice_affair_id` int(11) NOT NULL,
  923. `from_affair_detail_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  924. `piece_number` int(11) NOT NULL,
  925. `strip_quantity` int(22) NULL DEFAULT NULL,
  926. `single_quantity` decimal(22, 2) NULL DEFAULT NULL,
  927. `total_quantity` decimal(22, 2) NULL DEFAULT NULL,
  928. `responsible_user_id` int(11) NULL DEFAULT NULL,
  929. `loss_price` decimal(22, 5) NULL DEFAULT NULL,
  930. `loss_quantity` decimal(22, 2) NULL DEFAULT NULL,
  931. `loss_amount` decimal(22, 3) NULL DEFAULT NULL,
  932. `loss_time` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  933. `loss_user_id` int(11) NULL DEFAULT NULL,
  934. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  935. PRIMARY KEY (`edge_distribution_id`) USING BTREE,
  936. INDEX `notice_affair_id`(`notice_affair_id` ASC) USING BTREE
  937. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  938. -- ----------------------------
  939. -- Table structure for t_edge_in_calculation
  940. -- ----------------------------
  941. DROP TABLE IF EXISTS `t_edge_in_calculation`;
  942. CREATE TABLE `t_edge_in_calculation` (
  943. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  944. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  945. `affair_id` int(11) NOT NULL,
  946. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  947. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  948. `calculation_key` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  949. `calculation_time` datetime NOT NULL,
  950. `calculation_ctime` datetime NOT NULL,
  951. `calculation_condition` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  952. `calculation_value` decimal(22, 2) NOT NULL,
  953. `calculation_value_unit` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  954. `product_id` int(11) NOT NULL,
  955. `collection_id` int(11) NOT NULL,
  956. `product_color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  957. `product_width` decimal(14, 2) NOT NULL,
  958. `product_height` decimal(14, 2) NOT NULL,
  959. `total_weight` decimal(14, 2) NULL DEFAULT NULL,
  960. `estimate_weight_m_rate` decimal(14, 2) NULL DEFAULT NULL,
  961. `strip_quantity` decimal(14, 0) NULL DEFAULT NULL,
  962. `user_id` int(11) NOT NULL,
  963. `call_time` datetime NOT NULL,
  964. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  965. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  966. INDEX `call_time`(`call_time` ASC) USING BTREE,
  967. INDEX `affair_id`(`affair_id` ASC, `calculation_time` ASC, `calculation_condition` ASC, `tagIds` ASC, `calculation_key` ASC, `product_id` ASC, `product_color` ASC) USING BTREE
  968. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  969. -- ----------------------------
  970. -- Table structure for t_edge_notice_affair
  971. -- ----------------------------
  972. DROP TABLE IF EXISTS `t_edge_notice_affair`;
  973. CREATE TABLE `t_edge_notice_affair` (
  974. `notice_affair_id` int(11) NOT NULL AUTO_INCREMENT,
  975. `affair_id` int(11) NOT NULL,
  976. `affair_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  977. `from_affair_id` int(11) NOT NULL,
  978. `from_affair_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  979. `colleague_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  980. `notice_state` tinyint(1) NULL DEFAULT 0,
  981. `edge_distribution_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  982. `edge_cutting_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  983. `edge_cutting_price` decimal(22, 5) NULL DEFAULT NULL,
  984. `distribution_user_id` int(11) NULL DEFAULT NULL,
  985. `responsible_user_id` int(11) NULL DEFAULT NULL,
  986. `ignore_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  987. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  988. PRIMARY KEY (`notice_affair_id`) USING BTREE,
  989. UNIQUE INDEX `id`(`notice_affair_id` ASC) USING BTREE
  990. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  991. -- ----------------------------
  992. -- Table structure for t_edge_out_calculation
  993. -- ----------------------------
  994. DROP TABLE IF EXISTS `t_edge_out_calculation`;
  995. CREATE TABLE `t_edge_out_calculation` (
  996. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  997. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  998. `affair_id` int(11) NOT NULL,
  999. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1000. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1001. `from_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1002. `colleague_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1003. `calculation_condition` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1004. `calculation_time` datetime NOT NULL,
  1005. `calculation_stime` datetime NOT NULL,
  1006. `calculation_ctime` datetime NOT NULL,
  1007. `edge_quantity` decimal(15, 6) NOT NULL,
  1008. `edge_price` decimal(15, 6) NOT NULL,
  1009. `edge_total_amount` decimal(15, 6) NOT NULL,
  1010. `shipment_quantity` decimal(22, 6) NOT NULL,
  1011. `is_complete` int(1) NOT NULL DEFAULT 0,
  1012. `clearing_storehouse` int(1) NOT NULL DEFAULT 0,
  1013. `loss` decimal(22, 6) NOT NULL,
  1014. `deduction_amount` decimal(22, 6) NOT NULL,
  1015. `deduction_time` datetime NULL DEFAULT NULL,
  1016. `responsible_user_id` int(11) NOT NULL,
  1017. `user_id` int(11) NOT NULL,
  1018. `call_time` datetime NOT NULL,
  1019. PRIMARY KEY (`calculation_id`, `data_id`, `from_data_id`) USING BTREE,
  1020. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  1021. INDEX `call_time`(`call_time` ASC) USING BTREE,
  1022. INDEX `affair_id`(`affair_id` ASC, `calculation_time` ASC, `calculation_condition` ASC, `tagIds` ASC, `from_data_id` ASC) USING BTREE,
  1023. INDEX `responsible_user_id`(`responsible_user_id` ASC, `calculation_time` ASC, `calculation_stime` ASC) USING BTREE
  1024. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1025. -- ----------------------------
  1026. -- Table structure for t_entry
  1027. -- ----------------------------
  1028. DROP TABLE IF EXISTS `t_entry`;
  1029. CREATE TABLE `t_entry` (
  1030. `entry_id` int(11) NOT NULL AUTO_INCREMENT,
  1031. `entry_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1032. `entry_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1033. `permission` tinyint(1) NULL DEFAULT 1,
  1034. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1035. `affair_id` int(11) NULL DEFAULT NULL,
  1036. `status` int(11) NULL DEFAULT 99,
  1037. `user_id` int(11) NULL DEFAULT NULL,
  1038. `ctime` datetime NULL DEFAULT NULL,
  1039. `utime` datetime NULL DEFAULT NULL,
  1040. PRIMARY KEY (`entry_id`) USING BTREE,
  1041. INDEX `affair_id`(`affair_id` ASC) USING BTREE,
  1042. CONSTRAINT `t_entry_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1043. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1044. -- ----------------------------
  1045. -- Table structure for t_fast_input
  1046. -- ----------------------------
  1047. DROP TABLE IF EXISTS `t_fast_input`;
  1048. CREATE TABLE `t_fast_input` (
  1049. `fast_input_id` int(11) NOT NULL AUTO_INCREMENT,
  1050. `customized_id` int(11) NOT NULL,
  1051. `fast_input_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1052. `fast_input_state` tinyint(1) NULL DEFAULT 0,
  1053. `fast_input_data_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1054. `fast_input_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1055. `ctime` datetime NULL DEFAULT NULL,
  1056. `utime` datetime NULL DEFAULT NULL,
  1057. `company_id` int(11) NULL DEFAULT NULL,
  1058. `user_id` int(11) NULL DEFAULT NULL,
  1059. `status` int(2) NULL DEFAULT 99,
  1060. PRIMARY KEY (`fast_input_id`) USING BTREE,
  1061. INDEX `status`(`status` ASC, `customized_id` ASC, `user_id` ASC) USING BTREE
  1062. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1063. -- ----------------------------
  1064. -- Table structure for t_file_list
  1065. -- ----------------------------
  1066. DROP TABLE IF EXISTS `t_file_list`;
  1067. CREATE TABLE `t_file_list` (
  1068. `id` int(11) NOT NULL AUTO_INCREMENT,
  1069. `pid` int(11) NULL DEFAULT NULL,
  1070. `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1071. `md5` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1072. `crop` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1073. `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1074. `category` int(255) NULL DEFAULT NULL,
  1075. `props` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1076. `mime` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1077. `extension` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1078. `size` int(11) NULL DEFAULT NULL,
  1079. `type` int(255) NULL DEFAULT NULL,
  1080. `icat` int(255) NULL DEFAULT NULL,
  1081. `icatmp` int(255) NULL DEFAULT NULL,
  1082. `visitimes` int(11) NULL DEFAULT NULL,
  1083. `ctime` datetime NULL DEFAULT NULL,
  1084. `utime` datetime NULL DEFAULT NULL,
  1085. `dtime` datetime NULL DEFAULT NULL,
  1086. `status` int(255) NULL DEFAULT NULL,
  1087. `user_id` int(11) NULL DEFAULT NULL,
  1088. `template_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1089. PRIMARY KEY (`id`) USING BTREE,
  1090. UNIQUE INDEX `md5`(`md5` ASC, `type` ASC, `category` ASC) USING BTREE
  1091. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1092. -- ----------------------------
  1093. -- Table structure for t_group_position
  1094. -- ----------------------------
  1095. DROP TABLE IF EXISTS `t_group_position`;
  1096. CREATE TABLE `t_group_position` (
  1097. `position_id` int(11) NOT NULL AUTO_INCREMENT,
  1098. `user_id` int(11) NOT NULL,
  1099. `groupIds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1100. `categoryIds` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1101. `utime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  1102. `position_type` tinyint(1) NULL DEFAULT 0,
  1103. PRIMARY KEY (`position_id`) USING BTREE,
  1104. INDEX `user_id`(`user_id` ASC, `position_type` ASC) USING BTREE,
  1105. CONSTRAINT `t_group_position_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1106. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1107. -- ----------------------------
  1108. -- Table structure for t_home
  1109. -- ----------------------------
  1110. DROP TABLE IF EXISTS `t_home`;
  1111. CREATE TABLE `t_home` (
  1112. `id` int(11) NOT NULL AUTO_INCREMENT,
  1113. `home_type_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1114. `user_id` int(11) NULL DEFAULT 99,
  1115. `utime` datetime NULL DEFAULT NULL,
  1116. PRIMARY KEY (`id`) USING BTREE
  1117. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1118. -- ----------------------------
  1119. -- Table structure for t_inventory
  1120. -- ----------------------------
  1121. DROP TABLE IF EXISTS `t_inventory`;
  1122. CREATE TABLE `t_inventory` (
  1123. `inventory_id` int(11) NOT NULL AUTO_INCREMENT,
  1124. `warehouse_product_id` int(11) NULL DEFAULT NULL,
  1125. `warehouse_product_color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1126. `warehouse_product_color_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1127. `warehouse_product_height` double(22, 2) NULL DEFAULT NULL,
  1128. `warehouse_product_width` double(22, 2) NULL DEFAULT NULL,
  1129. `warehouse_material_composition` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1130. `warehouse_machine_id` int(11) NULL DEFAULT NULL,
  1131. `warehouse_storage_area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1132. `inventory_quantity_unit` int(1) NULL DEFAULT 0,
  1133. `status` int(2) NULL DEFAULT 99,
  1134. `ctime` datetime NULL DEFAULT NULL,
  1135. `utime` datetime NULL DEFAULT NULL,
  1136. `inventory_price_unit` tinyint(1) NULL DEFAULT NULL,
  1137. `warehouse_collection_id` int(11) NULL DEFAULT NULL,
  1138. `warehouse_other_description` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1139. PRIMARY KEY (`inventory_id`) USING BTREE,
  1140. INDEX `warehouse_product_id`(`warehouse_product_id` ASC) USING BTREE,
  1141. INDEX `warehouse_machine_id`(`warehouse_machine_id` ASC) USING BTREE,
  1142. CONSTRAINT `t_inventory_ibfk_1` FOREIGN KEY (`warehouse_product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1143. CONSTRAINT `t_inventory_ibfk_2` FOREIGN KEY (`warehouse_machine_id`) REFERENCES `t_machine` (`machine_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1144. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1145. -- ----------------------------
  1146. -- Table structure for t_inventory_calculation
  1147. -- ----------------------------
  1148. DROP TABLE IF EXISTS `t_inventory_calculation`;
  1149. CREATE TABLE `t_inventory_calculation` (
  1150. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1151. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1152. `affair_id` int(11) NOT NULL,
  1153. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1154. `calculation_key` int(11) NOT NULL,
  1155. `calculation_time` datetime NOT NULL,
  1156. `calculation_value` decimal(22, 6) NOT NULL,
  1157. `calculation_value2` decimal(22, 6) NOT NULL,
  1158. `calculation_condition` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1159. `calculation_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1160. `call_time` datetime NOT NULL,
  1161. `from_affair_id` int(11) NOT NULL,
  1162. `self_built_source` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1163. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1164. `from_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1165. `offer_price` decimal(22, 3) NULL DEFAULT -1.000,
  1166. `offer_product_total_cost` decimal(22, 6) NULL DEFAULT NULL,
  1167. `calculation_ctime` datetime NULL DEFAULT NULL,
  1168. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  1169. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  1170. INDEX `call_time`(`call_time` ASC) USING BTREE,
  1171. INDEX `calculation_value`(`calculation_key` ASC, `calculation_time` ASC, `calculation_value` ASC, `calculation_value2` ASC, `calculation_condition` ASC, `tagIds` ASC) USING BTREE
  1172. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1173. -- ----------------------------
  1174. -- Table structure for t_inventory_detail_calculation
  1175. -- ----------------------------
  1176. DROP TABLE IF EXISTS `t_inventory_detail_calculation`;
  1177. CREATE TABLE `t_inventory_detail_calculation` (
  1178. `detail_calculation_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1179. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1180. `warehouse_type` int(11) NOT NULL,
  1181. `common_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1182. `detail_calculation_key` int(11) NOT NULL,
  1183. `detail_calculation_time` datetime NOT NULL,
  1184. `detail_calculation_value` decimal(22, 6) NULL DEFAULT NULL,
  1185. `detail_calculation_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1186. `user_id` int(11) NULL DEFAULT NULL,
  1187. `status` int(2) NULL DEFAULT 99,
  1188. `ctime` datetime NULL DEFAULT NULL,
  1189. `call_time` datetime NOT NULL,
  1190. PRIMARY KEY (`detail_calculation_id`) USING BTREE,
  1191. INDEX `detail_calculation_key`(`detail_calculation_key` ASC, `warehouse_type` ASC, `common_id` ASC, `detail_calculation_time` ASC) USING BTREE,
  1192. INDEX `detail_calculation_id`(`detail_calculation_id` ASC, `common_id` ASC) USING BTREE,
  1193. INDEX `detail_calculation_id_2`(`detail_calculation_id` ASC, `data_id` ASC) USING BTREE
  1194. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1195. -- ----------------------------
  1196. -- Table structure for t_inventory_detail_record
  1197. -- ----------------------------
  1198. DROP TABLE IF EXISTS `t_inventory_detail_record`;
  1199. CREATE TABLE `t_inventory_detail_record` (
  1200. `detail_record_id` int(11) NOT NULL AUTO_INCREMENT,
  1201. `inventory_id` int(11) NOT NULL,
  1202. `detail_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1203. `detail_record_time` datetime NOT NULL,
  1204. `detail_record_value` decimal(22, 6) NOT NULL,
  1205. `detail_record_type` tinyint(1) NOT NULL DEFAULT 0,
  1206. `detail_diff_value` decimal(22, 6) NULL DEFAULT NULL,
  1207. `transfer_in_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1208. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1209. `user_id` int(11) NULL DEFAULT NULL,
  1210. `status` int(2) NULL DEFAULT 99,
  1211. `ctime` datetime NULL DEFAULT NULL,
  1212. `utime` datetime NULL DEFAULT NULL,
  1213. PRIMARY KEY (`detail_record_id`) USING BTREE
  1214. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1215. -- ----------------------------
  1216. -- Table structure for t_inventory_detail_sub_record
  1217. -- ----------------------------
  1218. DROP TABLE IF EXISTS `t_inventory_detail_sub_record`;
  1219. CREATE TABLE `t_inventory_detail_sub_record` (
  1220. `detail_sub_record_id` int(11) NOT NULL AUTO_INCREMENT,
  1221. `detail_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1222. `detail_sub_qrcode_id` int(11) NOT NULL,
  1223. `detail_sub_record_time` datetime NOT NULL,
  1224. `detail_sub_record_value` decimal(22, 6) NOT NULL,
  1225. `detail_sub_record_type` tinyint(1) NOT NULL DEFAULT 0,
  1226. `detail_sub_content` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1227. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1228. `user_id` int(11) NULL DEFAULT NULL,
  1229. `status` int(2) NULL DEFAULT 99,
  1230. `ctime` datetime NULL DEFAULT NULL,
  1231. `utime` datetime NULL DEFAULT NULL,
  1232. PRIMARY KEY (`detail_sub_record_id`) USING BTREE
  1233. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1234. -- ----------------------------
  1235. -- Table structure for t_inventory_fast
  1236. -- ----------------------------
  1237. DROP TABLE IF EXISTS `t_inventory_fast`;
  1238. CREATE TABLE `t_inventory_fast` (
  1239. `inventory_fast_id` int(11) NOT NULL AUTO_INCREMENT,
  1240. `affair_id` int(11) NOT NULL,
  1241. `inventory_fast_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1242. `inventory_fast_data_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1243. `inventory_fast_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1244. `notice_affair_id` int(11) NULL DEFAULT NULL,
  1245. `from_affair_id` int(11) NULL DEFAULT NULL,
  1246. `from_affair_data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1247. `requirement_quantity` decimal(22, 6) NULL DEFAULT NULL,
  1248. `requirement_quantity_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1249. `requirement_note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1250. `requirement_voice` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1251. `synchronous_quantity` decimal(22, 6) NULL DEFAULT NULL,
  1252. `synchronous_quantity_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1253. `ctime` datetime NULL DEFAULT NULL,
  1254. `utime` datetime NULL DEFAULT NULL,
  1255. `company_id` int(11) NULL DEFAULT NULL,
  1256. `user_id` int(11) NULL DEFAULT NULL,
  1257. `status` int(2) NULL DEFAULT 99,
  1258. PRIMARY KEY (`inventory_fast_id`) USING BTREE,
  1259. INDEX `status`(`status` ASC, `affair_id` ASC, `user_id` ASC) USING BTREE
  1260. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1261. -- ----------------------------
  1262. -- Table structure for t_inventory_notice_affair
  1263. -- ----------------------------
  1264. DROP TABLE IF EXISTS `t_inventory_notice_affair`;
  1265. CREATE TABLE `t_inventory_notice_affair` (
  1266. `notice_affair_id` int(11) NOT NULL AUTO_INCREMENT,
  1267. `affair_id` int(11) NOT NULL,
  1268. `from_affair_id` int(11) NOT NULL,
  1269. `from_affair_data_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1270. `notice_state` tinyint(1) NULL DEFAULT 0,
  1271. `requirement_quantity` decimal(22, 6) NULL DEFAULT NULL,
  1272. `requirement_quantity_unit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1273. `requirement_note` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1274. `requirement_voice` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1275. `allow_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1276. `ignore_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1277. `user_id` int(11) NULL DEFAULT NULL,
  1278. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1279. PRIMARY KEY (`notice_affair_id`) USING BTREE,
  1280. UNIQUE INDEX `id`(`notice_affair_id` ASC) USING BTREE
  1281. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1282. -- ----------------------------
  1283. -- Table structure for t_inventory_price_record
  1284. -- ----------------------------
  1285. DROP TABLE IF EXISTS `t_inventory_price_record`;
  1286. CREATE TABLE `t_inventory_price_record` (
  1287. `inventory_price_record_id` int(11) NOT NULL AUTO_INCREMENT,
  1288. `inventory_id` int(11) NOT NULL,
  1289. `record_time` datetime NOT NULL,
  1290. `inventory_price` double(22, 2) NOT NULL,
  1291. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1292. `status` int(2) NULL DEFAULT 99,
  1293. `ctime` datetime NULL DEFAULT NULL,
  1294. `utime` datetime NULL DEFAULT NULL,
  1295. `user_id` int(11) NULL DEFAULT NULL,
  1296. PRIMARY KEY (`inventory_price_record_id`) USING BTREE,
  1297. INDEX `inventory_id`(`inventory_id` ASC) USING BTREE,
  1298. CONSTRAINT `t_inventory_price_record_ibfk_1` FOREIGN KEY (`inventory_id`) REFERENCES `t_inventory` (`inventory_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1299. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1300. -- ----------------------------
  1301. -- Table structure for t_inventory_record
  1302. -- ----------------------------
  1303. DROP TABLE IF EXISTS `t_inventory_record`;
  1304. CREATE TABLE `t_inventory_record` (
  1305. `inventory_record_id` int(11) NOT NULL AUTO_INCREMENT,
  1306. `inventory_id` int(11) NOT NULL,
  1307. `record_time` datetime NOT NULL,
  1308. `inventory_quantity` double(22, 2) NOT NULL,
  1309. `inventory_quantity_reserve` double(22, 2) NULL DEFAULT 0.00,
  1310. `notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1311. `status` int(2) NULL DEFAULT 99,
  1312. `ctime` datetime NULL DEFAULT NULL,
  1313. `utime` datetime NULL DEFAULT NULL,
  1314. `user_id` int(11) NULL DEFAULT NULL,
  1315. PRIMARY KEY (`inventory_record_id`) USING BTREE,
  1316. INDEX `inventory_id`(`inventory_id` ASC) USING BTREE,
  1317. CONSTRAINT `t_inventory_record_ibfk_1` FOREIGN KEY (`inventory_id`) REFERENCES `t_inventory` (`inventory_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1318. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1319. -- ----------------------------
  1320. -- Table structure for t_keyword_log
  1321. -- ----------------------------
  1322. DROP TABLE IF EXISTS `t_keyword_log`;
  1323. CREATE TABLE `t_keyword_log` (
  1324. `keyword_id` int(11) NOT NULL AUTO_INCREMENT,
  1325. `user_id` int(11) NULL DEFAULT NULL,
  1326. `company_id` int(11) NULL DEFAULT NULL,
  1327. `keyword_category` int(11) NULL DEFAULT NULL,
  1328. `keyword_text` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1329. `keyword_values` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1330. `status` int(11) NULL DEFAULT 99,
  1331. `ctime` datetime NULL DEFAULT NULL,
  1332. `dtime` datetime NULL DEFAULT NULL,
  1333. PRIMARY KEY (`keyword_id`) USING BTREE,
  1334. INDEX `user_id`(`user_id` ASC) USING BTREE,
  1335. INDEX `company_id`(`company_id` ASC) USING BTREE,
  1336. CONSTRAINT `t_keyword_log_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1337. CONSTRAINT `t_keyword_log_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1338. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1339. -- ----------------------------
  1340. -- Table structure for t_link_affair
  1341. -- ----------------------------
  1342. DROP TABLE IF EXISTS `t_link_affair`;
  1343. CREATE TABLE `t_link_affair` (
  1344. `affair_id` int(11) NOT NULL,
  1345. `link_type` int(11) NOT NULL DEFAULT 0,
  1346. `link_order` int(11) NULL DEFAULT NULL,
  1347. `utime` datetime NULL DEFAULT NULL,
  1348. `join_permission` tinyint(1) NULL DEFAULT 2,
  1349. `join_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1350. `must_scan_join` tinyint(1) NULL DEFAULT 0,
  1351. `must_join_detail` tinyint(1) NULL DEFAULT 0,
  1352. `all_column_default_inherit` tinyint(1) NULL DEFAULT 0,
  1353. `can_join_detail` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1354. `can_multiple_affair` tinyint(1) NULL DEFAULT 0,
  1355. PRIMARY KEY (`affair_id`, `link_type`) USING BTREE,
  1356. UNIQUE INDEX `affair_id`(`affair_id` ASC, `link_type` ASC) USING BTREE
  1357. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1358. -- ----------------------------
  1359. -- Table structure for t_link_affair_tag
  1360. -- ----------------------------
  1361. DROP TABLE IF EXISTS `t_link_affair_tag`;
  1362. CREATE TABLE `t_link_affair_tag` (
  1363. `affair_id` int(11) NOT NULL,
  1364. `link_type` int(11) NOT NULL DEFAULT 0,
  1365. `affair_order` int(11) NULL DEFAULT 0,
  1366. `inherit_affair_id` int(11) NOT NULL,
  1367. `inherit_tag_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1368. PRIMARY KEY (`affair_id`, `link_type`, `inherit_affair_id`) USING BTREE
  1369. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1370. -- ----------------------------
  1371. -- Table structure for t_link_basic
  1372. -- ----------------------------
  1373. DROP TABLE IF EXISTS `t_link_basic`;
  1374. CREATE TABLE `t_link_basic` (
  1375. `basic_id` int(13) NOT NULL AUTO_INCREMENT,
  1376. `basic_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1377. `from_basic_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1378. `is_multiplex` tinyint(1) NULL DEFAULT 0,
  1379. `user_id` int(11) NULL DEFAULT NULL,
  1380. `status` int(2) NULL DEFAULT 99,
  1381. `ctime` datetime NULL DEFAULT NULL,
  1382. PRIMARY KEY (`basic_id`, `basic_number`) USING BTREE,
  1383. UNIQUE INDEX `basic_number`(`basic_number` ASC) USING BTREE
  1384. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1385. -- ----------------------------
  1386. -- Table structure for t_link_basic_record
  1387. -- ----------------------------
  1388. DROP TABLE IF EXISTS `t_link_basic_record`;
  1389. CREATE TABLE `t_link_basic_record` (
  1390. `basic_record_id` int(20) NOT NULL AUTO_INCREMENT,
  1391. `basic_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1392. `affair_id` int(11) NOT NULL,
  1393. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1394. `detail_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1395. `user_id` int(11) NULL DEFAULT NULL,
  1396. `ctime` decimal(15, 0) NOT NULL DEFAULT 0,
  1397. PRIMARY KEY (`basic_record_id`) USING BTREE,
  1398. UNIQUE INDEX `basicAffair`(`basic_number` ASC, `affair_id` ASC) USING BTREE
  1399. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1400. -- ----------------------------
  1401. -- Table structure for t_link_column
  1402. -- ----------------------------
  1403. DROP TABLE IF EXISTS `t_link_column`;
  1404. CREATE TABLE `t_link_column` (
  1405. `affair_id` int(11) NOT NULL,
  1406. `column_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1407. `link_type` int(11) NOT NULL DEFAULT 0,
  1408. `column_order` int(11) NULL DEFAULT 0,
  1409. `not_hand_modify` tinyint(1) NULL DEFAULT 0,
  1410. `is_force_inherit` tinyint(1) NULL DEFAULT 0,
  1411. `inherit_type` tinyint(1) NULL DEFAULT 0,
  1412. `inherit_order` tinyint(1) NULL DEFAULT 0,
  1413. PRIMARY KEY (`affair_id`, `column_name`, `link_type`) USING BTREE,
  1414. UNIQUE INDEX `affair_id`(`affair_id` ASC, `column_name` ASC, `link_type` ASC) USING BTREE
  1415. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1416. -- ----------------------------
  1417. -- Table structure for t_link_column_inherit
  1418. -- ----------------------------
  1419. DROP TABLE IF EXISTS `t_link_column_inherit`;
  1420. CREATE TABLE `t_link_column_inherit` (
  1421. `affair_id` int(11) NOT NULL,
  1422. `column_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1423. `link_type` int(11) NOT NULL DEFAULT 0,
  1424. `is_uniformity` tinyint(1) NULL DEFAULT 0,
  1425. `detail_id` int(11) NULL DEFAULT NULL,
  1426. `inherit_affair_id` int(11) NOT NULL,
  1427. `inherit_column_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1428. `inherit_column_order` int(11) NULL DEFAULT 0,
  1429. `inherit_detail_id` int(11) NULL DEFAULT NULL,
  1430. PRIMARY KEY (`affair_id`, `column_name`, `link_type`, `inherit_affair_id`, `inherit_column_name`) USING BTREE,
  1431. UNIQUE INDEX `affair_id`(`affair_id` ASC, `column_name` ASC, `link_type` ASC, `inherit_affair_id` ASC, `inherit_column_name` ASC) USING BTREE
  1432. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1433. -- ----------------------------
  1434. -- Table structure for t_link_qrcode
  1435. -- ----------------------------
  1436. DROP TABLE IF EXISTS `t_link_qrcode`;
  1437. CREATE TABLE `t_link_qrcode` (
  1438. `qrcode_id` int(13) NOT NULL AUTO_INCREMENT,
  1439. `qrcode_number` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1440. `qrcode_print` tinyint(1) NULL DEFAULT 0,
  1441. `qrcode_type` tinyint(1) NULL DEFAULT 0,
  1442. `qrcode_state` tinyint(1) NULL DEFAULT 0,
  1443. `activate_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1444. `activate_user_id` int(11) NULL DEFAULT NULL,
  1445. `activate_time` datetime NULL DEFAULT NULL,
  1446. `ctime` datetime NULL DEFAULT NULL,
  1447. PRIMARY KEY (`qrcode_id`, `qrcode_number`) USING BTREE,
  1448. UNIQUE INDEX `qrcode_number`(`qrcode_number` ASC) USING BTREE
  1449. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1450. -- ----------------------------
  1451. -- Table structure for t_link_qrcode_enable
  1452. -- ----------------------------
  1453. DROP TABLE IF EXISTS `t_link_qrcode_enable`;
  1454. CREATE TABLE `t_link_qrcode_enable` (
  1455. `enable_id` int(13) NOT NULL AUTO_INCREMENT,
  1456. `start_interval` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1457. `end_interval` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1458. `user_id` int(11) NULL DEFAULT NULL,
  1459. `ctime` datetime NULL DEFAULT NULL,
  1460. PRIMARY KEY (`enable_id`) USING BTREE
  1461. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1462. -- ----------------------------
  1463. -- Table structure for t_link_set
  1464. -- ----------------------------
  1465. DROP TABLE IF EXISTS `t_link_set`;
  1466. CREATE TABLE `t_link_set` (
  1467. `id` int(11) NOT NULL AUTO_INCREMENT,
  1468. `utime` datetime NULL DEFAULT NULL,
  1469. `manual_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1470. `replace_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1471. `multiplex_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1472. `print_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1473. PRIMARY KEY (`id`) USING BTREE
  1474. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1475. -- ----------------------------
  1476. -- Table structure for t_location
  1477. -- ----------------------------
  1478. DROP TABLE IF EXISTS `t_location`;
  1479. CREATE TABLE `t_location` (
  1480. `location_id` int(11) NOT NULL AUTO_INCREMENT,
  1481. `location_pid` int(11) NULL DEFAULT NULL,
  1482. `location_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1483. `location_postnum` varchar(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1484. `location_level` tinyint(1) NULL DEFAULT NULL,
  1485. `location_phonenum` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1486. PRIMARY KEY (`location_id`) USING BTREE,
  1487. INDEX `FK_Reference_28`(`location_pid` ASC) USING BTREE,
  1488. CONSTRAINT `FK_Reference_28` FOREIGN KEY (`location_pid`) REFERENCES `t_location` (`location_id`) ON DELETE SET NULL ON UPDATE CASCADE
  1489. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1490. -- ----------------------------
  1491. -- Table structure for t_log_edit
  1492. -- ----------------------------
  1493. DROP TABLE IF EXISTS `t_log_edit`;
  1494. CREATE TABLE `t_log_edit` (
  1495. `log_edit_id` int(11) NOT NULL AUTO_INCREMENT,
  1496. `log_company_id` int(11) NULL DEFAULT NULL,
  1497. `log_user_id` int(11) NULL DEFAULT NULL,
  1498. `log_edit_clazz` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1499. `log_edit_oldvalue` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1500. `log_edit_newvalue` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1501. `log_action` tinyint(1) NULL DEFAULT NULL,
  1502. `ctime` datetime NULL DEFAULT NULL,
  1503. PRIMARY KEY (`log_edit_id`) USING BTREE
  1504. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1505. -- ----------------------------
  1506. -- Table structure for t_machine_model
  1507. -- ----------------------------
  1508. DROP TABLE IF EXISTS `t_machine_model`;
  1509. CREATE TABLE `t_machine_model` (
  1510. `model_id` int(11) NOT NULL AUTO_INCREMENT,
  1511. `model_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1512. `model_des` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1513. `status` int(11) NULL DEFAULT 99,
  1514. `ctime` datetime NOT NULL,
  1515. `utime` datetime NULL DEFAULT NULL,
  1516. PRIMARY KEY (`model_id`) USING BTREE,
  1517. INDEX `model_name`(`model_name` ASC) USING BTREE
  1518. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1519. -- ----------------------------
  1520. -- Table structure for t_machine
  1521. -- ----------------------------
  1522. DROP TABLE IF EXISTS `t_machine`;
  1523. CREATE TABLE `t_machine` (
  1524. `machine_id` int(11) NOT NULL AUTO_INCREMENT,
  1525. `machine_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1526. `machine_horse` int(11) NULL DEFAULT 0,
  1527. `machine_des` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1528. `machine_state` int(2) NOT NULL DEFAULT 0,
  1529. `affair_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1530. `pause_affair_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1531. `model_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1532. `status` int(2) NOT NULL DEFAULT 99,
  1533. `ctime` datetime NOT NULL,
  1534. `utime` datetime NULL DEFAULT NULL,
  1535. `dtime` datetime NULL DEFAULT NULL,
  1536. PRIMARY KEY (`machine_id`) USING BTREE,
  1537. INDEX `machine_id`(`machine_id` ASC) USING BTREE,
  1538. INDEX `model_name`(`model_name` ASC) USING BTREE,
  1539. CONSTRAINT `t_machine_ibfk_1` FOREIGN KEY (`model_name`) REFERENCES `t_machine_model` (`model_name`) ON DELETE CASCADE ON UPDATE CASCADE
  1540. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1541. -- ----------------------------
  1542. -- Table structure for t_machine_calculation
  1543. -- ----------------------------
  1544. DROP TABLE IF EXISTS `t_machine_calculation`;
  1545. CREATE TABLE `t_machine_calculation` (
  1546. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1547. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1548. `affair_id` int(11) NOT NULL,
  1549. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1550. `calculation_condition` varchar(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1551. `call_time` datetime NOT NULL,
  1552. `calculation_key` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1553. `calculation_time` datetime NOT NULL,
  1554. `calculation_time2` datetime NOT NULL,
  1555. `calculation_ctime` datetime NOT NULL,
  1556. `product_id` int(11) NOT NULL DEFAULT 0,
  1557. `single_weight` decimal(22, 2) NULL DEFAULT 0.00,
  1558. `pipe_weight` decimal(22, 2) NULL DEFAULT 0.00,
  1559. `total_weight` decimal(22, 2) NULL DEFAULT NULL,
  1560. `machine_horse` bigint(22) NULL DEFAULT NULL,
  1561. `pan_head_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1562. `public_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1563. `stop_reason_id` int(11) NULL DEFAULT NULL,
  1564. `object_key` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1565. `calculation_value` decimal(22, 2) NULL DEFAULT NULL,
  1566. `needle_position` int(11) NULL DEFAULT NULL,
  1567. `net_needle` int(11) NULL DEFAULT NULL,
  1568. `product_specification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1569. `machine_production_state` tinyint(1) NULL DEFAULT 0,
  1570. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  1571. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  1572. INDEX `call_time`(`call_time` ASC) USING BTREE,
  1573. INDEX ` calculation_value`(`affair_id` ASC, `calculation_key` ASC, `calculation_condition` ASC, `calculation_time` ASC, `product_id` ASC, `tagIds` ASC, `calculation_time2` ASC) USING BTREE
  1574. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1575. -- ----------------------------
  1576. -- Table structure for t_machine_pause
  1577. -- ----------------------------
  1578. DROP TABLE IF EXISTS `t_machine_pause`;
  1579. CREATE TABLE `t_machine_pause` (
  1580. `machine_id` int(11) NOT NULL,
  1581. `ctime` datetime NULL DEFAULT NULL,
  1582. `utime` datetime NULL DEFAULT NULL,
  1583. `user_id` int(11) NULL DEFAULT NULL,
  1584. `permission` tinyint(1) NULL DEFAULT 1,
  1585. `pause_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1586. PRIMARY KEY (`machine_id`) USING BTREE
  1587. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1588. -- ----------------------------
  1589. -- Table structure for t_machine_record
  1590. -- ----------------------------
  1591. DROP TABLE IF EXISTS `t_machine_record`;
  1592. CREATE TABLE `t_machine_record` (
  1593. `record_id` int(11) NOT NULL AUTO_INCREMENT,
  1594. `machine_id` int(11) NOT NULL,
  1595. `record_des` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1596. `affair_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1597. `change_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1598. `production_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1599. `stop_time` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1600. `utime` datetime NOT NULL,
  1601. `ctime` datetime NOT NULL,
  1602. PRIMARY KEY (`record_id`) USING BTREE
  1603. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1604. -- ----------------------------
  1605. -- Table structure for t_machine_settings
  1606. -- ----------------------------
  1607. DROP TABLE IF EXISTS `t_machine_settings`;
  1608. CREATE TABLE `t_machine_settings` (
  1609. `id` int(11) NOT NULL AUTO_INCREMENT,
  1610. `produced_affair_id` int(11) NULL DEFAULT NULL,
  1611. `produced_sheet_id` int(11) NULL DEFAULT NULL,
  1612. `produced_affair_tag_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1613. `produced_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1614. `produced_affair_summary` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1615. `produced_affair_summary_permission` tinyint(1) NULL DEFAULT 1,
  1616. `utime` datetime NULL DEFAULT NULL,
  1617. PRIMARY KEY (`id`) USING BTREE,
  1618. INDEX `produced_sheet`(`produced_sheet_id` ASC) USING BTREE,
  1619. INDEX `produced_affair_id`(`produced_affair_id` ASC) USING BTREE,
  1620. CONSTRAINT `t_machine_settings_ibfk_3` FOREIGN KEY (`produced_sheet_id`) REFERENCES `t_affair_sheet` (`sheet_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1621. CONSTRAINT `t_machine_settings_ibfk_4` FOREIGN KEY (`produced_affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1622. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1623. -- ----------------------------
  1624. -- Table structure for t_machine_stop_reason
  1625. -- ----------------------------
  1626. DROP TABLE IF EXISTS `t_machine_stop_reason`;
  1627. CREATE TABLE `t_machine_stop_reason` (
  1628. `stop_reason_id` int(11) NOT NULL AUTO_INCREMENT,
  1629. `stop_reason_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1630. `ctime` datetime NULL DEFAULT NULL,
  1631. `utime` datetime NULL DEFAULT NULL,
  1632. `user_id` int(11) NULL DEFAULT NULL,
  1633. `permission` tinyint(1) NULL DEFAULT 1,
  1634. `stop_reason_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1635. PRIMARY KEY (`stop_reason_id`) USING BTREE
  1636. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1637. -- ----------------------------
  1638. -- Table structure for t_notice
  1639. -- ----------------------------
  1640. DROP TABLE IF EXISTS `t_notice`;
  1641. CREATE TABLE `t_notice` (
  1642. `notice_id` int(11) NOT NULL AUTO_INCREMENT,
  1643. `notice_type` tinyint(1) NOT NULL DEFAULT 1,
  1644. `user_id` int(11) NULL DEFAULT NULL,
  1645. `notice_title` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1646. `notice_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1647. `notice_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1648. `data_count` int(11) NULL DEFAULT 0,
  1649. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1650. PRIMARY KEY (`notice_id`) USING BTREE
  1651. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1652. -- ----------------------------
  1653. -- Table structure for t_notice_frequently
  1654. -- ----------------------------
  1655. DROP TABLE IF EXISTS `t_notice_frequently`;
  1656. CREATE TABLE `t_notice_frequently` (
  1657. `notice_frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  1658. `notice_frequently_type` tinyint(1) NULL DEFAULT 1,
  1659. `notice_frequently_type_id` int(11) NULL DEFAULT 0,
  1660. `notice_frequently_user_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1661. `user_id` int(11) NULL DEFAULT NULL,
  1662. `utime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1663. UNIQUE INDEX `frequently_id`(`notice_frequently_id` ASC) USING BTREE
  1664. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1665. -- ----------------------------
  1666. -- Table structure for t_notice_user
  1667. -- ----------------------------
  1668. DROP TABLE IF EXISTS `t_notice_user`;
  1669. CREATE TABLE `t_notice_user` (
  1670. `id` int(11) NOT NULL AUTO_INCREMENT,
  1671. `notice_id` int(11) NOT NULL,
  1672. `user_id` int(11) NOT NULL,
  1673. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1674. `notice_state` tinyint(1) NULL DEFAULT NULL,
  1675. PRIMARY KEY (`id`) USING BTREE,
  1676. INDEX `notice_id`(`user_id` ASC, `notice_id` ASC, `notice_state` ASC) USING BTREE
  1677. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1678. -- ----------------------------
  1679. -- Table structure for t_offer_cost_float
  1680. -- ----------------------------
  1681. DROP TABLE IF EXISTS `t_offer_cost_float`;
  1682. CREATE TABLE `t_offer_cost_float` (
  1683. `offer_cost_float_id` int(11) NOT NULL AUTO_INCREMENT,
  1684. `offer_cost_float_number` double(13, 2) NULL DEFAULT 0.00,
  1685. `product_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1686. `ctime` datetime NULL DEFAULT NULL,
  1687. `utime` datetime NULL DEFAULT NULL,
  1688. `user_id` int(11) NULL DEFAULT NULL,
  1689. PRIMARY KEY (`offer_cost_float_id`) USING BTREE
  1690. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1691. -- ----------------------------
  1692. -- Table structure for t_offer_price
  1693. -- ----------------------------
  1694. DROP TABLE IF EXISTS `t_offer_price`;
  1695. CREATE TABLE `t_offer_price` (
  1696. `offer_price_id` int(11) NOT NULL AUTO_INCREMENT,
  1697. `offer_price_des` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1698. `offer_price_number` double(13, 2) NULL DEFAULT 0.00,
  1699. `ctime` datetime NULL DEFAULT NULL,
  1700. `utime` datetime NULL DEFAULT NULL,
  1701. `user_id` int(11) NULL DEFAULT NULL,
  1702. `permission` tinyint(1) NULL DEFAULT 1,
  1703. `see_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1704. PRIMARY KEY (`offer_price_id`) USING BTREE
  1705. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1706. -- ----------------------------
  1707. -- Table structure for t_pad_home
  1708. -- ----------------------------
  1709. DROP TABLE IF EXISTS `t_pad_home`;
  1710. CREATE TABLE `t_pad_home` (
  1711. `id` int(11) NOT NULL AUTO_INCREMENT,
  1712. `user_id` int(11) NULL DEFAULT NULL,
  1713. `home_type_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1714. `utime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1715. UNIQUE INDEX `id`(`id` ASC) USING BTREE,
  1716. INDEX `user_id`(`user_id` ASC) USING BTREE,
  1717. CONSTRAINT `t_pad_home_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1718. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1719. -- ----------------------------
  1720. -- Table structure for t_pattribute
  1721. -- ----------------------------
  1722. DROP TABLE IF EXISTS `t_pattribute`;
  1723. CREATE TABLE `t_pattribute` (
  1724. `pattribute_id` int(11) NOT NULL AUTO_INCREMENT,
  1725. `user_id` int(11) NULL DEFAULT NULL,
  1726. `company_id` int(11) NULL DEFAULT NULL,
  1727. `product_id` int(11) NOT NULL,
  1728. `image_id` int(11) NULL DEFAULT NULL,
  1729. `pattribute_image_id` int(11) NULL DEFAULT NULL,
  1730. `pattribute_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1731. `pattribute_pname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1732. `pattribute_cname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1733. `pattribute_type` int(255) NULL DEFAULT NULL,
  1734. `pattribute_price` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1735. `pattribute_price_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1736. `pattribute_inventory` decimal(13, 3) NULL DEFAULT NULL,
  1737. `pattribute_inventory_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1738. `pattribute_width` decimal(13, 2) NULL DEFAULT NULL,
  1739. `pattribute_width_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1740. `pattribute_height` decimal(13, 2) NULL DEFAULT NULL,
  1741. `pattribute_height_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1742. `pattribute_freeheight` decimal(13, 2) NULL DEFAULT NULL,
  1743. `pattribute_freeheight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1744. `pattribute_weight` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1745. `pattribute_weight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1746. `pattribute_elasticity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1747. `pattribute_mtype` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1748. `pattribute_material` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1749. `pattribute_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1750. `pattribute_address` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1751. `pattribute_from` tinyint(1) NULL DEFAULT NULL,
  1752. `ctime` datetime NULL DEFAULT NULL,
  1753. PRIMARY KEY (`pattribute_id`) USING BTREE,
  1754. UNIQUE INDEX `pattribute_id`(`pattribute_id` ASC) USING BTREE,
  1755. INDEX `product_id`(`product_id` ASC) USING BTREE,
  1756. INDEX `image_id`(`image_id` ASC) USING BTREE,
  1757. CONSTRAINT `t_pattribute_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1758. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1759. -- ----------------------------
  1760. -- Table structure for t_pattribute_linkman
  1761. -- ----------------------------
  1762. DROP TABLE IF EXISTS `t_pattribute_linkman`;
  1763. CREATE TABLE `t_pattribute_linkman` (
  1764. `linkman_id` int(11) NOT NULL AUTO_INCREMENT,
  1765. `user_id` int(11) NULL DEFAULT NULL,
  1766. `pattribute_id` int(11) NULL DEFAULT NULL,
  1767. `linkman_realname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1768. `linkman_phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1769. `linkman_qq` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1770. `linkman_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1771. `linkman_rolename` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1772. `ctime` datetime NULL DEFAULT NULL,
  1773. PRIMARY KEY (`linkman_id`) USING BTREE,
  1774. UNIQUE INDEX `linkman_id`(`linkman_id` ASC) USING BTREE,
  1775. INDEX `pattribute_id`(`pattribute_id` ASC) USING BTREE,
  1776. INDEX `user_id`(`user_id` ASC) USING BTREE,
  1777. CONSTRAINT `t_pattribute_linkman_ibfk_1` FOREIGN KEY (`pattribute_id`) REFERENCES `t_pattribute` (`pattribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1778. CONSTRAINT `t_pattribute_linkman_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE SET NULL ON UPDATE CASCADE
  1779. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1780. -- ----------------------------
  1781. -- Table structure for t_printer
  1782. -- ----------------------------
  1783. DROP TABLE IF EXISTS `t_printer`;
  1784. CREATE TABLE `t_printer` (
  1785. `printer_id` int(11) NOT NULL AUTO_INCREMENT,
  1786. `need_user_id` int(11) NULL DEFAULT NULL,
  1787. `printer_user_id` int(11) NULL DEFAULT NULL,
  1788. `printer_type` int(11) NULL DEFAULT NULL,
  1789. `printer_from_id` int(11) NULL DEFAULT NULL,
  1790. `printer_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1791. `printer_state` int(11) NULL DEFAULT 0,
  1792. `ctime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1793. `ptime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1794. `ttime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1795. `printer_page` int(11) NULL DEFAULT NULL,
  1796. `version` int(11) NULL DEFAULT NULL,
  1797. PRIMARY KEY (`printer_id`) USING BTREE,
  1798. UNIQUE INDEX `printer_id`(`printer_id` ASC) USING BTREE,
  1799. INDEX `need_user_id`(`need_user_id` ASC) USING BTREE,
  1800. INDEX `printer_user_id`(`printer_user_id` ASC) USING BTREE,
  1801. CONSTRAINT `t_printer_ibfk_1` FOREIGN KEY (`need_user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1802. CONSTRAINT `t_printer_ibfk_2` FOREIGN KEY (`printer_user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1803. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1804. -- ----------------------------
  1805. -- Table structure for t_printer_frequently
  1806. -- ----------------------------
  1807. DROP TABLE IF EXISTS `t_printer_frequently`;
  1808. CREATE TABLE `t_printer_frequently` (
  1809. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  1810. `user_id` int(11) NULL DEFAULT NULL,
  1811. `printer_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1812. `utime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1813. UNIQUE INDEX `frequently_id`(`frequently_id` ASC) USING BTREE,
  1814. INDEX `user_id`(`user_id` ASC) USING BTREE,
  1815. CONSTRAINT `t_printer_frequently_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  1816. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1817. -- ----------------------------
  1818. -- Table structure for t_process_in_calculation
  1819. -- ----------------------------
  1820. DROP TABLE IF EXISTS `t_process_in_calculation`;
  1821. CREATE TABLE `t_process_in_calculation` (
  1822. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1823. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1824. `affair_id` int(11) NOT NULL,
  1825. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1826. `calculation_key` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1827. `calculation_time` datetime NOT NULL,
  1828. `product_id` int(11) NOT NULL,
  1829. `collection_id` int(11) NOT NULL,
  1830. `product_color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1831. `product_color_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1832. `sale_object` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1833. `product_width` decimal(14, 2) NOT NULL,
  1834. `product_height` decimal(14, 2) NOT NULL,
  1835. `machining_price` decimal(15, 5) NOT NULL,
  1836. `calculation_condition` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1837. `actual_in_storehouse_quantity` decimal(22, 2) NOT NULL,
  1838. `call_time` datetime NOT NULL,
  1839. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1840. `user_id` int(11) NOT NULL,
  1841. `width_cloth` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1842. `height_cloth` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1843. `product_gram_weight` decimal(14, 2) NULL DEFAULT NULL,
  1844. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  1845. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  1846. INDEX `call_time`(`call_time` ASC) USING BTREE,
  1847. INDEX `affair_id`(`affair_id` ASC, `calculation_time` ASC, `calculation_condition` ASC, `tagIds` ASC, `calculation_key` ASC, `product_id` ASC, `product_color` ASC, `sale_object` ASC) USING BTREE
  1848. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1849. -- ----------------------------
  1850. -- Table structure for t_process_out_calculation
  1851. -- ----------------------------
  1852. DROP TABLE IF EXISTS `t_process_out_calculation`;
  1853. CREATE TABLE `t_process_out_calculation` (
  1854. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  1855. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1856. `affair_id` int(11) NOT NULL,
  1857. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1858. `calculation_condition` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1859. `calculation_time` datetime NOT NULL,
  1860. `machining_price` decimal(15, 5) NOT NULL,
  1861. `machining_quantity` decimal(15, 2) NOT NULL,
  1862. `machining_total_amount` decimal(15, 6) NOT NULL,
  1863. `out_storehouse_quantity` decimal(22, 2) NOT NULL,
  1864. `out_storehouse_weight` decimal(22, 2) NOT NULL,
  1865. `from_data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1866. `is_complete` int(1) NOT NULL DEFAULT 0,
  1867. `call_time` datetime NOT NULL,
  1868. `clearing_storehouse` int(1) NOT NULL DEFAULT 0,
  1869. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  1870. `user_id` int(11) NOT NULL,
  1871. PRIMARY KEY (`calculation_id`, `data_id`, `from_data_id`) USING BTREE,
  1872. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  1873. INDEX `call_time`(`call_time` ASC) USING BTREE,
  1874. INDEX `affair_id`(`affair_id` ASC, `calculation_time` ASC, `calculation_condition` ASC, `tagIds` ASC, `from_data_id` ASC) USING BTREE
  1875. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1876. -- ----------------------------
  1877. -- Table structure for t_product
  1878. -- ----------------------------
  1879. DROP TABLE IF EXISTS `t_product`;
  1880. CREATE TABLE `t_product` (
  1881. `product_id` int(11) NOT NULL AUTO_INCREMENT,
  1882. `user_id` int(11) NULL DEFAULT NULL,
  1883. `company_id` int(11) NOT NULL,
  1884. `company_type` int(11) NULL DEFAULT NULL,
  1885. `image_id` int(11) NULL DEFAULT NULL,
  1886. `product_image_id` int(11) NULL DEFAULT NULL,
  1887. `product_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1888. `product_pname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
  1889. `product_cname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1890. `product_type` tinyint(2) NULL DEFAULT NULL,
  1891. `product_state` tinyint(2) NULL DEFAULT 0,
  1892. `product_price` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1893. `product_price_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1894. `product_cloth_price` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1895. `product_cloth_price_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1896. `product_product_price` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1897. `product_product_price_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1898. `product_inventory` decimal(13, 3) NULL DEFAULT NULL,
  1899. `product_inventory_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1900. `product_width` decimal(13, 2) NULL DEFAULT NULL,
  1901. `product_width_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1902. `product_height` decimal(13, 2) NULL DEFAULT NULL,
  1903. `product_height_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1904. `product_freeheight` decimal(13, 2) NULL DEFAULT NULL,
  1905. `product_freeheight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1906. `product_weight` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1907. `product_weight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1908. `product_elasticity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1909. `product_mtype` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1910. `product_material` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1911. `product_uptime` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1912. `product_uptime_density` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1913. `product_uptime_density_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1914. `product_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1915. `product_chart` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1916. `chart_image_id` int(11) NULL DEFAULT NULL,
  1917. `chart_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1918. `product_hits` int(255) NULL DEFAULT 0,
  1919. `product_tag_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1920. `ctime` datetime NOT NULL,
  1921. `utime` datetime NULL DEFAULT NULL,
  1922. `dtime` datetime NULL DEFAULT NULL,
  1923. `status` tinyint(2) NOT NULL DEFAULT 99,
  1924. `product_exhibition_id` int(11) NULL DEFAULT NULL,
  1925. `product_partially_id` int(11) NULL DEFAULT NULL,
  1926. `product_beginning_id` int(11) NULL DEFAULT NULL,
  1927. `product_gram_weight` decimal(13, 2) NULL DEFAULT NULL,
  1928. `product_gram_weight_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT 'g/m2',
  1929. `push_result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1930. `recv_result` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1931. `product_public_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1932. `search_id` int(10) UNSIGNED NULL DEFAULT NULL,
  1933. `search_status` int(1) NULL DEFAULT NULL,
  1934. `product_cabinet_id` int(11) NULL DEFAULT NULL,
  1935. `product_partially` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1936. PRIMARY KEY (`product_id`) USING BTREE,
  1937. UNIQUE INDEX `product_id`(`product_id` ASC) USING BTREE,
  1938. INDEX `FK_Relationship_12`(`user_id` ASC) USING BTREE,
  1939. INDEX `ctime`(`ctime` ASC) USING BTREE,
  1940. INDEX `status`(`status` ASC) USING BTREE,
  1941. INDEX `company_id`(`company_id` ASC) USING BTREE,
  1942. INDEX `image_id`(`image_id` ASC) USING BTREE,
  1943. INDEX `product_pname`(`product_pname` ASC, `product_cname` ASC, `product_type` ASC, `status` ASC) USING BTREE,
  1944. INDEX `product_cabinet_id`(`product_cabinet_id` ASC) USING BTREE,
  1945. CONSTRAINT `t_product_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  1946. CONSTRAINT `t_product_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  1947. CONSTRAINT `t_product_ibfk_4` FOREIGN KEY (`product_cabinet_id`) REFERENCES `t_confidential_cabinet` (`cabinet_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  1948. CONSTRAINT `t_product_ibfk_5` FOREIGN KEY (`product_cabinet_id`) REFERENCES `t_confidential_cabinet` (`cabinet_id`) ON DELETE SET NULL ON UPDATE CASCADE
  1949. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1950. -- ----------------------------
  1951. -- Table structure for t_product_entry
  1952. -- ----------------------------
  1953. DROP TABLE IF EXISTS `t_product_entry`;
  1954. CREATE TABLE `t_product_entry` (
  1955. `entry_id` int(11) NOT NULL AUTO_INCREMENT,
  1956. `entry_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1957. `entry_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1958. `is_system` tinyint(1) NULL DEFAULT 1,
  1959. `status` int(11) NULL DEFAULT 99,
  1960. `user_id` int(11) NULL DEFAULT NULL,
  1961. `ctime` datetime NULL DEFAULT NULL,
  1962. `utime` datetime NULL DEFAULT NULL,
  1963. PRIMARY KEY (`entry_id`) USING BTREE
  1964. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1965. -- ----------------------------
  1966. -- Table structure for t_product_share
  1967. -- ----------------------------
  1968. DROP TABLE IF EXISTS `t_product_share`;
  1969. CREATE TABLE `t_product_share` (
  1970. `product_ids` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1971. `user_id` int(11) NULL DEFAULT NULL,
  1972. `share_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  1973. `company_id` int(11) NULL DEFAULT NULL,
  1974. `title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  1975. `ctime` datetime NULL DEFAULT NULL,
  1976. `share_time` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1977. `desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1978. `imgUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1979. `share_type` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1980. `share_password` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  1981. `hits` int(11) NULL DEFAULT 0,
  1982. `permission` int(1) NULL DEFAULT 2,
  1983. `permission_view` int(1) NULL DEFAULT 2,
  1984. `sort_type` tinyint(1) NULL DEFAULT 0,
  1985. PRIMARY KEY (`share_id`) USING BTREE,
  1986. INDEX `share_id`(`share_id` ASC) USING BTREE
  1987. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1988. -- ----------------------------
  1989. -- Table structure for t_product_share_error
  1990. -- ----------------------------
  1991. DROP TABLE IF EXISTS `t_product_share_error`;
  1992. CREATE TABLE `t_product_share_error` (
  1993. `error_id` int(11) NOT NULL AUTO_INCREMENT,
  1994. `error_ip` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  1995. `error_number` tinyint(1) NULL DEFAULT NULL,
  1996. `error_time` datetime NULL DEFAULT NULL,
  1997. PRIMARY KEY (`error_id`) USING BTREE
  1998. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  1999. -- ----------------------------
  2000. -- Table structure for t_product_share_permission
  2001. -- ----------------------------
  2002. DROP TABLE IF EXISTS `t_product_share_permission`;
  2003. CREATE TABLE `t_product_share_permission` (
  2004. `per_id` int(11) NOT NULL AUTO_INCREMENT,
  2005. `share_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2006. `user_id` int(11) NOT NULL DEFAULT 0,
  2007. `allow` int(1) NULL DEFAULT 1,
  2008. PRIMARY KEY (`per_id`) USING BTREE,
  2009. INDEX `per_id`(`per_id` ASC) USING BTREE,
  2010. INDEX `user_id`(`user_id` ASC, `share_id` ASC) USING BTREE,
  2011. INDEX `share_id`(`share_id` ASC, `user_id` ASC) USING BTREE,
  2012. CONSTRAINT `t_product_share_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2013. CONSTRAINT `t_product_share_permission_ibfk_3` FOREIGN KEY (`share_id`) REFERENCES `t_product_share` (`share_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2014. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2015. -- ----------------------------
  2016. -- Table structure for t_product_template
  2017. -- ----------------------------
  2018. DROP TABLE IF EXISTS `t_product_template`;
  2019. CREATE TABLE `t_product_template` (
  2020. `template_md5` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2021. `user_id` int(11) NULL DEFAULT NULL,
  2022. `company_id` int(11) NULL DEFAULT NULL,
  2023. `ctime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  2024. `template_imgUrl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2025. `template_number` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2026. `template_color` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2027. PRIMARY KEY (`template_md5`) USING BTREE
  2028. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2029. -- ----------------------------
  2030. -- Table structure for t_product_watermark
  2031. -- ----------------------------
  2032. DROP TABLE IF EXISTS `t_product_watermark`;
  2033. CREATE TABLE `t_product_watermark` (
  2034. `watermark_id` int(11) NOT NULL AUTO_INCREMENT,
  2035. `product_id` int(11) NOT NULL,
  2036. `user_id` int(11) NULL DEFAULT NULL,
  2037. `company_id` int(11) NULL DEFAULT NULL,
  2038. `ctime` datetime NULL DEFAULT NULL,
  2039. `utime` datetime NULL DEFAULT NULL,
  2040. `watermark_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2041. `logo_image_id` int(11) NULL DEFAULT NULL,
  2042. `watermark_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2043. `font_type` tinyint(1) NULL DEFAULT 0,
  2044. `watermark_colour` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2045. `transparency` int(11) NULL DEFAULT 0,
  2046. `font_szie` int(11) NULL DEFAULT 0,
  2047. `row_number` int(11) NULL DEFAULT 0,
  2048. `row_spacing` int(11) NULL DEFAULT 0,
  2049. `column_number` int(11) NULL DEFAULT 0,
  2050. `column_spacing` int(11) NULL DEFAULT 0,
  2051. `angle` int(11) NULL DEFAULT 0,
  2052. PRIMARY KEY (`watermark_id`, `product_id`) USING BTREE,
  2053. UNIQUE INDEX `watermark_id`(`watermark_id` ASC) USING BTREE,
  2054. UNIQUE INDEX `product_id`(`product_id` ASC) USING BTREE
  2055. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2056. -- ----------------------------
  2057. -- Table structure for t_r_product_collection
  2058. -- ----------------------------
  2059. DROP TABLE IF EXISTS `t_r_product_collection`;
  2060. CREATE TABLE `t_r_product_collection` (
  2061. `collection_id` int(11) NOT NULL,
  2062. `product_id` int(11) NOT NULL,
  2063. PRIMARY KEY (`collection_id`, `product_id`) USING BTREE,
  2064. INDEX `product_id`(`product_id` ASC) USING BTREE,
  2065. INDEX `collection_id_2`(`collection_id` ASC) USING BTREE,
  2066. CONSTRAINT `t_r_product_collection_ibfk_1` FOREIGN KEY (`collection_id`) REFERENCES `t_collection` (`collection_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2067. CONSTRAINT `t_r_product_collection_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2068. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2069. -- ----------------------------
  2070. -- Table structure for t_report_account
  2071. -- ----------------------------
  2072. DROP TABLE IF EXISTS `t_report_account`;
  2073. CREATE TABLE `t_report_account` (
  2074. `account_id` int(11) NOT NULL AUTO_INCREMENT,
  2075. `account_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2076. `account_bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2077. `account_bank_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2078. `account_cumulative` double(13, 2) NULL DEFAULT 0.00,
  2079. `ctime` datetime NULL DEFAULT NULL,
  2080. `utime` datetime NULL DEFAULT NULL,
  2081. `user_id` int(11) NULL DEFAULT NULL,
  2082. `permission` tinyint(1) NULL DEFAULT 1,
  2083. `see_user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2084. PRIMARY KEY (`account_id`) USING BTREE
  2085. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2086. -- ----------------------------
  2087. -- Table structure for t_report_forms
  2088. -- ----------------------------
  2089. DROP TABLE IF EXISTS `t_report_forms`;
  2090. CREATE TABLE `t_report_forms` (
  2091. `report_forms_id` int(11) NOT NULL AUTO_INCREMENT,
  2092. `report_forms_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2093. `report_forms_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2094. `report_forms_desc` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2095. `report_forms_count` int(11) NULL DEFAULT 0,
  2096. `status` int(2) NULL DEFAULT 99,
  2097. `ctime` datetime NULL DEFAULT NULL,
  2098. `utime` datetime NULL DEFAULT NULL,
  2099. `forms_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2100. `report_forms_limit` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2101. `report_forms_url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2102. `forms_affair_Ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2103. `tag_limit` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2104. `set_begin` tinyint(1) NULL DEFAULT 2,
  2105. `set_inventory` tinyint(1) NULL DEFAULT 2,
  2106. `report_forms_pid` int(11) NULL DEFAULT NULL,
  2107. `report_forms_prompt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2108. `print_forms_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2109. `report_forms_group_id` int(11) NULL DEFAULT NULL,
  2110. `set_seal_account` tinyint(1) NULL DEFAULT 2,
  2111. `set_achievements` tinyint(1) NULL DEFAULT 2,
  2112. `set_company_account` tinyint(1) NULL DEFAULT 2,
  2113. `report_forms_template` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2114. PRIMARY KEY (`report_forms_id`) USING BTREE,
  2115. INDEX `report_forms_group_id`(`report_forms_group_id` ASC) USING BTREE,
  2116. 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
  2117. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2118. -- ----------------------------
  2119. -- Table structure for t_report_forms_begin
  2120. -- ----------------------------
  2121. DROP TABLE IF EXISTS `t_report_forms_begin`;
  2122. CREATE TABLE `t_report_forms_begin` (
  2123. `begin_id` int(11) NOT NULL AUTO_INCREMENT,
  2124. `user_id` int(11) NULL DEFAULT NULL,
  2125. `report_forms_id` int(11) NULL DEFAULT NULL,
  2126. `begin_customer` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2127. `status` int(2) NULL DEFAULT 99,
  2128. `ctime` datetime NULL DEFAULT NULL,
  2129. `utime` datetime NULL DEFAULT NULL,
  2130. `begin_cumulative` double(16, 2) NULL DEFAULT NULL,
  2131. `admission` tinyint(1) NULL DEFAULT 0,
  2132. PRIMARY KEY (`begin_id`) USING BTREE,
  2133. INDEX `user_id`(`user_id` ASC) USING BTREE,
  2134. INDEX `report_forms_id`(`report_forms_id` ASC) USING BTREE,
  2135. CONSTRAINT `t_report_forms_begin_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2136. 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
  2137. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2138. -- ----------------------------
  2139. -- Table structure for t_report_forms_group
  2140. -- ----------------------------
  2141. DROP TABLE IF EXISTS `t_report_forms_group`;
  2142. CREATE TABLE `t_report_forms_group` (
  2143. `report_forms_group_id` int(11) NOT NULL AUTO_INCREMENT,
  2144. `report_forms_group_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2145. `report_forms_group_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2146. `status` int(11) NULL DEFAULT 99,
  2147. `ctime` datetime NULL DEFAULT NULL,
  2148. `utime` datetime NULL DEFAULT NULL,
  2149. `dtime` datetime NULL DEFAULT NULL,
  2150. PRIMARY KEY (`report_forms_group_id`) USING BTREE
  2151. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2152. -- ----------------------------
  2153. -- Table structure for t_report_forms_permission
  2154. -- ----------------------------
  2155. DROP TABLE IF EXISTS `t_report_forms_permission`;
  2156. CREATE TABLE `t_report_forms_permission` (
  2157. `report_forms_per_id` int(11) NOT NULL AUTO_INCREMENT,
  2158. `report_forms_id` int(11) NOT NULL,
  2159. `user_id` int(11) NOT NULL DEFAULT 0,
  2160. PRIMARY KEY (`report_forms_per_id`) USING BTREE,
  2161. INDEX `user_id`(`user_id` ASC) USING BTREE,
  2162. INDEX `bill_per_id`(`report_forms_per_id` ASC) USING BTREE,
  2163. INDEX `bill_id`(`report_forms_id` ASC) USING BTREE,
  2164. CONSTRAINT `t_report_forms_permission_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2165. 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
  2166. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2167. -- ----------------------------
  2168. -- Table structure for t_report_set
  2169. -- ----------------------------
  2170. DROP TABLE IF EXISTS `t_report_set`;
  2171. CREATE TABLE `t_report_set` (
  2172. `report_set_id` int(11) NOT NULL AUTO_INCREMENT,
  2173. `report_forms_id` int(11) NULL DEFAULT 99,
  2174. `report_set_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2175. `report_set_value` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2176. `ctime` datetime NULL DEFAULT NULL,
  2177. `utime` datetime NULL DEFAULT NULL,
  2178. PRIMARY KEY (`report_set_id`) USING BTREE
  2179. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2180. -- ----------------------------
  2181. -- Table structure for t_role
  2182. -- ----------------------------
  2183. DROP TABLE IF EXISTS `t_role`;
  2184. CREATE TABLE `t_role` (
  2185. `role_id` int(11) NOT NULL AUTO_INCREMENT,
  2186. `role_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2187. `role_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2188. PRIMARY KEY (`role_id`) USING BTREE
  2189. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2190. -- ----------------------------
  2191. -- Table structure for t_rule_new
  2192. -- ----------------------------
  2193. DROP TABLE IF EXISTS `t_rule_new`;
  2194. CREATE TABLE `t_rule_new` (
  2195. `rule_new_id` int(11) NOT NULL AUTO_INCREMENT,
  2196. `user_id` int(11) NULL DEFAULT NULL,
  2197. `product_modular` tinyint(1) NULL DEFAULT 0,
  2198. `product_modular_delete` tinyint(1) NULL DEFAULT 0,
  2199. `product_modular_add` tinyint(1) NULL DEFAULT 0,
  2200. `product_modular_public` tinyint(1) NULL DEFAULT 0,
  2201. `product_modular_private` tinyint(1) NULL DEFAULT 0,
  2202. `product_modular_supplier` tinyint(1) NULL DEFAULT 0,
  2203. `product_modular_push` tinyint(1) NULL DEFAULT 0,
  2204. `product_modular_template` tinyint(1) NULL DEFAULT 0,
  2205. `product_modular_batch_share` tinyint(1) NULL DEFAULT 0,
  2206. `material_modular` tinyint(1) NULL DEFAULT 0,
  2207. `material_modular_edit` tinyint(1) NULL DEFAULT 0,
  2208. `material_modular_delete` tinyint(1) NULL DEFAULT 0,
  2209. `material_modular_push` tinyint(1) NULL DEFAULT 0,
  2210. `documentary_modular_statistics` tinyint(1) NULL DEFAULT 0,
  2211. `documentary_modular_remove` tinyint(1) NULL DEFAULT 0,
  2212. `product_modular_internal_price` tinyint(1) NULL DEFAULT 0,
  2213. `product_cost_accounting` tinyint(1) NULL DEFAULT 0,
  2214. `product_cost_view` tinyint(1) NULL DEFAULT 0,
  2215. `product_confidential_set` tinyint(1) NULL DEFAULT 0,
  2216. `product_confidential_use` tinyint(1) NULL DEFAULT 0,
  2217. `customer_modular_group_secrecy` tinyint(1) NULL DEFAULT 0,
  2218. `customer_modular_group` tinyint(1) NULL DEFAULT 0,
  2219. `product_watermark` tinyint(1) NULL DEFAULT 0,
  2220. `customer_modular` tinyint(1) NULL DEFAULT 0,
  2221. `customer_modular_delete` tinyint(1) NULL DEFAULT 0,
  2222. `customer_modular_customer_edit` tinyint(1) NULL DEFAULT 0,
  2223. `customer_modular_company_edit` tinyint(1) NULL DEFAULT 0,
  2224. `customer_modular_add` tinyint(1) NULL DEFAULT 0,
  2225. `customer_modular_transfer` tinyint(1) NULL DEFAULT 0,
  2226. `customer_modular_set_visible` tinyint(1) NULL DEFAULT 0,
  2227. `machine_modular` tinyint(1) NULL DEFAULT 0,
  2228. `machine_modular_add` tinyint(1) NULL DEFAULT 0,
  2229. `machine_modular_edit` tinyint(1) NULL DEFAULT 0,
  2230. `machine_modular_record` tinyint(1) NULL DEFAULT 0,
  2231. `machine_modular_wait` tinyint(1) NULL DEFAULT 0,
  2232. `shop_modular` tinyint(1) NULL DEFAULT 0,
  2233. `shop_modular_update` tinyint(1) NULL DEFAULT 0,
  2234. `bill_modular` tinyint(1) NULL DEFAULT 0,
  2235. `bill_modular_waste` tinyint(1) NULL DEFAULT 0,
  2236. `bill_modular_set` tinyint(1) NULL DEFAULT 0,
  2237. `affair_modular` tinyint(1) NULL DEFAULT 0,
  2238. `employee_modular` tinyint(1) NULL DEFAULT 0,
  2239. `tag_modular` tinyint(1) NULL DEFAULT 0,
  2240. `report_modular` tinyint(1) NULL DEFAULT 0,
  2241. `report_modular_download` tinyint(1) NULL DEFAULT 0,
  2242. `company_modular` tinyint(1) NULL DEFAULT 0,
  2243. `company_modular_authentication` tinyint(1) NULL DEFAULT 0,
  2244. `affair_recycle_bin` tinyint(1) NULL DEFAULT 0,
  2245. `documentary_modular` tinyint(1) NULL DEFAULT 0,
  2246. `documentary_modular_control` tinyint(1) NULL DEFAULT 0,
  2247. `documentary_modular_report` tinyint(1) NULL DEFAULT 0,
  2248. `print_modular` tinyint(1) NULL DEFAULT 0,
  2249. `documentary_modular_adjustment` tinyint(1) NULL DEFAULT 0,
  2250. `product_modular_public_see` tinyint(1) NULL DEFAULT 0,
  2251. `product_modular_private_see` tinyint(1) NULL DEFAULT 0,
  2252. `affair_all_modify_record_see` tinyint(1) NULL DEFAULT 0,
  2253. `inventory_modular_edit` tinyint(1) NULL DEFAULT 0,
  2254. `image_search` tinyint(1) NULL DEFAULT 0,
  2255. `qr_code_modular` tinyint(1) NULL DEFAULT 0,
  2256. `qr_code_modular_set` tinyint(1) NULL DEFAULT 0,
  2257. `qr_code_modular_delete` tinyint(1) NULL DEFAULT 0,
  2258. `inventory_modular` tinyint(1) NULL DEFAULT 0,
  2259. `inventory_modular_set` tinyint(1) NULL DEFAULT 0,
  2260. `documentary_modify_record_see` tinyint(1) NULL DEFAULT NULL,
  2261. `unified_set_modular` tinyint(1) NULL DEFAULT 0,
  2262. PRIMARY KEY (`rule_new_id`) USING BTREE,
  2263. UNIQUE INDEX `rule_new_id`(`rule_new_id` ASC) USING BTREE,
  2264. INDEX `user_id`(`user_id` ASC) USING BTREE,
  2265. CONSTRAINT `t_rule_new_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2266. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2267. -- ----------------------------
  2268. -- Table structure for t_screen
  2269. -- ----------------------------
  2270. DROP TABLE IF EXISTS `t_screen`;
  2271. CREATE TABLE `t_screen` (
  2272. `screen_id` int(11) NOT NULL AUTO_INCREMENT,
  2273. `user_id` int(11) NULL DEFAULT NULL,
  2274. `column_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2275. `utime` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2276. `screen_type` tinyint(1) NULL DEFAULT 1,
  2277. `screen_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2278. UNIQUE INDEX `frequently_id`(`screen_id` ASC) USING BTREE
  2279. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2280. -- ----------------------------
  2281. -- Table structure for t_seal_account
  2282. -- ----------------------------
  2283. DROP TABLE IF EXISTS `t_seal_account`;
  2284. CREATE TABLE `t_seal_account` (
  2285. `seal_id` int(11) NOT NULL AUTO_INCREMENT,
  2286. `user_id` int(11) NULL DEFAULT NULL,
  2287. `content_id` int(11) NULL DEFAULT NULL,
  2288. `content_type` tinyint(1) NULL DEFAULT 0,
  2289. `content_time` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2290. PRIMARY KEY (`seal_id`) USING BTREE,
  2291. INDEX `user_id`(`user_id` ASC) USING BTREE,
  2292. CONSTRAINT `t_seal_account_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2293. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2294. -- ----------------------------
  2295. -- Table structure for t_shop
  2296. -- ----------------------------
  2297. DROP TABLE IF EXISTS `t_shop`;
  2298. CREATE TABLE `t_shop` (
  2299. `shop_id` int(11) NOT NULL AUTO_INCREMENT,
  2300. `company_id` int(11) NULL DEFAULT NULL,
  2301. `shop_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2302. `shop_urlname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2303. `shop_intro` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2304. `shop_allow_subdomain` smallint(6) NULL DEFAULT 0,
  2305. `shop_open_time` datetime NULL DEFAULT NULL,
  2306. `shop_hits` int(255) NULL DEFAULT 0,
  2307. `shop_wechat_hits` int(255) NULL DEFAULT 0,
  2308. PRIMARY KEY (`shop_id`) USING BTREE
  2309. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2310. -- ----------------------------
  2311. -- Table structure for t_shop_product
  2312. -- ----------------------------
  2313. DROP TABLE IF EXISTS `t_shop_product`;
  2314. CREATE TABLE `t_shop_product` (
  2315. `product_id` int(11) NOT NULL,
  2316. `company_id` int(11) NULL DEFAULT NULL,
  2317. `user_id` int(11) NULL DEFAULT NULL,
  2318. `shop_id` int(11) NULL DEFAULT NULL,
  2319. `product_shop_pname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2320. `product_shop_material` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2321. `product_shop_height` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2322. `product_shop_height_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2323. `product_shop_width` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2324. `product_shop_width_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2325. `product_shop_elasticity` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2326. `product_shop_price_origin` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2327. `product_shop_price_origin_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2328. `product_shop_price_on_sale` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2329. `product_shop_price_on_sale_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2330. `product_shop_inventory` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2331. `product_shop_inventory_unit` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2332. `product_intro` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2333. `product_is_promotion` int(11) NULL DEFAULT NULL,
  2334. `product_is_order` int(255) NULL DEFAULT NULL,
  2335. `product_on_time` datetime NULL DEFAULT NULL,
  2336. `product_tag_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2337. `product_order` int(255) NULL DEFAULT 0,
  2338. `product_promotion` tinyint(1) NULL DEFAULT NULL,
  2339. `product_promotion_start` datetime NULL DEFAULT NULL,
  2340. `product_promotion_end` datetime NULL DEFAULT NULL,
  2341. `product_shop_hits` int(255) UNSIGNED NULL DEFAULT 0,
  2342. `product_shop_hits_weight` int(11) NULL DEFAULT 0,
  2343. PRIMARY KEY (`product_id`) USING BTREE,
  2344. UNIQUE INDEX `product_id`(`product_id` ASC) USING BTREE,
  2345. CONSTRAINT `t_shop_product_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `t_product` (`product_id`) ON DELETE CASCADE ON UPDATE RESTRICT
  2346. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2347. -- ----------------------------
  2348. -- Table structure for t_statement_calculation
  2349. -- ----------------------------
  2350. DROP TABLE IF EXISTS `t_statement_calculation`;
  2351. CREATE TABLE `t_statement_calculation` (
  2352. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  2353. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2354. `affair_id` int(11) NOT NULL,
  2355. `user_id` int(11) NOT NULL,
  2356. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2357. `bill_order_id` int(11) NOT NULL,
  2358. `calculation_key` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2359. `calculation_time` datetime NOT NULL,
  2360. `calculation_value` decimal(22, 6) NOT NULL DEFAULT 0.000000,
  2361. `calculation_condition` varchar(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2362. `calculation_supplement` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2363. `call_time` datetime NOT NULL,
  2364. `calculation_senior_screen` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2365. `calculation_account_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2366. `calculation_product_id` int(11) NOT NULL,
  2367. `calculation_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2368. `calculation_collection_id` int(11) NOT NULL,
  2369. `day` int(11) NULL DEFAULT NULL,
  2370. `calculation_ctime` datetime NULL DEFAULT NULL,
  2371. `calculation_product_specification` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2372. `calculation_product_color` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2373. `calculation_account_category_out` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2374. `receivables_mode` tinyint(1) NOT NULL,
  2375. `bill_order_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2376. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  2377. `bill_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2378. `calculation_receivables_payment_category` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2379. `difference_amount` decimal(22, 8) NULL DEFAULT NULL,
  2380. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  2381. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  2382. INDEX `bill_order_id`(`bill_order_id` ASC) USING BTREE,
  2383. INDEX `call_time`(`call_time` ASC) USING BTREE,
  2384. INDEX ` calculation_value`(`calculation_key` ASC, `affair_id` ASC, `calculation_time` ASC, `calculation_value` ASC, `calculation_condition` ASC, `tagIds` ASC) USING BTREE,
  2385. INDEX `calculation_time`(`calculation_time` ASC, `affair_id` ASC, `calculation_condition` ASC, `tagIds` ASC) USING BTREE
  2386. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2387. -- ----------------------------
  2388. -- Table structure for t_tag_frequently
  2389. -- ----------------------------
  2390. DROP TABLE IF EXISTS `t_tag_frequently`;
  2391. CREATE TABLE `t_tag_frequently` (
  2392. `frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  2393. `user_id` int(11) NOT NULL,
  2394. `tag_id` int(11) NOT NULL,
  2395. `see` tinyint(1) NULL DEFAULT 0,
  2396. `ctime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  2397. PRIMARY KEY (`frequently_id`) USING BTREE,
  2398. INDEX `user_id`(`user_id` ASC) USING BTREE,
  2399. INDEX `tag_id`(`tag_id` ASC) USING BTREE,
  2400. CONSTRAINT `t_tag_frequently_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2401. CONSTRAINT `t_tag_frequently_ibfk_3` FOREIGN KEY (`tag_id`) REFERENCES `t_tag_list` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2402. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2403. -- ----------------------------
  2404. -- Table structure for t_tag_group
  2405. -- ----------------------------
  2406. DROP TABLE IF EXISTS `t_tag_group`;
  2407. CREATE TABLE `t_tag_group` (
  2408. `tag_group_id` int(11) NOT NULL AUTO_INCREMENT,
  2409. `tag_group_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2410. `tag_group_notes` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2411. `tag_category` tinyint(1) NULL DEFAULT NULL,
  2412. `status` tinyint(1) NULL DEFAULT 99,
  2413. `ctime` datetime NULL DEFAULT NULL,
  2414. `utime` datetime NULL DEFAULT NULL,
  2415. `dtime` datetime NULL DEFAULT NULL,
  2416. PRIMARY KEY (`tag_group_id`) USING BTREE
  2417. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2418. -- ----------------------------
  2419. -- Table structure for t_tag_list
  2420. -- ----------------------------
  2421. DROP TABLE IF EXISTS `t_tag_list`;
  2422. CREATE TABLE `t_tag_list` (
  2423. `tag_id` int(11) NOT NULL AUTO_INCREMENT,
  2424. `company_id` int(11) NULL DEFAULT NULL,
  2425. `user_id` int(11) NULL DEFAULT NULL,
  2426. `tag_category` int(11) NULL DEFAULT 0,
  2427. `tag_image_id` int(11) NULL DEFAULT NULL,
  2428. `tag_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2429. `tag_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2430. `tag_desc` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2431. `used_count` int(11) NULL DEFAULT 0,
  2432. `status` int(2) NULL DEFAULT 99,
  2433. `ctime` datetime NULL DEFAULT NULL,
  2434. `utime` datetime NULL DEFAULT NULL,
  2435. `permission` int(1) NULL DEFAULT 1,
  2436. `necessary` int(1) NULL DEFAULT 0,
  2437. `data_protection` int(1) NULL DEFAULT 0,
  2438. `position` int(11) NULL DEFAULT 0,
  2439. `permission_view` int(1) NULL DEFAULT 1,
  2440. `tag_group_id` int(11) NULL DEFAULT 0,
  2441. PRIMARY KEY (`tag_id`) USING BTREE,
  2442. INDEX `t_tag_list_ibfk_1`(`tag_image_id` ASC) USING BTREE
  2443. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2444. -- ----------------------------
  2445. -- Table structure for t_tag_list_rel
  2446. -- ----------------------------
  2447. DROP TABLE IF EXISTS `t_tag_list_rel`;
  2448. CREATE TABLE `t_tag_list_rel` (
  2449. `rel_id` int(11) NOT NULL AUTO_INCREMENT,
  2450. `user_id` int(11) NOT NULL,
  2451. `tag_category` int(11) NULL DEFAULT NULL,
  2452. `content_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2453. `content_type` int(11) NULL DEFAULT 0,
  2454. `tag_id` int(11) NULL DEFAULT NULL,
  2455. `ctime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  2456. PRIMARY KEY (`rel_id`) USING BTREE,
  2457. INDEX `tag_id`(`tag_id` ASC) USING BTREE,
  2458. CONSTRAINT `t_tag_list_rel_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES `t_tag_list` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2459. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2460. -- ----------------------------
  2461. -- Table structure for t_tag_permission
  2462. -- ----------------------------
  2463. DROP TABLE IF EXISTS `t_tag_permission`;
  2464. CREATE TABLE `t_tag_permission` (
  2465. `per_id` int(11) NOT NULL AUTO_INCREMENT,
  2466. `tag_id` int(11) NOT NULL,
  2467. `user_id` int(11) NOT NULL DEFAULT 0,
  2468. `allow` int(1) NULL DEFAULT 1,
  2469. PRIMARY KEY (`per_id`) USING BTREE,
  2470. INDEX `per_id`(`per_id` ASC) USING BTREE,
  2471. INDEX `tag_id`(`tag_id` ASC) USING BTREE,
  2472. INDEX `user_id`(`user_id` ASC) USING BTREE,
  2473. CONSTRAINT `t_tag_permission_ibfk_1` FOREIGN KEY (`tag_id`) REFERENCES `t_tag_list` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2474. CONSTRAINT `t_tag_permission_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2475. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2476. -- ----------------------------
  2477. -- Table structure for t_ticket_calculation
  2478. -- ----------------------------
  2479. DROP TABLE IF EXISTS `t_ticket_calculation`;
  2480. CREATE TABLE `t_ticket_calculation` (
  2481. `calculation_id` int(11) NOT NULL AUTO_INCREMENT,
  2482. `data_id` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2483. `affair_id` int(11) NOT NULL,
  2484. `tagIds` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2485. `calculation_condition` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2486. `calculation_key` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2487. `calculation_time` datetime NOT NULL,
  2488. `calculation_value` decimal(22, 6) NOT NULL DEFAULT 0.000000,
  2489. `call_time` datetime NOT NULL,
  2490. `calculation_note` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2491. `tag_numbers` tinyint(1) NULL DEFAULT 0,
  2492. `ticket_key` varchar(13) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2493. `ticket_time` datetime NOT NULL,
  2494. PRIMARY KEY (`calculation_id`, `data_id`) USING BTREE,
  2495. UNIQUE INDEX `data_id`(`data_id` ASC) USING BTREE,
  2496. INDEX `call_time`(`call_time` ASC) USING BTREE,
  2497. INDEX ` calculation_value`(`affair_id` ASC, `calculation_key` ASC, `calculation_condition` ASC, `calculation_time` ASC, `tagIds` ASC, `ticket_key` ASC, `ticket_time` ASC) USING BTREE
  2498. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2499. -- ----------------------------
  2500. -- Table structure for t_unified_set
  2501. -- ----------------------------
  2502. DROP TABLE IF EXISTS `t_unified_set`;
  2503. CREATE TABLE `t_unified_set` (
  2504. `unified_set_id` int(11) NOT NULL AUTO_INCREMENT,
  2505. `unified_set_title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2506. `unified_set_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2507. `unified_set_type` tinyint(1) NULL DEFAULT 1,
  2508. `user_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2509. PRIMARY KEY (`unified_set_id`) USING BTREE
  2510. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2511. -- ----------------------------
  2512. -- Table structure for t_user
  2513. -- ----------------------------
  2514. DROP TABLE IF EXISTS `t_user`;
  2515. CREATE TABLE `t_user` (
  2516. `user_id` int(11) NOT NULL AUTO_INCREMENT,
  2517. `company_id` int(11) NULL DEFAULT NULL,
  2518. `role_id` int(11) NOT NULL,
  2519. `location_id` int(11) NULL DEFAULT NULL,
  2520. `department_id` int(11) NULL DEFAULT NULL,
  2521. `user_addr` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2522. `user_company_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2523. `user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2524. `user_password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2525. `user_pwdhash` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2526. `user_realname` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2527. `user_gender` tinyint(1) NULL DEFAULT 1,
  2528. `user_avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2529. `user_phonenum` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2530. `user_state` tinyint(1) NULL DEFAULT 0,
  2531. `user_qq` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2532. `user_email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2533. `user_uid` varchar(18) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2534. `user_region` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2535. `visible` tinyint(255) NULL DEFAULT NULL,
  2536. `ctime` datetime NOT NULL,
  2537. `utime` datetime NULL DEFAULT NULL,
  2538. `dtime` datetime NULL DEFAULT NULL,
  2539. `status` decimal(2, 0) NOT NULL DEFAULT 99,
  2540. `user_logtimes` int(11) NULL DEFAULT NULL,
  2541. `user_lastip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2542. `user_lastlogintime` datetime NULL DEFAULT NULL,
  2543. `user_lastackqstring` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2544. `user_lastackurl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2545. `avos_session_token` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2546. `user_lastacktime` datetime NULL DEFAULT NULL,
  2547. `user_lastackdevice` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2548. `user_signup_user_agent` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2549. `auth_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2550. `access_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2551. `tgt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2552. `st` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2553. `sid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2554. `avos_token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2555. `referral_code` int(6) NULL DEFAULT NULL,
  2556. `user_lastaddress` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2557. `necessary` tinyint(1) NULL DEFAULT 0,
  2558. `work_time` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2559. `attendance_id` int(11) NULL DEFAULT NULL,
  2560. `bill_header` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2561. `report_header` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2562. `report_password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2563. `report_password_type` tinyint(1) NULL DEFAULT 0,
  2564. `second_token` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2565. PRIMARY KEY (`user_id`) USING BTREE,
  2566. INDEX `FK_Relationship_2`(`role_id` ASC) USING BTREE,
  2567. INDEX `company_id`(`company_id` ASC) USING BTREE,
  2568. INDEX `department_id`(`department_id` ASC) USING BTREE,
  2569. INDEX `user_name`(`user_name` ASC) USING BTREE,
  2570. INDEX `referral_code`(`referral_code` ASC) USING BTREE,
  2571. INDEX `referral_code_2`(`referral_code` ASC) USING BTREE,
  2572. INDEX `user_phonenum`(`user_phonenum` ASC) USING BTREE,
  2573. CONSTRAINT `FK_Relationship_2` FOREIGN KEY (`role_id`) REFERENCES `t_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2574. CONSTRAINT `t_user_ibfk_2` FOREIGN KEY (`company_id`) REFERENCES `t_company` (`company_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2575. CONSTRAINT `t_user_ibfk_3` FOREIGN KEY (`department_id`) REFERENCES `t_department` (`department_id`) ON DELETE SET NULL ON UPDATE CASCADE
  2576. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2577. -- ----------------------------
  2578. -- Table structure for t_user_attendance
  2579. -- ----------------------------
  2580. DROP TABLE IF EXISTS `t_user_attendance`;
  2581. CREATE TABLE `t_user_attendance` (
  2582. `attendance_id` int(11) NOT NULL AUTO_INCREMENT,
  2583. `attendance_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
  2584. `attendance_time` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2585. `monday` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2586. `tuesday` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2587. `wednesday` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2588. `thursday` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2589. `friday` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2590. `saturday` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2591. `sunday` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT '',
  2592. PRIMARY KEY (`attendance_id`) USING BTREE
  2593. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2594. -- ----------------------------
  2595. -- Table structure for t_user_reminder
  2596. -- ----------------------------
  2597. DROP TABLE IF EXISTS `t_user_reminder`;
  2598. CREATE TABLE `t_user_reminder` (
  2599. `user_id` int(11) NOT NULL,
  2600. `sale_price_reminder` tinyint(1) NULL DEFAULT 0,
  2601. `purchase_price_reminder` tinyint(1) NULL DEFAULT 0,
  2602. `documentary_add_reminder` tinyint(1) NULL DEFAULT 0,
  2603. `documentary_add_son_reminder` tinyint(1) NULL DEFAULT 0,
  2604. `documentary_join_reminder` tinyint(1) NULL DEFAULT 0,
  2605. `documentary_new_affair_join_reminder` tinyint(1) NULL DEFAULT 0,
  2606. `product_image_shear` tinyint(1) NULL DEFAULT 0,
  2607. `documentary_copy_order` tinyint(1) NULL DEFAULT 0,
  2608. `customer_tag_reminder` tinyint(1) NULL DEFAULT 0,
  2609. `inventory_notice_reminder` tinyint(1) NULL DEFAULT 0,
  2610. `documentary_reply_reminder` tinyint(1) NULL DEFAULT 0,
  2611. `screen_affair_list` tinyint(1) NULL DEFAULT 0,
  2612. `screen_documentary_list` tinyint(1) NULL DEFAULT 0,
  2613. PRIMARY KEY (`user_id`) USING BTREE,
  2614. UNIQUE INDEX `user_id`(`user_id` ASC) USING BTREE
  2615. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2616. -- ----------------------------
  2617. -- Table structure for t_user_report_password
  2618. -- ----------------------------
  2619. DROP TABLE IF EXISTS `t_user_report_password`;
  2620. CREATE TABLE `t_user_report_password` (
  2621. `user_id` int(11) NOT NULL,
  2622. `report_password` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '',
  2623. `report_password_type` tinyint(1) NOT NULL DEFAULT 0,
  2624. `report_password_interval` int(11) NULL DEFAULT 0,
  2625. `use_time` datetime NULL DEFAULT NULL,
  2626. `ctime` datetime NULL DEFAULT NULL,
  2627. PRIMARY KEY (`user_id`) USING BTREE,
  2628. CONSTRAINT `t_user_report_password_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2629. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2630. -- ----------------------------
  2631. -- Table structure for t_work
  2632. -- ----------------------------
  2633. DROP TABLE IF EXISTS `t_work`;
  2634. CREATE TABLE `t_work` (
  2635. `work_id` int(11) NOT NULL AUTO_INCREMENT,
  2636. `work_pid` int(11) NULL DEFAULT NULL,
  2637. `work_children_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2638. `affair_id` int(11) NULL DEFAULT NULL,
  2639. `user_id` int(11) NULL DEFAULT NULL,
  2640. `work_type` int(11) NULL DEFAULT NULL,
  2641. `reminder_id` int(11) NULL DEFAULT NULL,
  2642. `image_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2643. `voice_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2644. `content_text` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2645. `ctime` datetime NULL DEFAULT NULL,
  2646. `utime` datetime NULL DEFAULT NULL,
  2647. `work_data_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2648. `work_object_type` tinyint(1) NULL DEFAULT 1,
  2649. `work_object_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2650. `work_theme` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2651. `affair_data_id` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2652. PRIMARY KEY (`work_id`) USING BTREE
  2653. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2654. -- ----------------------------
  2655. -- Table structure for t_work_frequently
  2656. -- ----------------------------
  2657. DROP TABLE IF EXISTS `t_work_frequently`;
  2658. CREATE TABLE `t_work_frequently` (
  2659. `work_frequently_id` int(11) NOT NULL AUTO_INCREMENT,
  2660. `user_id` int(11) NOT NULL,
  2661. `affair_id` int(11) NOT NULL,
  2662. `ctime` datetime NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
  2663. `work_type_notice` tinyint(1) NULL DEFAULT 0,
  2664. `work_type_instructions` tinyint(1) NULL DEFAULT 0,
  2665. `work_type_Assign` tinyint(1) NULL DEFAULT 0,
  2666. PRIMARY KEY (`work_frequently_id`) USING BTREE,
  2667. INDEX `affair_id`(`affair_id` ASC) USING BTREE,
  2668. INDEX `user_id`(`user_id` ASC) USING BTREE,
  2669. CONSTRAINT `t_work_frequently_ibfk_1` FOREIGN KEY (`affair_id`) REFERENCES `t_affair` (`affair_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  2670. CONSTRAINT `t_work_frequently_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `t_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2671. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2672. -- ----------------------------
  2673. -- Table structure for t_work_reminder
  2674. -- ----------------------------
  2675. DROP TABLE IF EXISTS `t_work_reminder`;
  2676. CREATE TABLE `t_work_reminder` (
  2677. `work_id` int(11) NOT NULL,
  2678. `reply_id` int(11) NULL DEFAULT NULL,
  2679. `set_object_type` tinyint(1) NULL DEFAULT NULL,
  2680. `set_object_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2681. `set_frequency` int(11) NULL DEFAULT 0,
  2682. `set_interval` int(11) NULL DEFAULT NULL,
  2683. `set_interval_unit` tinyint(1) NULL DEFAULT NULL,
  2684. `reminder_object_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2685. `reminder_frequency` int(11) NULL DEFAULT 0,
  2686. `reminder_time` datetime NULL DEFAULT NULL,
  2687. `is_reminder` tinyint(1) NULL DEFAULT 0,
  2688. PRIMARY KEY (`work_id`) USING BTREE,
  2689. CONSTRAINT `t_work_reminder_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `t_work` (`work_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2690. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2691. -- ----------------------------
  2692. -- Table structure for t_work_reply
  2693. -- ----------------------------
  2694. DROP TABLE IF EXISTS `t_work_reply`;
  2695. CREATE TABLE `t_work_reply` (
  2696. `reply_id` int(11) NOT NULL AUTO_INCREMENT,
  2697. `reply_pid` int(11) NULL DEFAULT NULL,
  2698. `work_id` int(11) NULL DEFAULT NULL,
  2699. `reply_user_id` int(11) NULL DEFAULT NULL,
  2700. `reply_txt` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2701. `reply_affair_old_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2702. `reply_affair_new_data` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2703. `reply_time` datetime NULL DEFAULT NULL,
  2704. `reply_object_ids` text CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2705. `reply_image` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2706. `reply_voice` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2707. `reply_content` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
  2708. PRIMARY KEY (`reply_id`) USING BTREE,
  2709. INDEX `work_id`(`work_id` ASC) USING BTREE,
  2710. CONSTRAINT `t_work_reply_ibfk_1` FOREIGN KEY (`work_id`) REFERENCES `t_work` (`work_id`) ON DELETE CASCADE ON UPDATE CASCADE
  2711. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
  2712. SET FOREIGN_KEY_CHECKS = 1;