scrm组dj_smartcarlife_dml.sql 53.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
### 叶立庆 -----------------start-------------------

### 叶立庆 -----------------end---------------------

### 周海宝 -----------------start-------------------

INSERT INTO `dj_car_life_store_approve_scene` (`business_code`, `scene_type`, `base_scene_code`, `created_by`, `created_date`, `deleted_flag`)
SELECT
    `business_code`,
    `scene_type`,
    `base_scene_code`,
    `created_by`,
    `created_date`,
    'N'
FROM `dj_car_life_store_crebus_approve`
WHERE `base_scene_code` IS NOT NULL AND `base_scene_code` != '';

UPDATE `dj_car_life_storeapp_listra_party` tpd
JOIN `dj_car_life_store_crebus_approve` main
    ON tpd.`business_code` = main.`business_code`
SET tpd.`base_scene_code` = main.`base_scene_code`
WHERE tpd.`base_scene_code` IS NULL;

update dj_car_life_store_crebus_approve set deleted_flag = 'Y'  where system_status = 1;

INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('100101', 'JPSJ_HMZX_AITOWJ', '鸿蒙智行/AITO问界', '2691,2695,2806,2807,2697,2698,2740,2741,2797', NULL, 18.0000, 3, '门店主营品牌同时存在AITO问界和LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界中任意一个或多个', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('100101', 'JPSJ_HMZX', '鸿蒙智行', '2697,2698,2740,2741,2797', '2691,2695,2806,2807', 20.0000, 1, '门店主营品牌存在LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界中任意一个或多个,且不存在AITO问界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('100101', 'JPSJ_AITOWJ', 'AITO问界', '2691,2695,2806,2807', '2697,2698,2740,2741,2797', 15.0000, 2, '门店主营品牌存在AITO问界中任意一个或多个,且不存在LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('100101', NULL, '其他品牌', '', '', 22.0000, 10, '精品升级场景其他品牌默认值', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('100102', NULL, '次新车升配默认值', '', '', NULL, 1, '次新车升配场景默认值为空', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('100103', NULL, '售后众筹默认值', '', '', NULL, 1, '售后众筹场景默认值为空', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110101', NULL, '售前权益默认值', '', '', 13.6000, 1, '售前会员权益升级场景默认人员成本占比', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110102', NULL, '售后权益默认值', '', '', 13.6000, 1, '售后会员权益升级场景默认人员成本占比', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_WJ', '问界', '2691,2695,2806,2807', '2697,2698,2740,2741,2797', 3.5000, 1, '门店主营品牌存在AITO问界,且不存在LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_ZJXJZJSJ', '智界+享界+尊界+尚界', '2697,2698,2740,2741,2797', '2691,2695,2806,2807', 6.0000, 2, '门店主营品牌存在LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界,且不存在AITO问界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_HMXT', '鸿蒙体系', '2691,2695,2806,2807,2697,2698,2740,2741,2797', '', 4.0000, 3, '门店主营品牌同时存在AITO问界和LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_GAXM', '广爱项目', '1309,1549,1575,1777,2724,2725,2245,1455,1604,1673,2707,1300,1844,1782,2456,2649', '', 13.0000, 4, '门店主营品牌ID包含广汽本田/广汽丰田/广汽传祺/广汽埃安/雷克萨斯任一个', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_AWT', '阿维塔', '2351', '', 14.0000, 5, '门店一级主营品牌ID包含阿维塔', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_BJEH', '北汽极狐', '1698', '', 13.0000, 6, '门店一级主营品牌ID包含ARCFOX极狐', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_BYD', '比亚迪', '1525,1708,2479,2519,2850', '', 13.0000, 7, '门店一级主营品牌ID包含比亚迪', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_AUDI', '奥迪', '1687', '', 18.0000, 8, '门店一级主营品牌ID包含奥迪', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_JK', '极氪', '2288,2289', '', 6.0000, 9, '门店一级主营品牌ID包含极氪', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_BENZ', '奔驰', '1704', '', 13.0000, 10, '门店一级主营品牌ID包含奔驰', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_ZJQC', '智己', '2267,2268', '', 8.6000, 11, '门店一级主营品牌ID包含智己汽车', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_SMART', 'smart', '1460,1926', '', 16.0000, 12, '门店一级主营品牌ID包含smart', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_LPQC', '零跑', '1633,1863', '', 8.5000, 13, '门店一级主营品牌ID包含零跑汽车', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_TS_FCB', '腾势/方程豹', '1945,1327,2518,2657', '', 8.0000, 14, '门店一级主营品牌ID包含腾势或方程豹', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_LTQC', '岚图', '2187,2188', '', 4.5000, 15, '门店一级主营品牌ID包含岚图汽车', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_TANK', '坦克', '2292', '', 12.0000, 16, '门店一级主营品牌ID包含坦克', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', 'YB_BUICK', '别克', '1707', '', 14.0000, 17, '门店一级主营品牌ID包含别克', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110201', NULL, '其他', '', '', NULL, 100, '售前延保场景其他品牌,人员成本占比为空', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_WJ', '问界', '2691,2695,2806,2807', '2697,2698,2740,2741,2797', 3.5000, 1, '门店主营品牌存在AITO问界,且不存在LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_ZJXJZJSJ', '智界+享界+尊界+尚界', '2697,2698,2740,2741,2797', '2691,2695,2806,2807', 6.0000, 2, '门店主营品牌存在LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界,且不存在AITO问界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_HMXT', '鸿蒙体系', '2691,2695,2806,2807,2697,2698,2740,2741,2797', '', 4.0000, 3, '门店主营品牌同时存在AITO问界和LUXEED智界/MAEXTRO尊界/SAIC尚界/STELATO享界', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_GAXM', '广爱项目', '1309,1549,1575,1777,2724,2725,2245,1455,1604,1673,2707,1300,1844,1782,2456,2649', '', 13.0000, 4, '门店主营品牌ID包含广汽本田/广汽丰田/广汽传祺/广汽埃安/雷克萨斯任一个', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_AWT', '阿维塔', '2351', '', 14.0000, 5, '门店一级主营品牌ID包含阿维塔', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_BJEH', '北汽极狐', '1698', '', 13.0000, 6, '门店一级主营品牌ID包含ARCFOX极狐', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_BYD', '比亚迪', '1525,1708,2479,2519,2850', '', 13.0000, 7, '门店一级主营品牌ID包含比亚迪', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_AUDI', '奥迪', '1687', '', 18.0000, 8, '门店一级主营品牌ID包含奥迪', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_JK', '极氪', '2288,2289', '', 6.0000, 9, '门店一级主营品牌ID包含极氪', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_BENZ', '奔驰', '1704', '', 13.0000, 10, '门店一级主营品牌ID包含奔驰', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_ZJQC', '智己', '2267,2268', '', 8.6000, 11, '门店一级主营品牌ID包含智己汽车', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_SMART', 'smart', '1460,1926', '', 16.0000, 12, '门店一级主营品牌ID包含smart', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_LPQC', '零跑', '1633,1863', '', 8.5000, 13, '门店一级主营品牌ID包含零跑汽车', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_TS_FCB', '腾势/方程豹', '1945,1327,2518,2657', '', 8.0000, 14, '门店一级主营品牌ID包含腾势或方程豹', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_LTQC', '岚图', '2187,2188', '', 4.5000, 15, '门店一级主营品牌ID包含岚图汽车', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_TANK', '坦克', '2292', '', 12.0000, 16, '门店一级主营品牌ID包含坦克', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', 'YB_BUICK', '别克', '1707', '', 14.0000, 17, '门店一级主营品牌ID包含别克', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');
INSERT INTO dj_car_life_storeapp_personnel_rate_rule
(base_scene_code, brand_group_code, brand_group_name, brand_list, exclude_brand_list, personnel_cost_rate, priority, rule_desc, enabled, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES('110202', NULL, '其他', '', '', NULL, 100, '售后延保场景其他品牌,人员成本占比为空', 1, 'system', '2026-07-08 20:37:44', NULL, NULL, 'N');


INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_RATE_001', '整车延保渗透率', 1, '比例', 1, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_RATE_002', '安心包渗透率', 1, '比例', 2, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_RATE_003', '电池渗透率', 1, '比例', 3, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_RATE_004', '轮胎渗透率', 1, '比例', 4, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_CONV_001', '整车延保触客转化率', 1, '比例', 5, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_CONV_002', '安心包触客转化率', 1, '比例', 6, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_CONV_003', '电池触客转化率', 1, '比例', 7, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(1, '延保', 'WR_CONV_004', '轮胎触客转化率', 1, '比例', 8, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(2, '权益', 'BE_CONV_001', '触客转化率', 1, '比例', 1, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(3, '轻改', 'LM_PROFIT_001', '单车利润', 2, '数值', 1, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(3, '轻改', 'LM_COST_001', '车窗膜单车采购成本', 2, '数值', 2, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(3, '轻改', 'LM_COST_002', '车身膜单车采购成本', 2, '数值', 3, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(3, '轻改', 'LM_COST_003', '精品附件单车采购成本', 2, '数值', 4, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(3, '轻改', 'LM_ECO_001', '车窗膜生态系数', 2, '数值', 5, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(3, '轻改', 'LM_ECO_002', '车身膜生态系数', 2, '数值', 6, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
INSERT INTO dj_car_life_storeapp_metric_config
(business_type, business_type_name, metric_code, metric_name, data_type, data_type_name, sort_order, status, created_by, created_date, updated_by, updated_date, deleted_flag)
VALUES(3, '轻改', 'LM_ECO_003', '精品附件生态系数', 2, '数值', 7, 'Y', 'system', '2026-07-14 15:56:29', 'system', '2026-07-14 15:56:29', 'N');
### 周海宝 -----------------end---------------------

### 周立明 -----------------start-------------------
INSERT INTO dj_car_life_fee_category 
(id, application_object_type, application_object_name,fee_category_type, form_type, source_type, created_by,created_date, updated_by, updated_date, deleted_flag)VALUES 
(1401, 3, '公共', 1, 1, 2, 'system', now(), 'system', now(), 'N'),
(1402, 3, '公共', 1, 1, 2, 'system', now(), 'system', now(), 'N'),
(1403, 3, '公共', 1, 1, 2, 'system', now(), 'system', now(), 'N'),
(1404, 3, '公共', 1, 1, 2, 'system', now(), 'system', now(), 'N');


INSERT INTO dj_car_life_fee_category_name 
(id, fee_category_id, fee_category_name, node_type, parent_id,category_to_sort, created_by, created_date, updated_by, updated_date,deleted_flag)VALUES 
(1401, 1401, '其他费用1', 1, null, 1, 'system', now(), 'system', now(), 'N'),
(1402, 1402, '其他费用2', 1, null, 2, 'system', now(), 'system', now(), 'N'),
(1403, 1403, '其他费用3', 1, null, 3, 'system', now(), 'system', now(), 'N'),
(1404, 1404, '其他费用4', 1, null, 4, 'system', now(), 'system', now(), 'N');



INSERT INTO dj_car_life_fee_category_scene 
(fee_category_id,base_scene_code, application_scene_type,application_scene_name, created_by, created_date,updated_by, updated_date, deleted_flag)VALUES 
(1401, '100101',1, '1.1', 'system', now(), 'system', now(), 'N'),
(1401, '110101',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1401, '110102',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1401, '110201',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1401, '110202',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1401, '100102',2, '1.2', 'system', now(), 'system', now(), 'N'),
(1401, '100103',3, '1.3', 'system', now(), 'system', now(), 'N'),

(1402, '100101',1, '1.1', 'system', now(), 'system', now(), 'N'),
(1402, '110101',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1402, '110102',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1402, '110201',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1402, '110202',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1402, '100102',2, '1.2', 'system', now(), 'system', now(), 'N'),
(1402, '100103',3, '1.3', 'system', now(), 'system', now(), 'N'),

(1403, '100101',1, '1.1', 'system', now(), 'system', now(), 'N'),
(1403, '110101',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1403, '110102',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1403, '110201',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1403, '110202',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1403, '100102',2, '1.2', 'system', now(), 'system', now(), 'N'),
(1403, '100103',3, '1.3', 'system', now(), 'system', now(), 'N'),

(1404, '100101',1, '1.1', 'system', now(), 'system', now(), 'N'),
(1404, '110101',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1404, '110102',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1404, '110201',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1404, '110202',0, '2.1', 'system', now(), 'system', now(), 'N'),
(1404, '100102',2, '1.2', 'system', now(), 'system', now(), 'N'),
(1404, '100103',3, '1.3', 'system', now(), 'system', now(), 'N');


INSERT INTO dj_car_life_fee_category_scene 
(fee_category_id,base_scene_code, application_scene_type,application_scene_name, created_by, created_date,updated_by, updated_date, deleted_flag)
SELECT fc.id, '100102',2, '1.2', 'system', now(), 'system', now(), 'N'
from dj_car_life_fee_category fc
where fc.deleted_flag='N' and not EXISTS (
select 1 from dj_car_life_fee_category_scene fds where fc.id = fds.fee_category_id and fds.deleted_flag ='N' and fds.base_scene_code in (100102)
) and EXISTS (
select 1 from dj_car_life_fee_category_scene fds where fc.id = fds.fee_category_id and fds.deleted_flag ='N'
) ;


INSERT INTO dj_car_life_fee_category_scene 
(fee_category_id,base_scene_code, application_scene_type,application_scene_name, created_by, created_date,updated_by, updated_date, deleted_flag)
SELECT fc.id,'100103',3, '1.3', 'system', now(), 'system', now(), 'N'
from dj_car_life_fee_category fc
where fc.deleted_flag='N' and not EXISTS (
select 1 from dj_car_life_fee_category_scene fds where fc.id = fds.fee_category_id and fds.deleted_flag ='N' and fds.base_scene_code in (100103)
) and EXISTS (
select 1 from dj_car_life_fee_category_scene fds where fc.id = fds.fee_category_id and fds.deleted_flag ='N'
) ;

### 周立明 -----------------end---------------------


### 范富荣 -----------------start-------------------

### 范富荣 -----------------end---------------------

### 林永健 -----------------start-------------------

-- 从 early_warning_threshold_config 同步兜底指标到 dj_car_life_merchant_guarantee
INSERT INTO dj_smartcarlife.dj_car_life_merchant_guarantee
    (base_scene_code, bizs, guarantee_index, guarantee_standard, merchant_id, compensation_mode, data_type, created_by, created_date, deleted_flag)
-- 延保转化率 WR_CONV_001
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_CONV_001' AS guarantee_index, ew_con_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND ew_con_rate IS NOT null
UNION ALL
-- 延保安心包转化率 WR_CONV_002
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_CONV_002' AS guarantee_index, ew_axb_con_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND ew_axb_con_rate IS NOT null
UNION ALL
-- 延保轮胎转化率 WR_CONV_004
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_CONV_004' AS guarantee_index, ew_lt_con_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND ew_lt_con_rate IS NOT null
UNION ALL
-- 延保电池转化率 WR_CONV_003
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_CONV_003' AS guarantee_index, battery_conversion_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND battery_conversion_rate IS NOT null
UNION ALL
-- 延保渗透率 WR_RATE_001
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_RATE_001' AS guarantee_index, ew_penetration_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND ew_penetration_rate IS NOT null
UNION ALL
-- 延保安心包渗透率 WR_RATE_002
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_RATE_002' AS guarantee_index, ew_axb_penetration_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND ew_axb_penetration_rate IS NOT null
UNION ALL
-- 延保轮胎渗透率 WR_RATE_004
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_RATE_004' AS guarantee_index, ew_lt_penetration_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND ew_lt_penetration_rate IS NOT null
UNION ALL
-- 延保电池渗透率 WR_RATE_003
SELECT
    '110201' AS base_scene_code, 1 AS bizs, 'WR_RATE_003' AS guarantee_index, battery_penetration_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND battery_penetration_rate IS NOT null
UNION ALL
-- 权益转化率 BE_CONV_001(触客转化率)
SELECT
    '110101' AS base_scene_code, 3 AS bizs, 'BE_CONV_001' AS guarantee_index, ri_con_rate AS guarantee_standard,
    merchant_no AS merchant_id, 0 AS compensation_mode, 1 AS data_type, created_by, created_date, deleted_flag
FROM dj_smartcarlife.early_warning_threshold_config WHERE deleted_flag = 'N' AND merchant_no IS NOT null
AND ri_con_rate IS NOT null
;

### 林永健 -----------------end---------------------

### 谢海旭 -----------------start-------------------
INSERT INTO `dj_car_life_dict` (`business_code`, `type_code`, `type_name`, `item_name`, `item_value`, `sort_order`, `created_by`, `created_date`, `updated_by`, `updated_date`, `deleted_flag`)
    VALUES ('recruitment', 'business_type', '业务类型', '安心包专岗', '11', '11', 'admin', now(), 'admin', now(), 'N');


INSERT INTO `dj_car_life_recruitment_province_hrbp_relation`
(`business_type`, `business_type_name`, `is_all_province`, `province_name`, `province_code`, `hrbp_name`, `hrbp_phone`, `created_by`, `updated_by`, `created_date`, `updated_date`)
VALUES
-- =================================================================================
-- 1. 安心包专岗业务 (业务类型: 11-安心包专岗)
-- =================================================================================
-- 华北 (张欣)
('11', '安心包专岗', 0, '北京市', '110000', '张欣', '15754904616', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '天津市', '120000', '张欣', '15754904616', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '河北省', '130000', '张欣', '15754904616', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '山东省', '370000', '张欣', '15754904616', 'admin', 'admin', NOW(), NOW()),
-- 华中 (吴雨晴)
('11', '安心包专岗', 0, '湖北省', '420000', '吴雨晴', '15827139903', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '湖南省', '430000', '吴雨晴', '15827139903', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '安徽省', '340000', '吴雨晴', '15827139903', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '江西省', '360000', '吴雨晴', '15827139903', 'admin', 'admin', NOW(), NOW()),
-- 华东 (黄敏)
('11', '安心包专岗', 0, '浙江省', '330000', '黄敏', '15213642943', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '江苏省', '320000', '黄敏', '15213642943', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '上海市', '310000', '黄敏', '15213642943', 'admin', 'admin', NOW(), NOW()),
-- 河南、山西 (毛亚阁)
('11', '安心包专岗', 0, '河南省', '410000', '毛亚阁', '18337408707', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '山西省', '140000', '毛亚阁', '18337408707', 'admin', 'admin', NOW(), NOW()),
-- 东北 (邓嘉铭)
('11', '安心包专岗', 0, '黑龙江省', '230000', '邓嘉铭', '13229602976', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '吉林省', '220000', '邓嘉铭', '13229602976', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '辽宁省', '210000', '邓嘉铭', '13229602976', 'admin', 'admin', NOW(), NOW()),
-- 西南 (苏晨珂)
('11', '安心包专岗', 0, '云南省', '530000', '苏晨珂', '15198034209', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '贵州省', '520000', '苏晨珂', '15198034209', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '四川省', '510000', '苏晨珂', '15198034209', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '重庆市', '500000', '苏晨珂', '15198034209', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '陕西省', '610000', '苏晨珂', '15198034209', 'admin', 'admin', NOW(), NOW()),
-- 西北、新疆 (魏文瑞)
('11', '安心包专岗', 0, '甘肃省', '620000', '魏文瑞', '15825385517', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '青海省', '630000', '魏文瑞', '15825385517', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '宁夏回族自治区', '640000', '魏文瑞', '15825385517', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '西藏自治区', '540000', '魏文瑞', '15825385517', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '内蒙古自治区', '150000', '魏文瑞', '15825385517', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '新疆维吾尔自治区', '650000', '魏文瑞', '15825385517', 'admin', 'admin', NOW(), NOW()),
-- 华南 (胡其玲)
('11', '安心包专岗', 0, '广东省', '440000', '胡其玲', '15610458251', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '广西壮族自治区', '450000', '胡其玲', '15610458251', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '海南省', '460000', '胡其玲', '15610458251', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '福建省', '350000', '胡其玲', '15610458251', 'admin', 'admin', NOW(), NOW()),
-- 港澳台 (高天艺)
('11', '安心包专岗', 0, '香港特别行政区', '810000', '高天艺', '13113659794', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '澳门特别行政区', '820000', '高天艺', '13113659794', 'admin', 'admin', NOW(), NOW()),
('11', '安心包专岗', 0, '台湾省', '710000', '高天艺', '13113659794', 'admin', 'admin', NOW(), NOW());

### 谢海旭 -----------------end---------------------

### 杨卫 -----------------start--------------------
-- 兜底预警规则修改,测试、生成环境id一样
-- 电池渗透率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":5,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_RATE_003'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 8;
-- 轮胎渗透率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":6,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_RATE_004'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 7;
-- 安心包渗透率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":4,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_RATE_002'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 6;
-- 整车延保渗透率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":3,"metricName":"渗透率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_RATE_001'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 5;
-- 电池转化率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":10,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_CONV_003'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 4;
-- 轮胎转化率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":11,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_CONV_004'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 3;
-- 安心包转化率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":9,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_CONV_002'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 2;
-- 整车延保转化率
update pg_warning_config set rule_json = '[{"sortNo":1,"metricId":8,"metricName":"转化率","operator":"<=","threshold":{"type":2,"value":"select t.merchant_id as merchant_id4s, t.guarantee_standard as config_value from dj_car_life_merchant_guarantee t where t.guarantee_index = ''WR_CONV_001'' and t.base_scene_code = ''110201'' and t.deleted_flag = ''N'';","valueField":"config_value"},"nextLogic":null}]'
where id = 1;

### 杨卫 -----------------end----------------------


### 黄炜 -----------------start--------------------
UPDATE dj_car_life_province_organization
SET regional_operations_two_one = regional_operations,
    regional_operations_two_three = regional_operations,
    regional_operations_two_one_name = regional_operations_name,
    regional_operations_two_three_name = regional_operations_name,
    updated_date = NOW()
WHERE
    deleted_flag = 'N'
AND regional_operations IS NOT NULL
AND regional_operations <> '';


### 黄炜 -----------------end--------------------


### 陈希 -----------------start-------------------


----------------------dev   start-------------------

  -- Step 1: 所有历史未删除记录先刷为 0(自定义成本)
UPDATE dj_car_life_merchant_goods_info
SET product_cost_type = 0
WHERE deleted_flag = 'N';

-- Step 2: 自营(供应商={SELF_OPERATED_SUPPLIER_ID})权益/延保刷为 1(产品自动带入成本)
UPDATE dj_car_life_merchant_goods_info mgi
    JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N'
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    SET mgi.product_cost_type = 1, mgi.updated_by = 'cx_260728上线刷数据SQL', mgi.updated_date = now()
WHERE mgi.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (73,102,146,158,114);
-- 占位: {EQUITY_TYPE_IDS} → smartcarlife.goodsType.equity 配置值, 默认 126
-- 占位: {EXTENDED_INSURANCE_TYPE_IDS} → smartcarlife.goodsType.extendedInsurance 配置值, 默认 1

update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set ug.purchase_cost = dj_cost, ug.operation_coefficient = 1, ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (73,102,146,158,114);


update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set  ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (73,102,146,158,114);


-----------------dev   end-------------------

----------------------test   start-------------------

-- Step 1: 所有历史未删除记录先刷为 0(自定义成本)
UPDATE dj_car_life_merchant_goods_info
SET product_cost_type = 0
WHERE deleted_flag = 'N';

-- Step 2: 自营(供应商={SELF_OPERATED_SUPPLIER_ID})权益/延保刷为 1(产品自动带入成本)
UPDATE dj_car_life_merchant_goods_info mgi
    JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N'
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    SET mgi.product_cost_type = 1, mgi.updated_by = 'cx_260728上线刷数据SQL', mgi.updated_date = now()
WHERE mgi.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (105,109,110,111,112,113,121,125,200,228,267,159);
-- 占位: {EQUITY_TYPE_IDS} → smartcarlife.goodsType.equity 配置值, 默认 126
-- 占位: {EXTENDED_INSURANCE_TYPE_IDS} → smartcarlife.goodsType.extendedInsurance 配置值, 默认 1


update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set ug.purchase_cost = dj_cost, ug.operation_coefficient = 1, ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (105,109,110,111,112,113,121,125,200,228,267,159);


update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set  ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (105,109,110,111,112,113,121,125,200,228,267,159);

-----------------test   end-------------------


----------------------beta   start-------------------

-- Step 1: 所有历史未删除记录先刷为 0(自定义成本)
UPDATE dj_car_life_merchant_goods_info
SET product_cost_type = 0
WHERE deleted_flag = 'N';

-- Step 2: 自营(供应商={SELF_OPERATED_SUPPLIER_ID})权益/延保刷为 1(产品自动带入成本)
UPDATE dj_car_life_merchant_goods_info mgi
    JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N'
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    SET mgi.product_cost_type = 1, mgi.updated_by = 'cx_260728上线刷数据SQL', mgi.updated_date = now()
WHERE mgi.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (107,109,113);
-- 占位: {EQUITY_TYPE_IDS} → smartcarlife.goodsType.equity 配置值, 默认 126
-- 占位: {EXTENDED_INSURANCE_TYPE_IDS} → smartcarlife.goodsType.extendedInsurance 配置值, 默认 1


update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set ug.purchase_cost = dj_cost, ug.operation_coefficient = 1, ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (107,109,113);


update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set  ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (107,109,113);

-----------------beta   end-------------------

----------------------pro   start-------------------

-- Step 1: 所有历史未删除记录先刷为 0(自定义成本)
UPDATE dj_car_life_merchant_goods_info
SET product_cost_type = 0
WHERE deleted_flag = 'N';

-- Step 2: 自营(供应商={SELF_OPERATED_SUPPLIER_ID})权益/延保刷为 1(产品自动带入成本)
UPDATE dj_car_life_merchant_goods_info mgi
    JOIN dj_car_life_upgrade_goods ug ON ug.id = mgi.upgrade_goods_id AND ug.deleted_flag = 'N'
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    SET mgi.product_cost_type = 1, mgi.updated_by = 'cx_260728上线刷数据SQL', mgi.updated_date = now()
WHERE mgi.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (104,126, 155);
-- 占位: {EQUITY_TYPE_IDS} → smartcarlife.goodsType.equity 配置值, 默认 126
-- 占位: {EXTENDED_INSURANCE_TYPE_IDS} → smartcarlife.goodsType.extendedInsurance 配置值, 默认 1

update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set ug.purchase_cost = dj_cost, ug.operation_coefficient = 1, ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (104,126, 155);


update
    dj_car_life_upgrade_goods ug
    JOIN dj_car_life_goods_info gi ON gi.goods_code = ug.goods_code AND gi.deleted_flag = 'N'
    set  ug.operation_cost = ug.purchase_cost * ug.operation_coefficient,
        ug.updated_by = 'cx_260728上线刷数据SQL', ug.updated_date = now()
WHERE  ug.deleted_flag = 'N'
  AND gi.supplier_code = '12'   -- 占位: supplier_glzy_id 配置值, 默认 '12'
  AND gi.goods_type IN (104,126, 155);

-----------------pro   end-------------------


### 陈希 -----------------end---------------------


### 崔彦峰 -----------------start---------------------

#修改单店模式的数据为1  类型(上架方式):1-新增 2-修改
UPDATE dj_car_life_goods_listing_product_base b
    INNER JOIN dj_car_life_goods_listing_approval a ON b.business_code = a.business_code
    SET b.shelf_style = 1,
        b.updated_by = 'SYSTEM_UPDATE_SHELF_STYLE'
WHERE
    a.shelf_type = 1
  AND a.deleted_flag = 'N' -- 审批单未删除
  AND b.deleted_flag = 'N';-- 产品数据未删除

#修改是否作为赠送成本
UPDATE dj_car_life_goods_listing_product_base b
    JOIN dj_car_life_goods_listing_product_detail d ON b.id = d.product_base_id
    SET b.is_gift_cost = 'Y' ,
        b.updated_by = 'SYSTEM_UPDATE_IS_GIFT_COST'
WHERE
    b.product_type = 1
  AND b.deleted_flag = 'N'
  AND d.deleted_flag = 'N'
  AND d.gift_cost IS NOT NULL;



#初始化精品数据产品成本获取方式为1-自定义成本
UPDATE dj_car_life_goods_listing_product_detail d
    JOIN dj_car_life_goods_listing_approval a ON d.business_code = a.business_code
    SET d.upgrade_product_cost_style = 1
WHERE
    d.deleted_flag = 'N'
  AND a.deleted_flag = 'N'
  AND a.base_scene_code = '100101';


#初始化权益延保类数据第三方成本获取方式为1-自定义成本
UPDATE dj_car_life_goods_listing_product_detail d
    JOIN dj_car_life_goods_listing_approval a ON d.business_code = a.business_code
    SET d.third_party_cost_style = 1
WHERE
    d.deleted_flag = 'N'
  AND a.deleted_flag = 'N'
  AND a.base_scene_code IN ( '110101', '110102', '110201', '110202' );

### 崔彦峰 -----------------end---------------------

### 王璐琦 -----------------start-------------------
UPDATE dj_car_life_daily_report_record
SET submission_status = 1,
    submission_date = created_date
WHERE report_status = 1 and template_type = 2 and deleted_flag = 'N';
### 王璐琦 -----------------end---------------------