structure.sql 122 KB

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