START TRANSACTION;

DELETE FROM ccdi_purchase_transaction
WHERE purchase_id = 'LSFXMOCKP2PUR001';

INSERT INTO ccdi_purchase_transaction (
  purchase_id,
  purchase_category,
  project_name,
  subject_name,
  subject_desc,
  purchase_qty,
  budget_amount,
  bid_amount,
  actual_amount,
  contract_amount,
  settlement_amount,
  purchase_method,
  supplier_name,
  contact_person,
  contact_phone,
  supplier_uscc,
  supplier_bank_account,
  apply_date,
  plan_approve_date,
  announce_date,
  bid_open_date,
  contract_sign_date,
  expected_delivery_date,
  actual_delivery_date,
  acceptance_date,
  settlement_date,
  applicant_id,
  applicant_name,
  apply_department,
  purchase_leader_id,
  purchase_leader_name,
  purchase_department,
  created_by,
  updated_by
)
SELECT
  'LSFXMOCKP2PUR001',
  '设备采购',
  'LSFX Mock P2',
  '可疑采购基线',
  '用于命中 SUPPLIER_CONCENTRATION 真实规则',
  1,
  188000.00,
  186000.00,
  186000.00,
  186000.00,
  186000.00,
  '竞争性谈判',
  '兰溪市联调供应链有限公司',
  '联调联系人',
  '13800000000',
  '91330781P2PUR00011',
  '6222000000001234',
  CURRENT_DATE,
  CURRENT_DATE,
  CURRENT_DATE,
  CURRENT_DATE,
  CURRENT_DATE,
  CURRENT_DATE,
  CURRENT_DATE,
  CURRENT_DATE,
  CURRENT_DATE,
  CAST(s.staff_id AS CHAR),
  s.name,
  '纪检初核部',
  NULL,
  NULL,
  NULL,
  'admin',
  'admin'
FROM ccdi_base_staff s
WHERE COALESCE(TRIM(s.id_card), '') <> ''
  AND COALESCE(TRIM(CAST(s.staff_id AS CHAR)), '') <> ''
  AND COALESCE(TRIM(s.name), '') <> ''
LIMIT 1;

DELETE FROM ccdi_asset_info
WHERE asset_name = 'LSFX Mock P2 HOUSE_REGISTRATION_MISMATCH';

INSERT INTO ccdi_asset_info (
  family_id,
  person_id,
  asset_main_type,
  asset_sub_type,
  asset_name,
  ownership_ratio,
  purchase_eval_date,
  original_value,
  current_value,
  valuation_date,
  asset_status,
  remarks,
  create_by,
  update_by
)
VALUES (
  '330101198801010011',
  '330101198801010011',
  '房产',
  '商铺',
  'LSFX Mock P2 HOUSE_REGISTRATION_MISMATCH',
  100.00,
  CURRENT_DATE,
  1880000.00,
  1880000.00,
  CURRENT_DATE,
  '正常',
  '用于命中 HOUSE_REGISTRATION_MISMATCH 真实规则的第二期基线',
  'admin',
  'admin'
);

DELETE FROM ccdi_asset_info
WHERE asset_name = 'LSFX Mock P2 PROPERTY_FEE_REGISTRATION_MISMATCH';

INSERT INTO ccdi_asset_info (
  family_id,
  person_id,
  asset_main_type,
  asset_sub_type,
  asset_name,
  ownership_ratio,
  purchase_eval_date,
  original_value,
  current_value,
  valuation_date,
  asset_status,
  remarks,
  create_by,
  update_by
)
VALUES (
  '330101198801010011',
  '330101199001010022',
  '房产',
  '商铺',
  'LSFX Mock P2 PROPERTY_FEE_REGISTRATION_MISMATCH',
  100.00,
  CURRENT_DATE,
  1880000.00,
  1880000.00,
  CURRENT_DATE,
  '正常',
  '用于命中 PROPERTY_FEE_REGISTRATION_MISMATCH 真实规则的第二期基线',
  'admin',
  'admin'
);

DELETE FROM ccdi_asset_info
WHERE asset_name = 'LSFX Mock P2 TAX_ASSET_REGISTRATION_MISMATCH';

INSERT INTO ccdi_asset_info (
  family_id,
  person_id,
  asset_main_type,
  asset_sub_type,
  asset_name,
  ownership_ratio,
  purchase_eval_date,
  original_value,
  current_value,
  valuation_date,
  asset_status,
  remarks,
  create_by,
  update_by
)
VALUES (
  '330101198801010011',
  '330101199202020044',
  '房产',
  '商铺',
  'LSFX Mock P2 TAX_ASSET_REGISTRATION_MISMATCH',
  100.00,
  CURRENT_DATE,
  1880000.00,
  1880000.00,
  CURRENT_DATE,
  '正常',
  '用于命中 TAX_ASSET_REGISTRATION_MISMATCH 真实规则的第二期基线',
  'admin',
  'admin'
);

COMMIT;
