fw_morax_v2.sql 78.6 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
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for approval_record
-- 8.0 utf8mb4_0900_ai_ci
-- 5.7 utf8mb4_general_ci
-- ----------------------------
DROP TABLE IF EXISTS `approval_record`;
CREATE TABLE `approval_record`
(
    `id`              bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `data_id`         bigint       NOT NULL COMMENT '被审批业务表主键',
    `approval_type`   int          NOT NULL COMMENT '审批业务类型;1:绩效配置 2:薪酬配置 3:绩效星级申诉',
    `approval_no`     varchar(255) NOT NULL COMMENT '审批单号',
    `approval_status` int          NOT NULL COMMENT '审批状态;1:审批中 2:审批通过 3:审批拒绝',
    `group_id`        bigint       NOT NULL COMMENT '集团id',
    `yn`              tinyint(1) DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime   DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime   DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `approval_record_approval_no_index` (`approval_no`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 63
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='审批记录';

-- ----------------------------
-- Table structure for eval
-- ----------------------------
DROP TABLE IF EXISTS `eval`;
CREATE TABLE `eval`
(
     `id`           bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
     `name`         varchar(255) DEFAULT NULL COMMENT '考评,活动名称',
     `type`         tinyint(4) NULL DEFAULT 1 COMMENT '考评类型; 1:活动考评 2:其他考评',
     `status`       tinyint(4) NOT NULL COMMENT '状态;1:审批中 2:审批拒绝 3:生效中 4:草稿 ',
     `group_id`     bigint(20) NOT NULL COMMENT '集团id',
     `yn`           tinyint(1) NULL DEFAULT 1 COMMENT '逻辑删除',
     `create_time`  datetime(0) NULL DEFAULT NULL COMMENT '创建时间',
     `update_time`  datetime(0) NULL DEFAULT NULL COMMENT '更新时间',
     PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评';

-- ----------------------------
-- Table structure for eval_group
-- ----------------------------
DROP TABLE IF EXISTS `eval_group`;
CREATE TABLE `eval_group`
(
    `id`            bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_id`       bigint       NOT NULL COMMENT '考评id',
    `egc`           varchar(60)  NOT NULL COMMENT '考评组编码',
    `name`          varchar(255) DEFAULT NULL COMMENT '考评,活动组名称',
    `type`          tinyint      DEFAULT '1' COMMENT '考评类型; 1:活动考评 2:其他考评',
    `post_id`       bigint       NOT NULL COMMENT '岗位id',
    `post_name`     varchar(255) DEFAULT NULL COMMENT '岗位名称',
    `shop_ids`      varchar(255) NOT NULL COMMENT '适用门店ids',
    `shop_names`    varchar(255) NOT NULL COMMENT '适用门店名称',
    `reason`        varchar(512) DEFAULT NULL COMMENT '调整原因',
    `attachment`    varchar(512) DEFAULT NULL COMMENT '附件;fid逗号隔开',
    `indicator_num` int          DEFAULT NULL COMMENT '包含指标数量',
    `begin_time`    date         DEFAULT NULL COMMENT '生效时间',
    `over_time`     date         DEFAULT NULL COMMENT '结束时间',
    `group_id`      bigint       NOT NULL COMMENT '集团id',
    `yn`            tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`   datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`   datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评组';

-- ----------------------------
-- Table structure for eval_group_indicator
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_indicator`;
CREATE TABLE `eval_group_indicator`
(
    `id`                 bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_id`      bigint       NOT NULL COMMENT '考评组配置id',
    `name`               varchar(255) DEFAULT NULL COMMENT '指标名称',
    `base_score`         int          NOT NULL COMMENT '基础绩效分',
    `score_way`          tinyint      DEFAULT NULL COMMENT '得分方式;1: 阶梯得分 2:普通得分',
    `param_alias`        varchar(255) NOT NULL COMMENT '考评项别名',
    `precondition_alias` varchar(255) DEFAULT NULL COMMENT '前置考评项别名(目前预留)',
    `yn`                 tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`        datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`        datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组指标项';

-- ----------------------------
-- Table structure for eval_group_indicator_param
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_indicator_param`;
CREATE TABLE `eval_group_indicator_param`
(
    `id`                      bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_id`           bigint       NOT NULL COMMENT '考评组配置id',
    `eval_group_indicator_id` bigint       NOT NULL COMMENT '考评组指标id',
    `param_type`               tinyint      NOT NULL COMMENT '条件类型(1.台阶条件,2,提成条件)',
    `code_type`               tinyint      NOT NULL COMMENT '指标类型(1.指标,2,考评指标)',
    `code`                    varchar(255) NOT NULL COMMENT '指标编码',
    `name`                    varchar(255)   DEFAULT NULL COMMENT '指标库名称',
    `proportion`              decimal(10, 4) DEFAULT NULL COMMENT '占比',
    `cap`                     tinyint(1)     DEFAULT '1' COMMENT '是否封顶',
    `target_calc_type`        tinyint(4)        DEFAULT NULL COMMENT '目标计算类型;1: 目标值计算 2:最低要求计算',
    `target_type`             tinyint(4)        DEFAULT '1' COMMENT '绩效目标值类型; 1:无 2:百分比 3:金额 4:台数',
    `target_value`            decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `yn`                      tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`             datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`             datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评组指标参数';

-- ----------------------------
-- Table structure for eval_group_indicator_precondition
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_indicator_precondition`;
CREATE TABLE `eval_group_indicator_precondition`
(
    `id`                      bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_id`           bigint       NOT NULL COMMENT '考评组配置id',
    `eval_group_indicator_id` bigint       NOT NULL COMMENT '考评组指标id',
    `code_type`               tinyint(4) NOT NULL COMMENT '编码类型(1. 指标,2.考评指标)',
    `code`                    varchar(255) NOT NULL COMMENT '指标编码',
    `name`                    varchar(255) DEFAULT NULL COMMENT '指标库名称',
    `target_calc_type`        tinyint(4)        DEFAULT NULL COMMENT '目标计算类型;1: 目标值计算 2:最低要求计算',
    `target_type`             tinyint(4)        DEFAULT '1' COMMENT '绩效目标值类型; 1:无 2:百分比 3:金额 4:台数',
    `target_value`            decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `sort`                    int          NOT NULL COMMENT '排序',
    `yn`                      tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`             datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`             datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评组指标条件';

-- ----------------------------
-- Table structure for eval_group_indicator_ladders
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_indicator_ladders`;
CREATE TABLE `eval_group_indicator_ladders`
(
    `id`                     bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_indicator_id` bigint       NOT NULL COMMENT '考评组指标id',
    `lower`                  decimal(10, 4) NOT NULL COMMENT '阶梯下限;大于等于',
    `upper`                  decimal(10, 4) NOT NULL DEFAULT '65536.0000' COMMENT '阶梯上限;小于; 无上限的情况值为 2<<15',
    `standard_score`         tinyint        NOT NULL COMMENT '标准分;本阶梯对应标准分',
    `yn`                     tinyint(1)              DEFAULT '1' COMMENT '逻辑删除',
    `create_time`            datetime                DEFAULT NULL COMMENT '创建时间',
    `update_time`            datetime                DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 1
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评组指标得分阶梯';

-- ----------------------------
-- Table structure for eval_group_indicator_precondition_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_indicator_precondition_hit_log`;
CREATE TABLE `eval_group_indicator_precondition_hit_log`
(
    `id`                      bigint NOT NULL AUTO_INCREMENT,
    `precondition_id`         bigint NOT NULL COMMENT '考评组指标条件id',
    `precondition_ladders_id` bigint NOT NULL COMMENT '考评组指标条件阶梯id',
    `value`                   decimal(18, 2) DEFAULT NULL COMMENT '原始值',
    `data_date`               date   NOT NULL COMMENT '数据日期',
    `group_id`                bigint NOT NULL COMMENT '集团id',
    `create_time`             datetime       DEFAULT NULL,
    `update_time`             datetime       DEFAULT NULL,
    `yn`                      tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评指标条件记录';

-- ----------------------------
-- Table structure for eval_group_indicator_precondition_ladders
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_indicator_precondition_ladders`;
CREATE TABLE `eval_group_indicator_precondition_ladders`
(
    `id`              bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `precondition_id` bigint         NOT NULL COMMENT '考评组指标条件id',
    `lower`           decimal(10, 4) NOT NULL COMMENT '阶梯下限;大于等于',
    `upper`           decimal(10, 4) NOT NULL DEFAULT '65536.0000' COMMENT '阶梯上限;小于; 无上限的情况值为 2<<15',
    `score_percent`   decimal(10, 4)          DEFAULT NULL COMMENT '得分百分比',
    `yn`              tinyint(1)              DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime                DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime                DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评组指标条件得分阶梯';

-- ----------------------------
-- Table structure for eval_group_indicator_target_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_indicator_target_hit_log`;
CREATE TABLE `eval_group_indicator_target_hit_log`
(
    `id`          bigint  NOT NULL AUTO_INCREMENT,
    `refer_id`    bigint  NOT NULL COMMENT '考评组指标/前置条件 id',
    `target_type` tinyint NOT NULL COMMENT '类型 1:考评组指标 2:前置条件指标',
    `value`       decimal(18, 2) DEFAULT NULL COMMENT '原始值',
    `reach_value` decimal(18, 2) DEFAULT NULL COMMENT '达成目标',
    `data_date`   date    NOT NULL COMMENT '数据日期',
    `group_id`    bigint  NOT NULL COMMENT '集团id',
    `create_time` datetime       DEFAULT NULL,
    `update_time` datetime       DEFAULT NULL,
    `yn`          tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评指标达成目标记录';

-- ----------------------------
-- Table structure for eval_group_reward
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_reward`;
CREATE TABLE `eval_group_reward`
(
    `id`          bigint  NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_id`           bigint       NOT NULL COMMENT '考评组配置id',
    `name`        varchar(255)   DEFAULT NULL COMMENT '考评,活动名称',
    `cal_method`  int     NOT NULL COMMENT '计算方式; 1: 排名正负激励 2:阶梯奖励(翻倍) 3:总金额X达成率占比 4:固定值X达成率 5: 固定值+超额部分追加奖励',
    `rank_type`   tinyint NOT NULL COMMENT '排名方式;1:排名序号 2:排名人数百分比',
    `money`       decimal(10, 4) DEFAULT NULL COMMENT '金额',
    `extra_money` decimal(10, 4) DEFAULT NULL COMMENT '追加奖励 XX 元/台,超额奖励用',
    `yn`          tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time` datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评奖惩';

-- ----------------------------
-- Table structure for eval_group_reward_ladders
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_reward_ladders`;
CREATE TABLE `eval_group_reward_ladders`
(
    `id`                   bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_id`        bigint         NOT NULL COMMENT '考评组配置id',
    `eval_group_reward_id` bigint         NOT NULL COMMENT '绩效组指标条件id',
    `lower`                decimal(10, 4) NOT NULL COMMENT '阶梯下限;大于等于',
    `upper`                decimal(10, 4) NOT NULL DEFAULT '65536.0000' COMMENT '阶梯上限;小于; 无上限的情况值为 2<<15',
    `money`                decimal(10, 4)          DEFAULT NULL COMMENT '金额',
    `cap_money`            decimal(10, 4)          DEFAULT NULL COMMENT '封顶金额/台',
    `yn`                   tinyint(1)              DEFAULT '1' COMMENT '逻辑删除',
    `create_time`          datetime                DEFAULT NULL COMMENT '创建时间',
    `update_time`          datetime                DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评奖惩阶梯';

-- ----------------------------
-- Table structure for eval_group_reward_param
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_reward_param`;
CREATE TABLE `eval_group_reward_param`
(
    `id`                   bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_id`        bigint       NOT NULL COMMENT '考评组id',
    `eval_group_reward_id` bigint       NOT NULL COMMENT '考评奖惩id',
    `param_type`           tinyint      NOT NULL COMMENT '参数类型(1.台阶,2,提成)',
    `code_type`            tinyint      NOT NULL COMMENT '编码类型(1.指标,2.考评指标)',
    `code`                 varchar(255) NOT NULL COMMENT '项目编码',
    `name`                 varchar(255)   DEFAULT NULL COMMENT '项目名称',
    `proportion`           decimal(10, 4) DEFAULT NULL COMMENT '占比',
    `cap`                  tinyint(1)     DEFAULT '1' COMMENT '是否封顶',
    `target_calc_type`        tinyint(4)        DEFAULT NULL COMMENT '目标计算类型;1: 目标值计算 2:最低要求计算',
    `target_type`          tinyint        DEFAULT '1' COMMENT '目标值类型; 1:无 2:百分比 3:金额 4:台数',
    `target_value`         decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `money`                decimal(10, 4) DEFAULT NULL COMMENT '金额',
    `yn`                   tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`          datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`          datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评奖惩参数';

-- ----------------------------
-- Table structure for eval_group_reward_precondition
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_reward_precondition`;
CREATE TABLE `eval_group_reward_precondition`
(
    `id`                   bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_group_id`        bigint       NOT NULL COMMENT '考评组id',
    `eval_group_reward_id` bigint       NOT NULL COMMENT '考评奖惩id',
    `cond_type`            tinyint        DEFAULT '1' COMMENT '条件值类型; 1:满足目标 2:满足排名率 3:金额',
    `code_type`            tinyint      NOT NULL COMMENT '编码类型(1. 指标,2.考评指标)',
    `code`                 varchar(255) NOT NULL COMMENT '项目编码',
    `name`                 varchar(255)   DEFAULT NULL COMMENT '项目名称',
    `target_type`          tinyint        DEFAULT '1' COMMENT '条件值类型; 1:无 2:百分比 3:金额',
    `target_value`         decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `cond_value`           decimal(10, 4) DEFAULT NULL COMMENT '条件值',
    `sort`                 int            DEFAULT NULL COMMENT '排序',
    `yn`                   tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`          datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`          datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评奖惩前置条件';

-- ----------------------------
-- Table structure for eval_group_reward_precondition_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `eval_group_reward_precondition_hit_log`;
CREATE TABLE `eval_group_reward_precondition_hit_log`
(
    `id`                   bigint NOT NULL AUTO_INCREMENT,
    `eval_group_id`        bigint NOT NULL COMMENT '考评组配置id',
    `eval_group_reward_id` bigint NOT NULL COMMENT '考评组奖惩id',
    `precondition_id`      bigint NOT NULL COMMENT '考评组奖惩条件id',
    `value`                decimal(18, 2) DEFAULT NULL COMMENT '原始值',
    `reach_value`          decimal(18, 2) DEFAULT NULL COMMENT '达成目标',
    `data_date`            date   NOT NULL COMMENT '数据日期',
    `group_id`             bigint NOT NULL COMMENT '集团id',
    `create_time`          datetime       DEFAULT NULL,
    `update_time`          datetime       DEFAULT NULL,
    `yn`                   tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评奖惩条件记录';

-- ----------------------------
-- Table structure for eval_indicator
-- ----------------------------
DROP TABLE IF EXISTS `eval_indicator`;
CREATE TABLE `eval_indicator`
(
    `id`          bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `code`        varchar(255) NOT NULL COMMENT '考评指标编码',
    `name`        varchar(255) DEFAULT NULL COMMENT '考评指标名称',
    `sys_id`      bigint       DEFAULT NULL COMMENT '归属系统id',
    `sys_prefix`  varchar(64)  DEFAULT NULL COMMENT '归属系统前缀',
    `sys_name`    varchar(32)  DEFAULT NULL COMMENT '归属系统名称',
    `role_code`   varchar(64)  DEFAULT NULL COMMENT '导入操作人员角色码',
    `role_name`   varchar(64)  DEFAULT NULL COMMENT '导入操作人员角色名称',
    `rule_type`   tinyint      DEFAULT NULL COMMENT '频率类型; 1:按滚动天 2:按星期 3:按月指定日期 4:按滚动月',
    `rule_values` varchar(256) DEFAULT NULL COMMENT '频率值 ,号分隔(按星期、按月指定日期使用)',
    `order_type`  tinyint      DEFAULT NULL COMMENT '按滚动月计算顺序; 1:正序 2:倒序',
    `start_time`  date         DEFAULT NULL COMMENT '开始日期',
    `target_type` tinyint      DEFAULT '1' COMMENT '目标值类型; 1:无 2:百分比 3:金额 4:台数',
    `enable`      tinyint(1)   NOT NULL COMMENT '启用/禁用;0:禁用 1:启用',
    `yn`          tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time` datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评指标';

-- ----------------------------
-- Table structure for eval_pool
-- ----------------------------
DROP TABLE IF EXISTS `eval_pool`;
CREATE TABLE `eval_pool`
(
    `id`             bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `egc`            varchar(60)    NOT NULL COMMENT '考评组编码',
    `eval_group_id`  bigint         NOT NULL COMMENT '考评组id',
    `user_id`        bigint         NOT NULL COMMENT '用户id',
    `user_name`      varchar(255) DEFAULT NULL COMMENT '用户名称',
    `post_id`        bigint         NOT NULL COMMENT '岗位id',
    `post_name`      varchar(255) DEFAULT NULL COMMENT '岗位名称',
    `shop_id`        bigint         NOT NULL COMMENT '门店id',
    `shop_name`      varchar(255) DEFAULT NULL COMMENT '门店名称',
    `fund_shop_id`   bigint       DEFAULT NULL COMMENT '社保公积金门店id',
    `fund_shop_name` varchar(255) DEFAULT NULL COMMENT '社保公积金门店名称',
    `reward`         decimal(18, 2) NOT NULL COMMENT '考评奖惩',
    `score`          decimal(10, 2) NOT NULL COMMENT '考评得分',
    `score_ratio`    decimal(10, 2) NOT NULL COMMENT '考评得分率',
    `monthly`        varchar(8)     NOT NULL COMMENT '月度',
    `regular`        tinyint(1)     NOT NULL COMMENT '固定的',
    `group_id`       bigint         NOT NULL COMMENT '集团id',
    `yn`             tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`    datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`    datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `eval_pool_monthly_index` (`monthly`),
    KEY `eval_pool_salary_group_id_index` (`eval_group_id`),
    KEY `eval_pool_user_id_index` (`user_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评池';

-- ----------------------------
-- Table structure for eval_pool_indicator_detail
-- ----------------------------
DROP TABLE IF EXISTS `eval_pool_indicator_detail`;
CREATE TABLE `eval_pool_indicator_detail`
(
    `id`                      bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `eval_pool_id`            bigint         NOT NULL COMMENT '考评池id',
    `eval_group_indicator_id` bigint       DEFAULT NULL COMMENT '考评项id',
    `name`                    varchar(255) DEFAULT NULL COMMENT '指标名称',
    `base_score`              int            NOT NULL COMMENT '基础绩效分',
    `score`                   decimal(10, 2) NOT NULL COMMENT '考评得分',
    `score_ratio`             decimal(10, 2) NOT NULL COMMENT '考评得分率',
    `monthly`                 varchar(8)     NOT NULL COMMENT '月度',
    `group_id`                bigint         NOT NULL COMMENT '集团id',
    `yn`                      tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`             datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`             datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 3804686
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='考评指标明细';

-- ----------------------------
-- Table structure for income_compensation
-- ----------------------------
DROP TABLE IF EXISTS `income_compensation`;
CREATE TABLE `income_compensation`
(
    `id`          bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `post_id`     bigint       NOT NULL COMMENT '岗位id',
    `post_name`   varchar(255)   DEFAULT NULL COMMENT '岗位名称',
    `shop_ids`    varchar(255) NOT NULL COMMENT '适用门店ids',
    `shop_names`  varchar(255) NOT NULL COMMENT '适用门店名称',
    `months`      varchar(255) NOT NULL COMMENT '多个生效月份',
    `money`       decimal(10, 4) DEFAULT NULL COMMENT '单人补偿金额',
    `max_money`   decimal(10, 4) DEFAULT NULL COMMENT '单人最高补偿金额',
    `status`      tinyint      NOT NULL COMMENT '状态;1:审批中 3:生效中 4:已失效 ',
    `group_id`    bigint       NOT NULL COMMENT '集团id',
    `yn`          tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_by`   bigint         DEFAULT NULL COMMENT '创建人',
    `create_time` datetime       DEFAULT NULL COMMENT '创建时间',
    `update_by`   bigint         DEFAULT NULL COMMENT '更新人',
    `update_time` datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='收入补偿配置';

-- ----------------------------
-- Table structure for income_compensation_list
-- ----------------------------
DROP TABLE IF EXISTS `income_compensation_list`;
CREATE TABLE `income_compensation_list`
(
    `id`                     bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `income_compensation_id` bigint       NOT NULL COMMENT '补偿id',
    `post_id`                bigint       NOT NULL COMMENT '岗位id',
    `shop_id`                bigint       NOT NULL COMMENT '门店id',
    `data_month`             varchar(255) NOT NULL COMMENT '生效月份',
    `effective`              tinyint(1)   NOT NULL COMMENT '有效性;0:生效 1:失效 ',
    `ineffective_date`       date     DEFAULT NULL COMMENT '失效时间 ',
    `yn`                     tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`            datetime DEFAULT NULL COMMENT '创建时间',
    `update_time`            datetime DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='收入补偿清单';

-- ----------------------------
-- Table structure for indicators
-- ----------------------------
DROP TABLE IF EXISTS `indicators`;
CREATE TABLE `indicators`
(
    `id`              bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `indicator_code`  varchar(32)  NOT NULL COMMENT '指标编号',
    `indicator_name`  varchar(255) NOT NULL COMMENT '指标名称',
    `sys_id`          bigint       NOT NULL COMMENT '归属系统id',
    `sys_prefix`      varchar(64)           DEFAULT NULL COMMENT '归属系统前缀',
    `sys_name`        varchar(32)           DEFAULT NULL COMMENT '归属系统名称',
    `role_type`       tinyint      NOT NULL COMMENT '适用角色类型;1: 全部角色 2:全部管理角色 3:自定义',
    `role_codes`      varchar(1024)         DEFAULT NULL COMMENT '适用角色码',
    `role_names`      varchar(2048)         DEFAULT NULL COMMENT '适用角色名称',
    `enable`          tinyint(1)   NOT NULL COMMENT '启用/禁用;0:禁用 1:启用',
    `target_type`     tinyint      NOT NULL DEFAULT '1' COMMENT '绩效目标值类型; 1:无 2:百分比 3:金额',
    `data_type`       tinyint      NOT NULL COMMENT '数据类型;1:台数  2:百分比 3:金额',
    `apply_types`     varchar(255) NOT NULL COMMENT '适用范围类型;1:绩效组 2:薪酬组 3:考评组',
    `inner_indicator` tinyint(1)            DEFAULT '0' COMMENT '内部指标',
    `create_time`     datetime              DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime              DEFAULT NULL COMMENT '更新时间',
    `yn`              tinyint(1)            DEFAULT '1' COMMENT '逻辑删除',
    PRIMARY KEY (`id`),
    UNIQUE KEY `idx_indicator_code` (`indicator_code`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 40
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='指标库';

-- ----------------------------
-- Table structure for kpi_group
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group`;
CREATE TABLE `kpi_group`
(
    `id`                   bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `name`                 varchar(255)   DEFAULT NULL COMMENT '绩效组名称',
    `kgc`                  varchar(60)  NOT NULL COMMENT '绩效组编码',
    `post_id`              bigint       NOT NULL COMMENT '岗位id',
    `post_name`            varchar(255)   DEFAULT NULL COMMENT '岗位名称',
    `shop_ids`             varchar(255) NOT NULL COMMENT '适用门店ids',
    `shop_names`           varchar(255) NOT NULL COMMENT '适用门店名称',
    `pre_id`               bigint         DEFAULT NULL COMMENT '前一次配置id',
    `begin_time`           date         NOT NULL COMMENT '生效时间',
    `over_time`            date           DEFAULT NULL COMMENT '失效时间',
    `reason`               varchar(512)   DEFAULT NULL COMMENT '调整原因',
    `attachment`           varchar(512)   DEFAULT NULL COMMENT '附件;fid逗号隔开',
    `status`               tinyint      NOT NULL COMMENT '状态;1:审批中 2:待生效 3:生效中 4:已失效',
    `indicator_num`        int            DEFAULT NULL COMMENT '包含指标数量',
    `star_evaluation_type` tinyint      NOT NULL COMMENT '星级评定方式;1:绩效得分率 2:人员百分比',
    `revoked_score_ratio`  decimal(10, 4) DEFAULT NULL COMMENT '人员百分比,撤销D级得分率',
    `group_id`             bigint       NOT NULL COMMENT '集团id',
    `yn`                   tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_by`            bigint         DEFAULT NULL COMMENT '创建人',
    `create_time`          datetime       DEFAULT NULL COMMENT '创建时间',
    `update_by`            bigint         DEFAULT NULL COMMENT '更新人',
    `update_time`          datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 78
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组配置';

-- ----------------------------
-- Table structure for kpi_group_indicator
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator`;
CREATE TABLE `kpi_group_indicator`
(
    `id`                 bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_group_id`       bigint       NOT NULL COMMENT '绩效组配置id',
    `name`               varchar(255) DEFAULT NULL COMMENT '指标名称',
    `base_score`         int          NOT NULL COMMENT '基础绩效分',
    `score_way`          tinyint      DEFAULT NULL COMMENT '得分方式;1: 阶梯得分 2:普通得分',
    `param_alias`        varchar(255) NOT NULL COMMENT '考核项别名',
    `precondition_alias` varchar(255) DEFAULT NULL COMMENT '前置考核项别名(目前预留)',
    `yn`                 tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`        datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`        datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组指标项';

-- ----------------------------
-- Table structure for kpi_group_indicator_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_hit_log`;
CREATE TABLE `kpi_group_indicator_hit_log`
(
    `id`                             bigint NOT NULL AUTO_INCREMENT,
    `kpi_pool_id`                    bigint NOT NULL COMMENT '绩效池id',
    `kpi_group_indicator_id`         bigint NOT NULL COMMENT '绩效组指标id',
    `kpi_group_indicator_ladders_id` bigint NOT NULL COMMENT '绩效组指标阶梯id',
    `kpi_value`                      decimal(18, 2) DEFAULT NULL COMMENT '绩效值',
    `data_date`                      date   NOT NULL COMMENT '数据日期',
    `group_id`                       bigint NOT NULL COMMENT '集团id',
    `create_time`                    datetime       DEFAULT NULL,
    `update_time`                    datetime       DEFAULT NULL,
    `yn`                             tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`),
    UNIQUE KEY `salary_project_hit_log_index` (`kpi_group_indicator_id`, `kpi_pool_id`, `data_date`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 1129
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='用户绩效项命中记录';

-- ----------------------------
-- Table structure for kpi_group_indicator_ladders
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_ladders`;
CREATE TABLE `kpi_group_indicator_ladders`
(
    `id`                     bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_group_indicator_id` bigint         NOT NULL COMMENT '绩效组指标项id',
    `lower`                  decimal(10, 4) NOT NULL COMMENT '阶梯下限;大于等于',
    `upper`                  decimal(10, 4) NOT NULL DEFAULT '65536.0000' COMMENT '阶梯上限;小于; 无上限的情况值为 2<<15',
    `standard_score`         tinyint        NOT NULL COMMENT '标准分;本阶梯对应标准分',
    `yn`                     tinyint(1)              DEFAULT '1' COMMENT '逻辑删除',
    `create_time`            datetime                DEFAULT NULL COMMENT '创建时间',
    `update_time`            datetime                DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 271
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='指标项得分阶梯';

-- ----------------------------
-- Table structure for kpi_group_indicator_param
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_param`;
CREATE TABLE `kpi_group_indicator_param`
(
    `id`                     bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_group_id`           bigint       NOT NULL COMMENT '绩效组配置id',
    `kpi_group_indicator_id` bigint       NOT NULL COMMENT '绩效组指标id',
    `param_type`             tinyint      NOT NULL COMMENT '参数类型(1.台阶条件,2,提成条件)',
    `indicator_code`         varchar(255) NOT NULL COMMENT '指标编码',
    `indicator_name`         varchar(255)   DEFAULT NULL COMMENT '指标库名称',
    `proportion`             decimal(10, 4) DEFAULT NULL COMMENT '占比',
    `cap`                    tinyint(1)     DEFAULT '1' COMMENT '是否封顶',
    `target_calc_type`       tinyint(4)        DEFAULT NULL COMMENT '目标计算类型;1: 目标值计算 2:最低要求计算',
    `target_type`            tinyint(4)        DEFAULT '1' COMMENT '绩效目标值类型; 1:无 2:百分比 3:金额 4:台数',
    `target_value`           decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `yn`                     tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`            datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`            datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组指标参数';

-- ----------------------------
-- Table structure for kpi_group_indicator_precondition
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_precondition`;
CREATE TABLE `kpi_group_indicator_precondition`
(
    `id`                     bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_group_id`           bigint       NOT NULL COMMENT '绩效组配置id',
    `kpi_group_indicator_id` bigint       NOT NULL COMMENT '绩效组指标id',
    `indicator_code`         varchar(255) NOT NULL COMMENT '指标编码',
    `indicator_name`         varchar(255)   DEFAULT NULL COMMENT '指标库名称',
    `target_calc_type`       tinyint(4)        DEFAULT NULL COMMENT '目标计算类型;1: 目标值计算 2:最低要求计算',
    `target_type`            tinyint(4)        DEFAULT '1' COMMENT '绩效目标值类型; 1:无 2:百分比 3:金额 4:台数',
    `target_value`           decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `sort`                   int          NOT NULL COMMENT '排序',
    `yn`                     tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`            datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`            datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组指标条件';

-- ----------------------------
-- Table structure for kpi_group_indicator_precondition_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_precondition_hit_log`;
CREATE TABLE `kpi_group_indicator_precondition_hit_log`
(
    `id`                      bigint NOT NULL AUTO_INCREMENT,
    `precondition_id`         bigint         DEFAULT NULL COMMENT '绩效组指标条件id',
    `precondition_ladders_id` bigint         DEFAULT NULL COMMENT '命中绩效组指标条件得分阶梯id',
    `value`                   decimal(18, 2) DEFAULT NULL COMMENT '值',
    `data_date`               date   NOT NULL COMMENT '数据日期',
    `group_id`                bigint NOT NULL COMMENT '集团id',
    `create_time`             datetime       DEFAULT NULL,
    `update_time`             datetime       DEFAULT NULL,
    `yn`                      tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效指标前置条件命中条件记录';

-- ----------------------------
-- Table structure for kpi_group_indicator_precondition_ladders
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_precondition_ladders`;
CREATE TABLE `kpi_group_indicator_precondition_ladders`
(
    `id`              bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `precondition_id` bigint         NOT NULL COMMENT '绩效组指标条件id',
    `lower`           decimal(10, 4) NOT NULL COMMENT '阶梯下限;大于等于',
    `upper`           decimal(10, 4) NOT NULL DEFAULT '65536.0000' COMMENT '阶梯上限;小于; 无上限的情况值为 2<<15',
    `score_percent`   decimal(10, 4)          DEFAULT NULL COMMENT '得分百分比',
    `yn`              tinyint(1)              DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime                DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime                DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组指标条件得分阶梯';

-- ----------------------------
-- Table structure for kpi_group_indicator_score_log
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_score_log`;
CREATE TABLE `kpi_group_indicator_score_log`
(
    `id`                     bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_group_indicator_id` bigint NOT NULL COMMENT '绩效组指标项id',
    `score`                  decimal(18,3)    NOT NULL COMMENT '得分',
    `data_date`              date   NOT NULL COMMENT '数据日期',
    `yn`                     tinyint(1) DEFAULT '1' COMMENT '逻辑删除',
    `create_time`            datetime   DEFAULT NULL COMMENT '创建时间',
    `update_time`            datetime   DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组指标项得分记录';

-- ----------------------------
-- Table structure for kpi_group_indicator_target_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_indicator_target_hit_log`;
CREATE TABLE `kpi_group_indicator_target_hit_log`
(
    `id`          bigint  NOT NULL AUTO_INCREMENT,
    `refer_id`    bigint  NOT NULL COMMENT '绩效组指标/前置条件配置id',
    `target_type` tinyint NOT NULL COMMENT '类型 1:绩效组指标 2:前置条件指标',
    `value`       decimal(18, 2) DEFAULT NULL COMMENT '原始值',
    `reach_value` decimal(18, 2) DEFAULT NULL COMMENT '达成目标',
    `data_date`   date    NOT NULL COMMENT '数据日期',
    `group_id`    bigint  NOT NULL COMMENT '集团id',
    `create_time` datetime       DEFAULT NULL,
    `update_time` datetime       DEFAULT NULL,
    `yn`          tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效指标目标达成记录';

-- ----------------------------
-- Table structure for kpi_group_rank
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_rank`;
CREATE TABLE `kpi_group_rank`
(
    `id`                   bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `name`                 varchar(255) NOT NULL COMMENT '组合名称',
    `star_evaluation_type` tinyint      NOT NULL COMMENT '星级评定方式;1:绩效得分率 2:人员百分比',
    `revoked_score_ratio`  decimal(10, 4) DEFAULT NULL COMMENT '撤销D级得分率',
    `kgcs`                 varchar(500) NOT NULL COMMENT '绩效组编码',
    `ineffective_date`     date           DEFAULT NULL COMMENT '失效日期',
    `group_id`             bigint       NOT NULL COMMENT '集团id',
    `yn`                   tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_by`            bigint         DEFAULT NULL COMMENT '创建者',
    `create_time`          datetime       DEFAULT NULL COMMENT '创建时间',
    `update_by`            bigint         DEFAULT NULL COMMENT '更新者',
    `update_time`          datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 11
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组排名配置';

-- ----------------------------
-- Table structure for kpi_group_rank_star_ladders
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_rank_star_ladders`;
CREATE TABLE `kpi_group_rank_star_ladders`
(
    `id`                bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_group_rank_id` bigint         DEFAULT NULL COMMENT '绩效组排名配置id',
    `level`             tinyint        NOT NULL COMMENT '等级;1:A 2:B 3:C 4:D',
    `lower`             decimal(10, 2) NOT NULL COMMENT '下限',
    `upper`             decimal(10, 2) DEFAULT NULL COMMENT '上限',
    `yn`                tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`       datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`       datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 41
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='排名星级评定阶梯';

-- ----------------------------
-- Table structure for kpi_group_user
-- ----------------------------
DROP TABLE IF EXISTS `kpi_group_user`;
CREATE TABLE `kpi_group_user`
(
    `id`                bigint      NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kgc`               varchar(60) NOT NULL COMMENT '绩效组编码',
    `kpi_group_id`      bigint       DEFAULT NULL COMMENT '绩效组id',
    `user_id`           bigint      NOT NULL COMMENT '人员id',
    `user_name`         varchar(255) DEFAULT NULL COMMENT '人员名称',
    `post_id`           bigint      NOT NULL COMMENT '岗位码',
    `post_name`         varchar(255) DEFAULT NULL COMMENT '岗位名称',
    `shop_id`           bigint      NOT NULL COMMENT '门店id',
    `shop_name`         varchar(255) DEFAULT NULL COMMENT '在职门店',
    `ignored`           tinyint(1)  NOT NULL COMMENT '是否不计入绩效考核',
    `ignore_cause`      tinyint      DEFAULT NULL COMMENT '不计入原因;枚举待定',
    `ignore_cause_desc` varchar(255) DEFAULT NULL COMMENT '不计入原因描述',
    `anticipated_date`  date         DEFAULT NULL COMMENT '开始考核时间',
    `remark`            varchar(255) DEFAULT NULL COMMENT '备注',
    `data_date`         date         DEFAULT NULL COMMENT '数据日期',
    `group_id`          bigint      NOT NULL COMMENT '集团id',
    `yn`                tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`       datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`       datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `kpi_group_user_data_date_index` (`data_date`),
    KEY `kpi_group_user_user_id_index` (`user_id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 3553
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效组人员';

-- ----------------------------
-- Table structure for kpi_indicator_user_value
-- ----------------------------
DROP TABLE IF EXISTS `kpi_indicator_user_value`;
CREATE TABLE `kpi_indicator_user_value`
(
    `id`              bigint        NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `user_id`         bigint        NOT NULL COMMENT '人员id',
    `indicator_code`  varchar(255)  NOT NULL COMMENT '指标编码',
    `indicator_name`  varchar(255) DEFAULT NULL COMMENT '指标库名称',
    `indicator_value` varchar(2000) NOT NULL COMMENT '指标业务值;jons字符串 map类型',
    `value_type`      tinyint       NOT NULL COMMENT '类型;1:台数  2:百分比 3:金额 4:条件值',
    `data_date`       date         DEFAULT NULL COMMENT '数据日期',
    `group_id`        bigint        NOT NULL COMMENT '集团id',
    `yn`              tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `kpi_indicator_value_data_date_index` (`data_date`),
    KEY `kpi_indicator_value_user_id_index` (`user_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效人员指标业务值';

-- ----------------------------
-- Table structure for kpi_mq_log
-- ----------------------------
DROP TABLE IF EXISTS `kpi_mq_log`;
CREATE TABLE `kpi_mq_log`
(
    `id`             bigint       NOT NULL,
    `indicator_code` varchar(225) NOT NULL COMMENT '指标编码',
    `post_id`        bigint       NOT NULL COMMENT '岗位id',
    `send_date`      date         NOT NULL COMMENT '数据时间 可能为过去的时间',
    `group_id`       bigint       NOT NULL COMMENT '集团id',
    `create_time`    datetime DEFAULT NULL COMMENT '创建时间',
    PRIMARY KEY (`id`),
    UNIQUE KEY `kpi_mq_log_id_uindex` (`id`),
    KEY `kpi_mq_log_indicator_code_index` (`indicator_code`),
    KEY `kpi_mq_log_post_code_index` (`post_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效上报mq发送记录';

-- ----------------------------
-- Table structure for kpi_pool
-- ----------------------------
DROP TABLE IF EXISTS `kpi_pool`;
CREATE TABLE `kpi_pool`
(
    `id`                      bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kgc`                     varchar(60)    NOT NULL COMMENT '绩效组编码',
    `kpi_group_id`            bigint         NOT NULL COMMENT '绩效组id',
    `user_id`                 bigint         NOT NULL COMMENT '用户id',
    `user_name`               varchar(255)            DEFAULT NULL COMMENT '用户名称',
    `post_id`                 bigint         NOT NULL COMMENT '岗位id',
    `post_name`               varchar(255)            DEFAULT NULL COMMENT '岗位名称',
    `shop_id`                 bigint         NOT NULL COMMENT '门店id',
    `shop_name`               varchar(255)            DEFAULT NULL COMMENT '门店名称',
    `kpi_score`               decimal(10, 2) NOT NULL COMMENT '绩效得分',
    `kpi_score_ratio`         decimal(10, 4) NOT NULL COMMENT '绩效得分率',
    `average_kpi_score_ratio` decimal(10, 4) NOT NULL COMMENT '平均绩效得分率',
    `star_level`              tinyint                 DEFAULT NULL COMMENT '星级;1: A 2:B 3:C 4:D',
    `actual_star`             tinyint                 DEFAULT NULL COMMENT '实际星级;默认等于系统评定的星级,有调整的情况修改次字段',
    `revoked`                 tinyint(1)              DEFAULT NULL COMMENT 'D级撤销状态;是否撤销本次D级',
    `inclusion`               tinyint(1)              DEFAULT NULL COMMENT '是否纳入绩效计算',
    `monthly`                 varchar(8)     NOT NULL COMMENT '月度',
    `regular`                 tinyint(1)     NOT NULL DEFAULT '0' COMMENT '固定的',
    `rank`                    int                     DEFAULT NULL COMMENT '排名',
    `group_id`                bigint         NOT NULL COMMENT '集团id',
    `yn`                      tinyint(1)              DEFAULT '1' COMMENT '逻辑删除',
    `create_time`             datetime                DEFAULT NULL COMMENT '创建时间',
    `update_time`             datetime                DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    UNIQUE KEY `pool_kpi_id_user_id_monthly_uindex` (`kpi_group_id`, `user_id`, `monthly`),
    KEY `kpi_pool_kpi_group_id_index` (`kpi_group_id`),
    KEY `kpi_pool_monthly_index` (`monthly`),
    KEY `kpi_pool_user_id_index` (`user_id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 196
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效池';

-- ----------------------------
-- Table structure for kpi_pool_indicator_value
-- ----------------------------
DROP TABLE IF EXISTS `kpi_pool_indicator_value`;
CREATE TABLE `kpi_pool_indicator_value`
(
    `id`              bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_pool_id`     bigint         NOT NULL COMMENT '绩效池id',
    `user_id`         bigint         NOT NULL COMMENT '人员id',
    `indicator_code`  varchar(255)   NOT NULL COMMENT '指标编码',
    `indicator_value` decimal(10, 4) NOT NULL COMMENT '指标业务值',
    `indicator_score` decimal(10, 4) NOT NULL COMMENT '指标得分',
    `data_date`       date       DEFAULT NULL COMMENT '数据日期',
    `mq_log_id`       bigint         NOT NULL COMMENT 'mq记录id',
    `group_id`        bigint         NOT NULL COMMENT '集团id',
    `yn`              tinyint(1) DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime   DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime   DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `kpi_pool_indicator_value_data_date_index` (`data_date`),
    KEY `kpi_pool_indicator_value_user_id_index` (`user_id`),
    KEY `kpi_pool_indicator_value_mq_log_id_index` (`mq_log_id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 16801
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效人员指标业务值';

-- ----------------------------
-- Table structure for kpi_reward_point
-- ----------------------------
DROP TABLE IF EXISTS `kpi_reward_point`;
CREATE TABLE `kpi_reward_point`
(
    `id`            bigint         NOT NULL AUTO_INCREMENT,
    `user_id`       bigint         NOT NULL COMMENT '用户id',
    `post_id`       bigint         NOT NULL COMMENT '岗位id',
    `shop_id`       bigint         NOT NULL COMMENT '在职门店',
    `occurred_time` datetime       NOT NULL COMMENT '产生时间',
    `monthly`       varchar(12)    NOT NULL COMMENT '月度',
    `score_point`   decimal(18, 4) NOT NULL COMMENT '出炉的分数值(为正数则是奖励,负数则是处罚)',
    `group_id`      bigint         NOT NULL COMMENT '集团id',
    `create_time`   datetime DEFAULT NULL,
    `update_time`   datetime DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `kpi_reward_point_monthly_index` (`monthly`),
    KEY `kpi_reward_point_user_id_post_id_index` (`user_id`, `post_id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 2031
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效分奖惩纪录';

-- ----------------------------
-- Table structure for kpi_star_ladders
-- ----------------------------
DROP TABLE IF EXISTS `kpi_star_ladders`;
CREATE TABLE `kpi_star_ladders`
(
    `id`           bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `kpi_group_id` bigint         DEFAULT NULL COMMENT '绩效组配置id',
    `level`        tinyint        NOT NULL COMMENT '等级;1:A 2:B 3:C 4:D',
    `lower`        decimal(10, 2) NOT NULL COMMENT '下限',
    `upper`        decimal(10, 2) DEFAULT NULL COMMENT '上限',
    `yn`           tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`  datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`  datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 309
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='星级评定阶梯';

-- ----------------------------
-- Table structure for kpi_star_rule
-- ----------------------------
DROP TABLE IF EXISTS `kpi_star_rule`;
CREATE TABLE `kpi_star_rule`
(
    `id`                    bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `roll_month`            int            DEFAULT NULL COMMENT '滚动月数',
    `forced_turnover_cycle` int            DEFAULT NULL COMMENT '强制离职考核周期',
    `max_unqualified_times` int            DEFAULT NULL COMMENT '强制离职周期内最大累计D级数',
    `continuous_monthly`    int            DEFAULT NULL COMMENT '连续月份;满足次条件减少一次D级',
    `min_score_ratio`       decimal(10, 4) DEFAULT NULL COMMENT '最小得分率',
    `group_id`              bigint NOT NULL COMMENT '集团id',
    `yn`                    tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`           datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`           datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 3
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效星级规则';

-- ----------------------------
-- Table structure for kpi_star_special_rule
-- ----------------------------
DROP TABLE IF EXISTS `kpi_star_special_rule`;
CREATE TABLE `kpi_star_special_rule`
(
    `id`                        bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `user_id`                   bigint NOT NULL COMMENT '人员id',
    `user_name`                 varchar(255) DEFAULT NULL COMMENT '人员名称',
    `earliest_starting_monthly` date         DEFAULT NULL COMMENT '开始考核日期',
    `revised_monthly`           date         DEFAULT NULL COMMENT '修正月度',
    `revised_level`             tinyint      DEFAULT NULL COMMENT '修正星级;1: A 2:B 3:C 4:D',
    `exclusion_monthly`         date         DEFAULT NULL COMMENT '排除月度',
    `revoked_times`             int          DEFAULT NULL COMMENT '免除次数;免除D级次数',
    `status`                    tinyint      DEFAULT NULL COMMENT '状态;1:审批中 2:待生效 3:生效中 4:已失效',
    `reason`                    varchar(255) DEFAULT NULL COMMENT '原因',
    `attachment`                varchar(255) DEFAULT NULL COMMENT '附件;fid逗号隔开',
    `group_id`                  bigint NOT NULL COMMENT '集团id',
    `yn`                        tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`               datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`               datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 6
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='绩效星级特殊规则';

-- ----------------------------
-- Table structure for payroll_record
-- ----------------------------
DROP TABLE IF EXISTS `payroll_record`;
CREATE TABLE `payroll_record`
(
    `id`             bigint         NOT NULL AUTO_INCREMENT,
    `user_id`        bigint         NOT NULL COMMENT '员工id',
    `user_name`      varchar(32) DEFAULT NULL COMMENT '用户名称',
    `shop_id`        bigint         NOT NULL COMMENT '门店id',
    `fund_shop_id`   bigint      DEFAULT NULL COMMENT '社保公积金门店id',
    `dealer_id`      bigint      DEFAULT NULL COMMENT '商家id',
    `biz_id`         varchar(32)    NOT NULL COMMENT '业务ID(对应薪酬池id)',
    `payment`        tinyint(1)     NOT NULL COMMENT '会否是付款',
    `amount`         decimal(18, 4) NOT NULL COMMENT '金额',
    `corporate`      tinyint(1)     NOT NULL COMMENT '公帐发放',
    `salary`         tinyint(1)     NOT NULL COMMENT '是否是工资',
    `payroll_status` int            NOT NULL COMMENT '发放状态 1:待推送到财务系统 2:已推送到财务系统 3:已发送成功',
    `payroll_token`  varchar(64) DEFAULT NULL COMMENT '发送token',
    `monthly`        varchar(12) DEFAULT NULL COMMENT '月度',
    `group_id`       bigint         NOT NULL COMMENT '集团id',
    `create_time`    datetime    DEFAULT NULL COMMENT '创建时间',
    `update_time`    datetime    DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `Payroll_Record_biz_id_index` (`biz_id`),
    KEY `Payroll_Record_monthly_index` (`monthly`),
    KEY `Payroll_Record_user_id_index` (`user_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪资发放记录';

-- ----------------------------
-- Table structure for salary_confirm
-- ----------------------------
DROP TABLE IF EXISTS `salary_confirm`;
CREATE TABLE `salary_confirm`
(
    `id`               bigint      NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_pool_id`   bigint      NOT NULL COMMENT '薪酬池id',
    `plan_time`        datetime    NOT NULL COMMENT '计划推送待办时间',
    `pushed_todo`      tinyint(1)  NOT NULL COMMENT '是否推送代办',
    `todo_code`        varchar(64) NOT NULL COMMENT '待办编码',
    `deadline`         datetime   DEFAULT NULL COMMENT '截止日期',
    `confirmed_status` tinyint    DEFAULT NULL COMMENT '确认状态;1:待定 2:已确认 3:已取消',
    `confirm_time`     datetime   DEFAULT NULL COMMENT '确认时间',
    `self_confirm`     tinyint(1) DEFAULT NULL COMMENT '是否本人确认',
    `group_id`         bigint      NOT NULL COMMENT '集团id',
    `yn`               tinyint(1) DEFAULT '1' COMMENT '逻辑删除',
    `create_time`      datetime   DEFAULT NULL COMMENT '创建时间',
    `update_time`      datetime   DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `salary_confirm_salary_pool_id_index` (`salary_pool_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬确认记录';

-- ----------------------------
-- Table structure for salary_extra_project
-- ----------------------------
DROP TABLE IF EXISTS `salary_extra_project`;
CREATE TABLE `salary_extra_project`
(
    `id`          bigint         NOT NULL AUTO_INCREMENT,
    `post_id`     bigint         NOT NULL COMMENT '岗位id',
    `shop_id`     bigint         NOT NULL COMMENT '在职门店id',
    `user_id`     bigint         NOT NULL COMMENT '用户id',
    `money`       decimal(18, 4) NOT NULL COMMENT '金额',
    `timely`      tinyint(1)     NOT NULL COMMENT '及时处理 为''''时会立即推送给财务,否则会并入工资里结算',
    `salary_type` int            NOT NULL COMMENT '额外项类型 1:奖励 2:处罚 3:社保扣除项 4:福利补贴',
    `data_id`     varchar(64)    NOT NULL COMMENT '业务数据id',
    `data_name`   varchar(128)   NOT NULL COMMENT '业务名称 e.g 考勤扣款、活动奖金... ',
    `data_date`   date           NOT NULL COMMENT '产生时间',
    `group_id`    bigint         NOT NULL COMMENT '集团id',
    `create_time` datetime   DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime   DEFAULT NULL COMMENT '更新时间',
    `yn`          tinyint(1) DEFAULT '1' COMMENT '逻辑删除',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 2150
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='额外薪资项';

-- ----------------------------
-- Table structure for salary_general_settin
-- ----------------------------
DROP TABLE IF EXISTS `salary_general_settin`;
CREATE TABLE `salary_general_settin`
(
    `id`                bigint      NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `leader_visibility` tinyint(1)           DEFAULT NULL COMMENT '管理层可见',
    `dates_of_appeal`   varchar(10) NOT NULL DEFAULT '3,5' COMMENT '可申诉日期;eg: 1,20 逗号隔开只存开始和结束',
    `payoff_date`       int                  DEFAULT NULL COMMENT '薪资发放日期;取值1-28(每月)',
    `payoff_limit`      int                  DEFAULT NULL COMMENT '薪资发放公户限额;元 0元则不限制',
    `group_id`          bigint      NOT NULL COMMENT '集团id',
    `yn`                tinyint(1)           DEFAULT '1' COMMENT '逻辑删除',
    `create_time`       datetime             DEFAULT NULL COMMENT '创建时间',
    `update_time`       datetime             DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 10
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬通用设置';

-- ----------------------------
-- Table structure for salary_group
-- ----------------------------
DROP TABLE IF EXISTS `salary_group`;
CREATE TABLE `salary_group`
(
    `id`          bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `name`        varchar(255)  DEFAULT NULL COMMENT '薪酬组名称',
    `sgc`         varchar(60)  NOT NULL COMMENT '薪酬组编码',
    `post_id`     bigint       NOT NULL COMMENT '岗位id',
    `post_name`   varchar(255)  DEFAULT NULL COMMENT '岗位名称',
    `shop_ids`    varchar(255) NOT NULL COMMENT '适用门店ids',
    `shop_names`  varchar(1024) DEFAULT NULL COMMENT '适用门店名称',
    `pre_id`      bigint        DEFAULT NULL COMMENT '前次配置id',
    `begin_time`  date          DEFAULT NULL COMMENT '生效时间',
    `over_time`   date          DEFAULT NULL COMMENT '失效时间',
    `reason`      varchar(900)  DEFAULT NULL COMMENT '调整原因',
    `attachment`  varchar(512)  DEFAULT NULL COMMENT '附件ids',
    `status`      int          NOT NULL COMMENT '状态;1:审批中 2:待生效 3:生效中 4:已失效',
    `project_num` int           DEFAULT NULL COMMENT '包薪酬项数量;只统计可配置的的项目数',
    `group_id`    bigint       NOT NULL COMMENT '集团id',
    `yn`          tinyint(1)    DEFAULT '1' COMMENT '逻辑删除',
    `create_time` datetime      DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime      DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 41
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬组配置';

-- ----------------------------
-- Table structure for salary_group_project
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_project`;
CREATE TABLE `salary_group_project`
(
    `id`              bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_group_id` bigint NOT NULL COMMENT '薪酬组id',
    `name`            varchar(255) DEFAULT NULL COMMENT '薪酬项目名称',
    `cal_method`      int    NOT NULL COMMENT '计算方式;1:员工星级 2:固定金额 3:台阶提成 4:车系提成',
    `yn`              tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 212
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬组薪酬项目';

-- ----------------------------
-- Table structure for salary_group_project_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_project_hit_log`;
CREATE TABLE `salary_group_project_hit_log`
(
    `id`                             bigint NOT NULL AUTO_INCREMENT,
    `salary_project_id`              bigint NOT NULL COMMENT '薪酬项id',
    `salary_pool_id`                 bigint NOT NULL COMMENT '薪酬池id',
    `salary_group_project_settin_id` bigint         DEFAULT NULL COMMENT '命中具体配置项id',
    `salary_value`                   decimal(18, 2) DEFAULT NULL COMMENT '薪酬值',
    `data_date`                      date   NOT NULL COMMENT '数据日期',
    `group_id`                       bigint NOT NULL COMMENT '集团id',
    `create_time`                    datetime       DEFAULT NULL,
    `update_time`                    datetime       DEFAULT NULL,
    `yn`                             tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`),
    UNIQUE KEY `salary_project_hit_log_index` (`salary_project_id`, `salary_pool_id`, `data_date`,
                                               `salary_group_project_settin_id`) USING BTREE
) ENGINE = InnoDB
  AUTO_INCREMENT = 3617
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='用户薪酬项命中记录';

-- ----------------------------
-- Table structure for salary_group_project_param
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_project_param`;
CREATE TABLE `salary_group_project_param`
(
    `id`                      bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_group_id`         bigint       NOT NULL COMMENT '薪酬组id',
    `salary_group_project_id` bigint       NOT NULL COMMENT '薪酬组项目id',
    `param_type`              tinyint        DEFAULT NULL COMMENT '参数类型(1.台阶指标,2,计算指标)',
    `indicator_code`          varchar(255) NOT NULL COMMENT '指标编码',
    `indicator_name`          varchar(255)   DEFAULT NULL COMMENT '指标库名称',
    `target_calc_type`        tinyint(4)     DEFAULT NULL COMMENT '目标计算类型;1: 目标值计算 2:最低要求计算',
    `target_type`             tinyint(4)     DEFAULT '1' COMMENT '目标值类型; 1:无 2:百分比 3:金额 4:台数',
    `target_value`            decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `proportion`              decimal(10, 4) DEFAULT NULL COMMENT '占比',
    `cap`                     tinyint(1)     DEFAULT '1' COMMENT '是否封顶',
    `sort`                    int            DEFAULT NULL COMMENT '排序',
    `yn`                      tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`             datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`             datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬组薪酬项目参数';

-- ----------------------------
-- Table structure for salary_group_project_precondition
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_project_precondition`;
CREATE TABLE `salary_group_project_precondition`
(
    `id`                      bigint       NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_group_id`         bigint       NOT NULL COMMENT '薪酬组id',
    `salary_group_project_id` bigint       NOT NULL COMMENT '薪酬组项目id',
    `indicator_code`          varchar(255) NOT NULL COMMENT '指标编码',
    `indicator_name`          varchar(255)   DEFAULT NULL COMMENT '指标库名称',
    `target_calc_type`        tinyint(4)        DEFAULT NULL COMMENT '目标计算类型;1: 目标值计算 2:最低要求计算',
    `target_type`             tinyint(4)        DEFAULT '1' COMMENT '条件值类型; 1:无 2:百分比 3:金额 4:台数',
    `target_value`            decimal(10, 4) DEFAULT NULL COMMENT '目标值',
    `cond_value`              decimal(10, 4) DEFAULT NULL COMMENT '条件值',
    `sort`                    int            DEFAULT NULL COMMENT '排序',
    `yn`                      tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`             datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`             datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬组薪酬项目前置条件';

-- ----------------------------
-- Table structure for salary_group_project_precondition_log
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_project_precondition_log`;
CREATE TABLE `salary_group_project_precondition_log`
(
    `id`                      bigint NOT NULL AUTO_INCREMENT,
    `salary_group_project_id` bigint NOT NULL COMMENT '薪酬组项目id',
    `precondition_id`         bigint         DEFAULT NULL COMMENT '薪酬组薪酬项目前置条件id',
    `value`                   decimal(18, 2) DEFAULT NULL COMMENT '值',
    `data_date`               date   NOT NULL COMMENT '数据日期',
    `create_time`             datetime       DEFAULT NULL,
    `update_time`             datetime       DEFAULT NULL,
    `yn`                      tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬指标条件记录';

-- ----------------------------
-- Table structure for salary_group_project_settin
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_project_settin`;
CREATE TABLE `salary_group_project_settin`
(
    `id`                      bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_group_project_id` bigint         NOT NULL COMMENT '薪酬项目配置id',
    `stair_key`               bigint       DEFAULT NULL COMMENT '阶梯key;星级名称/新车销售按车系计算是 对应车系id',
    `stair_key_desc`          varchar(255) DEFAULT NULL COMMENT '阶梯key对应描述',
    `stair_value`             decimal(18, 2) NOT NULL COMMENT '计算相关值',
    `stair_min`               int          DEFAULT NULL COMMENT '阶梯值下限',
    `stair_max`               int          DEFAULT NULL COMMENT '阶梯值上限;阶梯值上限',
    `yn`                      tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`             datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`             datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 444
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬项目配置';

-- ----------------------------
-- Table structure for salary_group_project_target_hit_log
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_project_target_hit_log`;
CREATE TABLE `salary_group_project_target_hit_log`
(
    `id`          bigint NOT NULL AUTO_INCREMENT,
    `refer_id`    bigint         DEFAULT NULL COMMENT '薪酬项目、前置条件 配置id',
    `target_type` tinyint        DEFAULT NULL COMMENT '1:薪酬项目 2:前置条件',
    `value`       decimal(18, 2) DEFAULT NULL COMMENT '原始值',
    `reach_value` decimal(18, 2) DEFAULT NULL COMMENT '达成目标',
    `data_date`   date   NOT NULL COMMENT '数据日期',
    `group_id`    bigint NOT NULL COMMENT '集团',
    `create_time` datetime       DEFAULT NULL,
    `update_time` datetime       DEFAULT NULL,
    `yn`          tinyint(1)     DEFAULT '1',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬指标达成目标记录';

-- ----------------------------
-- Table structure for salary_group_user
-- ----------------------------
DROP TABLE IF EXISTS `salary_group_user`;
CREATE TABLE `salary_group_user`
(
    `id`              bigint      NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `sgc`             varchar(60) NOT NULL COMMENT '薪酬组编码',
    `salary_group_id` bigint      NOT NULL COMMENT '薪酬组id',
    `user_id`         bigint      NOT NULL COMMENT '人员id',
    `user_name`       varchar(255) DEFAULT NULL COMMENT '人员名称',
    `post_id`         bigint      NOT NULL COMMENT '岗位id',
    `post_name`       varchar(255) DEFAULT NULL COMMENT '岗位名称',
    `shop_id`         bigint      NOT NULL COMMENT '门店id',
    `shop_name`       varchar(255) DEFAULT NULL COMMENT '门店名称',
    `probationer`     tinyint(1)  NOT NULL COMMENT '试用人员',
    `frozen`          tinyint(1)  NOT NULL COMMENT '冻结状态',
    `data_date`       date         DEFAULT NULL COMMENT '数据日期',
    `group_id`        bigint      NOT NULL COMMENT '集团id',
    `yn`              tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `salary_group_user_data_date_index` (`data_date`),
    KEY `salary_group_user_salary_group_id_index` (`salary_group_id`),
    KEY `salary_group_user_user_id_index` (`user_id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 3320
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬组人员';

-- ----------------------------
-- Table structure for salary_pay_notice
-- ----------------------------
DROP TABLE IF EXISTS `salary_pay_notice`;
CREATE TABLE `salary_pay_notice`
(
    `id`               bigint      NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_pool_id`   bigint      NOT NULL COMMENT '薪酬池id',
    `plan_time`        datetime    NOT NULL COMMENT '计划推送待办时间',
    `pushed_todo`      tinyint(1)  NOT NULL COMMENT '是否推送代办',
    `todo_code`        varchar(64) NOT NULL COMMENT '待办编码',
    `deadline`         datetime   DEFAULT NULL COMMENT '截止日期',
    `confirmed_status` tinyint    DEFAULT NULL COMMENT '确认状态;1:待定 2:已确认 3:已取消',
    `confirm_time`     datetime   DEFAULT NULL COMMENT '确认时间',
    `self_confirm`     tinyint(1) DEFAULT NULL COMMENT '是否本人确认',
    `group_id`         bigint      NOT NULL COMMENT '集团id',
    `yn`               tinyint(1) DEFAULT '1' COMMENT '逻辑删除',
    `create_time`      datetime   DEFAULT NULL COMMENT '创建时间',
    `update_time`      datetime   DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `salary_confirm_salary_pool_id_index` (`salary_pool_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬确认记录';

-- ----------------------------
-- Table structure for salary_pool
-- ----------------------------
DROP TABLE IF EXISTS `salary_pool`;
CREATE TABLE `salary_pool`
(
    `id`              bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `sgc`             varchar(60)    NOT NULL COMMENT '薪酬组编码',
    `salary_group_id` bigint         NOT NULL COMMENT '薪酬组id',
    `user_id`         bigint         NOT NULL COMMENT '用户id',
    `user_name`       varchar(255) DEFAULT NULL COMMENT '用户名称',
    `post_id`         bigint         NOT NULL COMMENT '岗位id',
    `post_name`       varchar(255) DEFAULT NULL COMMENT '岗位名称',
    `shop_id`         bigint         NOT NULL COMMENT '门店id',
    `shop_name`       varchar(255) DEFAULT NULL COMMENT '门店名称',
    `fund_shop_id`    bigint       DEFAULT NULL COMMENT '社保公积金门店id',
    `fund_shop_name`  varchar(255) DEFAULT NULL COMMENT '社保公积金门店名称',
    `star_level`      tinyint        NOT NULL COMMENT '星级; 1:A 2:B 3:C 4:D',
    `reward`          decimal(18, 2) NOT NULL COMMENT '薪资报酬',
    `monthly`         varchar(8)     NOT NULL COMMENT '月度',
    `regular`         tinyint(1)     NOT NULL COMMENT '固定的',
    `signature_file`  varchar(255) DEFAULT NULL COMMENT '签名文件',
    `paid`            tinyint(1)   DEFAULT NULL COMMENT '是否已发放',
    `group_id`        bigint         NOT NULL COMMENT '集团id',
    `yn`              tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`     datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`     datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `salary_pool_monthly_index` (`monthly`),
    KEY `salary_pool_salary_group_id_index` (`salary_group_id`),
    KEY `salary_pool_user_id_index` (`user_id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 116
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬池';

-- ----------------------------
-- Table structure for salary_pool_detail
-- ----------------------------
DROP TABLE IF EXISTS `salary_pool_detail`;
CREATE TABLE `salary_pool_detail`
(
    `id`                   bigint         NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_pool_id`       bigint         NOT NULL COMMENT '薪酬池id',
    `salary_project_id`    bigint         DEFAULT NULL COMMENT '薪酬项id',
    `salary_project_name`  varchar(255)   DEFAULT NULL COMMENT '薪酬项名称',
    `type`                 int            NOT NULL COMMENT '薪酬类型 1:绩效提成 2:内部奖励 3:内部罚款 4:社保扣款 5:福利补贴 6:试用期工资',
    `salary_amount`        decimal(18, 2) DEFAULT NULL COMMENT '预计收入',
    `processed_amount`     decimal(18, 2) NOT NULL COMMENT '已处理金额',
    `actual_salary_amount` decimal(18, 2) DEFAULT NULL COMMENT '实际收入',
    `salary_date`          date           NOT NULL COMMENT '薪资日期',
    `group_id`             bigint         NOT NULL COMMENT '集团id',
    `yn`                   tinyint(1)     DEFAULT '1' COMMENT '逻辑删除',
    `create_time`          datetime       DEFAULT NULL COMMENT '创建时间',
    `update_time`          datetime       DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `salary_pool_detail_salary_pool_id_index` (`salary_pool_id`),
    KEY `salary_pool_detail_salary_date_index` (`salary_date`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 4219870
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪资明细';

-- ----------------------------
-- Table structure for salary_raw_data
-- ----------------------------
DROP TABLE IF EXISTS `salary_raw_data`;
CREATE TABLE `salary_raw_data`
(
    `id`                   bigint        NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `salary_project_code`  varchar(255) DEFAULT NULL COMMENT '薪酬项编码',
    `salary_project_value` varchar(2000) NOT NULL COMMENT '薪酬项具体值;jons字符串 map类型',
    `value_type`           tinyint       NOT NULL COMMENT '类型;1: 百分比 2:数量 3:条件值 4:金额 5:工龄',
    `user_id`              bigint        NOT NULL COMMENT '人员id',
    `data_date`            date          NOT NULL COMMENT '数据对应日期',
    `group_id`             bigint        NOT NULL COMMENT '集团id',
    `yn`                   tinyint(1)   DEFAULT '1' COMMENT '逻辑删除',
    `create_time`          datetime     DEFAULT NULL COMMENT '创建时间',
    `update_time`          datetime     DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`),
    KEY `salary_raw_data_user_id_index` (`user_id`),
    KEY `salary_raw_data_data_date_index` (`data_date`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 9967
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='薪酬提成原始数据';

-- ----------------------------
-- Table structure for setting_draft
-- ----------------------------
DROP TABLE IF EXISTS `setting_draft`;
CREATE TABLE `setting_draft`
(
    `id`          bigint NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `type`        tinyint    DEFAULT '1' COMMENT '类型; 1:考评组 ',
    `union_id`    bigint NOT NULL COMMENT '关联id',
    `content`     text COMMENT '内容【json】',
    `yn`          tinyint(1) DEFAULT '1' COMMENT '逻辑删除',
    `create_time` datetime   DEFAULT NULL COMMENT '创建时间',
    `update_time` datetime   DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_0900_ai_ci COMMENT ='草稿';

SET FOREIGN_KEY_CHECKS = 1;