gxb_core.sql 266 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618
/*
 Navicat Premium Data Transfer

 Source Server         : 154
 Source Server Type    : MySQL
 Source Server Version : 50628
 Source Host           : 192.168.30.154
 Source Database       : gxb_core

 Target Server Type    : MySQL
 Target Server Version : 50628
 File Encoding         : utf-8

 Date: 08/24/2017 10:43:55 AM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `about_us`
-- ----------------------------
DROP TABLE IF EXISTS `about_us`;
CREATE TABLE `about_us` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT '' COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL COMMENT '对应租户id',
  PRIMARY KEY (`id`),
  KEY `index_tenant_id` (`tenant_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='关于我们';

-- ----------------------------
--  Table structure for `admin_users`
-- ----------------------------
DROP TABLE IF EXISTS `admin_users`;
CREATE TABLE `admin_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(255) DEFAULT NULL,
  `sub_type` varchar(255) DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `type_index` (`type`),
  KEY `user_id` (`user_id`),
  KEY `sub_type_index` (`sub_type`)
) ENGINE=InnoDB AUTO_INCREMENT=13864 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `admin_users_courses_classes`
-- ----------------------------
DROP TABLE IF EXISTS `admin_users_courses_classes`;
CREATE TABLE `admin_users_courses_classes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `admin_user_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL,
  `course_class_id` int(11) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `sub_type` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=67643 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有发现任何地方用到';

-- ----------------------------
--  Table structure for `admin_users_permission_records`
-- ----------------------------
DROP TABLE IF EXISTS `admin_users_permission_records`;
CREATE TABLE `admin_users_permission_records` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `admin_user_id` int(11) DEFAULT NULL,
  `record_type` varchar(255) DEFAULT NULL,
  `record_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='废弃表,没有任何地方用到';

-- ----------------------------
--  Table structure for `admin_users_roles`
-- ----------------------------
DROP TABLE IF EXISTS `admin_users_roles`;
CREATE TABLE `admin_users_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `admin_user_id` int(11) DEFAULT NULL,
  `tenants_role_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=926 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `administrators`
-- ----------------------------
DROP TABLE IF EXISTS `administrators`;
CREATE TABLE `administrators` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `username` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `admin` tinyint(1) DEFAULT NULL,
  `email` varchar(255) DEFAULT '',
  `encrypted_password` varchar(255) DEFAULT '',
  `reset_password_token` varchar(255) DEFAULT NULL,
  `reset_password_sent_at` datetime DEFAULT NULL,
  `remember_created_at` datetime DEFAULT NULL,
  `sign_in_count` int(11) DEFAULT NULL,
  `current_sign_in_at` datetime DEFAULT NULL,
  `last_sign_in_at` datetime DEFAULT NULL,
  `current_sign_in_ip` varchar(255) DEFAULT NULL,
  `last_sign_in_ip` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COMMENT='废弃表,没有任何地方用到';

-- ----------------------------
--  Table structure for `announcement`
-- ----------------------------
DROP TABLE IF EXISTS `announcement`;
CREATE TABLE `announcement` (
  `announcement_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `context_id` bigint(20) DEFAULT NULL COMMENT 'context_type对应的id',
  `context_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Course 课程',
  `user_id` bigint(20) DEFAULT NULL,
  `editor_id` bigint(20) DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '标题',
  `body` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT '内容',
  `permalink` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '链接 暂时没用到',
  `position` int(11) DEFAULT NULL COMMENT '序号 暂时没用到',
  `STATUS` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '暂时没用到',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`announcement_id`),
  KEY `context_id_idx` (`context_id`,`context_type`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1238 DEFAULT CHARSET=utf8 COMMENT='课程公告表';

-- ----------------------------
--  Table structure for `announcements`
-- ----------------------------
DROP TABLE IF EXISTS `announcements`;
CREATE TABLE `announcements` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `school_id` int(11) NOT NULL COMMENT '学校id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `desc` mediumtext COMMENT '详情',
  `position` int(11) DEFAULT NULL COMMENT '序号 -1 置顶',
  `status` varchar(255) DEFAULT NULL COMMENT '暂时没有意义',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`id`,`school_id`),
  KEY `tenant_id_idx` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1002 DEFAULT CHARSET=utf8 COMMENT='租户公告表';

-- ----------------------------
--  Table structure for `app_mandatory_version`
-- ----------------------------
DROP TABLE IF EXISTS `app_mandatory_version`;
CREATE TABLE `app_mandatory_version` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `version` varchar(10) NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到app强制更新';

-- ----------------------------
--  Table structure for `app_popup_img`
-- ----------------------------
DROP TABLE IF EXISTS `app_popup_img`;
CREATE TABLE `app_popup_img` (
  `app_popup_img_id` int(11) NOT NULL AUTO_INCREMENT,
  `img_title` varchar(255) DEFAULT NULL COMMENT '图片标题',
  `img_url` varchar(255) DEFAULT NULL COMMENT '图片地址',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `user_id` bigint(20) DEFAULT NULL,
  `editor_id` bigint(20) DEFAULT NULL,
  `start_at` datetime DEFAULT NULL COMMENT '生效时间',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL,
  `btn_url` varchar(255) DEFAULT NULL COMMENT '按钮url',
  PRIMARY KEY (`app_popup_img_id`),
  UNIQUE KEY `timeUnique` (`start_at`,`delete_flag`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8 COMMENT='app每日弹出层图片表';

-- ----------------------------
--  Table structure for `app_popup_str`
-- ----------------------------
DROP TABLE IF EXISTS `app_popup_str`;
CREATE TABLE `app_popup_str` (
  `app_popup_str_id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `user_id` bigint(20) DEFAULT NULL,
  `editor_id` bigint(20) DEFAULT NULL,
  `start_at` datetime DEFAULT NULL COMMENT '生效时间',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`app_popup_str_id`),
  UNIQUE KEY `timeUnique` (`start_at`,`delete_flag`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=143 DEFAULT CHARSET=utf8 COMMENT='app每日弹出层文字表';

-- ----------------------------
--  Table structure for `app_startup`
-- ----------------------------
DROP TABLE IF EXISTS `app_startup`;
CREATE TABLE `app_startup` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `image_name` varchar(255) DEFAULT NULL COMMENT '图片名称',
  `ios_url` varchar(255) DEFAULT NULL COMMENT 'IOS',
  `android_url` varchar(255) DEFAULT NULL COMMENT 'Android',
  `position` int(11) DEFAULT NULL COMMENT '暂时没用',
  `status` varchar(255) DEFAULT NULL COMMENT 'online:发布 offline:下线',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '暂无租户 默认-99',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='app启动页表';

-- ----------------------------
--  Table structure for `app_version`
-- ----------------------------
DROP TABLE IF EXISTS `app_version`;
CREATE TABLE `app_version` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `file_name` varchar(255) NOT NULL COMMENT '文件名',
  `version` varchar(100) NOT NULL COMMENT '版本号',
  `created_at` datetime NOT NULL,
  `type` varchar(100) DEFAULT NULL COMMENT 'app版本:android,ios',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=66 DEFAULT CHARSET=utf8 COMMENT='App静默更新使用表';

-- ----------------------------
--  Table structure for `asset`
-- ----------------------------
DROP TABLE IF EXISTS `asset`;
CREATE TABLE `asset` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `viewable_id` int(11) DEFAULT NULL,
  `viewable_type` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL,
  `attachment_width` int(11) DEFAULT NULL,
  `attachment_height` int(11) DEFAULT NULL,
  `attachment_file_size` int(11) DEFAULT NULL,
  `attachment_content_type` varchar(255) DEFAULT NULL,
  `attachment_file_name` varchar(255) DEFAULT NULL,
  `attachment_updated_at` datetime DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL COMMENT '附件地址',
  `alt` varchar(255) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL COMMENT '附件类型',
  `position` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `cas_user_id` int(11) DEFAULT NULL,
  `cms_user_id` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_viewable_id` (`viewable_id`),
  KEY `index_viewable_type` (`viewable_type`),
  KEY `index_type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=647089 DEFAULT CHARSET=utf8 COMMENT='附件表';

-- ----------------------------
--  Table structure for `assignment_resubmit`
-- ----------------------------
DROP TABLE IF EXISTS `assignment_resubmit`;
CREATE TABLE `assignment_resubmit` (
  `submission_id` int(11) NOT NULL,
  `context_id` int(11) DEFAULT NULL,
  `context_type` varchar(255) DEFAULT NULL,
  `submitted_id` int(11) DEFAULT NULL,
  `submitted_type` varchar(255) DEFAULT NULL,
  `assignment_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `body` mediumtext,
  `url` varchar(255) DEFAULT NULL,
  `grade` varchar(255) DEFAULT NULL,
  `score` double(12,2) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `submission_type` varchar(255) DEFAULT NULL,
  `processed` tinyint(1) DEFAULT NULL,
  `process_attempts` int(11) DEFAULT NULL,
  `published_score` double(12,2) DEFAULT NULL,
  `graded_at` datetime DEFAULT NULL,
  `graded_comment` mediumtext,
  `grader_id` int(11) DEFAULT NULL,
  `late` tinyint(1) DEFAULT NULL,
  `is_master` tinyint(1) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `peer_review_comment` mediumtext,
  `is_distribution` tinyint(4) DEFAULT '0',
  `is_calculateScore` tinyint(4) DEFAULT '0',
  `resubmit_user_id` int(11) DEFAULT NULL COMMENT '作业打回人',
  `resubmit_at` datetime DEFAULT NULL COMMENT '作业打回时间',
  PRIMARY KEY (`submission_id`),
  KEY `submitted_id_index` (`submitted_id`),
  KEY `user_id_index` (`user_id`),
  KEY `type_index` (`submitted_type`),
  KEY `context_id_index` (`context_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='作业重新提交记录表(前面字段取自submission表)';

-- ----------------------------
--  Table structure for `banner`
-- ----------------------------
DROP TABLE IF EXISTS `banner`;
CREATE TABLE `banner` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `inner_name` varchar(255) DEFAULT NULL COMMENT '暂时没用',
  `category` varchar(255) DEFAULT 'home' COMMENT '暂时没用',
  `title` varchar(255) DEFAULT '' COMMENT '名称',
  `subtitle` varchar(255) DEFAULT '' COMMENT '暂时没用',
  `url` varchar(255) DEFAULT NULL COMMENT 'PC端url',
  `button_text` varchar(255) DEFAULT '进入课程' COMMENT '暂时没用',
  `online` tinyint(1) DEFAULT NULL COMMENT '暂时没用',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '暂时没用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户id',
  `app_url` varchar(255) DEFAULT NULL COMMENT '移动端跳转链接',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1310 DEFAULT CHARSET=utf8 COMMENT='轮播图表';

-- ----------------------------
--  Table structure for `bigbang_user`
-- ----------------------------
DROP TABLE IF EXISTS `bigbang_user`;
CREATE TABLE `bigbang_user` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `openid` varchar(255) DEFAULT NULL,
  `unionid` varchar(255) DEFAULT NULL,
  `delete_flag` varchar(4) NOT NULL DEFAULT '1',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4294 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='BigBang用户表';

-- ----------------------------
--  Table structure for `category`
-- ----------------------------
DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
  `category_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) DEFAULT NULL COMMENT '父级id null 为一级分类',
  `category_name` varchar(255) DEFAULT NULL COMMENT '分类名称',
  `short_name` varchar(255) DEFAULT NULL COMMENT '暂时没用',
  `description` mediumtext COMMENT '暂时没用',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '暂时没用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '默认内部系统tenantid',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `old_category_id` bigint(20) DEFAULT NULL COMMENT '暂时没用',
  `category_type` smallint(1) unsigned DEFAULT '0' COMMENT '分类类型 0-默认分类,1-链接分类 2-广告分类',
  `category_url` varchar(255) DEFAULT NULL COMMENT '分类链接',
  `image_name` varchar(255) DEFAULT NULL COMMENT '图片名称',
  `image_url` varchar(255) DEFAULT NULL COMMENT '图片地址',
  `advertisement_desc` varchar(255) DEFAULT NULL COMMENT '广告描述',
  PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1149 DEFAULT CHARSET=utf8 COMMENT='课程分类表';

-- ----------------------------
--  Table structure for `chalk_wechat_account`
-- ----------------------------
DROP TABLE IF EXISTS `chalk_wechat_account`;
CREATE TABLE `chalk_wechat_account` (
  `chalk_wechat_account_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `login_key` varchar(255) DEFAULT NULL COMMENT '第三方平台id',
  `key_type` varchar(255) NOT NULL COMMENT '第三方平台',
  `nick_name` varchar(255) DEFAULT NULL COMMENT '第三方平台昵称',
  `union_id` varchar(255) DEFAULT NULL COMMENT '用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。',
  `open_id` varchar(255) DEFAULT NULL COMMENT '保存新版粉笔匠的open_id',
  `delete_flag` tinyint(4) DEFAULT '1' COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`chalk_wechat_account_id`),
  UNIQUE KEY `login_key` (`login_key`),
  UNIQUE KEY `union_id` (`union_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6167 DEFAULT CHARSET=utf8 COMMENT='粉笔匠微信账号表';

-- ----------------------------
--  Table structure for `charging_article`
-- ----------------------------
DROP TABLE IF EXISTS `charging_article`;
CREATE TABLE `charging_article` (
  `article_id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `author` varchar(255) DEFAULT NULL COMMENT '作者',
  `desc` varchar(255) DEFAULT NULL COMMENT '简介',
  `category_id` bigint(11) DEFAULT NULL COMMENT '所属分类id',
  `cover` varchar(100) DEFAULT NULL COMMENT '封面',
  `content` mediumtext COMMENT '内容',
  `user_id` bigint(11) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL COMMENT '0 草稿  1 发布 2下线',
  `position` int(10) DEFAULT NULL,
  `unread_count` int(10) DEFAULT NULL COMMENT '评论未读数',
  `vote_count` int(10) DEFAULT NULL COMMENT '点赞数',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL,
  `tenant_id` bigint(10) DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`article_id`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8mb4 COMMENT='app充充电的文章表';

-- ----------------------------
--  Table structure for `charging_category`
-- ----------------------------
DROP TABLE IF EXISTS `charging_category`;
CREATE TABLE `charging_category` (
  `category_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `category_name` varchar(255) NOT NULL COMMENT '分类名字',
  `position` int(10) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL COMMENT '状态:0未发布   1已发布',
  `user_id` bigint(10) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL,
  `tenant_id` bigint(10) DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`category_id`)
) ENGINE=InnoDB AUTO_INCREMENT=140 DEFAULT CHARSET=utf8 COMMENT='app充充电的文章分类表';

-- ----------------------------
--  Table structure for `charging_comment`
-- ----------------------------
DROP TABLE IF EXISTS `charging_comment`;
CREATE TABLE `charging_comment` (
  `comment_id` bigint(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL COMMENT '姓名',
  `anonymity` tinyint(4) DEFAULT NULL COMMENT '0 非匿名 1匿名',
  `position` tinyint(4) DEFAULT NULL COMMENT '-1置顶  null为不置顶',
  `content` varchar(400) DEFAULT NULL COMMENT '评论内容',
  `article_id` bigint(11) DEFAULT NULL COMMENT '评论的文章的id',
  `is_read` tinyint(4) DEFAULT NULL COMMENT '0 已读 1 未读',
  `in_wall` tinyint(4) DEFAULT NULL COMMENT '0 未上墙 1已上墙',
  `vote_count` int(10) DEFAULT NULL COMMENT '点赞个数',
  `user_id` bigint(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`comment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8mb4 COMMENT='app充充电的评论表';

-- ----------------------------
--  Table structure for `charging_post`
-- ----------------------------
DROP TABLE IF EXISTS `charging_post`;
CREATE TABLE `charging_post` (
  `post_id` bigint(11) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(11) DEFAULT NULL COMMENT '用户id',
  `content` mediumtext COMMENT '回复内容',
  `comment_id` bigint(11) DEFAULT NULL COMMENT '评论id',
  `created_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL,
  PRIMARY KEY (`post_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='充充电评论的回复表';

-- ----------------------------
--  Table structure for `charging_vote`
-- ----------------------------
DROP TABLE IF EXISTS `charging_vote`;
CREATE TABLE `charging_vote` (
  `vote_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `context_id` bigint(20) DEFAULT NULL,
  `context_type` varchar(10) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '文章 article 评论 comment',
  `user_id` bigint(20) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`vote_id`),
  KEY `index_context_id` (`context_id`) USING BTREE,
  KEY `index_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=208 DEFAULT CHARSET=utf8 COMMENT='app充充电的文章点赞表';

-- ----------------------------
--  Table structure for `class`
-- ----------------------------
DROP TABLE IF EXISTS `class`;
CREATE TABLE `class` (
  `class_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '视频上传小工具要用uuid',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `from_tenant_id` bigint(20) DEFAULT NULL COMMENT '购买租户id',
  `class_name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '班次名称',
  `intro` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '班次简介',
  `class_type` varchar(50) CHARACTER SET utf8 DEFAULT 'Class' COMMENT '班次类型,MicroClass Class 微课 普通班次',
  `level` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '班次难度:10 易 20 中 30 难',
  `use_type` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '班次使用性质:10 自用 20 售卖',
  `credit_score` decimal(5,2) DEFAULT NULL COMMENT '学分',
  `validate_type` varchar(255) CHARACTER SET utf8 DEFAULT '30' COMMENT '校验类型: 10 其他用户 20 全校可选 30 授权 40 付费',
  `teach_mode` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '教学模式: 10 开放学习模式 20 传统学习模式 30 顺序学习模式 40 条件解锁模式',
  `start_at` datetime DEFAULT NULL COMMENT '开课时间',
  `conclude_at` datetime DEFAULT NULL COMMENT '结课时间',
  `score_publish_day` int(11) DEFAULT NULL COMMENT '成绩公布时间(N天之后)',
  `study_hour` int(11) DEFAULT NULL COMMENT '课程学时',
  `experience_num` int(11) DEFAULT NULL COMMENT '试学的前N个视频',
  `status` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '状态: 10 待发布 20 预发布 30 已发布 40 关闭',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `is_documented` tinyint(1) DEFAULT '0' COMMENT '是否归档',
  `unlock_quiz_score` int(11) DEFAULT '0' COMMENT '条件模式解锁条件,测验需要达到的分数',
  `type` varchar(50) CHARACTER SET utf8 DEFAULT 'Class' COMMENT '班次类型,MiniClass Class Self 微课 普通班次 邀请课',
  `position` bigint(20) DEFAULT NULL COMMENT '排序',
  `is_top` tinyint(4) DEFAULT NULL COMMENT '是否置顶 -1:置顶,null:不置顶',
  `is_move` tinyint(4) DEFAULT '0' COMMENT '0 未移动数据 1 已移动数据',
  `least_move_at` datetime DEFAULT NULL COMMENT '最早移动时间',
  `dropping_self` tinyint(4) DEFAULT '0' COMMENT '是否允许自主退选,1是允许,0是禁止',
  `practice_hour` int(11) DEFAULT NULL COMMENT '实践课时',
  `theory_hour` int(11) DEFAULT NULL COMMENT '理论课时',
  `evaluation_mode` tinyint(4) DEFAULT NULL COMMENT '考核方式 1:线上考试 2:线下考试 3:答辩 4:大作业',
  `version` varchar(255) DEFAULT NULL COMMENT '版本',
  `research_personnel` varchar(255) DEFAULT NULL COMMENT '研发人员',
  `from_class` bigint(20) DEFAULT NULL COMMENT '班次复制售卖源',
  `root_class` bigint(20) DEFAULT NULL COMMENT '班次复制根源',
  PRIMARY KEY (`class_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7584 DEFAULT CHARSET=utf8mb4 COMMENT='班次表';

-- ----------------------------
--  Table structure for `class_asset`
-- ----------------------------
DROP TABLE IF EXISTS `class_asset`;
CREATE TABLE `class_asset` (
  `asset_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `viewable_id` bigint(20) DEFAULT NULL,
  `viewable_type` varchar(255) DEFAULT NULL COMMENT '所属类型',
  `title` varchar(255) DEFAULT NULL,
  `attachment_width` int(11) DEFAULT NULL,
  `attachment_height` int(11) DEFAULT NULL,
  `attachment_file_size` int(11) DEFAULT NULL,
  `attachment_content_type` varchar(255) DEFAULT NULL,
  `attachment_file_name` varchar(255) DEFAULT NULL,
  `attachment_updated_at` datetime DEFAULT NULL,
  `link` varchar(255) DEFAULT NULL COMMENT '链接地址',
  `type` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`asset_id`),
  KEY `index_class_id` (`class_id`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=56719 DEFAULT CHARSET=utf8 COMMENT='班次相关附件表';

-- ----------------------------
--  Table structure for `class_assignment`
-- ----------------------------
DROP TABLE IF EXISTS `class_assignment`;
CREATE TABLE `class_assignment` (
  `assignment_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次Id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `due_at` datetime DEFAULT NULL COMMENT '作业提交截止时间',
  `unlock_at` datetime DEFAULT NULL COMMENT '解锁时间',
  `grading_standard` mediumtext COMMENT '评分标准',
  `is_distribution` tinyint(4) DEFAULT NULL COMMENT '互评作业是否已经分配 1 是 0 不是',
  `is_calculate_score` tinyint(4) DEFAULT NULL COMMENT '互评作业是否已经计算成绩  1 是 0 不是',
  `is_peer_review` tinyint(4) DEFAULT NULL COMMENT '是否是互评作业 1 是 0 不是',
  `is_anonymous` tinyint(4) DEFAULT NULL COMMENT '是否匿名显示 1 是 0 不是',
  `auto_distribution_num` int(11) DEFAULT NULL COMMENT '互评作业分配份数',
  `peer_review_started_at` datetime DEFAULT NULL COMMENT '互评开始时间',
  `peer_review_ended_at` datetime DEFAULT NULL COMMENT '互评结束时间',
  `score_publish_at` datetime DEFAULT NULL COMMENT '成绩公布时间',
  `score` decimal(5,2) DEFAULT '100.00' COMMENT '满分',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态 同班次发布状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `sub_type` varchar(20) DEFAULT NULL COMMENT '提交类型,文本加附件 录制编程 asset programming',
  `programming_source` tinyint(4) DEFAULT NULL COMMENT '互动编程来源默认0 时速云1 ',
  PRIMARY KEY (`assignment_id`),
  KEY `index_class_id` (`class_id`),
  KEY `index_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18389 DEFAULT CHARSET=utf8 COMMENT='班次作业表';

-- ----------------------------
--  Table structure for `class_category`
-- ----------------------------
DROP TABLE IF EXISTS `class_category`;
CREATE TABLE `class_category` (
  `class_category_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `category_id` bigint(20) NOT NULL COMMENT '分类id',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态 暂时没用',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`class_category_id`),
  KEY `index_category_id` (`category_id`),
  KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3988 DEFAULT CHARSET=utf8 COMMENT='班次与课程分类关联表';

-- ----------------------------
--  Table structure for `class_chapter`
-- ----------------------------
DROP TABLE IF EXISTS `class_chapter`;
CREATE TABLE `class_chapter` (
  `chapter_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `item_id` bigint(20) NOT NULL COMMENT '节id',
  `unit_id` bigint(20) NOT NULL COMMENT '章id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `content_id` bigint(20) NOT NULL COMMENT 'video 等id',
  `content_type` varchar(255) NOT NULL COMMENT '类型,比如video',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态: 10 未发布 30 已发布',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`chapter_id`),
  KEY `index_item_id` (`item_id`),
  KEY `index_unit_id` (`unit_id`),
  KEY `index_content_id` (`content_id`),
  KEY `delete_flag_index` (`delete_flag`),
  KEY `class_id_index` (`class_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=318245 DEFAULT CHARSET=utf8 COMMENT='班次内容表(unit-item-chapter结构)';

-- ----------------------------
--  Table structure for `class_collection`
-- ----------------------------
DROP TABLE IF EXISTS `class_collection`;
CREATE TABLE `class_collection` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL COMMENT '收藏用户id',
  `class_id` int(11) DEFAULT NULL COMMENT '班次id',
  `status` int(11) DEFAULT NULL COMMENT '暂时没用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=106269 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='班次收藏表';

-- ----------------------------
--  Table structure for `class_copy`
-- ----------------------------
DROP TABLE IF EXISTS `class_copy`;
CREATE TABLE `class_copy` (
  `class_id` bigint(20) NOT NULL,
  `from_class_id` bigint(20) NOT NULL COMMENT '源班次ID',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `from_tenant_id` bigint(20) DEFAULT NULL COMMENT '源班次租户id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='班次复制售卖记录表';

-- ----------------------------
--  Table structure for `class_courseware`
-- ----------------------------
DROP TABLE IF EXISTS `class_courseware`;
CREATE TABLE `class_courseware` (
  `courseware_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `description` mediumtext COMMENT '描述',
  `courseware_count` int(5) DEFAULT '0' COMMENT '课件个数',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`courseware_id`)
) ENGINE=InnoDB AUTO_INCREMENT=63366 DEFAULT CHARSET=utf8 COMMENT='班次课件表';

-- ----------------------------
--  Table structure for `class_document_relate`
-- ----------------------------
DROP TABLE IF EXISTS `class_document_relate`;
CREATE TABLE `class_document_relate` (
  `document_relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `context_id` bigint(20) NOT NULL COMMENT '对应的id(比如课件)',
  `context_type` varchar(255) DEFAULT NULL COMMENT '所属类型,比如课件',
  `document_id` bigint(20) NOT NULL COMMENT 'document id',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`document_relate_id`),
  KEY `index_context_id` (`context_id`),
  KEY `index_document_id` (`document_id`)
) ENGINE=InnoDB AUTO_INCREMENT=77908 DEFAULT CHARSET=utf8 COMMENT='班次文档关联表';

-- ----------------------------
--  Table structure for `class_doing`
-- ----------------------------
DROP TABLE IF EXISTS `class_doing`;
CREATE TABLE `class_doing` (
  `class_doing_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `doing_id` bigint(20) NOT NULL COMMENT '班次id',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`class_doing_id`)
) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到以前微课用到';

-- ----------------------------
--  Table structure for `class_group`
-- ----------------------------
DROP TABLE IF EXISTS `class_group`;
CREATE TABLE `class_group` (
  `group_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `group_name` varchar(255) DEFAULT NULL COMMENT '班组名称',
  `user_num` int(11) NOT NULL COMMENT '学生数量',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`group_id`),
  KEY `index_group_id` (`group_id`),
  KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=91877 DEFAULT CHARSET=utf8 COMMENT='班组表';

-- ----------------------------
--  Table structure for `class_group_teacher`
-- ----------------------------
DROP TABLE IF EXISTS `class_group_teacher`;
CREATE TABLE `class_group_teacher` (
  `group_teacher_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `group_id` bigint(20) DEFAULT NULL COMMENT '班组id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `teacher_id` bigint(20) NOT NULL COMMENT '教师用户id',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`group_teacher_id`),
  KEY `index_teacher_id` (`teacher_id`),
  KEY `index_group_id` (`group_id`),
  KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=32799 DEFAULT CHARSET=utf8 COMMENT='班次老师管理班组表';

-- ----------------------------
--  Table structure for `class_group_user`
-- ----------------------------
DROP TABLE IF EXISTS `class_group_user`;
CREATE TABLE `class_group_user` (
  `group_user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `group_id` bigint(20) NOT NULL COMMENT '班组id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `student_user_id` bigint(20) DEFAULT NULL COMMENT '学生用户id(user表的user_id)',
  `source` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '数据来源:10 自选 20 导入',
  `status` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '状态',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用 -1退选',
  `no` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `bindingFlag` tinyint(1) DEFAULT NULL COMMENT '绑定状态 1 已绑定 0 未绑定',
  `name` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '姓名',
  PRIMARY KEY (`group_user_id`),
  KEY `index_group_id` (`group_id`),
  KEY `index_class_id` (`class_id`),
  KEY `index_student_user_id` (`student_user_id`),
  KEY `index_tenant_id` (`tenant_id`),
  KEY `index_no` (`no`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=700455 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='班次加入学生表';

-- ----------------------------
--  Table structure for `class_info`
-- ----------------------------
DROP TABLE IF EXISTS `class_info`;
CREATE TABLE `class_info` (
  `class_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `description` mediumtext COMMENT '班次介绍',
  `class_cover` varchar(255) DEFAULT NULL COMMENT '班次封面',
  `promotional_video` varchar(255) DEFAULT NULL COMMENT '班次宣传视频',
  `promotional_video_srt` varchar(255) DEFAULT NULL COMMENT '班次宣传视频字幕',
  `promotional_video_cover` varchar(255) DEFAULT NULL COMMENT '班次宣传视频封面',
  `teach_plan` mediumtext COMMENT '教学安排',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `cultivate` mediumtext COMMENT '培养目标',
  `first_study` varchar(255) DEFAULT NULL COMMENT '先修课名称',
  `outline_link` varchar(255) DEFAULT NULL COMMENT '标准大纲',
  `courseware_link` varchar(255) DEFAULT NULL COMMENT '标准课件',
  `courseware_title` varchar(255) DEFAULT NULL COMMENT '标准课件文件名',
  `outline_title` varchar(255) DEFAULT NULL COMMENT '标准大纲文件名',
  `remarks` text COMMENT '备注',
  `material_ids` varchar(45) DEFAULT NULL COMMENT '参考教材(教材表id) 已废弃',
  PRIMARY KEY (`class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='班次信息表与class 配合使用';

-- ----------------------------
--  Table structure for `class_instructor`
-- ----------------------------
DROP TABLE IF EXISTS `class_instructor`;
CREATE TABLE `class_instructor` (
  `class_instructor_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `instructor_id` bigint(20) NOT NULL COMMENT '授课老师id',
  `instructor_name` varchar(255) DEFAULT NULL COMMENT '授课老师名称',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`class_instructor_id`),
  KEY `index_instructor_id` (`instructor_id`),
  KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13468 DEFAULT CHARSET=utf8 COMMENT='班次与讲师关联关系表';

-- ----------------------------
--  Table structure for `class_invitation_code`
-- ----------------------------
DROP TABLE IF EXISTS `class_invitation_code`;
CREATE TABLE `class_invitation_code` (
  `invitation_code_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `invitation_code` varchar(20) NOT NULL COMMENT '口令码',
  `status` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 可用 0 不可用',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`invitation_code_id`),
  KEY `invitation_code_index` (`invitation_code`),
  KEY `class_index` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=741 DEFAULT CHARSET=utf8 COMMENT='班次邀请码表';

-- ----------------------------
--  Table structure for `class_item`
-- ----------------------------
DROP TABLE IF EXISTS `class_item`;
CREATE TABLE `class_item` (
  `item_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `unit_id` bigint(20) NOT NULL COMMENT '单元id',
  `class_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `unlock_at` datetime DEFAULT NULL COMMENT '解锁时间',
  `end_at` datetime DEFAULT NULL COMMENT '结束时间',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态: 10 未发布 30 已发布',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `teaching_design_id` bigint(20) DEFAULT NULL COMMENT '教学设计id',
  PRIMARY KEY (`item_id`),
  KEY `index_unit_id` (`unit_id`)
) ENGINE=InnoDB AUTO_INCREMENT=74446 DEFAULT CHARSET=utf8 COMMENT='班次节表';

-- ----------------------------
--  Table structure for `class_lab`
-- ----------------------------
DROP TABLE IF EXISTS `class_lab`;
CREATE TABLE `class_lab` (
  `class_lab_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `class_id` bigint(20) DEFAULT NULL COMMENT '班级ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT '添加用户',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改用户',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户ID',
  `title` varchar(255) DEFAULT NULL COMMENT '该资源在某一个章节的标题',
  `lab_count` int(11) DEFAULT NULL COMMENT '该资源在某一个章节使用次数',
  `position` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除',
  `created_at` datetime DEFAULT NULL COMMENT '添加时间',
  `updated_at` datetime DEFAULT NULL COMMENT '修改时间',
  `lab_id` bigint(20) DEFAULT NULL COMMENT '实验ID',
  PRIMARY KEY (`class_lab_id`)
) ENGINE=InnoDB AUTO_INCREMENT=86 DEFAULT CHARSET=utf8 COMMENT='班级的实验';

-- ----------------------------
--  Table structure for `class_level`
-- ----------------------------
DROP TABLE IF EXISTS `class_level`;
CREATE TABLE `class_level` (
  `class_level_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `level_name` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`class_level_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='班次级别表';

-- ----------------------------
--  Table structure for `class_level_relate`
-- ----------------------------
DROP TABLE IF EXISTS `class_level_relate`;
CREATE TABLE `class_level_relate` (
  `class_level_relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_level_id` bigint(20) DEFAULT NULL COMMENT 'class level 表的id',
  `class_id` bigint(20) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`class_level_relate_id`,`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=510 DEFAULT CHARSET=utf8 COMMENT='班次与级别关联关系表';

-- ----------------------------
--  Table structure for `class_menu_set`
-- ----------------------------
DROP TABLE IF EXISTS `class_menu_set`;
CREATE TABLE `class_menu_set` (
  `menu_set_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `type` varchar(20) NOT NULL DEFAULT '' COMMENT '菜单类型',
  `status` tinyint(20) NOT NULL COMMENT '状态 1:存在;0:不存在',
  `created_at` datetime NOT NULL COMMENT '创建时间',
  `updated_at` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`menu_set_id`),
  KEY `context_id_index` (`class_id`),
  KEY `type_index` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=34540 DEFAULT CHARSET=utf8 COMMENT='菜单配置表';

-- ----------------------------
--  Table structure for `class_note`
-- ----------------------------
DROP TABLE IF EXISTS `class_note`;
CREATE TABLE `class_note` (
  `note_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `chapter_id` bigint(20) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) DEFAULT NULL,
  `body` mediumtext COMMENT '内容',
  `is_public` tinyint(1) DEFAULT NULL COMMENT '是否公开 0不公开 1公开',
  `vote_log_count` int(11) DEFAULT NULL COMMENT '点赞次数',
  `collect_count` int(11) DEFAULT NULL COMMENT '收藏次数',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`note_id`),
  UNIQUE KEY `class_chapter_user_unque` (`class_id`,`chapter_id`,`user_id`) USING BTREE,
  KEY `index_chapter_id` (`chapter_id`) USING BTREE,
  KEY `index_note_id` (`note_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=538 DEFAULT CHARSET=utf8 COMMENT='学生笔记表';

-- ----------------------------
--  Table structure for `class_note_collection`
-- ----------------------------
DROP TABLE IF EXISTS `class_note_collection`;
CREATE TABLE `class_note_collection` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `note_id` int(11) DEFAULT NULL,
  `chapter_id` bigint(20) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `index_user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=106212 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='学生笔记收藏表';

-- ----------------------------
--  Table structure for `class_page`
-- ----------------------------
DROP TABLE IF EXISTS `class_page`;
CREATE TABLE `class_page` (
  `page_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `link` varchar(255) DEFAULT NULL COMMENT '链接,只有类型是链接类型的时候',
  `type` varchar(255) DEFAULT NULL COMMENT 'Link,Text类型,链接类型或者富文本类型',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`page_id`)
) ENGINE=InnoDB AUTO_INCREMENT=33939 DEFAULT CHARSET=utf8 COMMENT='班次页面表';

-- ----------------------------
--  Table structure for `class_pop_quiz`
-- ----------------------------
DROP TABLE IF EXISTS `class_pop_quiz`;
CREATE TABLE `class_pop_quiz` (
  `class_pop_quiz_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `unit_id` bigint(20) DEFAULT NULL,
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `quiz_questions_count` int(11) DEFAULT NULL COMMENT '测验题目数',
  `time` int(11) DEFAULT NULL COMMENT '限时',
  `hide_results` tinyint(4) DEFAULT NULL COMMENT '是否显示结果 1 是 0 不是',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态(10:未发布;20:进行中;30:已结束)',
  `publish_at` datetime DEFAULT NULL COMMENT '发布时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `school_room_id` bigint(20) DEFAULT '0' COMMENT '课堂id',
  PRIMARY KEY (`class_pop_quiz_id`),
  KEY `index_class_id` (`class_id`),
  KEY `index_unit_id` (`unit_id`),
  KEY `index_status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=354 DEFAULT CHARSET=utf8 COMMENT='班次随堂测验表';

-- ----------------------------
--  Table structure for `class_push_message`
-- ----------------------------
DROP TABLE IF EXISTS `class_push_message`;
CREATE TABLE `class_push_message` (
  `message_id` int(20) NOT NULL AUTO_INCREMENT,
  `class_id` int(20) NOT NULL,
  `user_id` int(20) NOT NULL COMMENT '发布消息的教师id',
  `body` mediumtext COMMENT '督学内容',
  `type` varchar(255) DEFAULT NULL COMMENT '发送消息的类型 督学:Urge',
  `editor_id` int(20) DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`message_id`),
  KEY `classIdAndUserId` (`class_id`,`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=207 DEFAULT CHARSET=utf8 COMMENT='班次推送消息表';

-- ----------------------------
--  Table structure for `class_question_relate`
-- ----------------------------
DROP TABLE IF EXISTS `class_question_relate`;
CREATE TABLE `class_question_relate` (
  `questions_relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `context_id` bigint(20) NOT NULL COMMENT '对应的id(比如测验), 视频id',
  `context_type` varchar(255) DEFAULT NULL COMMENT '所属类型,比如测验(quiz),视频',
  `question_id` bigint(20) NOT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`questions_relate_id`),
  KEY `index_context_id` (`context_id`),
  KEY `index_question_id` (`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=233131 DEFAULT CHARSET=utf8 COMMENT='班次题目关联表';

-- ----------------------------
--  Table structure for `class_quiz`
-- ----------------------------
DROP TABLE IF EXISTS `class_quiz`;
CREATE TABLE `class_quiz` (
  `quiz_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `description` mediumtext COMMENT '描述',
  `allowed_attempts` int(11) DEFAULT NULL COMMENT '允许提交次数',
  `due_at` datetime DEFAULT NULL COMMENT '提交截止时间',
  `unlock_at` datetime DEFAULT NULL COMMENT '解锁时间',
  `quiz_questions_count` int(11) DEFAULT NULL COMMENT '测验题目数',
  `hide_results` tinyint(4) DEFAULT NULL COMMENT '是否显示结果 1 是 0 不是',
  `is_time_left` tinyint(4) DEFAULT NULL COMMENT '是否限时 1 是 0 不是',
  `time` int(11) DEFAULT NULL COMMENT '限时长(分钟)',
  `score` decimal(6,2) DEFAULT '100.00' COMMENT '满分',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `show_answer_comment` tinyint(4) DEFAULT '1' COMMENT '是否显示答案与解析',
  PRIMARY KEY (`quiz_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25315 DEFAULT CHARSET=utf8 COMMENT='班次测验表';

-- ----------------------------
--  Table structure for `class_school_room`
-- ----------------------------
DROP TABLE IF EXISTS `class_school_room`;
CREATE TABLE `class_school_room` (
  `school_room_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `user_id` bigint(20) DEFAULT NULL,
  `editor_id` bigint(20) DEFAULT NULL,
  `tenant_id` bigint(20) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL COMMENT '课堂主题',
  `body` mediumtext COMMENT '教学目标',
  `start_at` datetime DEFAULT NULL COMMENT '上课日期',
  `lesson` varchar(255) DEFAULT NULL COMMENT '第几节课',
  `delete_flag` tinyint(4) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`school_room_id`)
) ENGINE=InnoDB AUTO_INCREMENT=126 DEFAULT CHARSET=utf8 COMMENT='班次课堂表';

-- ----------------------------
--  Table structure for `class_select`
-- ----------------------------
DROP TABLE IF EXISTS `class_select`;
CREATE TABLE `class_select` (
  `class_select_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`class_select_id`),
  KEY `index_class_id` (`class_id`),
  KEY `index_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=253 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `class_select_rule`
-- ----------------------------
DROP TABLE IF EXISTS `class_select_rule`;
CREATE TABLE `class_select_rule` (
  `class_select_rule_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `rule_id` bigint(20) NOT NULL COMMENT '规则id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `number` double(12,2) DEFAULT NULL COMMENT '数量',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `end_time` datetime DEFAULT NULL COMMENT '截止时间',
  PRIMARY KEY (`class_select_rule_id`),
  KEY `index_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `class_set`
-- ----------------------------
DROP TABLE IF EXISTS `class_set`;
CREATE TABLE `class_set` (
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `offline_percent` int(11) DEFAULT NULL COMMENT '线下成绩占比',
  `online_percent` int(11) DEFAULT NULL COMMENT '线上成绩占比',
  `video_percent` int(11) DEFAULT NULL COMMENT '视频成绩占比',
  `quiz_percent` int(11) DEFAULT NULL COMMENT '测验成绩占比',
  `assignment_percent` int(11) DEFAULT NULL COMMENT '作业成绩占比',
  `topic_percent` int(11) DEFAULT NULL COMMENT '讨论成绩占比',
  `set_info` mediumtext COMMENT '评分标准前台展示',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `exam_percent` int(11) DEFAULT NULL COMMENT '考试占比',
  `programming_percent` int(11) DEFAULT NULL COMMENT '编程权重',
  `video_completion` tinyint(4) DEFAULT NULL COMMENT '视频完成度',
  PRIMARY KEY (`class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='班次权重相关设置表';

-- ----------------------------
--  Table structure for `class_teaching_design`
-- ----------------------------
DROP TABLE IF EXISTS `class_teaching_design`;
CREATE TABLE `class_teaching_design` (
  `class_teaching_design_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `content_id` bigint(20) DEFAULT NULL COMMENT 'content_type对应id',
  `content_type` varchar(255) DEFAULT NULL COMMENT 'unit item',
  `user_id` bigint(20) DEFAULT NULL,
  `target` mediumtext COMMENT '目标',
  `extract` mediumtext COMMENT '回顾抽取',
  `essentials` mediumtext COMMENT '知识要点',
  `resource` mediumtext COMMENT '资源',
  `flow` mediumtext COMMENT '课堂组织',
  `checkpoint` mediumtext COMMENT '检查点',
  `performance` mediumtext COMMENT '效果评估',
  `delete_flag` tinyint(4) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`class_teaching_design_id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 COMMENT='班次教学设计表';

-- ----------------------------
--  Table structure for `class_tenant_type`
-- ----------------------------
DROP TABLE IF EXISTS `class_tenant_type`;
CREATE TABLE `class_tenant_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `class_id` int(11) DEFAULT NULL COMMENT '班次id',
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户id',
  `type` varchar(255) DEFAULT NULL COMMENT 'guessyoulike  hezuo jingcaishiting recommend related',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_class_id` (`class_id`),
  KEY `index_type` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=7034253 DEFAULT CHARSET=utf8 COMMENT='租户合作课程猜你喜欢精彩试听等配置';

-- ----------------------------
--  Table structure for `class_topic`
-- ----------------------------
DROP TABLE IF EXISTS `class_topic`;
CREATE TABLE `class_topic` (
  `topic_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `forum_id` bigint(20) NOT NULL COMMENT '板块id',
  `is_score` tinyint(4) DEFAULT NULL COMMENT '是否算分:1 算 0 不算',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `due_at` datetime DEFAULT NULL COMMENT '提交截止时间',
  `unlock_at` datetime DEFAULT NULL COMMENT '解锁时间',
  `score_publish_at` datetime DEFAULT NULL COMMENT '成绩公布时间',
  `view_count` int(11) DEFAULT NULL COMMENT '观看次数',
  `post_count` int(11) DEFAULT NULL COMMENT '回复次数',
  `vote_log_count` int(11) DEFAULT NULL COMMENT '点赞次数',
  `last_posted_at` datetime DEFAULT NULL COMMENT '最后一次回复时间',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `teacher_post_count` tinyint(4) DEFAULT NULL COMMENT '教师参与 1 是 0 否',
  `chapter_id` bigint(20) DEFAULT NULL,
  `is_essence` tinyint(4) DEFAULT NULL COMMENT '是否精华',
  `topic_type` varchar(255) DEFAULT NULL COMMENT '讨论类型 10 老师创建讨论 20 学生创建讨论',
  `score` decimal(5,2) DEFAULT '100.00' COMMENT '满分',
  PRIMARY KEY (`topic_id`),
  KEY `index_forum_id` (`forum_id`),
  KEY `index_chapter_id` (`chapter_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=26994 DEFAULT CHARSET=utf8 COMMENT='班次讨论表';

-- ----------------------------
--  Table structure for `class_unit`
-- ----------------------------
DROP TABLE IF EXISTS `class_unit`;
CREATE TABLE `class_unit` (
  `unit_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `unlock_at` datetime DEFAULT NULL COMMENT '解锁时间',
  `end_at` datetime DEFAULT NULL COMMENT '结束时间',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态: 10 未发布 30 已发布',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `teaching_design_id` bigint(20) DEFAULT NULL COMMENT '教学设计id 已废弃',
  PRIMARY KEY (`unit_id`),
  KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=43751 DEFAULT CHARSET=utf8 COMMENT='班次章表';

-- ----------------------------
--  Table structure for `class_video_time_node`
-- ----------------------------
DROP TABLE IF EXISTS `class_video_time_node`;
CREATE TABLE `class_video_time_node` (
  `video_time_node_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `video_id` bigint(20) NOT NULL COMMENT '视频id',
  `time_node` int(11) DEFAULT NULL COMMENT '时间点',
  `question_count` int(11) DEFAULT NULL COMMENT '测验题目数量',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`video_time_node_id`),
  KEY `index_video_id` (`video_id`)
) ENGINE=InnoDB AUTO_INCREMENT=116645 DEFAULT CHARSET=utf8 COMMENT='班次视频内测验时间点';

-- ----------------------------
--  Table structure for `clock`
-- ----------------------------
DROP TABLE IF EXISTS `clock`;
CREATE TABLE `clock` (
  `clock_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '打卡id',
  `user_id` bigint(20) NOT NULL COMMENT '学生ID',
  `message` varchar(255) DEFAULT '' COMMENT '打卡信息',
  `clock_at` datetime NOT NULL COMMENT '打卡时间',
  PRIMARY KEY (`clock_id`),
  KEY `user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=537 DEFAULT CHARSET=utf8 COMMENT='打卡信息表';

-- ----------------------------
--  Table structure for `clock_info`
-- ----------------------------
DROP TABLE IF EXISTS `clock_info`;
CREATE TABLE `clock_info` (
  `clock_info_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '打卡次数id',
  `user_id` bigint(20) NOT NULL COMMENT '学生id',
  `clock_count` bigint(20) NOT NULL COMMENT '打卡总次数',
  `vote_count` bigint(20) NOT NULL COMMENT '点赞次数',
  `view_count` bigint(20) NOT NULL COMMENT '查看次数',
  `last_clock_at` datetime NOT NULL COMMENT '最后一次打卡时间',
  PRIMARY KEY (`clock_info_id`),
  UNIQUE KEY `user_id_unique` (`user_id`),
  KEY `last_clock_at_index` (`last_clock_at`)
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8 COMMENT='打卡次数信息表';

-- ----------------------------
--  Table structure for `clock_profile`
-- ----------------------------
DROP TABLE IF EXISTS `clock_profile`;
CREATE TABLE `clock_profile` (
  `clock_profile_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '打卡id',
  `user_id` bigint(20) NOT NULL COMMENT '学生id',
  `clock_count` bigint(20) NOT NULL COMMENT '打卡次数',
  `clock_at` date NOT NULL COMMENT '打卡日期',
  PRIMARY KEY (`clock_profile_id`),
  UNIQUE KEY `user_id_clock_at_unique` (`user_id`,`clock_at`),
  KEY `user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=144 DEFAULT CHARSET=utf8 COMMENT='打卡记录信息表';

-- ----------------------------
--  Table structure for `clock_view_info`
-- ----------------------------
DROP TABLE IF EXISTS `clock_view_info`;
CREATE TABLE `clock_view_info` (
  `clock_view_info_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '打卡观看id',
  `user_id` bigint(20) NOT NULL COMMENT '学生id',
  `view_user_id` bigint(20) NOT NULL COMMENT '观看学生id',
  `view_at` datetime NOT NULL COMMENT '观看时间',
  PRIMARY KEY (`clock_view_info_id`),
  UNIQUE KEY `user_id_view_user_id_unique` (`user_id`,`view_user_id`),
  KEY `user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=143 DEFAULT CHARSET=utf8 COMMENT='打卡观看信息表';

-- ----------------------------
--  Table structure for `clock_vote_info`
-- ----------------------------
DROP TABLE IF EXISTS `clock_vote_info`;
CREATE TABLE `clock_vote_info` (
  `clock_vote_info_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '打卡点赞id',
  `user_id` bigint(20) NOT NULL COMMENT '学生id',
  `vote_user_id` bigint(20) NOT NULL COMMENT '点赞学生id',
  `vote_at` datetime NOT NULL COMMENT '点赞时间',
  `status` tinyint(4) NOT NULL COMMENT '点赞状态 1:可用 0:不可用',
  PRIMARY KEY (`clock_vote_info_id`),
  UNIQUE KEY `user_id_vote_user_id_unique` (`user_id`,`vote_user_id`),
  KEY `user_id_index` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=203 DEFAULT CHARSET=utf8 COMMENT='打卡点赞信息表';

-- ----------------------------
--  Table structure for `cloud_correct`
-- ----------------------------
DROP TABLE IF EXISTS `cloud_correct`;
CREATE TABLE `cloud_correct` (
  `cloud_correct_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `context_id` bigint(20) NOT NULL COMMENT 'id',
  `context_type` varchar(20) NOT NULL COMMENT '类型',
  `user_id` bigint(20) NOT NULL COMMENT '学生id',
  `url` varchar(255) NOT NULL DEFAULT '' COMMENT '附件url',
  `body` varchar(255) DEFAULT '' COMMENT '备注',
  `status` tinyint(4) NOT NULL COMMENT '批改状态 10:未批改;20:已批改',
  `created_at` datetime NOT NULL COMMENT '创建时间',
  `updated_at` datetime NOT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) NOT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`cloud_correct_id`),
  KEY `context_index` (`context_id`,`context_type`),
  KEY `index_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=288 DEFAULT CHARSET=utf8 COMMENT='学生云批改信息表';

-- ----------------------------
--  Table structure for `cloud_teach_correct`
-- ----------------------------
DROP TABLE IF EXISTS `cloud_teach_correct`;
CREATE TABLE `cloud_teach_correct` (
  `teach_correct_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `cloud_correct_id` bigint(20) NOT NULL COMMENT '批改id',
  `grade_id` bigint(20) NOT NULL COMMENT '批改人id',
  `edit_id` bigint(20) NOT NULL COMMENT '更新人id',
  `abscissa` decimal(12,10) NOT NULL COMMENT 'x轴',
  `ordinate` decimal(12,10) NOT NULL COMMENT 'y轴',
  `type` tinyint(4) NOT NULL COMMENT '批改类型 10:对号;20:X号;30:语音',
  `position` int(11) NOT NULL COMMENT '排序',
  `media_id` varchar(255) DEFAULT '' COMMENT '语音id',
  `url` varchar(255) DEFAULT '' COMMENT '语音url',
  `seconds` int(11) NOT NULL DEFAULT '0' COMMENT '语音长度',
  `created_at` datetime NOT NULL COMMENT '创建时间',
  `updated_at` datetime NOT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) NOT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`teach_correct_id`),
  KEY `cloud_correct_id_index` (`cloud_correct_id`),
  KEY `position_index` (`position`)
) ENGINE=InnoDB AUTO_INCREMENT=288 DEFAULT CHARSET=utf8 COMMENT='教师批改信息表';

-- ----------------------------
--  Table structure for `combined_account`
-- ----------------------------
DROP TABLE IF EXISTS `combined_account`;
CREATE TABLE `combined_account` (
  `combined_account_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL,
  `login_key` varchar(255) DEFAULT NULL COMMENT '第三方平台id',
  `key_type` varchar(255) NOT NULL COMMENT '第三方平台',
  `nick_name` varchar(255) DEFAULT NULL COMMENT '第三方平台昵称',
  `union_id` varchar(255) DEFAULT NULL COMMENT '用户统一标识。针对一个微信开放平台帐号下的应用,同一用户的unionid是唯一的。',
  `open_id` varchar(255) DEFAULT NULL COMMENT 'bigbang用户openId',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `delete_flag` tinyint(4) NOT NULL DEFAULT '1' COMMENT '1可用 0 不可用',
  PRIMARY KEY (`combined_account_id`),
  UNIQUE KEY `login_key` (`login_key`),
  UNIQUE KEY `union_id` (`union_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=4500 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `course`
-- ----------------------------
DROP TABLE IF EXISTS `course`;
CREATE TABLE `course` (
  `course_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `name` varchar(255) DEFAULT NULL COMMENT '课程名称',
  `uuid` varchar(255) DEFAULT NULL COMMENT '唯一标示',
  `intro` varchar(255) DEFAULT NULL COMMENT '短介绍',
  `course_cover` varchar(255) DEFAULT NULL COMMENT '课程封面',
  `intro_video` varchar(255) DEFAULT NULL COMMENT '介绍视频',
  `intro_video_cover` varchar(255) DEFAULT NULL COMMENT '介绍视频封面',
  `intro_video_srt` varchar(255) DEFAULT NULL COMMENT '介绍视频字幕',
  `level` varchar(255) DEFAULT NULL COMMENT '课程难度',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '创建租户id',
  `status` varchar(255) DEFAULT NULL COMMENT '状态: 10 未发布 20 预发布 30 已发布 40 停用',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`course_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4484 DEFAULT CHARSET=utf8 COMMENT='课程表';

-- ----------------------------
--  Table structure for `course_asset`
-- ----------------------------
DROP TABLE IF EXISTS `course_asset`;
CREATE TABLE `course_asset` (
  `asset_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `viewable_id` bigint(20) NOT NULL COMMENT 'viewable_type对应id',
  `viewable_type` varchar(255) DEFAULT NULL COMMENT '暂时只有Assignment',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `attachment_width` int(11) DEFAULT NULL COMMENT '附件宽度主要针对图片 暂时应该没用到',
  `attachment_height` int(11) DEFAULT NULL COMMENT '附件高度针对图片 暂时应该没用到',
  `attachment_file_size` int(11) DEFAULT NULL COMMENT '附件大小',
  `attachment_content_type` varchar(255) DEFAULT NULL COMMENT '附件文件类型',
  `attachment_file_name` varchar(255) DEFAULT NULL COMMENT '附件文件名称',
  `attachment_updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `link` varchar(255) DEFAULT NULL COMMENT '连接地址',
  `type` varchar(255) DEFAULT NULL COMMENT 'AssignmentAttachment,Attachment',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '状态 暂时没用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`asset_id`),
  KEY `index_viewable_id` (`viewable_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=53504 DEFAULT CHARSET=utf8 COMMENT='课程附件表';

-- ----------------------------
--  Table structure for `course_assignment`
-- ----------------------------
DROP TABLE IF EXISTS `course_assignment`;
CREATE TABLE `course_assignment` (
  `assignment_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `grading_standard` mediumtext COMMENT '评分标准',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '状态 主要是发布未发布',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`assignment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10858 DEFAULT CHARSET=utf8 COMMENT='课程作业表';

-- ----------------------------
--  Table structure for `course_category`
-- ----------------------------
DROP TABLE IF EXISTS `course_category`;
CREATE TABLE `course_category` (
  `category_course_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `category_id` bigint(20) NOT NULL,
  `course_id` bigint(20) NOT NULL,
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`category_course_id`),
  KEY `index_category_id` (`category_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1126 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `course_chapter`
-- ----------------------------
DROP TABLE IF EXISTS `course_chapter`;
CREATE TABLE `course_chapter` (
  `chapter_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `item_id` bigint(20) NOT NULL COMMENT '课程节id',
  `unit_id` bigint(20) NOT NULL COMMENT '课程章id',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `content_id` bigint(20) NOT NULL COMMENT 'video 等id',
  `content_type` varchar(255) DEFAULT NULL COMMENT '类型,比如video',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '状态 10未发布 30已发布',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`chapter_id`),
  KEY `index_item_id` (`item_id`),
  KEY `index_unit_id` (`unit_id`),
  KEY `index_content_id` (`content_id`)
) ENGINE=InnoDB AUTO_INCREMENT=206505 DEFAULT CHARSET=utf8 COMMENT='课程具体内容表(unit-item-chapter)';

-- ----------------------------
--  Table structure for `course_courseware`
-- ----------------------------
DROP TABLE IF EXISTS `course_courseware`;
CREATE TABLE `course_courseware` (
  `courseware_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `description` mediumtext COMMENT '描述',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `STATUS` varchar(255) DEFAULT NULL COMMENT '状态 10未发布 30已发布',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  PRIMARY KEY (`courseware_id`)
) ENGINE=InnoDB AUTO_INCREMENT=54510 DEFAULT CHARSET=utf8 COMMENT='课程课件表';

-- ----------------------------
--  Table structure for `course_document_relate`
-- ----------------------------
DROP TABLE IF EXISTS `course_document_relate`;
CREATE TABLE `course_document_relate` (
  `document_relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `context_id` bigint(20) NOT NULL COMMENT '对应的id(比如课件)',
  `context_type` varchar(255) DEFAULT NULL COMMENT '所属类型,比如课件',
  `document_id` bigint(20) NOT NULL COMMENT 'document id',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`document_relate_id`),
  KEY `index_context_id` (`context_id`),
  KEY `index_document_id` (`document_id`)
) ENGINE=InnoDB AUTO_INCREMENT=54960 DEFAULT CHARSET=utf8 COMMENT='课程文档关联表';

-- ----------------------------
--  Table structure for `course_info`
-- ----------------------------
DROP TABLE IF EXISTS `course_info`;
CREATE TABLE `course_info` (
  `course_id` bigint(20) NOT NULL,
  `description` mediumtext COMMENT '课程长介绍',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`course_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='课程基本信息表';

-- ----------------------------
--  Table structure for `course_instructor`
-- ----------------------------
DROP TABLE IF EXISTS `course_instructor`;
CREATE TABLE `course_instructor` (
  `course_instructor_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `instructor_id` bigint(20) NOT NULL COMMENT '授课老师id',
  `instructor_name` varchar(255) DEFAULT NULL COMMENT '授课老师姓名',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '暂时没用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`course_instructor_id`),
  KEY `index_instructor_id` (`instructor_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6773 DEFAULT CHARSET=utf8 COMMENT='课程授课老师关联表';

-- ----------------------------
--  Table structure for `course_item`
-- ----------------------------
DROP TABLE IF EXISTS `course_item`;
CREATE TABLE `course_item` (
  `item_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `unit_id` bigint(20) NOT NULL COMMENT '章id',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`item_id`),
  KEY `index_unit_id` (`unit_id`)
) ENGINE=InnoDB AUTO_INCREMENT=32916 DEFAULT CHARSET=utf8 COMMENT='课程节表';

-- ----------------------------
--  Table structure for `course_page`
-- ----------------------------
DROP TABLE IF EXISTS `course_page`;
CREATE TABLE `course_page` (
  `page_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `link` varchar(255) DEFAULT NULL COMMENT '链接,只有类型是链接类型的时候',
  `type` varchar(255) DEFAULT NULL COMMENT 'Link,text类型,链接类型或者富文本类型',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `STATUS` varchar(255) DEFAULT NULL COMMENT '状态',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`page_id`)
) ENGINE=InnoDB AUTO_INCREMENT=22445 DEFAULT CHARSET=utf8 COMMENT='课程页面表';

-- ----------------------------
--  Table structure for `course_question_relate`
-- ----------------------------
DROP TABLE IF EXISTS `course_question_relate`;
CREATE TABLE `course_question_relate` (
  `question_relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL,
  `context_id` bigint(20) NOT NULL COMMENT '对应的id(比如测验), 视频时间点id',
  `context_type` varchar(255) DEFAULT NULL COMMENT '所属类型,比如测验(quiz),视频',
  `question_id` bigint(20) NOT NULL COMMENT '题目id',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`question_relate_id`),
  KEY `index_context_id` (`context_id`),
  KEY `index_question_id` (`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=122579 DEFAULT CHARSET=utf8 COMMENT='课程题目关联表';

-- ----------------------------
--  Table structure for `course_quiz`
-- ----------------------------
DROP TABLE IF EXISTS `course_quiz`;
CREATE TABLE `course_quiz` (
  `quiz_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `description` mediumtext COMMENT '描述',
  `quiz_questions_count` int(11) DEFAULT NULL COMMENT '题目数量',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`quiz_id`)
) ENGINE=InnoDB AUTO_INCREMENT=12641 DEFAULT CHARSET=utf8 COMMENT='课程测验表';

-- ----------------------------
--  Table structure for `course_topic`
-- ----------------------------
DROP TABLE IF EXISTS `course_topic`;
CREATE TABLE `course_topic` (
  `topic_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` mediumtext COMMENT '内容',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`topic_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14847 DEFAULT CHARSET=utf8 COMMENT='课程讨论表';

-- ----------------------------
--  Table structure for `course_unit`
-- ----------------------------
DROP TABLE IF EXISTS `course_unit`;
CREATE TABLE `course_unit` (
  `unit_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `title` varchar(255) DEFAULT NULL COMMENT '章名称',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`unit_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26668 DEFAULT CHARSET=utf8 COMMENT='课程章表';

-- ----------------------------
--  Table structure for `course_video_time_node`
-- ----------------------------
DROP TABLE IF EXISTS `course_video_time_node`;
CREATE TABLE `course_video_time_node` (
  `video_time_node_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `video_id` bigint(20) NOT NULL COMMENT '视频id',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `time_node` int(11) DEFAULT NULL COMMENT '时间点',
  `question_count` int(11) DEFAULT NULL COMMENT '测验题目数量',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`video_time_node_id`),
  KEY `index_video_id` (`video_id`)
) ENGINE=InnoDB AUTO_INCREMENT=109897 DEFAULT CHARSET=utf8 COMMENT='课程视频测验时间点表';

-- ----------------------------
--  Table structure for `courses_profiles`
-- ----------------------------
DROP TABLE IF EXISTS `courses_profiles`;
CREATE TABLE `courses_profiles` (
  `course_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `eval_count` int(11) DEFAULT NULL,
  `eval_score_total` decimal(10,2) DEFAULT NULL,
  `eval_score_avg` decimal(10,2) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3961 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `document`
-- ----------------------------
DROP TABLE IF EXISTS `document`;
CREATE TABLE `document` (
  `document_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) DEFAULT NULL,
  `title` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '标题',
  `page_num` int(20) DEFAULT NULL COMMENT '页数',
  `file_path` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `size` int(11) DEFAULT NULL COMMENT '大小(byte)',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `md5_code` varchar(255) DEFAULT NULL COMMENT '文件md5值',
  `uuid` varchar(255) DEFAULT NULL COMMENT 'uuid',
  `trans_unit_id` int(20) DEFAULT NULL COMMENT '暂时没用',
  PRIMARY KEY (`document_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=55920 DEFAULT CHARSET=utf8 COMMENT='文档表';

-- ----------------------------
--  Table structure for `doing`
-- ----------------------------
DROP TABLE IF EXISTS `doing`;
CREATE TABLE `doing` (
  `doing_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL COMMENT '标题',
  `body` text COMMENT '内容详情',
  `link` varchar(255) DEFAULT NULL COMMENT '链接地址',
  `position` int(11) DEFAULT NULL COMMENT '排序',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `start_at` datetime DEFAULT NULL COMMENT '开始时间',
  `conclude_at` datetime DEFAULT NULL COMMENT '结束时间',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`doing_id`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到原来活动相关';

-- ----------------------------
--  Table structure for `elective_cource`
-- ----------------------------
DROP TABLE IF EXISTS `elective_cource`;
CREATE TABLE `elective_cource` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `cource` varchar(45) NOT NULL COMMENT '名称',
  `type` int(1) NOT NULL DEFAULT '0' COMMENT '0:章节  1:视频    2:测验',
  `source` varchar(500) NOT NULL COMMENT '链接',
  `duration` int(10) NOT NULL COMMENT '时长',
  `creation_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted` int(1) DEFAULT '0',
  `sort` int(1) DEFAULT '0',
  `parent_id` int(10) DEFAULT '0' COMMENT '父id',
  `courcedescribe` varchar(300) DEFAULT NULL COMMENT '描述',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8 COMMENT='智慧选修课课程表';

-- ----------------------------
--  Table structure for `elective_examinations`
-- ----------------------------
DROP TABLE IF EXISTS `elective_examinations`;
CREATE TABLE `elective_examinations` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `cource_id` int(10) NOT NULL DEFAULT '0' COMMENT '课程id',
  `title` varchar(200) NOT NULL COMMENT '标题',
  `A` varchar(100) DEFAULT NULL COMMENT '选项',
  `B` varchar(100) DEFAULT NULL COMMENT '选项',
  `C` varchar(100) DEFAULT NULL COMMENT '选项',
  `D` varchar(100) DEFAULT NULL COMMENT '选项',
  `E` varchar(100) DEFAULT NULL COMMENT '选项',
  `right_answer` varchar(45) DEFAULT NULL COMMENT '判断题:0对1错',
  `creation_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `deleted` int(1) DEFAULT '0',
  `sort` int(5) DEFAULT '0',
  `type` int(1) DEFAULT NULL COMMENT '0单选;1多选;2判断',
  `testtime` int(5) DEFAULT '0',
  `personality` int(1) DEFAULT NULL COMMENT '暂定',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=228 DEFAULT CHARSET=utf8 COMMENT='智慧选修课测验表';

-- ----------------------------
--  Table structure for `elective_feedback`
-- ----------------------------
DROP TABLE IF EXISTS `elective_feedback`;
CREATE TABLE `elective_feedback` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `union_id` varchar(255) NOT NULL COMMENT '微信唯一账号标识',
  `text` mediumtext NOT NULL COMMENT '反馈内容',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=utf8 COMMENT='智慧选修课反馈表';

-- ----------------------------
--  Table structure for `elective_pathlogic`
-- ----------------------------
DROP TABLE IF EXISTS `elective_pathlogic`;
CREATE TABLE `elective_pathlogic` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `personality_type` int(1) DEFAULT '0' COMMENT '职业类型',
  `cource_id` int(10) DEFAULT NULL COMMENT '课程id',
  `sort` int(2) DEFAULT '0',
  `creation_time` datetime DEFAULT NULL,
  `deleted` int(1) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=154 DEFAULT CHARSET=utf8 COMMENT='智慧选修课学习路线表';

-- ----------------------------
--  Table structure for `elective_rule`
-- ----------------------------
DROP TABLE IF EXISTS `elective_rule`;
CREATE TABLE `elective_rule` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `cource_id` bigint(20) NOT NULL COMMENT '章节名称',
  `count` int(10) DEFAULT NULL COMMENT '测试数量',
  `min_score` int(10) DEFAULT NULL COMMENT '最低分',
  `max_score` int(10) DEFAULT NULL COMMENT '最高分',
  `description` varchar(100) DEFAULT NULL COMMENT '描述',
  `result` mediumtext COMMENT '测试反馈',
  `report` mediumtext COMMENT '结课报告',
  `created_at` datetime NOT NULL,
  `love_emotion` mediumtext COMMENT '暂定',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='智慧选修课选修规则表';

-- ----------------------------
--  Table structure for `elective_user_answer`
-- ----------------------------
DROP TABLE IF EXISTS `elective_user_answer`;
CREATE TABLE `elective_user_answer` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `exam_id` bigint(20) NOT NULL COMMENT '测验id',
  `answer` varchar(45) NOT NULL COMMENT '提交答案',
  `result` int(1) NOT NULL COMMENT '0正确;1错误',
  `score` int(2) DEFAULT NULL COMMENT '分数',
  `creation_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted` int(1) DEFAULT '0',
  `unionid` varchar(45) DEFAULT NULL COMMENT '用户唯一标志',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1608 DEFAULT CHARSET=utf8 COMMENT='智慧选修课测验提交表';

-- ----------------------------
--  Table structure for `elective_user_info`
-- ----------------------------
DROP TABLE IF EXISTS `elective_user_info`;
CREATE TABLE `elective_user_info` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `user_id` int(10) NOT NULL,
  `personality_type` int(1) DEFAULT '0' COMMENT '人格类型',
  `self_conscious` text COMMENT '自我意识',
  `personality_characteristics` text COMMENT '人格特征',
  `career_planning` text COMMENT '生涯规划',
  `learning_psychology` text COMMENT '学习心理',
  `emotional_management` text COMMENT '情绪管理',
  `interpersonal_communication` text COMMENT '人际交往',
  `love_emotion` text COMMENT '恋爱与情感',
  `pressure_management` text COMMENT '压力管理',
  `exchange_credits` int(1) DEFAULT '0' COMMENT '申请兑换学分 \n0:未申请状态   1:申请状态',
  `credits` int(10) DEFAULT '0' COMMENT '学分',
  `creation_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted` int(1) DEFAULT '0',
  `userlock` int(5) DEFAULT '0',
  `report_time` datetime DEFAULT NULL,
  `union_id` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=159 DEFAULT CHARSET=utf8 COMMENT='智慧选修课选课用户信息';

-- ----------------------------
--  Table structure for `elective_user_schedule`
-- ----------------------------
DROP TABLE IF EXISTS `elective_user_schedule`;
CREATE TABLE `elective_user_schedule` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `cource_id` int(10) NOT NULL COMMENT '课程id',
  `user_id` int(10) NOT NULL COMMENT '用户id',
  `schedule` int(10) NOT NULL DEFAULT '0' COMMENT '进度',
  `creation_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `deleted` int(1) DEFAULT '0',
  `union_id` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2590 DEFAULT CHARSET=utf8 COMMENT='智慧选修课学习进度表';

-- ----------------------------
--  Table structure for `employee`
-- ----------------------------
DROP TABLE IF EXISTS `employee`;
CREATE TABLE `employee` (
  `employee_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT '姓名',
  `mobile` varchar(255) DEFAULT NULL COMMENT '手机',
  `entry_at` datetime DEFAULT NULL COMMENT '入职时间',
  `job` varchar(255) DEFAULT NULL COMMENT '岗位 10:慧科销售 20:客户主管 30:高校邦销售',
  `office` varchar(255) DEFAULT NULL COMMENT '职位',
  `zone_id` bigint(20) DEFAULT NULL COMMENT '销售所属区域',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`employee_id`)
) ENGINE=InnoDB AUTO_INCREMENT=167 DEFAULT CHARSET=utf8 COMMENT='销售人员表';

-- ----------------------------
--  Table structure for `evaluation`
-- ----------------------------
DROP TABLE IF EXISTS `evaluation`;
CREATE TABLE `evaluation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `course_id` int(11) DEFAULT NULL COMMENT '课程id',
  `rating` int(11) DEFAULT NULL COMMENT '评分',
  `useful` int(11) DEFAULT NULL COMMENT '有用数',
  `useless` int(11) DEFAULT NULL COMMENT '无用数',
  `content` mediumtext CHARACTER SET utf8 COMMENT '评价内容',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '默认active',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `cas_user_id` int(11) DEFAULT NULL,
  `cms_user_id` int(11) DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11829 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='课程评价表';

-- ----------------------------
--  Table structure for `evaluation_user`
-- ----------------------------
DROP TABLE IF EXISTS `evaluation_user`;
CREATE TABLE `evaluation_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `evaluation_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `useful` tinyint(1) DEFAULT NULL COMMENT '是否有用',
  `status` varchar(255) DEFAULT NULL COMMENT '暂时没用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `cas_user_id` int(11) DEFAULT NULL,
  `cms_user_id` int(11) DEFAULT NULL COMMENT '已废弃',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2324 DEFAULT CHARSET=utf8 COMMENT='有用无用评价表';

-- ----------------------------
--  Table structure for `exam`
-- ----------------------------
DROP TABLE IF EXISTS `exam`;
CREATE TABLE `exam` (
  `exam_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `exam_name` varchar(255) DEFAULT NULL COMMENT '考试名称',
  `exam_category` varchar(255) DEFAULT NULL COMMENT '考试分类',
  `pass_score` decimal(5,2) DEFAULT NULL COMMENT '及格分数',
  `duration` int(11) DEFAULT NULL COMMENT '考试时长默认分钟',
  `start_at` datetime DEFAULT NULL COMMENT '开始时间',
  `end_at` datetime DEFAULT NULL COMMENT '结束时间',
  `allowed_attempts` int(11) DEFAULT NULL COMMENT '允许考试次数 0 无限制',
  `status` tinyint(4) DEFAULT NULL COMMENT '考试状态 1 正常 0 禁用',
  `publish_score_type` tinyint(4) DEFAULT NULL COMMENT '成绩公布方式1显示成绩,0不显示',
  `total_score` decimal(5,2) DEFAULT '100.00' COMMENT '考试总分',
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除 1 正常 0 删除',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `third_party_exam_id` bigint(20) DEFAULT NULL COMMENT '第三方考试id,考试星考试id',
  `least_schedule` int(11) DEFAULT '0' COMMENT '参加考试必须完成的学习进度',
  `publish_score_delay` int(11) DEFAULT '0' COMMENT '考试结束后几天公布成绩',
  `switching_times` int(11) DEFAULT '0' COMMENT '窗口切换次数',
  `is_correct` tinyint(5) DEFAULT '1' COMMENT '是否需要批改',
  `is_publish` tinyint(5) DEFAULT NULL COMMENT '是否发布 1是 0否',
  `question_order` tinyint(4) NOT NULL DEFAULT '0',
  `question_option_order` tinyint(4) NOT NULL DEFAULT '0',
  `is_makeup` tinyint(4) DEFAULT '0' COMMENT '是否补考',
  `makeup_scores` decimal(5,0) DEFAULT NULL COMMENT '参加补考分数',
  `parent_id` bigint(20) DEFAULT NULL COMMENT '补考对应的正考id',
  `has_programming` tinyint(5) NOT NULL DEFAULT '0' COMMENT '是否设置编程题   0不设置   1设置',
  `objective_percent` int(11) DEFAULT NULL COMMENT '客观题占比',
  `programming_percent` int(11) DEFAULT NULL COMMENT '编程题占比',
  `client_type` tinyint(4) DEFAULT NULL COMMENT '客户端类型0 不限制 1 WEB端 2 PC客户端',
  `subjective_percent` int(11) DEFAULT '0' COMMENT '主观题占比',
  PRIMARY KEY (`exam_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1045 DEFAULT CHARSET=utf8 COMMENT='考试表';

-- ----------------------------
--  Table structure for `exam_class_relate`
-- ----------------------------
DROP TABLE IF EXISTS `exam_class_relate`;
CREATE TABLE `exam_class_relate` (
  `exam_class_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `exam_id` bigint(20) DEFAULT NULL COMMENT '考试id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`exam_class_id`),
  KEY `exam_class_relate_classid_index` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1146 DEFAULT CHARSET=utf8 COMMENT='考试班次关联表';

-- ----------------------------
--  Table structure for `exam_log`
-- ----------------------------
DROP TABLE IF EXISTS `exam_log`;
CREATE TABLE `exam_log` (
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `exam_id` bigint(20) DEFAULT NULL COMMENT '考试id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `error_message` varchar(2000) DEFAULT NULL COMMENT '失败原因',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  KEY `exam_log_class_id_exam_id_user_id` (`class_id`,`exam_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='考试提交错误表';

-- ----------------------------
--  Table structure for `exam_paper_relate`
-- ----------------------------
DROP TABLE IF EXISTS `exam_paper_relate`;
CREATE TABLE `exam_paper_relate` (
  `exam_paper_relate_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '关联id',
  `exam_id` bigint(20) NOT NULL COMMENT '考试id',
  `paper_id` bigint(20) NOT NULL COMMENT '试卷id',
  `description` varchar(500) DEFAULT NULL COMMENT '描述',
  `user_Id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `editor_Id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 未删除 0 删除',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`exam_paper_relate_id`),
  KEY `exam_index` (`exam_id`),
  KEY `paper_index` (`paper_id`)
) ENGINE=InnoDB AUTO_INCREMENT=901 DEFAULT CHARSET=utf8 COMMENT='考试试卷关联表';

-- ----------------------------
--  Table structure for `exam_record`
-- ----------------------------
DROP TABLE IF EXISTS `exam_record`;
CREATE TABLE `exam_record` (
  `exam_record_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `exam_id` bigint(20) DEFAULT NULL COMMENT '考试id',
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `exam_sub_id` bigint(20) DEFAULT NULL COMMENT '考试提交id',
  `submit_score` decimal(5,2) DEFAULT NULL COMMENT '提交考试成绩',
  `grade_score` decimal(5,2) DEFAULT NULL COMMENT '批改考试成绩',
  `submit_at` datetime DEFAULT NULL COMMENT '提交考试时间',
  `grade_at` datetime DEFAULT NULL COMMENT '批改考试时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `start_at` datetime DEFAULT NULL COMMENT '学生开始答题时间',
  PRIMARY KEY (`exam_record_id`),
  UNIQUE KEY `uk_exam_id_class_id_user_id_delete_flag` (`exam_id`,`class_id`,`user_id`,`delete_flag`),
  KEY `index_exam_id` (`exam_id`),
  KEY `index_class_id` (`class_id`),
  KEY `index_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1358 DEFAULT CHARSET=utf8 COMMENT='考试学生记录表';

-- ----------------------------
--  Table structure for `exam_score`
-- ----------------------------
DROP TABLE IF EXISTS `exam_score`;
CREATE TABLE `exam_score` (
  `exam_score_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `exam_id` bigint(20) DEFAULT NULL COMMENT '考试id',
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `score` decimal(5,2) DEFAULT NULL COMMENT '考试成绩',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `graded_id` bigint(20) DEFAULT NULL COMMENT '批改老师id',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `user_ip` varchar(20) DEFAULT NULL,
  `subjective_score` decimal(5,2) DEFAULT NULL COMMENT '主观题得分',
  `objective_score` decimal(5,2) DEFAULT NULL COMMENT '客观题得分',
  `subjective_grade_complete` char(1) DEFAULT '0' COMMENT '主观题是否批阅完成 1 完成 0 未完成',
  `programming_score` decimal(5,2) DEFAULT NULL COMMENT '编程题得分',
  PRIMARY KEY (`exam_score_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1190 DEFAULT CHARSET=utf8 COMMENT='考试学生成绩表';

-- ----------------------------
--  Table structure for `exam_submission`
-- ----------------------------
DROP TABLE IF EXISTS `exam_submission`;
CREATE TABLE `exam_submission` (
  `exam_submission_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '关联id',
  `class_id` bigint(20) NOT NULL COMMENT '班次ID',
  `exam_id` bigint(20) NOT NULL COMMENT '考试ID',
  `sub_data` mediumtext COMMENT '提交数据',
  `user_Id` bigint(20) NOT NULL COMMENT '提交人',
  `version` int(11) DEFAULT NULL COMMENT '版本',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 未删除 0 删除',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`exam_submission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1144 DEFAULT CHARSET=utf8 COMMENT='考试信息提交表';

-- ----------------------------
--  Table structure for `exam_white_list`
-- ----------------------------
DROP TABLE IF EXISTS `exam_white_list`;
CREATE TABLE `exam_white_list` (
  `relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `exam_id` bigint(20) NOT NULL COMMENT '考试ID',
  `start_ip` bigint(20) NOT NULL COMMENT '起始ip,int存储ip inet_aton(ip) inet_ntoa(int值)',
  `end_ip` bigint(20) DEFAULT NULL COMMENT '结束ip',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`relate_id`),
  KEY `index_user_id` (`exam_id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='考试IP白名单';

-- ----------------------------
--  Table structure for `forum`
-- ----------------------------
DROP TABLE IF EXISTS `forum`;
CREATE TABLE `forum` (
  `forum_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `description` mediumtext COMMENT '描述',
  `topics_count` int(11) DEFAULT NULL COMMENT '讨论数量',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `is_custom` tinyint(4) DEFAULT '0' COMMENT '是否为自定义分区',
  PRIMARY KEY (`forum_id`),
  KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=25338 DEFAULT CHARSET=utf8 COMMENT='讨论版块表';

-- ----------------------------
--  Table structure for `friend_chain`
-- ----------------------------
DROP TABLE IF EXISTS `friend_chain`;
CREATE TABLE `friend_chain` (
  `friend_chain_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `title` varchar(255) DEFAULT NULL COMMENT '友链名称',
  `url` varchar(255) DEFAULT NULL COMMENT '跳转链接',
  `tenant_id` bigint(20) NOT NULL COMMENT '租户id',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`friend_chain_id`),
  KEY `index_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='友链表';

-- ----------------------------
--  Table structure for `function`
-- ----------------------------
DROP TABLE IF EXISTS `function`;
CREATE TABLE `function` (
  `function_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `function_name` varchar(255) DEFAULT NULL,
  `parent_id` bigint(20) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`function_id`)
) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `gxb_comments`
-- ----------------------------
DROP TABLE IF EXISTS `gxb_comments`;
CREATE TABLE `gxb_comments` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL,
  `evaluation_id` int(11) DEFAULT NULL,
  `content` mediumtext,
  `status` varchar(255) DEFAULT NULL,
  `from` varchar(255) DEFAULT 'user',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=100122 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `gxb_evaluations`
-- ----------------------------
DROP TABLE IF EXISTS `gxb_evaluations`;
CREATE TABLE `gxb_evaluations` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `course_id` bigint(20) DEFAULT NULL COMMENT '课程id',
  `rating` int(11) DEFAULT NULL COMMENT '评分',
  `useful` int(11) DEFAULT NULL COMMENT '有用数',
  `useless` int(11) DEFAULT NULL COMMENT '无用数',
  `content` mediumtext CHARACTER SET utf8 COMMENT '评价内容',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  PRIMARY KEY (`id`),
  KEY `gxb_evaluations_course_id` (`course_id`),
  KEY `gxb_evaluations_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=107727 DEFAULT CHARSET=utf8mb4 COMMENT='班次评价表';

-- ----------------------------
--  Table structure for `gxb_evaluations_users`
-- ----------------------------
DROP TABLE IF EXISTS `gxb_evaluations_users`;
CREATE TABLE `gxb_evaluations_users` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `evaluation_id` int(11) DEFAULT NULL COMMENT '评价id',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `useful` tinyint(1) DEFAULT NULL COMMENT '是否有用',
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6960 DEFAULT CHARSET=utf8 COMMENT='班次评价有用无用表';

-- ----------------------------
--  Table structure for `help_center`
-- ----------------------------
DROP TABLE IF EXISTS `help_center`;
CREATE TABLE `help_center` (
  `help_center_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) DEFAULT NULL COMMENT '父级导航id',
  `navigation_name` varchar(50) DEFAULT NULL COMMENT '导航名称',
  `description` mediumtext COMMENT '描述',
  `position` tinyint(4) DEFAULT NULL COMMENT '序号',
  `status` tinyint(4) DEFAULT NULL COMMENT '暂时无用',
  `type` varchar(50) DEFAULT '0' COMMENT '类型',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '默认内部系统tenantid',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`help_center_id`)
) ENGINE=InnoDB AUTO_INCREMENT=260 DEFAULT CHARSET=utf8 COMMENT='帮助中心导航表';

-- ----------------------------
--  Table structure for `help_center_body`
-- ----------------------------
DROP TABLE IF EXISTS `help_center_body`;
CREATE TABLE `help_center_body` (
  `help_center_body_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `help_center_id` bigint(20) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `body` text COMMENT '编辑器文本',
  `body_text` text COMMENT '中文文本',
  `position` tinyint(4) DEFAULT NULL,
  `status` tinyint(4) DEFAULT NULL,
  `type` varchar(50) DEFAULT '0' COMMENT '类型',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '默认内部系统tenantid',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`help_center_body_id`)
) ENGINE=InnoDB AUTO_INCREMENT=217 DEFAULT CHARSET=utf8 COMMENT='帮助中心具体问题表';

-- ----------------------------
--  Table structure for `instructor`
-- ----------------------------
DROP TABLE IF EXISTS `instructor`;
CREATE TABLE `instructor` (
  `instructor_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '讲师id',
  `name` varchar(255) DEFAULT NULL COMMENT '姓名',
  `title` varchar(255) DEFAULT NULL COMMENT '头衔',
  `intro` varchar(1000) DEFAULT NULL COMMENT '简介',
  `description` mediumtext COMMENT '详情',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像地址',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `sina_weibo` varchar(255) DEFAULT NULL COMMENT '新浪微博',
  `wechat` varchar(255) DEFAULT NULL COMMENT '微信',
  `tag` varchar(255) DEFAULT NULL COMMENT '标签',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` int(11) DEFAULT NULL COMMENT '1可用 0 不可用',
  `tenant_id` bigint(20) DEFAULT NULL,
  `tran_cid` int(11) DEFAULT NULL,
  PRIMARY KEY (`instructor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6806 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='讲师表';

-- ----------------------------
--  Table structure for `interactive_practice`
-- ----------------------------
DROP TABLE IF EXISTS `interactive_practice`;
CREATE TABLE `interactive_practice` (
  `practice_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '互动实践id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `name` varchar(255) NOT NULL COMMENT '名称',
  `place` varchar(255) NOT NULL COMMENT '地点',
  `start_at` datetime NOT NULL COMMENT '活动开始时间',
  `end_at` datetime NOT NULL COMMENT '活动结束时间',
  `introduce` mediumtext COMMENT '活动介绍',
  `signup_end_at` datetime DEFAULT NULL COMMENT '报名结束时间',
  `signup_number` int(8) DEFAULT NULL COMMENT '报名人数',
  `cover` varchar(255) DEFAULT NULL COMMENT '封面(uuid)',
  `cooperative_unit` varchar(255) DEFAULT NULL COMMENT '合作单位',
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '编辑人id',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`practice_id`),
  KEY `interactive_practice_classid_index` (`class_id`),
  KEY `interactive_practice_delete_flag_index` (`delete_flag`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 COMMENT='互动实践表';

-- ----------------------------
--  Table structure for `interactive_practice_signup`
-- ----------------------------
DROP TABLE IF EXISTS `interactive_practice_signup`;
CREATE TABLE `interactive_practice_signup` (
  `signup_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '报名id',
  `practice_id` bigint(20) NOT NULL COMMENT '互动实践id',
  `user_id` bigint(20) NOT NULL COMMENT '报名人id',
  `mobile` varchar(255) NOT NULL COMMENT '报名人手机号',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`signup_id`),
  KEY `interactive_practice_signup_delete_flag_index` (`delete_flag`),
  KEY `interactive_practice_signup_practiceid_index` (`practice_id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8 COMMENT='互动实践报名表';

-- ----------------------------
--  Table structure for `learn_schedule`
-- ----------------------------
DROP TABLE IF EXISTS `learn_schedule`;
CREATE TABLE `learn_schedule` (
  `learn_schedule_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `chapter_id` bigint(20) NOT NULL,
  `content_id` bigint(20) NOT NULL COMMENT 'content_type 对应id',
  `content_type` varchar(20) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `learn_status` smallint(6) DEFAULT NULL COMMENT '学习状态 1 开始学习 2完成学习',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`learn_schedule_id`),
  UNIQUE KEY `class_chapter_user_unque` (`class_id`,`chapter_id`,`user_id`) USING BTREE,
  KEY `class_index` (`class_id`),
  KEY `chapter_index` (`chapter_id`),
  KEY `user_index` (`user_id`),
  KEY `index_content_type` (`content_type`)
) ENGINE=InnoDB AUTO_INCREMENT=13959668 DEFAULT CHARSET=utf8 COMMENT='学生学习进度表';


-- ----------------------------
--  Table structure for `message`
-- ----------------------------
DROP TABLE IF EXISTS `message`;
CREATE TABLE `message` (
  `message_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `content` varchar(255) NOT NULL COMMENT '内容',
  `content_id` bigint(20) NOT NULL COMMENT '内容相应id,例:作业id,考试id',
  `content_type` varchar(255) NOT NULL COMMENT 'ClassEndNotice:结课预告,ScorePublish:成绩公布,ExamStartNotice:考试预告,ExamScorePublish:考试成绩公布,ExamMakeUp:补考安排,AssignmentBack:作业打回',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`message_id`),
  KEY `index_user_id` (`user_id`),
  KEY `index_class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=998 DEFAULT CHARSET=utf8 COMMENT='消息表';

-- ----------------------------
--  Table structure for `message_center`
-- ----------------------------
DROP TABLE IF EXISTS `message_center`;
CREATE TABLE `message_center` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `content` mediumtext COMMENT '内容',
  `message_type` varchar(255) DEFAULT NULL COMMENT '消息类型,Supervision:教学监督信息(class_push_message),TenantAnnouncement:租户公告(announcements),ClassAnnouncement:班次公告(announcement),ClassEndNotice:结课预告,ScorePublish:成绩公布,ExamStartNotice:考试预告,ExamScorePublish:考试成绩公布,ExamMakeUp:补考安排,AssignmentBack:作业打回',
  `created_time` datetime DEFAULT NULL,
  `extras` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=604 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `message_user`
-- ----------------------------
DROP TABLE IF EXISTS `message_user`;
CREATE TABLE `message_user` (
  `user_id` bigint(25) NOT NULL COMMENT '用户id',
  `all_message_id` mediumtext COMMENT '所有消息',
  `unread` mediumtext COMMENT '未读消息id',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户消息表';

-- ----------------------------
--  Table structure for `micro_class_enrollment`
-- ----------------------------
DROP TABLE IF EXISTS `micro_class_enrollment`;
CREATE TABLE `micro_class_enrollment` (
  `micro_class_enrollment_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`micro_class_enrollment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COMMENT='微课加入情况表';

-- ----------------------------
--  Table structure for `micro_class_watch`
-- ----------------------------
DROP TABLE IF EXISTS `micro_class_watch`;
CREATE TABLE `micro_class_watch` (
  `micro_class_watch_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `num` bigint(20) DEFAULT NULL COMMENT '观看次数',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `web_num` bigint(20) DEFAULT NULL COMMENT 'web端观看次数',
  PRIMARY KEY (`micro_class_watch_id`),
  UNIQUE KEY `class_id` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8 COMMENT='微课观看表';

-- ----------------------------
--  Table structure for `mobile_message_record`
-- ----------------------------
DROP TABLE IF EXISTS `mobile_message_record`;
CREATE TABLE `mobile_message_record` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) DEFAULT NULL,
  `context_id` bigint(20) DEFAULT NULL COMMENT 'context_type对应id',
  `context_type` varchar(30) DEFAULT NULL COMMENT '类型 announcement teachingSupervision',
  `mobile` varchar(20) DEFAULT NULL COMMENT '手机号',
  `user_id` bigint(20) DEFAULT NULL COMMENT '发送人',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='短信发送记录表';

-- ----------------------------
--  Table structure for `news`
-- ----------------------------
DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `category` varchar(255) DEFAULT NULL,
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  `subtitle` varchar(255) DEFAULT NULL COMMENT '暂时无用',
  `url` varchar(255) DEFAULT NULL COMMENT '暂时无用',
  `body` mediumtext COMMENT '详情',
  `position` int(11) DEFAULT NULL COMMENT '序号 -1 置顶',
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `published_at` datetime DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=800 DEFAULT CHARSET=utf8 COMMENT='门户新闻表';

-- ----------------------------
--  Table structure for `open_question`
-- ----------------------------
DROP TABLE IF EXISTS `open_question`;
CREATE TABLE `open_question` (
  `open_question_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `question_name` varchar(2000) DEFAULT NULL COMMENT '题干',
  `question_type` varchar(255) DEFAULT NULL COMMENT '题目类型 单选 多选 填空 问答,multiple_choice、multiple_answers、fill_in_blank、short_answer',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`open_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=305 DEFAULT CHARSET=utf8 COMMENT='问卷投票问题表';

-- ----------------------------
--  Table structure for `open_question_option`
-- ----------------------------
DROP TABLE IF EXISTS `open_question_option`;
CREATE TABLE `open_question_option` (
  `open_question_option_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `open_question_id` bigint(20) NOT NULL,
  `content` mediumtext COMMENT '选项内容',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`open_question_option_id`),
  KEY `index_question_id` (`open_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=704 DEFAULT CHARSET=utf8 COMMENT='问卷投票问题选项表';

-- ----------------------------
--  Table structure for `open_question_option_statistics`
-- ----------------------------
DROP TABLE IF EXISTS `open_question_option_statistics`;
CREATE TABLE `open_question_option_statistics` (
  `open_question_option_id` bigint(20) NOT NULL,
  `count` int(11) DEFAULT NULL COMMENT '被选择数量',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`open_question_option_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='问卷投票问题选项统计表';

-- ----------------------------
--  Table structure for `open_question_relate`
-- ----------------------------
DROP TABLE IF EXISTS `open_question_relate`;
CREATE TABLE `open_question_relate` (
  `questions_relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `context_id` bigint(20) NOT NULL,
  `context_type` varchar(255) DEFAULT NULL COMMENT '所属类型,vote questionnaire',
  `open_question_id` bigint(20) NOT NULL COMMENT 'open_question表的id',
  `position` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`questions_relate_id`),
  KEY `index_context_type_context_id` (`context_type`,`context_id`)
) ENGINE=InnoDB AUTO_INCREMENT=303 DEFAULT CHARSET=utf8 COMMENT='调查问卷、投票与题目的对应关系表';

-- ----------------------------
--  Table structure for `paper`
-- ----------------------------
DROP TABLE IF EXISTS `paper`;
CREATE TABLE `paper` (
  `paper_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '试卷id',
  `paper_name` varchar(100) NOT NULL COMMENT '试卷名称',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `description` varchar(500) DEFAULT NULL COMMENT '描述',
  `user_Id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `editor_Id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 未删除 0 删除',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`paper_id`)
) ENGINE=InnoDB AUTO_INCREMENT=902 DEFAULT CHARSET=utf8 COMMENT='试卷表';

-- ----------------------------
--  Table structure for `paper_question_type_relate`
-- ----------------------------
DROP TABLE IF EXISTS `paper_question_type_relate`;
CREATE TABLE `paper_question_type_relate` (
  `paper_question_type_relate_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '关联id',
  `paper_id` bigint(20) NOT NULL COMMENT '试卷id',
  `question_type` varchar(20) NOT NULL COMMENT '试题类型',
  `position` int(11) DEFAULT NULL COMMENT '顺序',
  `description` varchar(200) DEFAULT NULL COMMENT '描述',
  `user_Id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `editor_Id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 未删除 0 删除',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`paper_question_type_relate_id`),
  KEY `paper_index` (`paper_id`)
) ENGINE=InnoDB AUTO_INCREMENT=125458 DEFAULT CHARSET=utf8 COMMENT='试卷题型关联表';

-- ----------------------------
--  Table structure for `peer_review`
-- ----------------------------
DROP TABLE IF EXISTS `peer_review`;
CREATE TABLE `peer_review` (
  `peer_review_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `submission_id` bigint(20) DEFAULT NULL COMMENT '作业提交id',
  `assignment_id` bigint(20) DEFAULT NULL COMMENT '作业id',
  `review_user_id` bigint(20) DEFAULT NULL COMMENT '评阅人id',
  `score` decimal(5,2) DEFAULT NULL COMMENT '分数',
  `graded_comment` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT '评语',
  `is_self_rating` tinyint(4) DEFAULT NULL COMMENT '1 是自评 0 不是自评',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`peer_review_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5777 DEFAULT CHARSET=utf8 COMMENT='作业互评表';

-- ----------------------------
--  Table structure for `permission`
-- ----------------------------
DROP TABLE IF EXISTS `permission`;
CREATE TABLE `permission` (
  `permission_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '权限id',
  `url` varchar(200) DEFAULT NULL COMMENT '权限url',
  `method` varchar(20) DEFAULT NULL COMMENT '请求类型GET POST PUT DELETE',
  `system` varchar(20) DEFAULT NULL COMMENT '系统类型 lcms,cms等',
  `is_anonymous` tinyint(4) DEFAULT NULL COMMENT '是否允许匿名访问 1 允许 0 不允许',
  `created_at` datetime DEFAULT NULL COMMENT '创建日期',
  `description` varchar(200) DEFAULT NULL COMMENT '信息描述',
  PRIMARY KEY (`permission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=55 DEFAULT CHARSET=utf8 COMMENT='权限信息表';

-- ----------------------------
--  Table structure for `permission_dictionary`
-- ----------------------------
DROP TABLE IF EXISTS `permission_dictionary`;
CREATE TABLE `permission_dictionary` (
  `dictionary_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '字典id',
  `parent_id` int(11) NOT NULL COMMENT '父Id -1 无父级',
  `type` tinyint(4) NOT NULL COMMENT '类型 0 非叶子 1叶子',
  `title` varchar(200) DEFAULT NULL COMMENT '标题',
  `code` varchar(200) DEFAULT NULL COMMENT '权限码',
  `delete_flag` tinyint(20) NOT NULL COMMENT '状态 1 可用 0 不可用',
  `created_at` datetime NOT NULL COMMENT '创建时间',
  `updated_at` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`dictionary_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='权限字典表';

-- ----------------------------
--  Table structure for `permission_dictionary_permission_relate`
-- ----------------------------
DROP TABLE IF EXISTS `permission_dictionary_permission_relate`;
CREATE TABLE `permission_dictionary_permission_relate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dictionary_id` int(11) NOT NULL COMMENT '字典id',
  `permission_id` int(11) NOT NULL COMMENT '权限Id',
  `delete_flag` tinyint(20) NOT NULL COMMENT '状态 1 可用 0 不可用',
  `created_at` datetime NOT NULL COMMENT '创建时间',
  `updated_at` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `index_dictionary_id` (`dictionary_id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='权限字典与具体权限关联表';

-- ----------------------------
--  Table structure for `permission_functions`
-- ----------------------------
DROP TABLE IF EXISTS `permission_functions`;
CREATE TABLE `permission_functions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `parent_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `path` varchar(255) DEFAULT NULL,
  `tree_path` varchar(255) DEFAULT NULL,
  `lft` int(11) DEFAULT NULL,
  `rgt` int(11) DEFAULT NULL,
  `depth` int(11) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=632 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `picture_dictionary`
-- ----------------------------
DROP TABLE IF EXISTS `picture_dictionary`;
CREATE TABLE `picture_dictionary` (
  `dictionary_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '菜单id',
  `type` varchar(20) NOT NULL COMMENT '类型,ClassCover',
  `url` varchar(200) NOT NULL COMMENT '值',
  `description` varchar(200) DEFAULT NULL COMMENT '描述',
  `status` tinyint(20) NOT NULL COMMENT '状态 1 可用 0 不可用',
  `created_at` datetime NOT NULL COMMENT '创建时间',
  `updated_at` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`dictionary_id`),
  KEY `type_index` (`type`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='图片字典表';

-- ----------------------------
--  Table structure for `pop_quiz_answers`
-- ----------------------------
DROP TABLE IF EXISTS `pop_quiz_answers`;
CREATE TABLE `pop_quiz_answers` (
  `pop_quiz_answers_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `class_pop_quiz_id` bigint(20) NOT NULL COMMENT '随堂测验id',
  `question_id` bigint(20) DEFAULT NULL COMMENT '问题id',
  `answer_id` bigint(20) DEFAULT NULL COMMENT '答案id',
  `sub_count` int(11) DEFAULT NULL COMMENT '选择此答案个数',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`pop_quiz_answers_id`),
  UNIQUE KEY `uk_question_answer_id` (`class_id`,`class_pop_quiz_id`,`question_id`,`answer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=294 DEFAULT CHARSET=utf8 COMMENT='随堂测验统计表';

-- ----------------------------
--  Table structure for `pop_quiz_gather`
-- ----------------------------
DROP TABLE IF EXISTS `pop_quiz_gather`;
CREATE TABLE `pop_quiz_gather` (
  `pop_quiz_gather_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `class_pop_quiz_id` bigint(20) NOT NULL COMMENT '随堂测验id',
  `question_id` bigint(20) NOT NULL COMMENT '问题id',
  `sub_count` int(11) DEFAULT NULL COMMENT '问题回答次数',
  `correct_count` int(11) DEFAULT NULL COMMENT '回答正确次数',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`pop_quiz_gather_id`),
  UNIQUE KEY `uk_class_pop_question_id` (`class_id`,`class_pop_quiz_id`,`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=228 DEFAULT CHARSET=utf8 COMMENT='随堂测验统计表';

-- ----------------------------
--  Table structure for `pop_quiz_submission`
-- ----------------------------
DROP TABLE IF EXISTS `pop_quiz_submission`;
CREATE TABLE `pop_quiz_submission` (
  `pop_quiz_submission_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `class_pop_quiz_id` bigint(20) NOT NULL COMMENT '随堂测验id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `submission_data` mediumtext COMMENT '提交详情',
  `score` double(12,2) DEFAULT NULL COMMENT '成绩',
  `started_at` datetime DEFAULT NULL COMMENT '开始做题时间',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`pop_quiz_submission_id`),
  UNIQUE KEY `uk_class_pop_user_id` (`class_id`,`class_pop_quiz_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8 COMMENT='随堂测验提交表';

-- ----------------------------
--  Table structure for `post`
-- ----------------------------
DROP TABLE IF EXISTS `post`;
CREATE TABLE `post` (
  `post_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `topic_id` bigint(20) NOT NULL COMMENT '板块id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `root_parent_id` bigint(20) DEFAULT NULL COMMENT '回复的根id',
  `parent_id` bigint(20) DEFAULT NULL COMMENT '回复的讨论回复id',
  `message` text COMMENT '内容',
  `vote_up_count` int(11) DEFAULT NULL COMMENT '点赞次数',
  `posts_count` int(11) DEFAULT NULL COMMENT '回复数量',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `attachment_is_exist` tinyint(4) DEFAULT '0' COMMENT '是否有附件;0:没有;1:有',
  PRIMARY KEY (`post_id`),
  KEY `index_topic_id` (`topic_id`),
  KEY `index_user_id` (`user_id`),
  KEY `index_parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=804858 DEFAULT CHARSET=utf8 COMMENT='讨论回复表';

-- ----------------------------
--  Table structure for `post_attachment`
-- ----------------------------
DROP TABLE IF EXISTS `post_attachment`;
CREATE TABLE `post_attachment` (
  `attachment_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `post_id` bigint(20) NOT NULL COMMENT '回复id',
  `third_party_id` varchar(255) DEFAULT NULL COMMENT '第三方资源id',
  `url` varchar(255) DEFAULT NULL COMMENT '资源url',
  `type` varchar(255) DEFAULT NULL COMMENT '所属类型',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `seconds` int(11) DEFAULT NULL COMMENT '语音长度',
  `transcoding_status` int(4) DEFAULT NULL COMMENT '1已转码 0 未转码',
  `transcoding_progress` int(4) DEFAULT NULL COMMENT '1 正在转码;2 成功;3失败',
  PRIMARY KEY (`attachment_id`)
) ENGINE=InnoDB AUTO_INCREMENT=787 DEFAULT CHARSET=utf8 COMMENT='讨论回复附件表';

-- ----------------------------
--  Table structure for `ppt`
-- ----------------------------
DROP TABLE IF EXISTS `ppt`;
CREATE TABLE `ppt` (
  `ppt_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '' COMMENT '幻灯标题',
  `url` varchar(500) NOT NULL DEFAULT '' COMMENT '幻灯url',
  `seconds` int(11) NOT NULL DEFAULT '0' COMMENT '幻灯时长',
  `size` int(11) DEFAULT '0' COMMENT '大小(byte)',
  `course_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '班次id',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '编辑者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id ',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  PRIMARY KEY (`ppt_id`)
) ENGINE=InnoDB AUTO_INCREMENT=299 DEFAULT CHARSET=utf8 COMMENT='幻灯片表';

-- ----------------------------
--  Table structure for `ppt_convert`
-- ----------------------------
DROP TABLE IF EXISTS `ppt_convert`;
CREATE TABLE `ppt_convert` (
  `ppt_convert_id` bigint(10) NOT NULL AUTO_INCREMENT,
  `resource_node_id` bigint(10) DEFAULT NULL COMMENT 'ppt文件的resource_node_id',
  `ppt_url` varchar(255) DEFAULT NULL COMMENT 'ppt的地址',
  `html_url` varchar(255) DEFAULT NULL COMMENT 'ppt的html地址',
  `status` tinyint(4) DEFAULT NULL COMMENT '状态   0 未转码  1 已转码',
  `thumb` varchar(255) DEFAULT NULL COMMENT 'ppt封面',
  `page_amount` int(10) DEFAULT NULL COMMENT '页数',
  `ppt_id` int(10) DEFAULT NULL COMMENT '自由坊pptId',
  `filename` varchar(255) DEFAULT NULL COMMENT '文件名',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`ppt_convert_id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COMMENT='幻灯片转换表';

-- ----------------------------
--  Table structure for `programming`
-- ----------------------------
DROP TABLE IF EXISTS `programming`;
CREATE TABLE `programming` (
  `programming_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `title` varchar(1000) NOT NULL COMMENT '标题',
  `title_desc` mediumtext NOT NULL COMMENT '题目描述',
  `input_desc` varchar(10000) NOT NULL COMMENT '输入描述',
  `output_desc` mediumtext NOT NULL COMMENT '输出描述',
  `code_model` mediumtext COMMENT '代码模块',
  `comment` mediumtext COMMENT '题目解析',
  `level` varchar(255) DEFAULT NULL COMMENT '题目难度级别',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `business_type` int(11) DEFAULT '0' COMMENT '题目类型:0-常规 1-期末 2-内嵌',
  `language_type` varchar(255) NOT NULL COMMENT '编程语言类型',
  PRIMARY KEY (`programming_id`),
  KEY `index_course_id` (`course_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=697 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='互动编程表';

-- ----------------------------
--  Table structure for `programming_config`
-- ----------------------------
DROP TABLE IF EXISTS `programming_config`;
CREATE TABLE `programming_config` (
  `config_id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除  0 删除 1 未删除',
  PRIMARY KEY (`config_id`),
  KEY `index_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 COMMENT='互动编程配置表';

-- ----------------------------
--  Table structure for `programming_file`
-- ----------------------------
DROP TABLE IF EXISTS `programming_file`;
CREATE TABLE `programming_file` (
  `file_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `path` varchar(100) NOT NULL COMMENT '文件的路径',
  `content` mediumtext COMMENT '文件内容',
  `code_replay_id` bigint(10) NOT NULL COMMENT '对应编程id',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `delete_flag` tinyint(2) NOT NULL,
  PRIMARY KEY (`file_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8558 DEFAULT CHARSET=utf8 COMMENT='互动编程文件表';

-- ----------------------------
--  Table structure for `programming_file_student`
-- ----------------------------
DROP TABLE IF EXISTS `programming_file_student`;
CREATE TABLE `programming_file_student` (
  `file_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `path` varchar(100) NOT NULL COMMENT '文件的路径',
  `content` mediumtext COMMENT '文件内容',
  `code_replay_id` bigint(10) NOT NULL COMMENT '对应编程id',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `delete_flag` tinyint(2) NOT NULL,
  PRIMARY KEY (`file_id`)
) ENGINE=InnoDB AUTO_INCREMENT=301 DEFAULT CHARSET=utf8 COMMENT='互动编程学生编程文件表';

-- ----------------------------
--  Table structure for `programming_language`
-- ----------------------------
DROP TABLE IF EXISTS `programming_language`;
CREATE TABLE `programming_language` (
  `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `languageid` int(10) NOT NULL COMMENT '语言编号',
  `name` varchar(100) NOT NULL COMMENT '语言名称',
  `created_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(1) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='互动编程语言表';

-- ----------------------------
--  Table structure for `programming_node`
-- ----------------------------
DROP TABLE IF EXISTS `programming_node`;
CREATE TABLE `programming_node` (
  `programming_node_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) NOT NULL COMMENT '父节点id',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `context_uuid` varchar(40) NOT NULL COMMENT '课程的uuid或者班次的uuid',
  `context_type` varchar(255) NOT NULL COMMENT '所属类型,课程或者班级',
  `programming_id` bigint(20) NOT NULL COMMENT 'programming id',
  `type` varchar(255) DEFAULT NULL COMMENT '文件夹 或者文件类型',
  `name` varchar(400) NOT NULL COMMENT '名称',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `is_private` tinyint(4) DEFAULT NULL COMMENT '是否私有,1是私有 0不是私有',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `language_type` varchar(10) DEFAULT NULL COMMENT '语言类型',
  PRIMARY KEY (`programming_node_id`),
  KEY `index_parent_id` (`parent_id`) USING BTREE,
  KEY `index_context_uuid` (`context_uuid`) USING BTREE,
  KEY `index_programming_id` (`programming_id`) USING BTREE,
  KEY `index_context_type` (`context_type`(10)) USING BTREE,
  KEY `index_course_id` (`course_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1104 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='编程库表';

-- ----------------------------
--  Table structure for `programming_submission`
-- ----------------------------
DROP TABLE IF EXISTS `programming_submission`;
CREATE TABLE `programming_submission` (
  `programming_submission_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(10) NOT NULL,
  `programming_id` bigint(20) NOT NULL COMMENT '编程id',
  `exam_id` bigint(10) NOT NULL COMMENT '考试id',
  `correct_rate` double(12,2) DEFAULT NULL COMMENT '正确率',
  `content` mediumtext NOT NULL COMMENT '编程内容',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`programming_submission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=283 DEFAULT CHARSET=utf8 COMMENT='互动编程考试提交表';

-- ----------------------------
--  Table structure for `question`
-- ----------------------------
DROP TABLE IF EXISTS `question`;
CREATE TABLE `question` (
  `question_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `question_name` varchar(10000) DEFAULT NULL,
  `question_type` varchar(255) DEFAULT NULL COMMENT '题目类型,multiple_choice、multiple_answers、fill_in_blank',
  `comment` mediumtext COMMENT '题目解析',
  `level` varchar(255) DEFAULT NULL COMMENT '题目难度级别',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `business_type` int(11) DEFAULT '0' COMMENT '题目类型:0-常规 1-期末 2-内嵌',
  PRIMARY KEY (`question_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=150130 DEFAULT CHARSET=utf8 COMMENT='题目表';

-- ----------------------------
--  Table structure for `question_correct_rate`
-- ----------------------------
DROP TABLE IF EXISTS `question_correct_rate`;
CREATE TABLE `question_correct_rate` (
  `question_correct_rate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `question_id` bigint(20) NOT NULL COMMENT '问题id',
  `sub_count` int(11) DEFAULT NULL COMMENT 'question提交次数',
  `correct_count` int(11) DEFAULT NULL COMMENT 'question 正确次数',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`question_correct_rate_id`),
  KEY `class_id_question_id` (`class_id`,`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=519 DEFAULT CHARSET=utf8 COMMENT='题目正确率表';

-- ----------------------------
--  Table structure for `question_node`
-- ----------------------------
DROP TABLE IF EXISTS `question_node`;
CREATE TABLE `question_node` (
  `question_node_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) NOT NULL COMMENT '父节点id',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `context_uuid` varchar(40) NOT NULL COMMENT '课程的uuid或者班次的uuid',
  `context_type` varchar(255) NOT NULL COMMENT '所属类型,课程或者班级',
  `question_id` bigint(20) NOT NULL COMMENT 'question id',
  `type` varchar(255) DEFAULT NULL COMMENT '文件夹 或者文件类型',
  `name` varchar(400) NOT NULL COMMENT '名称',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `is_private` tinyint(4) DEFAULT NULL COMMENT '是否私有,1是私有 0不是私有',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  PRIMARY KEY (`question_node_id`),
  KEY `index_parent_id` (`parent_id`),
  KEY `index_context_uuid` (`context_uuid`),
  KEY `index_question_id` (`question_id`),
  KEY `index_context_type` (`context_type`(10)),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=139675 DEFAULT CHARSET=utf8 COMMENT='题库表';

-- ----------------------------
--  Table structure for `question_option`
-- ----------------------------
DROP TABLE IF EXISTS `question_option`;
CREATE TABLE `question_option` (
  `question_option_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `question_id` bigint(20) NOT NULL,
  `content` mediumtext COMMENT '选项内容',
  `comment` mediumtext COMMENT '选项解析',
  `correct` int(11) DEFAULT NULL COMMENT '是否正确,1正确 0错误',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`question_option_id`),
  KEY `index_question_id` (`question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=576200 DEFAULT CHARSET=utf8 COMMENT='题目选项表';

-- ----------------------------
--  Table structure for `question_push_record`
-- ----------------------------
DROP TABLE IF EXISTS `question_push_record`;
CREATE TABLE `question_push_record` (
  `question_push_record_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '推送id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `tenant_id` bigint(20) NOT NULL COMMENT '租户ID',
  `question_id` bigint(20) NOT NULL COMMENT '试题id',
  `push_at` datetime DEFAULT NULL COMMENT '推送时间',
  PRIMARY KEY (`question_push_record_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2804 DEFAULT CHARSET=utf8 COMMENT='试题推送记录表';

-- ----------------------------
--  Table structure for `question_type_question_relate`
-- ----------------------------
DROP TABLE IF EXISTS `question_type_question_relate`;
CREATE TABLE `question_type_question_relate` (
  `question_type_question_relate_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '关联id',
  `question_type_id` bigint(20) NOT NULL COMMENT '试卷试题类型id,表paper_question_type_relate主键',
  `question_id` bigint(20) DEFAULT NULL COMMENT '试题id',
  `position` int(11) DEFAULT NULL COMMENT '顺序',
  `score` decimal(5,2) DEFAULT NULL COMMENT '分数',
  `user_Id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `editor_Id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 未删除 0 删除',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `type` varchar(255) DEFAULT 'objective' COMMENT '试题类型  objective客观题  programming编程题 subjective 主观题 ',
  PRIMARY KEY (`question_type_question_relate_id`),
  KEY `question_type_id_index` (`question_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17987 DEFAULT CHARSET=utf8 COMMENT='题型试题对应表';

-- ----------------------------
--  Table structure for `questionnaire`
-- ----------------------------
DROP TABLE IF EXISTS `questionnaire`;
CREATE TABLE `questionnaire` (
  `questionnaire_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '调查问卷id',
  `context_type` varchar(50) NOT NULL COMMENT '所属类型 Class Tenant',
  `context_id` bigint(20) NOT NULL COMMENT 'type id',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `description` varchar(2000) DEFAULT NULL COMMENT '描述',
  `start_at` datetime NOT NULL COMMENT '开始时间',
  `end_at` datetime NOT NULL COMMENT '结束时间',
  `user_Id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 未删除 0 删除',
  `editor_Id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`questionnaire_id`),
  KEY `context_index` (`context_type`,`context_id`)
) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8 COMMENT='调查问卷表';

-- ----------------------------
--  Table structure for `questionnaire_short_answer_statistics`
-- ----------------------------
DROP TABLE IF EXISTS `questionnaire_short_answer_statistics`;
CREATE TABLE `questionnaire_short_answer_statistics` (
  `statistics_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `questionnaire_id` int(11) NOT NULL COMMENT '调查问卷id',
  `open_question_id` int(11) NOT NULL COMMENT '题目id',
  `submission_data` mediumtext COMMENT '提交数据',
  `user_id` bigint(20) NOT NULL COMMENT '提交人id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`statistics_id`),
  KEY `index_questionnaire_id_question_id` (`questionnaire_id`,`open_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 COMMENT='调查问卷问答统计表';

-- ----------------------------
--  Table structure for `questionnaire_submission`
-- ----------------------------
DROP TABLE IF EXISTS `questionnaire_submission`;
CREATE TABLE `questionnaire_submission` (
  `questionnaire_submission_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '提交人id',
  `questionnaire_id` bigint(20) NOT NULL COMMENT '问卷id',
  `submission_data` mediumtext COMMENT '提交数据',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`questionnaire_submission_id`),
  KEY `index_questionnaire_id_user_id` (`questionnaire_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='调查问卷提交表';

-- ----------------------------
--  Table structure for `quiz_submission`
-- ----------------------------
DROP TABLE IF EXISTS `quiz_submission`;
CREATE TABLE `quiz_submission` (
  `quiz_submission_id` int(11) NOT NULL AUTO_INCREMENT,
  `context_id` int(11) DEFAULT NULL COMMENT '班次id',
  `context_type` varchar(255) DEFAULT NULL COMMENT 'Course',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `quiz_id` int(11) DEFAULT NULL COMMENT '测验id',
  `quiz_version` int(11) DEFAULT NULL COMMENT '暂时不用',
  `submission_data` mediumtext COMMENT '提价内容',
  `submission_id` int(11) DEFAULT NULL COMMENT '对应submission id',
  `score` double(12,2) DEFAULT NULL COMMENT '分数',
  `kept_score` double(12,2) DEFAULT NULL COMMENT '分数',
  `quiz_data` mediumtext COMMENT '测验数据',
  `started_at` datetime DEFAULT NULL COMMENT '开始时间',
  `ended_at` datetime DEFAULT NULL COMMENT '结束时间',
  `finished_at` datetime DEFAULT NULL COMMENT '结束时间',
  `attempt` int(11) DEFAULT NULL COMMENT '第几次提交',
  `is_master` tinyint(1) DEFAULT NULL COMMENT '是否是最终成绩',
  `position` int(11) DEFAULT NULL COMMENT '序号',
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`quiz_submission_id`),
  KEY `index_context_id` (`context_id`),
  KEY `index_user_id` (`user_id`),
  KEY `index_submission_id` (`submission_id`),
  KEY `index_quiz_id` (`quiz_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1212323 DEFAULT CHARSET=utf8 COMMENT='测验提交表';

-- ----------------------------
--  Table structure for `report_log`
-- ----------------------------
DROP TABLE IF EXISTS `report_log`;
CREATE TABLE `report_log` (
  `report_log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '举报id',
  `context_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `context_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `content_id` bigint(20) DEFAULT NULL COMMENT '讨论/回复id',
  `content_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '讨论/回复',
  `user_id` bigint(20) DEFAULT NULL COMMENT '举报人id',
  `reason` text CHARACTER SET utf8 COLLATE utf8_bin COMMENT '举报内容',
  `status` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '暂时无用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`report_log_id`),
  KEY `index_content_id` (`content_id`),
  KEY `index_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8 COMMENT='讨论区举报表';

-- ----------------------------
--  Table structure for `resource_node`
-- ----------------------------
DROP TABLE IF EXISTS `resource_node`;
CREATE TABLE `resource_node` (
  `resource_node_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `parent_id` bigint(20) NOT NULL COMMENT '父节点id',
  `context_uuid` varchar(40) NOT NULL COMMENT '课程的uuid或者班次的uuid',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `context_type` varchar(255) NOT NULL COMMENT '所属类型,课程或者班级',
  `content_id` bigint(20) NOT NULL COMMENT '对应的id(比如视频)',
  `content_type` varchar(255) DEFAULT NULL COMMENT '所属类型,比如视频(video)',
  `type` varchar(255) DEFAULT NULL COMMENT '文件夹 或者文件类型',
  `name` varchar(2000) NOT NULL COMMENT '名称',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `is_private` tinyint(4) DEFAULT NULL COMMENT '是否私有,1是私有 0不是私有',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `trans_unit_id` int(20) DEFAULT NULL,
  PRIMARY KEY (`resource_node_id`),
  KEY `index_trans_unit_id` (`trans_unit_id`),
  KEY `index_parent_id` (`parent_id`),
  KEY `index_context_uuid` (`context_uuid`),
  KEY `index_content_id` (`content_id`),
  KEY `index_context_type` (`context_type`(10)),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23456839269 DEFAULT CHARSET=utf8 COMMENT='资源库表(视频库,文档库,幻灯库)';

-- ----------------------------
--  Table structure for `resource_node_publish`
-- ----------------------------
DROP TABLE IF EXISTS `resource_node_publish`;
CREATE TABLE `resource_node_publish` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `resource_node_id` bigint(20) DEFAULT NULL COMMENT '资源id',
  `publish_status` tinyint(4) DEFAULT '0' COMMENT '1已发布 0未发布',
  PRIMARY KEY (`id`),
  UNIQUE KEY `resource_node_id_index` (`resource_node_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=utf8 COMMENT='app资源库公开表';

-- ----------------------------
--  Table structure for `resource_node_publish_test`
-- ----------------------------
DROP TABLE IF EXISTS `resource_node_publish_test`;
CREATE TABLE `resource_node_publish_test` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `resource_node_id` bigint(20) NOT NULL,
  `publish_status` tinyint(4) DEFAULT '0' COMMENT '1已发布 0未发布',
  PRIMARY KEY (`id`),
  UNIQUE KEY `resource_node_id_index` (`resource_node_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `role`
-- ----------------------------
DROP TABLE IF EXISTS `role`;
CREATE TABLE `role` (
  `role_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '角色id',
  `name` varchar(255) DEFAULT NULL COMMENT '角色名称',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `desc` mediumtext COMMENT '暂时无用',
  `type` varchar(255) DEFAULT NULL COMMENT '作用域',
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户id',
  PRIMARY KEY (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=70 DEFAULT CHARSET=utf8 COMMENT='角色配置表';

-- ----------------------------
--  Table structure for `role_function`
-- ----------------------------
DROP TABLE IF EXISTS `role_function`;
CREATE TABLE `role_function` (
  `role_function_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `role_id` bigint(20) DEFAULT NULL,
  `function_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`role_function_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 COMMENT='废弃表,暂时没有任何地方用到';

-- ----------------------------
--  Table structure for `role_permission`
-- ----------------------------
DROP TABLE IF EXISTS `role_permission`;
CREATE TABLE `role_permission` (
  `role_permission_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `role_id` varchar(200) DEFAULT NULL COMMENT '角色id',
  `permission_id` bigint(20) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL COMMENT '创建日期',
  `description` varchar(200) DEFAULT NULL COMMENT '信息描述',
  PRIMARY KEY (`role_permission_id`),
  KEY `role_index` (`role_id`),
  KEY `index_permission_id` (`permission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8 COMMENT='角色权限关联表';

-- ----------------------------
--  Table structure for `role_permission_dictionary_relate`
-- ----------------------------
DROP TABLE IF EXISTS `role_permission_dictionary_relate`;
CREATE TABLE `role_permission_dictionary_relate` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `dictionary_id` int(11) NOT NULL COMMENT '权限字典id',
  `role_id` int(11) NOT NULL COMMENT '权限Id',
  `delete_flag` tinyint(20) NOT NULL COMMENT '状态 1 可用 0 不可用',
  `created_at` datetime NOT NULL COMMENT '创建时间',
  `updated_at` datetime NOT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `index_dictionary_id` (`dictionary_id`),
  KEY `index_role_id` (`role_id`)
) ENGINE=InnoDB AUTO_INCREMENT=132 DEFAULT CHARSET=utf8 COMMENT='角色权限字典关联表';

-- ----------------------------
--  Table structure for `role_user`
-- ----------------------------
DROP TABLE IF EXISTS `role_user`;
CREATE TABLE `role_user` (
  `role_user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `role_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '角色id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`role_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=18142 DEFAULT CHARSET=utf8 COMMENT='用户身份表';

-- ----------------------------
--  Table structure for `roles`
-- ----------------------------
DROP TABLE IF EXISTS `roles`;
CREATE TABLE `roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `roles_users`
-- ----------------------------
DROP TABLE IF EXISTS `roles_users`;
CREATE TABLE `roles_users` (
  `user_id` int(11) DEFAULT NULL,
  `role_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `roll_call`
-- ----------------------------
DROP TABLE IF EXISTS `roll_call`;
CREATE TABLE `roll_call` (
  `roll_call_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '点名id',
  `teacher_id` bigint(20) NOT NULL COMMENT '老师id',
  `distance` double NOT NULL,
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL,
  `status` tinyint(4) NOT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `longitude` double NOT NULL COMMENT '经度',
  `latitude` double NOT NULL COMMENT '纬度',
  `start_time` datetime DEFAULT NULL,
  `time` tinyint(4) DEFAULT NULL,
  `school_room_id` bigint(20) DEFAULT '0' COMMENT '课堂id',
  PRIMARY KEY (`roll_call_id`),
  KEY `roll_call_delete_flag_index` (`delete_flag`),
  KEY `roll_call_teacher_id_index` (`teacher_id`),
  KEY `roll_call_class_id_index` (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=903 DEFAULT CHARSET=utf8 COMMENT='点名表';

-- ----------------------------
--  Table structure for `roll_call_sign`
-- ----------------------------
DROP TABLE IF EXISTS `roll_call_sign`;
CREATE TABLE `roll_call_sign` (
  `roll_call_sign_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '签到id',
  `roll_call_id` bigint(20) NOT NULL COMMENT '点名id',
  `student_user_id` bigint(20) NOT NULL COMMENT '用户id',
  `longitude` double DEFAULT NULL COMMENT '经度',
  `latitude` double DEFAULT NULL COMMENT '纬度',
  `created_at` datetime DEFAULT NULL COMMENT '签到时间',
  `type` tinyint(4) DEFAULT NULL COMMENT '0-正常;1-补签;2-请假',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`roll_call_sign_id`),
  KEY `roll_call_delete_flag_index` (`delete_flag`),
  KEY `roll_call_user_id_index` (`student_user_id`),
  KEY `roll_call_roll_call_id_index` (`roll_call_id`)
) ENGINE=InnoDB AUTO_INCREMENT=572 DEFAULT CHARSET=utf8 COMMENT='点名签到表';

-- ----------------------------
--  Table structure for `sales`
-- ----------------------------
DROP TABLE IF EXISTS `sales`;
CREATE TABLE `sales` (
  `sales_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `zone_id` bigint(20) DEFAULT NULL,
  `sales_name` varchar(255) DEFAULT NULL COMMENT '集团销售',
  `customer_supervisor` varchar(255) DEFAULT NULL,
  `organization_type` varchar(255) DEFAULT NULL,
  `contract_type` varchar(255) DEFAULT NULL,
  `channel_type` varchar(255) DEFAULT NULL,
  `started_at` date NOT NULL,
  `ended_at` date NOT NULL,
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `gxb_sales_name` varchar(255) DEFAULT NULL COMMENT '高校邦销售名称',
  PRIMARY KEY (`sales_id`)
) ENGINE=InnoDB AUTO_INCREMENT=107 DEFAULT CHARSET=utf8 COMMENT='销售表';

-- ----------------------------
--  Table structure for `schedule_history`
-- ----------------------------
DROP TABLE IF EXISTS `schedule_history`;
CREATE TABLE `schedule_history` (
  `learn_schedule_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL,
  `chapter_id` bigint(20) NOT NULL,
  `content_id` bigint(20) NOT NULL,
  `content_type` varchar(20) DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL,
  `learn_status` smallint(6) DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `document_at` datetime DEFAULT NULL COMMENT '归档时间',
  PRIMARY KEY (`learn_schedule_id`),
  UNIQUE KEY `class_chapter_user_unque` (`class_id`,`chapter_id`,`user_id`) USING BTREE,
  KEY `class_index` (`class_id`),
  KEY `chapter_index` (`chapter_id`),
  KEY `user_index` (`user_id`),
  KEY `index_content_type` (`content_type`)
) ENGINE=InnoDB AUTO_INCREMENT=15808758 DEFAULT CHARSET=utf8 COMMENT='学生章节列表学习记录表';

-- ----------------------------
--  Table structure for `school`
-- ----------------------------
DROP TABLE IF EXISTS `school`;
CREATE TABLE `school` (
  `school_id` int(11) DEFAULT '0',
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `zone_id` int(11) DEFAULT NULL,
  `motto` varchar(255) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL COMMENT '学校名称',
  `category` varchar(255) DEFAULT NULL COMMENT '学校分类',
  `validate_type` varchar(255) DEFAULT NULL,
  `website` varchar(255) DEFAULT NULL,
  `intro` varchar(255) DEFAULT NULL,
  `desc` mediumtext COMMENT '学校简介',
  `permalink` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `shortname` varchar(255) DEFAULT NULL COMMENT '学校短域名',
  `tenant_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `index_tenant_id` (`tenant_id`),
  KEY `index_school_id` (`school_id`),
  KEY `index_shortname` (`shortname`)
) ENGINE=InnoDB AUTO_INCREMENT=775 DEFAULT CHARSET=utf8 COMMENT='学校表';

-- ----------------------------
--  Table structure for `school_host`
-- ----------------------------
DROP TABLE IF EXISTS `school_host`;
CREATE TABLE `school_host` (
  `school_host_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `school_id` bigint(20) DEFAULT NULL,
  `school_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `host_url` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `id` int(11) DEFAULT NULL,
  PRIMARY KEY (`school_host_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `selective_classses`
-- ----------------------------
DROP TABLE IF EXISTS `selective_classses`;
CREATE TABLE `selective_classses` (
  `selective_classes_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `selective_id` bigint(20) NOT NULL COMMENT '选课表id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`selective_classes_id`),
  KEY `index_selective_classes_id` (`selective_classes_id`),
  KEY `index_class_id` (`class_id`) USING BTREE,
  KEY `index_selective_id` (`selective_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7154 DEFAULT CHARSET=utf8mb4 COMMENT='选课与班次关联表';

-- ----------------------------
--  Table structure for `selective_info`
-- ----------------------------
DROP TABLE IF EXISTS `selective_info`;
CREATE TABLE `selective_info` (
  `selective_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL COMMENT '租户id',
  `title` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '选课标题',
  `start_at` datetime DEFAULT NULL COMMENT '开始选课时间',
  `end_at` datetime DEFAULT NULL COMMENT '选课截止时间',
  `description` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '选课描述',
  `max_num` int(11) DEFAULT NULL COMMENT '最多选几门',
  `limit_num_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '1限制数量 0 不限制选课数量',
  `is_publish` tinyint(4) NOT NULL DEFAULT '0' COMMENT '发布状态',
  `creater_id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `student_type` tinyint(4) NOT NULL COMMENT '1导入名单 0 全校可选',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`selective_id`),
  KEY `index_selective_id` (`selective_id`),
  KEY `index_tenant_id` (`tenant_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=6819 DEFAULT CHARSET=utf8mb4 COMMENT='选课表';

-- ----------------------------
--  Table structure for `selective_students`
-- ----------------------------
DROP TABLE IF EXISTS `selective_students`;
CREATE TABLE `selective_students` (
  `selective_students_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `student_user_id` bigint(20) DEFAULT NULL COMMENT '学生id',
  `selective_status` tinyint(4) NOT NULL COMMENT '1已选 0 未选',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `selective_id` bigint(20) NOT NULL COMMENT '选课id',
  `student_no` varchar(255) DEFAULT NULL COMMENT '学号',
  PRIMARY KEY (`selective_students_id`),
  KEY `index_selective_students_id` (`selective_students_id`),
  KEY `index_student_user_id` (`student_user_id`) USING BTREE,
  KEY `index_selective_id` (`selective_id`) USING BTREE,
  KEY `index_student_no` (`student_no`(50)) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7426 DEFAULT CHARSET=utf8mb4 COMMENT='学生选课表';

-- ----------------------------
--  Table structure for `send_message_config`
-- ----------------------------
DROP TABLE IF EXISTS `send_message_config`;
CREATE TABLE `send_message_config` (
  `config_id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL COMMENT '租户id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除  0 删除 1 未删除',
  PRIMARY KEY (`config_id`),
  KEY `index_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='发送短信配置表';

-- ----------------------------
--  Table structure for `shake`
-- ----------------------------
DROP TABLE IF EXISTS `shake`;
CREATE TABLE `shake` (
  `shake_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '摇一摇id',
  `teacher_id` bigint(20) NOT NULL COMMENT '老师id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `student_user_id` bigint(20) NOT NULL COMMENT '学生id',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`shake_id`),
  KEY `shake_delete_flag_index` (`delete_flag`),
  KEY `shake_teacher_id_index` (`teacher_id`),
  KEY `shake_class_id_index` (`class_id`),
  KEY `shake_user_id_index` (`student_user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=556 DEFAULT CHARSET=utf8 COMMENT='摇一摇表';

-- ----------------------------
--  Table structure for `share_resource_config`
-- ----------------------------
DROP TABLE IF EXISTS `share_resource_config`;
CREATE TABLE `share_resource_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除  0 删除 1 未删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 COMMENT='跨租户引用资源配置表';

-- ----------------------------
--  Table structure for `student`
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `student_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `no` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '学号',
  `major` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '专业',
  `school_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '学校名称',
  `school_department` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '院系',
  `school_grade` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '年级',
  `school_class` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '班级',
  `enrollment_at` datetime DEFAULT NULL COMMENT '入学年份',
  `status` int(11) DEFAULT NULL COMMENT '学生状态 10在校 20校外实习 30毕业 40社会用户',
  `remark` int(11) NOT NULL COMMENT '学生来源 10学校导入 20自由注册',
  `confirmed_at` datetime DEFAULT NULL COMMENT '认证时间',
  `tenant_id` bigint(20) DEFAULT NULL,
  `delete_flag` int(11) DEFAULT '1' COMMENT '0不可用 1可用',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `discipline` varchar(100) DEFAULT NULL COMMENT '学科',
  `education_qualification` varchar(20) DEFAULT NULL COMMENT '学历',
  PRIMARY KEY (`student_id`),
  KEY `index_user_id` (`user_id`),
  KEY `index_no` (`no`),
  KEY `idnex_tenant` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=464247 DEFAULT CHARSET=utf8 COMMENT='学生认证表';

-- ----------------------------
--  Table structure for `student_temp`
-- ----------------------------
DROP TABLE IF EXISTS `student_temp`;
CREATE TABLE `student_temp` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `student_id` bigint(20) DEFAULT NULL COMMENT '学生id(认证后从student表取主键)',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id(认证后从user表取主键)',
  `no` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '学号',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '姓名',
  `gender` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '性别',
  `mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '手机号',
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '邮箱',
  `major` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '专业',
  `school_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '学校名称',
  `school_department` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '院系',
  `school_grade` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '年级',
  `school_class` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '班级',
  `enrollment_at` datetime DEFAULT NULL COMMENT '入学年份',
  `status` int(11) DEFAULT NULL COMMENT '学生状态 10在校 20校外实习 30毕业 40社会用户',
  `confirmed_at` datetime DEFAULT NULL COMMENT '认证时间',
  `tenant_id` bigint(20) NOT NULL,
  `import_flag` tinyint(1) DEFAULT '0' COMMENT '导入状态 0-未认证,1-已认证',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `discipline` varchar(100) DEFAULT NULL COMMENT '学科',
  `education_qualification` varchar(20) DEFAULT NULL COMMENT '学历',
  PRIMARY KEY (`id`),
  KEY `index_no` (`no`),
  KEY `mobile` (`mobile`),
  KEY `email` (`email`),
  KEY `tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=464262 DEFAULT CHARSET=utf8 COMMENT='学生认证临时表';

-- ----------------------------
--  Table structure for `study_profile`
-- ----------------------------
DROP TABLE IF EXISTS `study_profile`;
CREATE TABLE `study_profile` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(10) NOT NULL COMMENT '班次id',
  `user_id` bigint(10) NOT NULL COMMENT '用户id',
  `unit_id` bigint(10) DEFAULT NULL COMMENT '暂时无用',
  `title` varchar(255) DEFAULT NULL COMMENT '文件名',
  `body` mediumtext COMMENT '暂时无用',
  `path` varchar(255) DEFAULT NULL COMMENT '暂时无用',
  `size` int(11) DEFAULT NULL COMMENT '暂时无用',
  `created_at` datetime NOT NULL,
  `updated_at` datetime DEFAULT NULL,
  `status` varchar(10) DEFAULT NULL COMMENT '10未发布  20已发布',
  `delete_flag` varchar(10) DEFAULT NULL,
  `school_room_id` bigint(20) DEFAULT '0' COMMENT '课堂id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=578 DEFAULT CHARSET=utf8 COMMENT='学习资料表';

-- ----------------------------
--  Table structure for `study_profile_file`
-- ----------------------------
DROP TABLE IF EXISTS `study_profile_file`;
CREATE TABLE `study_profile_file` (
  `id` bigint(10) NOT NULL AUTO_INCREMENT,
  `study_profile_id` bigint(10) NOT NULL COMMENT '学习资料id',
  `file_path` varchar(255) NOT NULL COMMENT '文件地址',
  `type` varchar(255) NOT NULL COMMENT '类型',
  `size` bigint(10) DEFAULT NULL COMMENT '文件大小',
  `created_at` datetime NOT NULL,
  `delete_flag` varchar(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=272 DEFAULT CHARSET=utf8 COMMENT='学习资料附件表';

-- ----------------------------
--  Table structure for `study_profile_view`
-- ----------------------------
DROP TABLE IF EXISTS `study_profile_view`;
CREATE TABLE `study_profile_view` (
  `study_profile_view_id` bigint(10) NOT NULL AUTO_INCREMENT,
  `study_profile_id` bigint(10) NOT NULL COMMENT '学习资料id',
  `user_id` bigint(10) NOT NULL COMMENT '用户id',
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`study_profile_view_id`)
) ENGINE=InnoDB AUTO_INCREMENT=139 DEFAULT CHARSET=utf8 COMMENT='学习资料查看记录表';

-- ----------------------------
--  Table structure for `subjective_question`
-- ----------------------------
DROP TABLE IF EXISTS `subjective_question`;
CREATE TABLE `subjective_question` (
  `subjective_question_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `editor_id` bigint(20) NOT NULL,
  `title` varchar(4000) DEFAULT NULL COMMENT '标题',
  `comment` mediumtext COMMENT '题目解析',
  `level` varchar(255) DEFAULT NULL COMMENT '题目难度级别',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0不可用',
  `least_count_answer` int(11) DEFAULT NULL COMMENT '答案字数限制',
  `score` decimal(3,0) DEFAULT '0' COMMENT '分值',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `reference_answer` mediumtext COMMENT '参考答案',
  PRIMARY KEY (`subjective_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=596 DEFAULT CHARSET=utf8 COMMENT='主观题表';

-- ----------------------------
--  Table structure for `subjective_question_submission`
-- ----------------------------
DROP TABLE IF EXISTS `subjective_question_submission`;
CREATE TABLE `subjective_question_submission` (
  `subjective_question_submission_id` int(11) NOT NULL AUTO_INCREMENT,
  `exam_id` int(11) NOT NULL COMMENT '考试id',
  `user_id` int(11) NOT NULL COMMENT '提交人',
  `subjective_question_id` int(11) NOT NULL COMMENT '主观题id',
  `submission_data` mediumtext COMMENT '提交内容',
  `submitted_at` datetime DEFAULT NULL COMMENT '提交时间',
  `graded_at` datetime DEFAULT NULL COMMENT '批改时间',
  `graded_id` int(11) DEFAULT NULL COMMENT '批阅人',
  `graded_comment` mediumtext COMMENT '批阅注解',
  `score` double(3,0) DEFAULT NULL COMMENT '评分',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`subjective_question_submission_id`),
  KEY `index_exam_user_subjective_id` (`exam_id`,`user_id`,`subjective_question_id`)
) ENGINE=InnoDB AUTO_INCREMENT=701 DEFAULT CHARSET=utf8 COMMENT='主观题提交记录';

-- ----------------------------
--  Table structure for `submission`
-- ----------------------------
DROP TABLE IF EXISTS `submission`;
CREATE TABLE `submission` (
  `submission_id` int(11) NOT NULL AUTO_INCREMENT,
  `context_id` int(11) DEFAULT NULL,
  `context_type` varchar(255) DEFAULT NULL,
  `submitted_id` int(11) DEFAULT NULL COMMENT '作业/讨论/测验相关主键',
  `submitted_type` varchar(255) DEFAULT NULL COMMENT '回答类型 作业/讨论/测验',
  `assignment_id` int(11) DEFAULT NULL COMMENT '暂时无用',
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `body` mediumtext COMMENT '回答内容',
  `url` varchar(255) DEFAULT NULL COMMENT '暂时无用',
  `grade` varchar(255) DEFAULT NULL,
  `score` double(12,2) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `submission_type` varchar(255) DEFAULT NULL,
  `processed` tinyint(1) DEFAULT NULL,
  `process_attempts` int(11) DEFAULT NULL,
  `published_score` double(12,2) DEFAULT NULL COMMENT '分数',
  `graded_at` datetime DEFAULT NULL COMMENT '教师评分时间',
  `graded_comment` mediumtext COMMENT '教师评语',
  `grader_id` int(11) DEFAULT NULL COMMENT '教师id',
  `late` tinyint(1) DEFAULT NULL,
  `is_master` tinyint(1) DEFAULT NULL COMMENT '是否为自己提交',
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `peer_review_comment` mediumtext,
  `is_distribution` tinyint(4) DEFAULT '0',
  `is_calculateScore` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`submission_id`),
  KEY `submitted_id_index` (`submitted_id`),
  KEY `user_id_index` (`user_id`),
  KEY `type_index` (`submitted_type`),
  KEY `context_id_index` (`context_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2346068 DEFAULT CHARSET=utf8 COMMENT='学习得分表';

-- ----------------------------
--  Table structure for `submission_copy`
-- ----------------------------
DROP TABLE IF EXISTS `submission_copy`;
CREATE TABLE `submission_copy` (
  `submission_id` int(11) NOT NULL AUTO_INCREMENT,
  `context_id` int(11) NOT NULL DEFAULT '0',
  `context_type` varchar(255) DEFAULT NULL,
  `submitted_id` int(11) DEFAULT NULL,
  `submitted_type` varchar(255) DEFAULT NULL,
  `assignment_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `body` mediumtext,
  `url` varchar(255) DEFAULT NULL,
  `grade` varchar(255) DEFAULT NULL,
  `score` double(12,2) DEFAULT NULL,
  `submitted_at` datetime DEFAULT NULL,
  `submission_type` varchar(255) DEFAULT NULL,
  `processed` tinyint(1) DEFAULT NULL,
  `process_attempts` int(11) DEFAULT NULL,
  `published_score` double(12,2) DEFAULT NULL,
  `graded_at` datetime DEFAULT NULL,
  `graded_comment` mediumtext,
  `grader_id` int(11) DEFAULT NULL,
  `late` tinyint(1) DEFAULT NULL,
  `is_master` tinyint(1) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `peer_review_comment` mediumtext,
  `is_distribution` tinyint(4) DEFAULT '0',
  `is_calculateScore` tinyint(4) DEFAULT '0',
  PRIMARY KEY (`submission_id`,`context_id`),
  KEY `submitted_id_index` (`submitted_id`),
  KEY `user_id_index` (`user_id`),
  KEY `type_index` (`submitted_type`),
  KEY `context_id_index` (`context_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1978037 DEFAULT CHARSET=utf8
/*!50100 PARTITION BY HASH (context_id)
PARTITIONS 100 */;

-- ----------------------------
--  Table structure for `submission_tutorial_replay_relate`
-- ----------------------------
DROP TABLE IF EXISTS `submission_tutorial_replay_relate`;
CREATE TABLE `submission_tutorial_replay_relate` (
  `relate_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `submission_id` bigint(20) NOT NULL COMMENT '作业提交id',
  `replay_id` bigint(20) DEFAULT NULL COMMENT '学生录制视频id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除  0 删除 1 未删除',
  PRIMARY KEY (`relate_id`),
  KEY `index_submission_id` (`submission_id`)
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8 COMMENT='编程作业提交关联表';

-- ----------------------------
--  Table structure for `system_code_record`
-- ----------------------------
DROP TABLE IF EXISTS `system_code_record`;
CREATE TABLE `system_code_record` (
  `code_record_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `code_replay_id` bigint(10) NOT NULL COMMENT '回放id',
  `intervaltime` int(10) DEFAULT NULL COMMENT '操作间隔',
  `editor` varchar(20) DEFAULT NULL COMMENT '语言分类',
  `changeobj` mediumtext COMMENT '每一个操作的记录',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `delete_flag` tinyint(1) DEFAULT NULL COMMENT '删除状态',
  `cmpinfo` mediumtext,
  `output` mediumtext,
  `result` mediumtext,
  `stderr` mediumtext,
  `status` varchar(10) DEFAULT NULL,
  `compiler_info` mediumtext,
  `content` mediumtext,
  `error` mediumtext,
  `code` varchar(10) DEFAULT NULL,
  `main_argus` varchar(200) DEFAULT NULL,
  `runtime_argus` varchar(200) DEFAULT NULL,
  `treefile` mediumtext,
  PRIMARY KEY (`code_record_id`)
) ENGINE=InnoDB AUTO_INCREMENT=118354 DEFAULT CHARSET=utf8 COMMENT='实境编程录制步骤表';

-- ----------------------------
--  Table structure for `system_code_replay`
-- ----------------------------
DROP TABLE IF EXISTS `system_code_replay`;
CREATE TABLE `system_code_replay` (
  `code_replay_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `html` mediumtext COMMENT '最终html代码',
  `css` mediumtext COMMENT '最终css代码',
  `javascript` mediumtext COMMENT '最终js代码',
  `pickup` int(11) NOT NULL COMMENT '判断该课程是视频还是文本',
  `user_id` bigint(10) DEFAULT NULL,
  `replaytitle` varchar(255) DEFAULT NULL COMMENT '课程名称',
  `languageid` tinyint(2) DEFAULT NULL COMMENT '课程语言类型',
  `replaydesc` text COMMENT '回放说明',
  `image` varchar(200) DEFAULT NULL COMMENT '图片',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `viewcount` int(10) DEFAULT NULL COMMENT '播放次数',
  `saveformat` tinyint(1) DEFAULT NULL COMMENT '保存格式',
  `delete_flag` tinyint(1) DEFAULT NULL COMMENT '删除状态',
  `audio_url` varchar(100) DEFAULT NULL COMMENT '语音地址',
  `class_id` bigint(10) DEFAULT NULL COMMENT '班次id',
  `totaltime` int(10) DEFAULT NULL COMMENT '总时长',
  `main_path` varchar(200) DEFAULT NULL COMMENT 'mian函数所在类的路径',
  `main_argus` varchar(200) DEFAULT NULL COMMENT 'main函数参数',
  `runtime_argus` varchar(200) DEFAULT NULL COMMENT 'Scanner参数',
  `programming_source` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否是时速云编译,0否  1是',
  PRIMARY KEY (`code_replay_id`)
) ENGINE=InnoDB AUTO_INCREMENT=286611 DEFAULT CHARSET=utf8 COMMENT='实境编程录制表';

-- ----------------------------
--  Table structure for `system_config`
-- ----------------------------
DROP TABLE IF EXISTS `system_config`;
CREATE TABLE `system_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `config_type` varchar(100) NOT NULL DEFAULT '' COMMENT '类型',
  `config_value` varchar(100) NOT NULL DEFAULT '' COMMENT '值',
  `status` tinyint(4) DEFAULT '1' COMMENT '1可用 0 不可用',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='系统配置表';

-- ----------------------------
--  Table structure for `system_student_record`
-- ----------------------------
DROP TABLE IF EXISTS `system_student_record`;
CREATE TABLE `system_student_record` (
  `student_record_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `student_replay_id` bit(10) NOT NULL COMMENT '回放id',
  `intervaltime` int(10) DEFAULT NULL COMMENT '操作间隔',
  `editor` varchar(20) DEFAULT NULL COMMENT '语言类型',
  `changeobj` mediumtext COMMENT '操作内容',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `delete_flag` tinyint(1) DEFAULT NULL COMMENT '删除状态',
  `cmpinfo` mediumtext,
  `output` mediumtext,
  `result` mediumtext,
  `stderr` mediumtext,
  `status` varchar(10) DEFAULT NULL,
  `compiler_info` mediumtext,
  `content` mediumtext,
  `error` mediumtext,
  `code` varchar(10) DEFAULT NULL,
  `main_argus` varchar(200) DEFAULT NULL,
  `runtime_argus` varchar(200) DEFAULT NULL,
  `treefile` mediumtext,
  PRIMARY KEY (`student_record_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4698 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='实境编程学生提交作业步骤表';

-- ----------------------------
--  Table structure for `system_student_replay`
-- ----------------------------
DROP TABLE IF EXISTS `system_student_replay`;
CREATE TABLE `system_student_replay` (
  `student_replay_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `html` mediumtext COMMENT '最终html代码',
  `css` text COMMENT 'css内容',
  `javascript` text COMMENT 'js内容',
  `pickup` int(11) NOT NULL,
  `user_id` bigint(10) DEFAULT NULL COMMENT '用户id',
  `replaytitle` varchar(200) DEFAULT NULL COMMENT '课程标题',
  `replaydesc` longtext COMMENT '课程描述',
  `image` varchar(200) DEFAULT NULL COMMENT '图片',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `viewcount` int(10) DEFAULT NULL COMMENT '播放次数',
  `saveformat` tinyint(1) DEFAULT NULL COMMENT '保存类型',
  `delete_flag` tinyint(1) DEFAULT NULL COMMENT '删除状态',
  `languageid` int(10) DEFAULT NULL COMMENT '语言类型',
  `audio_url` varchar(100) DEFAULT NULL COMMENT '语音地址',
  `class_id` bigint(10) DEFAULT NULL,
  `totaltime` int(10) DEFAULT NULL,
  `main_path` varchar(200) DEFAULT NULL COMMENT 'mian函数所在类的路径',
  `main_argus` varchar(200) DEFAULT NULL COMMENT 'main函数参数',
  `runtime_argus` varchar(200) DEFAULT NULL COMMENT 'Scanner参数',
  `programming_source` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否是时速云编译,0否  1是',
  PRIMARY KEY (`student_replay_id`)
) ENGINE=InnoDB AUTO_INCREMENT=121 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='实境编程学生提交作业表';

-- ----------------------------
--  Table structure for `system_tutorial_record`
-- ----------------------------
DROP TABLE IF EXISTS `system_tutorial_record`;
CREATE TABLE `system_tutorial_record` (
  `tutorial_record_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `tutorial_replay_id` bit(10) NOT NULL COMMENT '回放id',
  `intervaltime` int(10) DEFAULT NULL COMMENT '操作间隔',
  `editor` varchar(20) DEFAULT NULL COMMENT '语言类型',
  `changeobj` varchar(2000) DEFAULT NULL COMMENT '操作内容',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `delete_flag` tinyint(1) DEFAULT NULL COMMENT '删除状态',
  PRIMARY KEY (`tutorial_record_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `system_tutorial_replay`
-- ----------------------------
DROP TABLE IF EXISTS `system_tutorial_replay`;
CREATE TABLE `system_tutorial_replay` (
  `tutorial_replay_id` bigint(10) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `html` text NOT NULL COMMENT 'html内容',
  `css` text NOT NULL COMMENT 'css内容',
  `javascript` text NOT NULL COMMENT 'js内容',
  `pickup` int(11) NOT NULL,
  `user_id` bigint(10) DEFAULT NULL COMMENT '用户id',
  `replaytitle` varchar(200) DEFAULT NULL COMMENT '课程标题',
  `replaydesc` longtext COMMENT '课程描述',
  `image` varchar(200) DEFAULT NULL COMMENT '图片',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `viewcount` int(10) DEFAULT NULL COMMENT '播放次数',
  `saveformat` tinyint(1) DEFAULT NULL COMMENT '保存类型',
  `delete_flag` tinyint(1) DEFAULT NULL COMMENT '删除状态',
  `languageid` int(10) DEFAULT NULL COMMENT '语言类型',
  `audio_url` varchar(100) DEFAULT NULL COMMENT '语音地址',
  PRIMARY KEY (`tutorial_replay_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `teacher_calendar`
-- ----------------------------
DROP TABLE IF EXISTS `teacher_calendar`;
CREATE TABLE `teacher_calendar` (
  `teacher_calendar_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `teacher_id` bigint(20) NOT NULL COMMENT '老师id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `content_type` varchar(30) NOT NULL COMMENT '类型 Quiz,Topic,Exam,Announcement,ROllCall,Activity,Vote,Questionnaire,WebCast',
  `content_id` bigint(20) NOT NULL COMMENT '学生id',
  `created_at` date NOT NULL COMMENT '创建日期',
  `delete_flag` tinyint(4) NOT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`teacher_calendar_id`),
  KEY `teacher_id_class_id_index` (`teacher_id`,`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=675 DEFAULT CHARSET=utf8 COMMENT='教学日历表';

-- ----------------------------
--  Table structure for `teacher_white_list`
-- ----------------------------
DROP TABLE IF EXISTS `teacher_white_list`;
CREATE TABLE `teacher_white_list` (
  `teacher_white_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `content_id` bigint(20) DEFAULT NULL COMMENT '课程或班次id',
  `content_type` varchar(255) DEFAULT NULL COMMENT '课程/班次',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`teacher_white_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3253 DEFAULT CHARSET=utf8 COMMENT='建课开班白名单';

-- ----------------------------
--  Table structure for `template`
-- ----------------------------
DROP TABLE IF EXISTS `template`;
CREATE TABLE `template` (
  `template_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `body` text COMMENT '模板内容',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `status` varchar(255) DEFAULT NULL COMMENT '状态10:基础 20:定制',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`template_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='模板表';

-- ----------------------------
--  Table structure for `tenant_template`
-- ----------------------------
DROP TABLE IF EXISTS `tenant_template`;
CREATE TABLE `tenant_template` (
  `tenant_template_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `template_id` bigint(20) NOT NULL,
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `body` text COMMENT '模板内容',
  `status` varchar(255) DEFAULT NULL COMMENT '状态10:激活 20:禁用',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`tenant_template_id`)
) ENGINE=InnoDB AUTO_INCREMENT=39 DEFAULT CHARSET=utf8 COMMENT='租户与模板关联关系表';

-- ----------------------------
--  Table structure for `tenants`
-- ----------------------------
DROP TABLE IF EXISTS `tenants`;
CREATE TABLE `tenants` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `tenant_type` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `status` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `zone_id` varchar(255) DEFAULT NULL,
  `related_intro` mediumtext,
  `related_intro_title` varchar(255) DEFAULT NULL,
  `frontend_template` varchar(255) DEFAULT NULL,
  `focus_color` varchar(255) DEFAULT NULL,
  `button_color` varchar(255) DEFAULT NULL,
  `jingcai_title` varchar(255) DEFAULT NULL,
  `photo_title` varchar(255) DEFAULT NULL,
  `teacher_title` varchar(255) DEFAULT NULL,
  `news_title` varchar(255) DEFAULT NULL,
  `entry_level` varchar(255) DEFAULT NULL,
  `login_type` varchar(255) DEFAULT NULL,
  `oauth_type` varchar(255) DEFAULT NULL,
  `oauth_link` varchar(255) DEFAULT NULL,
  `about_us` mediumtext,
  `verify_type` int(11) DEFAULT NULL,
  `hezuo_type` int(11) DEFAULT '10',
  `guessyoulike_type` int(11) DEFAULT '10',
  `related_type` int(11) DEFAULT '10',
  `university_id` bigint(20) DEFAULT NULL COMMENT '院校id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1022 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `tenants_permission_config`
-- ----------------------------
DROP TABLE IF EXISTS `tenants_permission_config`;
CREATE TABLE `tenants_permission_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL,
  `type` varchar(50) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除  0 删除 1 未删除',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_tenant_type` (`tenant_id`,`type`)
) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8 COMMENT='通用服务配置表';

-- ----------------------------
--  Table structure for `tenants_permission_functions`
-- ----------------------------
DROP TABLE IF EXISTS `tenants_permission_functions`;
CREATE TABLE `tenants_permission_functions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` int(11) DEFAULT NULL,
  `permission_function_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `tree_path` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6407 DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `tenants_relate_link`
-- ----------------------------
DROP TABLE IF EXISTS `tenants_relate_link`;
CREATE TABLE `tenants_relate_link` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) DEFAULT NULL,
  `url` varchar(255) DEFAULT NULL,
  `position` int(11) DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `tenants_roles`
-- ----------------------------
DROP TABLE IF EXISTS `tenants_roles`;
CREATE TABLE `tenants_roles` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `tenants_roles_permission_functions`
-- ----------------------------
DROP TABLE IF EXISTS `tenants_roles_permission_functions`;
CREATE TABLE `tenants_roles_permission_functions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `tenants_role_id` int(11) DEFAULT NULL,
  `permission_function_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2114 DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `tenants_set`
-- ----------------------------
DROP TABLE IF EXISTS `tenants_set`;
CREATE TABLE `tenants_set` (
  `tenants_set_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `context_id` bigint(20) NOT NULL COMMENT 'id',
  `context_type` varchar(20) NOT NULL COMMENT '类型',
  `permission_type` varchar(20) DEFAULT NULL COMMENT '权限类型',
  `is_permission` tinyint(4) NOT NULL COMMENT '0:没有权限;1:有权限',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`tenants_set_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COMMENT='租户设置表';

-- ----------------------------
--  Table structure for `testcase`
-- ----------------------------
DROP TABLE IF EXISTS `testcase`;
CREATE TABLE `testcase` (
  `testcase_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
  `programming_id` bigint(20) NOT NULL COMMENT '编程题id',
  `content` mediumtext NOT NULL COMMENT 'testcase内容',
  `user_id` bigint(10) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `delete_flag` tinyint(4) NOT NULL,
  PRIMARY KEY (`testcase_id`)
) ENGINE=InnoDB AUTO_INCREMENT=990 DEFAULT CHARSET=utf8 COMMENT='互动编程测试用例表';

-- ----------------------------
--  Table structure for `tokens`
-- ----------------------------
DROP TABLE IF EXISTS `tokens`;
CREATE TABLE `tokens` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `token` varchar(255) DEFAULT NULL,
  `cid` varchar(255) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `tenant_id` int(11) DEFAULT NULL,
  `dead_time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=507245 DEFAULT CHARSET=utf8 COMMENT='移动端用户登录表(已废弃)';

-- ----------------------------
--  Table structure for `transcript`
-- ----------------------------
DROP TABLE IF EXISTS `transcript`;
CREATE TABLE `transcript` (
  `transcript_id` int(11) NOT NULL AUTO_INCREMENT,
  `enrollment_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL COMMENT '用户id',
  `course_id` int(11) DEFAULT NULL,
  `grade_publishing_status` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL COMMENT '用户名',
  `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '用户姓名',
  `email` varchar(255) DEFAULT NULL COMMENT '邮箱',
  `student_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '学号',
  `assignment_score` double(12,2) DEFAULT NULL COMMENT '作业成绩',
  `topic_score` double(12,2) DEFAULT NULL COMMENT '讨论成绩',
  `quiz_score` double(12,2) DEFAULT NULL COMMENT '测验成绩',
  `assignment_total_score` double(12,2) DEFAULT NULL COMMENT '作业总分',
  `topic_total_score` double(12,2) DEFAULT NULL COMMENT '讨论总分',
  `quiz_total_score` double(12,2) DEFAULT NULL COMMENT '测验总分',
  `assignment_percentile_score` double(12,2) DEFAULT NULL COMMENT '作业占比',
  `topic_percentile_score` double(12,2) DEFAULT NULL COMMENT '讨论占比',
  `quiz_percentile_score` double(12,2) DEFAULT NULL COMMENT '测验占比',
  `video_percentile_score` double(12,2) DEFAULT NULL COMMENT '视频占比',
  `video_score` double(12,2) DEFAULT NULL COMMENT '视频分数',
  `final_percentile_score` double(12,2) DEFAULT NULL COMMENT '最终占比分数',
  `final_score` double(12,2) DEFAULT NULL COMMENT '最终分数',
  `total_score` double(12,2) DEFAULT NULL COMMENT '总分数',
  `school_department` varchar(255) DEFAULT NULL,
  `school_class` varchar(255) DEFAULT NULL COMMENT '班级',
  `assignmentnum` int(11) DEFAULT NULL COMMENT '作业个数',
  `topicnum` int(11) DEFAULT NULL COMMENT '讨论个数',
  `quiznum` int(11) DEFAULT NULL COMMENT '测验个数',
  `subassignmentnum` int(11) DEFAULT NULL COMMENT '完成作业数',
  `subtopicnum` int(11) DEFAULT NULL COMMENT '完成讨论数',
  `subquiznum` int(11) DEFAULT NULL COMMENT '完成测验数',
  `videonum` int(11) DEFAULT NULL COMMENT '视频数',
  `team_name` varchar(255) DEFAULT NULL COMMENT '组名',
  `team_id` int(11) DEFAULT NULL COMMENT '组id',
  `created_at` datetime DEFAULT NULL,
  `video_total_length` double(12,2) DEFAULT NULL COMMENT '视频总时长',
  `video_view_percentile` double(12,2) DEFAULT NULL COMMENT '视频观看占比',
  `mobile` varchar(255) DEFAULT NULL COMMENT '手机号',
  `major` varchar(255) DEFAULT NULL COMMENT '主修',
  `new_final_percentile_score` decimal(5,2) DEFAULT NULL COMMENT '新最终成绩占比',
  `publish_score` decimal(5,2) DEFAULT NULL COMMENT '公布成绩',
  `video_view_count` int(11) DEFAULT NULL COMMENT '视频观看个数',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `class_group_user_id` bigint(20) DEFAULT NULL COMMENT '选课记录id',
  `exam_percentile_score` decimal(5,2) DEFAULT NULL COMMENT '考试百分占比成绩',
  `exam_count` int(11) DEFAULT NULL COMMENT '考试数量',
  `sub_exam_count` int(11) DEFAULT NULL COMMENT '参加考试数量',
  `learn_rating` int(11) DEFAULT NULL COMMENT '学习进度',
  `off_line_score` decimal(5,2) DEFAULT NULL COMMENT '线下成绩',
  `programming_num` int(11) DEFAULT NULL COMMENT '编程数量',
  `view_programming_num` int(11) DEFAULT NULL COMMENT '观看的编程数量',
  `programming_percentile_score` decimal(5,2) DEFAULT NULL COMMENT '编程分数',
  PRIMARY KEY (`transcript_id`),
  KEY `index_transcript_course_id` (`course_id`),
  KEY `student_no` (`student_no`),
  KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=19892655 DEFAULT CHARSET=utf8 COMMENT='成绩表';

-- ----------------------------
--  Table structure for `transcript_log`
-- ----------------------------
DROP TABLE IF EXISTS `transcript_log`;
CREATE TABLE `transcript_log` (
  `class_id` bigint(20) DEFAULT NULL COMMENT '班次id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `error_message` varchar(2000) DEFAULT NULL COMMENT '失败原因',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  KEY `transcript_log_class_id_user_id` (`class_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='成绩计算异常记录表';

-- ----------------------------
--  Table structure for `transcript_task_status`
-- ----------------------------
DROP TABLE IF EXISTS `transcript_task_status`;
CREATE TABLE `transcript_task_status` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `cur_date` date NOT NULL COMMENT '日期',
  `status` tinyint(4) NOT NULL COMMENT '状态 0 计算中 1 计算完成',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`id`),
  KEY `cur_date` (`cur_date`)
) ENGINE=InnoDB AUTO_INCREMENT=184 DEFAULT CHARSET=utf8 COMMENT='成绩计算状态';

-- ----------------------------
--  Table structure for `university`
-- ----------------------------
DROP TABLE IF EXISTS `university`;
CREATE TABLE `university` (
  `university_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '高校id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `name` varchar(255) NOT NULL COMMENT '高校名称',
  `zone_id` bigint(20) DEFAULT NULL COMMENT '地区',
  `type` varchar(255) DEFAULT NULL COMMENT '高校类型:综合、工科、师范等等',
  `level` varchar(255) NOT NULL COMMENT '办学层次,10:专科 20:本科 30:高职',
  `category` varchar(255) DEFAULT NULL COMMENT '学校类别,10:985 20:211 30:一本',
  `competent_authority` varchar(255) DEFAULT NULL COMMENT '主管部门',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT '1' COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`university_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2596 DEFAULT CHARSET=utf8 COMMENT='高校信息表';

-- ----------------------------
--  Table structure for `user`
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户名',
  `name` varchar(2555) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '用户姓名',
  `gender` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '性别',
  `mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '手机号',
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '邮箱',
  `encrypted_password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT '密码',
  `confirm_status` int(11) DEFAULT '10' COMMENT '认证状态 10未认证 20已认证',
  `status` int(11) DEFAULT '10' COMMENT '用户状态 10正常 20禁用',
  `uuid` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '用户uuid(暂时无用)',
  `delete_flag` int(11) DEFAULT '1' COMMENT '0不可用 1可用',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `user_center_user_id` bigint(20) DEFAULT NULL COMMENT '用户中心user_id(暂时没用)',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_center_id` (`user_center_user_id`),
  KEY `index_mobile` (`mobile`),
  KEY `index_email` (`email`),
  KEY `index_user_id` (`user_id`),
  KEY `index_username` (`username`),
  KEY `user_name_index` (`name`(50))
) ENGINE=InnoDB AUTO_INCREMENT=1404638 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户表';

-- ----------------------------
--  Table structure for `user_copy`
-- ----------------------------
DROP TABLE IF EXISTS `user_copy`;
CREATE TABLE `user_copy` (
  `user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `username` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  `name` varchar(2555) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `gender` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `mobile` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `email` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `encrypted_password` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
  `confirm_status` int(11) DEFAULT '10' COMMENT '认证状态 10未认证 20已认证',
  `status` int(11) DEFAULT '10' COMMENT '用户状态 10正常 20禁用',
  `uuid` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
  `delete_flag` int(11) DEFAULT '1' COMMENT '0不可用 1可用',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`user_id`),
  KEY `index_mobile` (`mobile`),
  KEY `index_email` (`email`),
  KEY `index_user_id` (`user_id`),
  KEY `index_username` (`username`),
  KEY `user_name_index` (`name`(50))
) ENGINE=InnoDB AUTO_INCREMENT=1314808 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
--  Table structure for `user_im_token`
-- ----------------------------
DROP TABLE IF EXISTS `user_im_token`;
CREATE TABLE `user_im_token` (
  `id` bigint(11) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(11) DEFAULT NULL,
  `im_token` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_id_index` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=102 DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `user_message_center`
-- ----------------------------
DROP TABLE IF EXISTS `user_message_center`;
CREATE TABLE `user_message_center` (
  `user_message_id` int(20) NOT NULL AUTO_INCREMENT,
  `user_id` int(20) NOT NULL,
  `class_id` int(20) DEFAULT NULL,
  `message_id` int(20) NOT NULL COMMENT '消息id',
  `is_read` tinyint(4) DEFAULT NULL COMMENT '是否已读 1 是 0 否',
  `delete_flag` tinyint(4) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `message_type` varchar(255) DEFAULT 'Supervision' COMMENT '消息类型,Supervision:教学监督信息(class_push_message),TenantAnnouncement:租户公告(announcements),ClassAnnouncement:班次公告(announcement),ClassEndNotice:结课预告,ScorePublish:成绩公布,ExamStartNotice:考试预告,ExamScorePublish:考试成绩公布,ExamMakeUp:补考安排,AssignmentBack:作业打回',
  `title` varchar(255) DEFAULT NULL COMMENT '标题',
  PRIMARY KEY (`user_message_id`),
  UNIQUE KEY `message_type_id_unque` (`user_id`,`message_type`,`message_id`),
  KEY `userId` (`user_id`) USING BTREE,
  KEY `class_id` (`class_id`) USING BTREE,
  KEY `message_type_id_idx` (`message_type`,`message_id`),
  KEY `message_id` (`message_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=17571970 DEFAULT CHARSET=utf8 COMMENT='用户消息状态表';

-- ----------------------------
--  Table structure for `user_message_center_test`
-- ----------------------------
DROP TABLE IF EXISTS `user_message_center_test`;
CREATE TABLE `user_message_center_test` (
  `user_message_id` int(20) NOT NULL DEFAULT '0',
  `user_id` int(20) NOT NULL,
  `class_id` int(20) DEFAULT NULL,
  `message_id` int(20) NOT NULL,
  `is_read` tinyint(4) DEFAULT NULL COMMENT '是否已读 1 是 0 否',
  `delete_flag` tinyint(4) DEFAULT NULL,
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `message_type` varchar(255) DEFAULT '10' COMMENT '消息类型,10:教学监督信息(class_push_message),20:租户公告(announcements),30:班次公告(announcement)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `user_mobile_info`
-- ----------------------------
DROP TABLE IF EXISTS `user_mobile_info`;
CREATE TABLE `user_mobile_info` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  `registration_id` varchar(255) DEFAULT NULL COMMENT '用户识别id',
  `imei` varchar(255) DEFAULT NULL COMMENT '手机编码',
  PRIMARY KEY (`id`),
  KEY `index_id` (`id`) USING BTREE,
  KEY `index_user_id` (`user_id`) USING BTREE,
  KEY `index_registration_id` (`registration_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=299 DEFAULT CHARSET=utf8 COMMENT='移动端 用户识别表';

-- ----------------------------
--  Table structure for `user_profile`
-- ----------------------------
DROP TABLE IF EXISTS `user_profile`;
CREATE TABLE `user_profile` (
  `user_id` bigint(20) NOT NULL,
  `register_from` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT 'qq, sina, weixin, baidu ,wangyi',
  `platform` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '注册客服端 ios android chrome ie',
  `fail_attempts` int(11) DEFAULT '0',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `open_id` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '开放平台用户唯一标识符',
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `open_id` (`open_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='三方平台用户与user表关联关系表';

-- ----------------------------
--  Table structure for `video`
-- ----------------------------
DROP TABLE IF EXISTS `video`;
CREATE TABLE `video` (
  `video_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL,
  `title` varchar(255) DEFAULT NULL COMMENT '标题名',
  `cover_path` varchar(255) DEFAULT NULL COMMENT '视频封面的文件名,比如课程(course)',
  `srt_path` varchar(255) DEFAULT NULL COMMENT '字幕的文件名',
  `file_path` varchar(255) DEFAULT NULL COMMENT '视频的文件名',
  `seconds` int(11) DEFAULT NULL COMMENT '视频的长度(秒)',
  `file_size` bigint(20) DEFAULT NULL COMMENT '文件大小',
  `srt_size` int(11) DEFAULT NULL COMMENT '字幕大小',
  `transcoding_status` tinyint(4) DEFAULT NULL COMMENT '1已转码 0 未转码',
  `quiz_num` int(11) DEFAULT NULL COMMENT '视频测验数量',
  `position` int(11) DEFAULT NULL COMMENT '排序坐标',
  `status` varchar(255) DEFAULT NULL COMMENT '状态',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `md5_code` varchar(255) DEFAULT NULL COMMENT '文件md5值',
  `uuid` varchar(255) DEFAULT NULL,
  `trans_unit_id` int(20) DEFAULT NULL,
  `transcoding_progress` tinyint(4) DEFAULT NULL COMMENT '1 正在转码;2 成功;3失败',
  `is_splice` tinyint(4) DEFAULT '0' COMMENT '是否需要拼接视频前后缀',
  `header` tinyint(4) DEFAULT '0' COMMENT '是否添加片头',
  `footer` tinyint(4) DEFAULT '0' COMMENT '是否添加片尾',
  `logo` tinyint(4) DEFAULT '0' COMMENT '是否添加logo',
  PRIMARY KEY (`video_id`),
  KEY `index_course_id` (`course_id`),
  KEY `index_uuid` (`uuid`),
  KEY `transcoding_status_index` (`transcoding_status`),
  KEY `transcoding_progress_index` (`transcoding_progress`)
) ENGINE=InnoDB AUTO_INCREMENT=150317 DEFAULT CHARSET=utf8 COMMENT='视频表';

-- ----------------------------
--  Table structure for `video_tmp20160301`
-- ----------------------------
DROP TABLE IF EXISTS `video_tmp20160301`;
CREATE TABLE `video_tmp20160301` (
  `video_id` bigint(20) NOT NULL DEFAULT '0',
  `file_path` varchar(255) DEFAULT NULL COMMENT '视频的文件名',
  `seconds` int(11) DEFAULT NULL COMMENT '视频的长度(秒)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `video_tmp20160308`
-- ----------------------------
DROP TABLE IF EXISTS `video_tmp20160308`;
CREATE TABLE `video_tmp20160308` (
  `video_id` bigint(20) NOT NULL DEFAULT '0',
  `file_path` varchar(255) DEFAULT NULL COMMENT '视频的文件名',
  `seconds` int(11) DEFAULT NULL COMMENT '视频的长度(秒)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `vote`
-- ----------------------------
DROP TABLE IF EXISTS `vote`;
CREATE TABLE `vote` (
  `vote_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '投票id',
  `context_type` varchar(50) NOT NULL COMMENT '所属类型 Class Tenant',
  `context_id` bigint(20) NOT NULL COMMENT 'type id',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `description` varchar(2000) DEFAULT NULL COMMENT '描述',
  `start_at` datetime NOT NULL COMMENT '开始时间',
  `end_at` datetime NOT NULL COMMENT '结束时间',
  `user_Id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `editor_Id` bigint(20) DEFAULT NULL COMMENT '修改人',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否可用 1 未删除 0 删除',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`vote_id`),
  KEY `context_index` (`context_type`,`context_id`)
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 COMMENT='投票表';

-- ----------------------------
--  Table structure for `vote_log`
-- ----------------------------
DROP TABLE IF EXISTS `vote_log`;
CREATE TABLE `vote_log` (
  `vote_log_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `context_id` bigint(20) DEFAULT NULL,
  `context_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT 'Topic Post',
  `user_id` bigint(20) DEFAULT NULL,
  `up` tinyint(4) DEFAULT NULL COMMENT '1 表示顶 0 表示踩',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`vote_log_id`),
  KEY `index_context_id` (`context_id`),
  KEY `index_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14370 DEFAULT CHARSET=utf8 COMMENT='点赞表(讨论区与笔记)';

-- ----------------------------
--  Table structure for `vote_submission`
-- ----------------------------
DROP TABLE IF EXISTS `vote_submission`;
CREATE TABLE `vote_submission` (
  `vote_submission_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '提交人id',
  `vote_id` bigint(20) NOT NULL COMMENT '投票id',
  `submission_data` mediumtext COMMENT '提交数据',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`vote_submission_id`),
  KEY `index_vote_id_user_id` (`vote_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COMMENT='投票提交表';

-- ----------------------------
--  Table structure for `webcast`
-- ----------------------------
DROP TABLE IF EXISTS `webcast`;
CREATE TABLE `webcast` (
  `webcast_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '直播id',
  `title` varchar(255) NOT NULL COMMENT '标题',
  `teacher_name` varchar(255) NOT NULL COMMENT '讲师姓名',
  `start_at` datetime NOT NULL COMMENT '直播开始时间',
  `end_at` datetime NOT NULL COMMENT '直播结束时间',
  `place` varchar(255) DEFAULT NULL COMMENT '直播地点',
  `live_id` varchar(255) DEFAULT NULL COMMENT '房间id',
  `is_support_signup_site` tinyint(4) DEFAULT NULL COMMENT '是否支持报名现场(1 是; 0 不是)',
  `is_prevent_cheating` tinyint(4) DEFAULT NULL COMMENT '是否防作弊(1 是; 0 不是)',
  `is_lock` tinyint(4) NOT NULL COMMENT '开启/关闭直播(1 开启; 0 关闭)',
  `lock_open_at` datetime DEFAULT NULL COMMENT '开启时间',
  `lock_close_at` datetime DEFAULT NULL COMMENT '关闭时间',
  `introduce` mediumtext NOT NULL COMMENT '直播介绍',
  `teaching_required` varchar(2000) DEFAULT NULL COMMENT '教学要求',
  `signup_start_at` datetime DEFAULT NULL COMMENT '报名开始时间',
  `signup_end_at` datetime DEFAULT NULL COMMENT '报名结束时间',
  `signup_number` int(8) DEFAULT NULL COMMENT '报名人数',
  `cover` varchar(255) DEFAULT NULL COMMENT '封面(uuid)',
  `webcast_url` varchar(255) DEFAULT NULL COMMENT '直播url',
  `teacher_url` varchar(255) DEFAULT NULL COMMENT '讲师url',
  `assistant_url` varchar(255) DEFAULT NULL COMMENT '助教url',
  `play_back_url` varchar(255) DEFAULT NULL COMMENT '回放url',
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '编辑人id',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `teacher_avatar` varchar(200) DEFAULT NULL COMMENT '主讲人头像',
  `app_cover` varchar(200) DEFAULT NULL COMMENT 'app入口图',
  `material_description` mediumtext COMMENT '课件介绍',
  `type` tinyint(4) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`webcast_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10163 DEFAULT CHARSET=utf8 COMMENT='直播表';

-- ----------------------------
--  Table structure for `webcast_checkin`
-- ----------------------------
DROP TABLE IF EXISTS `webcast_checkin`;
CREATE TABLE `webcast_checkin` (
  `webcast_checkin_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '签到id',
  `webcast_id` bigint(20) NOT NULL COMMENT '直播id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `checkin_type` tinyint(4) NOT NULL COMMENT '签到类型(1:pc端签到;2:手机端签到;3:现场签到)',
  `checkin_at` datetime DEFAULT NULL COMMENT '签到时间',
  PRIMARY KEY (`webcast_checkin_id`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=utf8 COMMENT='直播签到表';

-- ----------------------------
--  Table structure for `webcast_material`
-- ----------------------------
DROP TABLE IF EXISTS `webcast_material`;
CREATE TABLE `webcast_material` (
  `webcast_material_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '直播资料id',
  `webcast_id` bigint(20) NOT NULL COMMENT '直播id',
  `title` varchar(255) DEFAULT NULL COMMENT '资料标题',
  `material_path` varchar(255) DEFAULT NULL COMMENT '资料路径',
  `description` mediumtext COMMENT '资料描述',
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '编辑人id',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  PRIMARY KEY (`webcast_material_id`)
) ENGINE=InnoDB AUTO_INCREMENT=360 DEFAULT CHARSET=utf8 COMMENT='直播资料表';

-- ----------------------------
--  Table structure for `webcast_permission_config`
-- ----------------------------
DROP TABLE IF EXISTS `webcast_permission_config`;
CREATE TABLE `webcast_permission_config` (
  `config_id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除  0 删除 1 未删除',
  PRIMARY KEY (`config_id`),
  KEY `index_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COMMENT='直播配置表';

-- ----------------------------
--  Table structure for `webcast_playback`
-- ----------------------------
DROP TABLE IF EXISTS `webcast_playback`;
CREATE TABLE `webcast_playback` (
  `webcast_playback_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `webcast_id` bigint(20) NOT NULL COMMENT '直播id',
  `third_party_id` varchar(255) NOT NULL COMMENT '第三方回放id',
  `start_at` datetime NOT NULL COMMENT '直播回放开始时间',
  `end_at` datetime NOT NULL COMMENT '直播回放结束时间',
  `play_back_url` varchar(255) DEFAULT NULL COMMENT '回放url',
  `is_marker` tinyint(4) NOT NULL COMMENT '是否使用当前回放 0:不使用;1:使用',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '编辑人ID',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`webcast_playback_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='直播回放信息表';

-- ----------------------------
--  Table structure for `webcast_record`
-- ----------------------------
DROP TABLE IF EXISTS `webcast_record`;
CREATE TABLE `webcast_record` (
  `webcast_record_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `webcast_id` bigint(20) NOT NULL COMMENT '直播id',
  `class_id` bigint(20) NOT NULL COMMENT '班级Id',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `webcast_length` int(11) NOT NULL COMMENT '直播长度',
  `webcast_view_time` int(11) DEFAULT NULL COMMENT '观看直播长度',
  `play_back_view_time` int(11) DEFAULT NULL COMMENT '观看回放长度',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`webcast_record_id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 COMMENT='直播观看记录表';

-- ----------------------------
--  Table structure for `webcast_sale`
-- ----------------------------
DROP TABLE IF EXISTS `webcast_sale`;
CREATE TABLE `webcast_sale` (
  `webcast_sale_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '售卖id',
  `webcast_id` bigint(20) NOT NULL COMMENT '直播id',
  `class_id` bigint(20) NOT NULL COMMENT '班级id',
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建人id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '编辑人id',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '0不可用 1可用',
  PRIMARY KEY (`webcast_sale_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2430 DEFAULT CHARSET=utf8 COMMENT='直播售卖表';

-- ----------------------------
--  Table structure for `webcast_signup`
-- ----------------------------
DROP TABLE IF EXISTS `webcast_signup`;
CREATE TABLE `webcast_signup` (
  `webcast_signup_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '报名id',
  `webcast_id` bigint(20) NOT NULL COMMENT '直播id',
  `user_id` bigint(20) NOT NULL COMMENT '报名用户id',
  `mobile` varchar(11) NOT NULL COMMENT '手机号',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '0不可用 1可用',
  PRIMARY KEY (`webcast_signup_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='直播报名表';

-- ----------------------------
--  Table structure for `wechat_teacher`
-- ----------------------------
DROP TABLE IF EXISTS `wechat_teacher`;
CREATE TABLE `wechat_teacher` (
  `teacher_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `school_name` varchar(255) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`teacher_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='废弃表';

-- ----------------------------
--  Table structure for `wechat_user`
-- ----------------------------
DROP TABLE IF EXISTS `wechat_user`;
CREATE TABLE `wechat_user` (
  `wechat_user_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `open_id` varchar(255) NOT NULL COMMENT '微信openId',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  PRIMARY KEY (`wechat_user_id`),
  UNIQUE KEY `open_id` (`open_id`)
) ENGINE=InnoDB AUTO_INCREMENT=78 DEFAULT CHARSET=utf8 COMMENT='微信端用户与系统user关联表';

-- ----------------------------
--  Table structure for `wrong_question`
-- ----------------------------
DROP TABLE IF EXISTS `wrong_question`;
CREATE TABLE `wrong_question` (
  `wrong_question_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '错题本id',
  `class_id` bigint(20) NOT NULL COMMENT '班次id',
  `user_id` bigint(20) NOT NULL COMMENT '用户id',
  `question_id` bigint(20) NOT NULL COMMENT '题目id',
  `error_count` int(11) NOT NULL COMMENT '错误次数',
  `belong_type` varchar(20) NOT NULL COMMENT '题目属于 Quiz PopQuiz',
  `belong_type_id` bigint(20) NOT NULL COMMENT '对应的id',
  `answer_data` mediumtext NOT NULL COMMENT '提交的错题答案',
  `question_data` mediumtext COMMENT '题目数据',
  `created_at` datetime DEFAULT NULL COMMENT '创建时间',
  `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`wrong_question_id`),
  KEY `class_id_user_id` (`class_id`,`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=757 DEFAULT CHARSET=utf8 COMMENT='错题本表';

-- ----------------------------
--  Table structure for `zones`
-- ----------------------------
DROP TABLE IF EXISTS `zones`;
CREATE TABLE `zones` (
  `area_id` int(11) NOT NULL,
  `code` int(11) NOT NULL DEFAULT '0' COMMENT '编码',
  `name` varchar(255) DEFAULT NULL COMMENT '城市名称',
  `parent_id` int(11) DEFAULT NULL COMMENT '上级编码',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `schools_count` int(11) DEFAULT NULL COMMENT '包含学校数',
  `position` int(11) DEFAULT NULL,
  PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='省市级联表';

-- ----------------------------
--  Table structure for `zy_exchange_user`
-- ----------------------------
DROP TABLE IF EXISTS `zy_exchange_user`;
CREATE TABLE `zy_exchange_user` (
  `user_id` bigint(20) NOT NULL,
  `zy_user_id` varchar(64) COLLATE utf8mb4_bin NOT NULL,
  `created_at` datetime DEFAULT NULL,
  UNIQUE KEY `user_id_UNIQUE` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
--  Table structure for `zy_lab`
-- ----------------------------
DROP TABLE IF EXISTS `zy_lab`;
CREATE TABLE `zy_lab` (
  `lab_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '实验ID',
  `name` varchar(255) DEFAULT NULL COMMENT '标题',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `zy_lab_id` varchar(255) NOT NULL COMMENT '驻云实验ID',
  PRIMARY KEY (`lab_id`),
  UNIQUE KEY `zylab_lab_id` (`zy_lab_id`),
  KEY `zylab_tenant_id` (`tenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zy_lab_config`
-- ----------------------------
DROP TABLE IF EXISTS `zy_lab_config`;
CREATE TABLE `zy_lab_config` (
  `config_id` int(11) NOT NULL AUTO_INCREMENT,
  `tenant_id` bigint(20) NOT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  `editor_id` bigint(20) DEFAULT NULL COMMENT '修改者id',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '是否删除  0 删除 1 未删除',
  PRIMARY KEY (`config_id`)
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 COMMENT='驻云实验配置表';

-- ----------------------------
--  Table structure for `zy_receive_log`
-- ----------------------------
DROP TABLE IF EXISTS `zy_receive_log`;
CREATE TABLE `zy_receive_log` (
  `receive_id` bigint(20) NOT NULL,
  `receive_msg` mediumtext NOT NULL,
  `result_msg` mediumtext,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `result_at` datetime DEFAULT NULL,
  PRIMARY KEY (`receive_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='接受到驻云回调请求';

-- ----------------------------
--  Table structure for `zy_request_log`
-- ----------------------------
DROP TABLE IF EXISTS `zy_request_log`;
CREATE TABLE `zy_request_log` (
  `request_id` bigint(20) NOT NULL,
  `reqeust_url` varchar(255) NOT NULL,
  `reqeust_msg` mediumtext NOT NULL,
  `result_msg` mediumtext,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `result_at` datetime DEFAULT NULL,
  PRIMARY KEY (`request_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' ';

-- ----------------------------
--  Table structure for `zy_teacher`
-- ----------------------------
DROP TABLE IF EXISTS `zy_teacher`;
CREATE TABLE `zy_teacher` (
  `zy_teacher_id` varchar(100) NOT NULL COMMENT '驻云老师ID',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `teacher_id` bigint(20) NOT NULL COMMENT '高校邦ID',
  `user_id` bigint(20) DEFAULT NULL,
  `app_key` varchar(100) DEFAULT NULL,
  `app_secret` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`zy_teacher_id`),
  UNIQUE KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zy_user`
-- ----------------------------
DROP TABLE IF EXISTS `zy_user`;
CREATE TABLE `zy_user` (
  `zy_user_id` varchar(64) NOT NULL COMMENT '驻云学生ID',
  `user_id` bigint(20) NOT NULL COMMENT '高校邦学生ID',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  PRIMARY KEY (`zy_user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='zy_user';

-- ----------------------------
--  Table structure for `zy_user_lab`
-- ----------------------------
DROP TABLE IF EXISTS `zy_user_lab`;
CREATE TABLE `zy_user_lab` (
  `user_lab_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户班级实验ID',
  `class_lab_id` bigint(20) NOT NULL COMMENT '班级实验ID',
  `lab_id` bigint(20) NOT NULL COMMENT '实验ID',
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `status` tinyint(4) NOT NULL COMMENT '状态',
  `user_id` bigint(11) NOT NULL COMMENT '用户ID',
  `zy_serial` varchar(64) NOT NULL,
  `zy_user_id` varchar(64) DEFAULT NULL,
  PRIMARY KEY (`user_lab_id`)
) ENGINE=InnoDB AUTO_INCREMENT=826966 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zygj_city`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_city`;
CREATE TABLE `zygj_city` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '城市名称',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=35 DEFAULT CHARSET=utf8 COMMENT='城市';

-- ----------------------------
--  Table structure for `zygj_class_category`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_class_category`;
CREATE TABLE `zygj_class_category` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '分类名称',
  `level` int(11) NOT NULL DEFAULT '1' COMMENT '层级',
  `parent_id` bigint(20) NOT NULL COMMENT '父节点',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '更新时间',
  `delete_flag` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除',
  `tenant_id` int(11) DEFAULT NULL COMMENT '租户ID',
  `user_id` int(11) DEFAULT NULL COMMENT '学生ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COMMENT='班级分类';

-- ----------------------------
--  Table structure for `zygj_class_material`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_class_material`;
CREATE TABLE `zygj_class_material` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `class_id` bigint(20) NOT NULL,
  `material_id` bigint(20) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `delete_flag` tinyint(4) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  `class_target` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=481 DEFAULT CHARSET=utf8;

-- ----------------------------
--  Table structure for `zygj_class_schedule`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_class_schedule`;
CREATE TABLE `zygj_class_schedule` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `class_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '课程id',
  `solution_term_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '学期id',
  `teacher_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '授课老师id',
  `school_room` varchar(20) NOT NULL DEFAULT '' COMMENT '教室',
  `class_section` varchar(100) NOT NULL DEFAULT '' COMMENT '课节,格式:0,0,0,0,1,1,0,0,0,0,0   一共10位,表示共10节课,1表示该位置上有课,0表示该位置上没课',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `tenant_id` bigint(20) NOT NULL DEFAULT '-100' COMMENT '租户id',
  `total_week_str` varchar(100) DEFAULT NULL COMMENT '1~16周总周数',
  `class_target` varchar(20) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=472 DEFAULT CHARSET=utf8 COMMENT='课程表';

-- ----------------------------
--  Table structure for `zygj_class_schedule_classroom`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_class_schedule_classroom`;
CREATE TABLE `zygj_class_schedule_classroom` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `class_schedule_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '课程表id',
  `classroom_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '班级id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=593 DEFAULT CHARSET=utf8 COMMENT='排课关联合班的班级';

-- ----------------------------
--  Table structure for `zygj_class_schedule_info`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_class_schedule_info`;
CREATE TABLE `zygj_class_schedule_info` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `class_schedule_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '课表id',
  `week_number` tinyint(2) NOT NULL DEFAULT '1' COMMENT '周数,注:课程排课到哪些周',
  `week` tinyint(2) NOT NULL DEFAULT '0' COMMENT '星期,注:课程排课在星期几',
  `date_time` date NOT NULL COMMENT '日期',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1819 DEFAULT CHARSET=utf8 COMMENT='排课详情表';

-- ----------------------------
--  Table structure for `zygj_classroom`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_classroom`;
CREATE TABLE `zygj_classroom` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `classroom_name` varchar(255) NOT NULL DEFAULT '' COMMENT '班级名称',
  `zygj_school_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '所属学校id',
  `zygj_specialty_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '专业id',
  `classroom_teacher_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '班主任id',
  `teaching_person` varchar(100) NOT NULL DEFAULT 'o' COMMENT '教学专员',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `tenant_id` bigint(20) NOT NULL DEFAULT '-100' COMMENT '租户id',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `zygj_college_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '学院id',
  `teaching_admin_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '教学管理员',
  `enter_year` varchar(10) NOT NULL DEFAULT '' COMMENT '入学年份',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=154 DEFAULT CHARSET=utf8 COMMENT='行政班级';

-- ----------------------------
--  Table structure for `zygj_college`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_college`;
CREATE TABLE `zygj_college` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '学院名称',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `tenant_id` bigint(20) NOT NULL DEFAULT '-100' COMMENT '租户id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8 COMMENT='学院';

-- ----------------------------
--  Table structure for `zygj_implement_term`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_implement_term`;
CREATE TABLE `zygj_implement_term` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `term_name` varchar(50) NOT NULL DEFAULT '' COMMENT '学期名',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8 COMMENT='实施学期时间';

-- ----------------------------
--  Table structure for `zygj_major`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_major`;
CREATE TABLE `zygj_major` (
  `major_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `product_direction` int(11) NOT NULL DEFAULT '0' COMMENT '产品方向,1:云计算、2:大数据技术与应用、3:智能硬件、4:虚拟现实(VR)、5:互联网产品设计、6:互联网营销、7:互联网金融、8:网络空间安全、9:人工智能、10:互联网医疗、11:互联网教育、12:智能制造',
  `name` varchar(60) COLLATE utf8mb4_bin NOT NULL COMMENT '专业名称',
  `synopsis` text COLLATE utf8mb4_bin NOT NULL COMMENT '专业简介',
  `cover` text CHARACTER SET utf8mb4 COMMENT '封面',
  `tenant_id` bigint(20) DEFAULT '0' COMMENT '所属学校id',
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1',
  PRIMARY KEY (`major_id`)
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='合作专业表';

-- ----------------------------
--  Table structure for `zygj_material`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_material`;
CREATE TABLE `zygj_material` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `author` varchar(50) NOT NULL,
  `isbn` varchar(100) NOT NULL,
  `press` varchar(50) NOT NULL,
  `publish_at` date DEFAULT NULL,
  `remark` mediumtext,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
  `delete_flag` tinyint(4) NOT NULL,
  `user_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=124 DEFAULT CHARSET=utf8 COMMENT='教材';

-- ----------------------------
--  Table structure for `zygj_school`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_school`;
CREATE TABLE `zygj_school` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '学校名称',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `zygj_city_id` bigint(20) NOT NULL DEFAULT '1' COMMENT '城市id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3410 DEFAULT CHARSET=utf8 COMMENT='学校';

-- ----------------------------
--  Table structure for `zygj_school_class`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_school_class`;
CREATE TABLE `zygj_school_class` (
  `class_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '视频上传小工具要用uuid',
  `course_id` bigint(20) NOT NULL COMMENT '课程id',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `editor_id` bigint(20) NOT NULL COMMENT '修改者id',
  `tenant_id` bigint(20) DEFAULT NULL COMMENT '租户id',
  `from_tenant_id` bigint(20) DEFAULT NULL COMMENT '购买租户id',
  `class_name` varchar(255) CHARACTER SET utf8 NOT NULL COMMENT '班次名称',
  `intro` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '班次简介',
  `class_type` varchar(50) CHARACTER SET utf8 DEFAULT 'Class' COMMENT '班次类型,MicroClass Class 微课 普通班次',
  `level` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '班次难度:10 易 20 中 30 难',
  `use_type` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '班次使用性质:10 自用 20 售卖',
  `credit_score` decimal(5,2) DEFAULT NULL COMMENT '学分',
  `validate_type` varchar(255) CHARACTER SET utf8 DEFAULT '30' COMMENT '校验类型: 10 其他用户 20 全校可选 30 授权 40 付费',
  `teach_mode` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '教学模式: 10 开放学习模式 20 传统学习模式 30 顺序学习模式 40 条件解锁模式',
  `start_at` datetime DEFAULT NULL COMMENT '开课时间',
  `conclude_at` datetime DEFAULT NULL COMMENT '结课时间',
  `score_publish_day` int(11) DEFAULT NULL COMMENT '成绩公布时间(N天之后)',
  `study_hour` int(11) DEFAULT NULL COMMENT '课程学时',
  `experience_num` int(11) DEFAULT NULL COMMENT '试学的前N个视频',
  `status` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '状态: 10 待发布 20 预发布 30 已发布 40 关闭',
  `delete_flag` tinyint(4) DEFAULT NULL COMMENT '1可用 0 不可用',
  `created_at` datetime DEFAULT NULL,
  `updated_at` datetime DEFAULT NULL,
  `is_documented` tinyint(1) DEFAULT '0' COMMENT '是否归档',
  `unlock_quiz_score` int(11) DEFAULT '0' COMMENT '条件模式解锁条件,测验需要达到的分数',
  `type` varchar(50) CHARACTER SET utf8 DEFAULT 'Class' COMMENT '班次类型,MiniClass Class Self 微课 普通班次 邀请课',
  `position` bigint(20) DEFAULT NULL COMMENT '排序',
  `is_top` tinyint(4) DEFAULT NULL COMMENT '是否置顶 -1:置顶,null:不置顶',
  `is_move` tinyint(4) DEFAULT '0' COMMENT '0 未移动数据 1 已移动数据',
  `least_move_at` datetime DEFAULT NULL COMMENT '最早移动时间',
  `dropping_self` tinyint(4) DEFAULT '0',
  `practice_hour` int(11) DEFAULT NULL COMMENT '实践课时',
  `theory_hour` int(11) DEFAULT NULL COMMENT '理论课时',
  `evaluation_mode` tinyint(4) DEFAULT NULL COMMENT '考核方式 1:线上考试 2:线下考试 3:答辩 4:大作业',
  `version` varchar(255) DEFAULT NULL COMMENT '版本',
  `research_personnel` varchar(255) DEFAULT NULL COMMENT '研发人员',
  `from_class` bigint(20) DEFAULT NULL COMMENT '班次复制售卖源',
  `root_class` bigint(20) DEFAULT NULL COMMENT '班次复制根源',
  PRIMARY KEY (`class_id`),
  KEY `index_course_id` (`course_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COMMENT='Class表映射表,表示学校自由课程,表结构跟class一致';

-- ----------------------------
--  Table structure for `zygj_school_tenant`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_school_tenant`;
CREATE TABLE `zygj_school_tenant` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `school_name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '学校名称',
  `tenant_name` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT '租户名称',
  `tenant_domain` varchar(125) COLLATE utf8mb4_bin NOT NULL COMMENT '租户域名',
  `area` varchar(125) COLLATE utf8mb4_bin NOT NULL COMMENT '地区',
  `tenant_status` varchar(255) COLLATE utf8mb4_bin NOT NULL COMMENT 'online',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL COMMENT '创建者id',
  `tenant_id` bigint(20) NOT NULL COMMENT '租户id',
  `school_id` bigint(20) NOT NULL COMMENT '学校id',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=153 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
--  Table structure for `zygj_solution`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_solution`;
CREATE TABLE `zygj_solution` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(100) NOT NULL DEFAULT '' COMMENT '方案名称',
  `product_direction` int(11) NOT NULL DEFAULT '0' COMMENT '产品方向,1:云计算、2:大数据技术与应用、3:智能硬件、4:虚拟现实(VR)、5:互联网产品设计、6:互联网营销、7:互联网金融、8:网络空间安全、9:人工智能、10:互联网医疗、11:互联网教育、12:智能制造',
  `description` text COMMENT '方案描述',
  `education_level` tinyint(2) NOT NULL DEFAULT '0' COMMENT '办学层次,1:中职中专、2:高职高专、3:本科、4:研究生(在职)、5:研究生(普硕)',
  `total_score` float NOT NULL DEFAULT '0' COMMENT '总学分',
  `required_score` float NOT NULL DEFAULT '0' COMMENT '必修学分',
  `elective_score` float NOT NULL DEFAULT '0' COMMENT '选修学分',
  `period` float NOT NULL DEFAULT '0' COMMENT '培养周期,单位:年',
  `standard_solution` varchar(255) NOT NULL DEFAULT '' COMMENT '标准培养方案',
  `version` varchar(100) NOT NULL DEFAULT '1' COMMENT '版本',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1正常,0 删除',
  `tenant_id` bigint(20) NOT NULL DEFAULT '-100' COMMENT '租户id',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `standard_solution_name` varchar(255) NOT NULL DEFAULT '' COMMENT '标准培养方案名称',
  `total_term` int(11) NOT NULL DEFAULT '0' COMMENT '总计学期',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=242 DEFAULT CHARSET=utf8 COMMENT='培养方案';

-- ----------------------------
--  Table structure for `zygj_solution_class`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_solution_class`;
CREATE TABLE `zygj_solution_class` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `zygj_solution_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '培养方案id',
  `class_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '课程id',
  `class_property` int(11) NOT NULL DEFAULT '0' COMMENT '课程属性,1 公共基础课、2 大类平台课、3 学科基础课、4 专业基础课、5 专业核心课、6 专业模块课、7 专业实践课、8 创新创业课、9 跨学科交叉课、10 第二课堂 废弃,用category_id代替',
  `class_way` int(11) NOT NULL DEFAULT '0' COMMENT '授课形式,1 线上、2 线下、3 线上+线下',
  `term` tinyint(2) NOT NULL DEFAULT '0' COMMENT '学期',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `credit_score` decimal(5,2) NOT NULL DEFAULT '0.00' COMMENT '学分',
  `study_hour` int(11) NOT NULL DEFAULT '0' COMMENT '课时',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `class_type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '课程类型,1 必修,2 选修',
  `category_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '课程分类',
  `class_target` varchar(20) NOT NULL DEFAULT '0' COMMENT '0 慧科课程 1 学校自建课程',
  `theory_hour` int(11) NOT NULL DEFAULT '0' COMMENT '理论学时',
  `practice_hour` int(11) NOT NULL DEFAULT '0' COMMENT '实践学时',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=633 DEFAULT CHARSET=utf8 COMMENT='培养方案关联课程';

-- ----------------------------
--  Table structure for `zygj_solution_classroom`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_solution_classroom`;
CREATE TABLE `zygj_solution_classroom` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `zygj_solution_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '培养方案id',
  `zygj_classroom_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '班级id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=702 DEFAULT CHARSET=utf8 COMMENT='培养方案关联班级';

-- ----------------------------
--  Table structure for `zygj_solution_term`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_solution_term`;
CREATE TABLE `zygj_solution_term` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `zygj_solution_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '培养方案id',
  `implement_term_id` varchar(20) NOT NULL DEFAULT '' COMMENT '实施时间id',
  `term` tinyint(2) NOT NULL DEFAULT '1' COMMENT '学期',
  `start_time` datetime DEFAULT NULL COMMENT '学期开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '学期结束时间',
  `weeks` tinyint(2) NOT NULL DEFAULT '0' COMMENT '周数',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=268 DEFAULT CHARSET=utf8 COMMENT='培养方案学期详情表';

-- ----------------------------
--  Table structure for `zygj_specialty`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_specialty`;
CREATE TABLE `zygj_specialty` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '专业名称',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `tenant_id` bigint(20) NOT NULL DEFAULT '-100' COMMENT '租户id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=85 DEFAULT CHARSET=utf8 COMMENT='专业';

-- ----------------------------
--  Table structure for `zygj_student_family`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_student_family`;
CREATE TABLE `zygj_student_family` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `zygj_student_info_id` bigint(20) NOT NULL DEFAULT '0',
  `home_person` varchar(50) NOT NULL DEFAULT '' COMMENT '家庭联系人姓名',
  `home_phone` varchar(20) NOT NULL DEFAULT '' COMMENT '家庭联系人电话',
  `home_address` varchar(255) NOT NULL DEFAULT '' COMMENT '家庭住址',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,o 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=465 DEFAULT CHARSET=utf8 COMMENT='学员实习表';

-- ----------------------------
--  Table structure for `zygj_student_info`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_student_info`;
CREATE TABLE `zygj_student_info` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `code` varchar(100) NOT NULL DEFAULT '' COMMENT '班内编号',
  `user_id` bigint(20) NOT NULL DEFAULT '0',
  `student_id` bigint(20) NOT NULL DEFAULT '0',
  `student_temp_id` bigint(20) NOT NULL DEFAULT '0',
  `zygj_classroom_id` bigint(20) NOT NULL DEFAULT '0',
  `nation` varchar(50) NOT NULL DEFAULT '' COMMENT '民族',
  `native_place` varchar(255) NOT NULL DEFAULT '' COMMENT '籍贯',
  `birthday` datetime DEFAULT NULL COMMENT '出生年月日',
  `card_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '证件号类型:1 身份证、2 军官证、3 护照、4 港澳台身份证',
  `card_id` varchar(50) NOT NULL DEFAULT '' COMMENT '证件号',
  `we_chat` varchar(50) NOT NULL DEFAULT '' COMMENT '微信号',
  `qq` varchar(50) NOT NULL DEFAULT '' COMMENT 'qq号',
  `political` tinyint(2) NOT NULL DEFAULT '0' COMMENT '政治面貌,1 党员、2 团员、3 群众',
  `product_direction` int(11) NOT NULL DEFAULT '0' COMMENT '产品方向,0: 待分配、1:云计算、2:大数据技术与应用、3:智能硬件、4:虚拟现实(VR)、5:互联网产品设计、6:互联网营销、7:互联网金融、8:网络空间安全、9:人工智能、10:互联网医疗、11:互联网教育、12:智能制造',
  `class_position` varchar(50) NOT NULL DEFAULT '' COMMENT '班级职务',
  `high_school` varchar(255) NOT NULL DEFAULT '' COMMENT '高中毕业学校',
  `enter_time` datetime DEFAULT NULL COMMENT '入学时间',
  `dormitory_code` varchar(100) NOT NULL DEFAULT '' COMMENT '宿舍编号',
  `hobby` text COMMENT '兴趣爱好',
  `internship` text COMMENT '项目/实习经历',
  `attachment_url` varchar(255) NOT NULL DEFAULT '' COMMENT '附件url',
  `attachment_name` varchar(255) NOT NULL DEFAULT '' COMMENT '附件名称',
  `dissertation` varchar(255) NOT NULL DEFAULT '' COMMENT '毕业论文题目',
  `answer_time` datetime DEFAULT NULL COMMENT '毕业答辩时间',
  `credential_time` datetime DEFAULT NULL COMMENT '获得毕业证书时间',
  `note` text COMMENT '备注',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,o 删除',
  `create_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `school_roll` tinyint(2) NOT NULL DEFAULT '1' COMMENT '学籍状态,1 在校、2 休学、3 退学、4 毕业',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=493 DEFAULT CHARSET=utf8 COMMENT='学员详情表';

-- ----------------------------
--  Table structure for `zygj_student_internship`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_student_internship`;
CREATE TABLE `zygj_student_internship` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `zygj_student_info_id` bigint(20) NOT NULL DEFAULT '0',
  `internship_company` varchar(255) NOT NULL DEFAULT '' COMMENT '实习单位名称',
  `internship_job` varchar(255) NOT NULL DEFAULT '' COMMENT '实习岗位',
  `internship_salary` int(11) NOT NULL DEFAULT '0' COMMENT '实习月薪',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,o 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `start_at` datetime DEFAULT NULL COMMENT '开始时间',
  `end_at` datetime DEFAULT NULL COMMENT '结束时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=374 DEFAULT CHARSET=utf8 COMMENT='学员实习表';

-- ----------------------------
--  Table structure for `zygj_student_job`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_student_job`;
CREATE TABLE `zygj_student_job` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `zygj_student_info_id` bigint(20) NOT NULL DEFAULT '0',
  `job_name` varchar(100) NOT NULL DEFAULT '' COMMENT '工作单位名称',
  `job_address` varchar(200) NOT NULL DEFAULT '' COMMENT '毕业后工作地',
  `job_position` varchar(255) NOT NULL DEFAULT '' COMMENT '工作岗位',
  `job_salary` int(11) NOT NULL DEFAULT '0' COMMENT '毕业后工作月薪',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,o 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `start_at` datetime DEFAULT NULL COMMENT '开始时间',
  `end_at` datetime DEFAULT NULL COMMENT '结束时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=367 DEFAULT CHARSET=utf8 COMMENT='学员实习表';

-- ----------------------------
--  Table structure for `zygj_teacher`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_teacher`;
CREATE TABLE `zygj_teacher` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT '姓名',
  `card_id` varchar(50) NOT NULL DEFAULT '' COMMENT '身份证号',
  `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '电话号码',
  `city` varchar(20) NOT NULL DEFAULT '' COMMENT '城市',
  `job_type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '工作类型,1 全职, 2兼职',
  `teacher_type` tinyint(2) NOT NULL DEFAULT '0' COMMENT '师资类型,1:兼职讲师-企业老师,2:兼职讲师-学校老师,3:全职讲师',
  `company` varchar(200) NOT NULL DEFAULT '' COMMENT '工作单位',
  `position` varchar(50) NOT NULL DEFAULT '' COMMENT '职位',
  `professional` varchar(50) NOT NULL DEFAULT '' COMMENT '职称',
  `photo_url` varchar(255) NOT NULL DEFAULT '' COMMENT '真实照片url,格式 jpg、png',
  `stage_name` varchar(255) NOT NULL DEFAULT '' COMMENT '艺名',
  `gender` tinyint(2) NOT NULL DEFAULT '0' COMMENT '性别,0 男、1女',
  `birthday` datetime DEFAULT NULL COMMENT '生日',
  `we_chat` varchar(100) NOT NULL DEFAULT '' COMMENT '微信',
  `email` varchar(100) NOT NULL DEFAULT '' COMMENT '邮箱',
  `qq` varchar(50) NOT NULL DEFAULT '' COMMENT 'QQ',
  `education` tinyint(2) NOT NULL DEFAULT '0' COMMENT '最近学历 (1 博士、2 硕士、3 本科、4 大专、5 高中)',
  `degree` tinyint(2) NOT NULL DEFAULT '0' COMMENT '最近学位(1 博士学位、2 硕士学位、3 学士学位)',
  `introduction` mediumtext COMMENT '个人简介',
  `background` text COMMENT '背景',
  `research_area` text COMMENT '研究领域',
  `achievement` text COMMENT '成就',
  `resume_url` varchar(255) NOT NULL DEFAULT '' COMMENT '简历附件url',
  `resource` varchar(255) NOT NULL DEFAULT '' COMMENT '教师来源',
  `linkman` varchar(50) NOT NULL DEFAULT '' COMMENT '对应联系人',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `tenant_id` bigint(20) NOT NULL DEFAULT '-100' COMMENT '租户id',
  `create_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `resume_name` varchar(255) NOT NULL DEFAULT '',
  `photo_name` varchar(255) NOT NULL DEFAULT '',
  `user_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  `benchmark` decimal(12,2) DEFAULT '0.00' COMMENT '基准课酬',
  `history_score` decimal(8,2) DEFAULT '0.00' COMMENT '历史评分',
  `teacher_level` tinyint(2) NOT NULL DEFAULT '0' COMMENT '师资级别,1:实习,2:初级,3:高级,4:金牌,5:特级,6:特约',
  `address` varchar(255) NOT NULL DEFAULT '' COMMENT '详细地址',
  `credentials_photo_url` varchar(255) NOT NULL DEFAULT '' COMMENT '证件照片url,格式 jpg、png',
  `credentials_photo_name` varchar(255) NOT NULL DEFAULT '' COMMENT '证件照片名称',
  `linkman_mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '推荐人联系方式',
  `contract_start_time` datetime DEFAULT NULL COMMENT '合同开始时间',
  `contract_end_time` datetime DEFAULT NULL COMMENT '合同结束时间',
  `contract_photo_url` varchar(255) NOT NULL DEFAULT '' COMMENT '合同照片url',
  `contract_photo_name` varchar(255) NOT NULL DEFAULT '' COMMENT '合同照片名称',
  `card_photo_url` varchar(255) NOT NULL DEFAULT '' COMMENT '身份证照片url',
  `card_photo_name` varchar(255) NOT NULL DEFAULT '' COMMENT '身份证照片名称',
  `benchmark_condition` varchar(255) NOT NULL DEFAULT '' COMMENT '课酬约束条件',
  `bank_card` varchar(255) NOT NULL DEFAULT '' COMMENT '银行卡号',
  `open_bank` varchar(255) NOT NULL DEFAULT '' COMMENT '开户行',
  `open_bank_address` varchar(255) NOT NULL DEFAULT '' COMMENT '开户网点',
  `replace_name` varchar(255) NOT NULL DEFAULT '' COMMENT '代收款人姓名',
  `replace_bank_card` varchar(255) NOT NULL DEFAULT '' COMMENT '代收款人银行卡号',
  `replace_open_bank` varchar(255) NOT NULL DEFAULT '' COMMENT '代收款人开户行',
  `replace_open_bank_address` varchar(255) NOT NULL DEFAULT '' COMMENT '代收款人开户网点',
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_mobile` (`mobile`)
) ENGINE=InnoDB AUTO_INCREMENT=12834 DEFAULT CHARSET=utf8 COMMENT='老师表';

-- ----------------------------
--  Table structure for `zygj_teacher_class`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_teacher_class`;
CREATE TABLE `zygj_teacher_class` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `zygj_teacher_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '老师id',
  `class_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '课程id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建者id',
  `score` float NOT NULL DEFAULT '0' COMMENT '认证评分',
  `judges` varchar(100) NOT NULL DEFAULT '' COMMENT '认证评委名称',
  `authenticate_time` datetime DEFAULT NULL COMMENT '认证时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=355 DEFAULT CHARSET=utf8 COMMENT='老师认证课程';

-- ----------------------------
--  Table structure for `zygj_teacher_education`
-- ----------------------------
DROP TABLE IF EXISTS `zygj_teacher_education`;
CREATE TABLE `zygj_teacher_education` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `teacher_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '专业共建老师id',
  `type` tinyint(2) NOT NULL DEFAULT '1' COMMENT '学历类型,最近学历:1,第一学历:2',
  `school` varchar(100) NOT NULL DEFAULT '' COMMENT '毕业院校',
  `major` varchar(100) NOT NULL DEFAULT '' COMMENT '专业',
  `education` tinyint(2) NOT NULL DEFAULT '0' COMMENT '最近学历 (1 博士、2 硕士、3 本科、4 大专、5 高中)',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `delete_flag` tinyint(2) NOT NULL DEFAULT '1' COMMENT '1 正常,0 删除',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COMMENT='老师学历表';

-- ----------------------------
--  Procedure structure for `demo_in_parameter`
-- ----------------------------
DROP PROCEDURE IF EXISTS `demo_in_parameter`;
delimiter ;;
CREATE DEFINER=`test`@`192.168.%` PROCEDURE `demo_in_parameter`()
BEGIN
	select count(*) from user_center.user;
END
 ;;
delimiter ;

-- ----------------------------
--  Procedure structure for `test`
-- ----------------------------
DROP PROCEDURE IF EXISTS `test`;
delimiter ;;
CREATE DEFINER=`test`@`192.168.%` PROCEDURE `test`()
    DETERMINISTIC
BEGIN
DECLARE video_id BIGINT(20);
DECLARE maxVideoId BIGINT(20);
DECLARE done INT DEFAULT FALSE;

DECLARE curtable CURSOR FOR
select v.video_id,tmp.maxVideoId from video v join(
select max(video_id) maxVideoId,file_path from video group by file_path HAVING count(1)>1 
) tmp on v.file_path=tmp.file_path;
-- 将结束标志绑定到游标
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;

OPEN curtable;

-- 开始循环
  read_loop: LOOP
    -- 提取游标里的数据
    FETCH curtable INTO video_id,maxVideoId;
    -- 声明结束的时候
    IF done THEN
      LEAVE read_loop;
    END IF;
    -- 循环的事件

select CONCAT(video_id,maxVideoId);
     -- select * from class_chapter where content_type='Video' 
 -- and content_id=video_id;

  END LOOP;

  -- 关闭游标
close curtable;
END
 ;;
delimiter ;

-- ----------------------------
--  Procedure structure for `test_01`
-- ----------------------------
DROP PROCEDURE IF EXISTS `test_01`;
delimiter ;;
CREATE DEFINER=`test`@`192.168.%` PROCEDURE `test_01`(out result varchar(90))
BEGIN

DECLARE video_id BIGINT(20);
DECLARE maxVideoId BIGINT(20);
DECLARE done INT DEFAULT FALSE;
DECLARE curtable CURSOR FOR
select v.video_id,tmp.maxVideoId from video v join(
select max(video_id) maxVideoId,file_path from video group by file_path HAVING count(1)>1 
) tmp on v.file_path=tmp.file_path;
-- 将结束标志绑定到游标
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;

OPEN curtable;

-- 开始循环
  read_loop: LOOP
    -- 提取游标里的数据
    FETCH curtable INTO video_id,maxVideoId;
    -- 声明结束的时候
    IF done THEN
      LEAVE read_loop;
    END IF;
    -- 循环的事件
select CONCAT(video_id,'ff');
-- select *,CONCAT(video_id,'tt') from video limit 100;
 -- and content_id=video_id;

  END LOOP;

  -- 关闭游标
close curtable;
END
 ;;
delimiter ;

SET FOREIGN_KEY_CHECKS = 1;