USE ccdi;

CREATE TABLE IF NOT EXISTS `ccdi_asset_info` (
  `asset_id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '资产ID',
  `family_id` VARCHAR(18) NOT NULL COMMENT '归属员工身份证号',
  `person_id` VARCHAR(18) NOT NULL COMMENT '资产实际持有人身份证号',
  `asset_main_type` VARCHAR(20) NOT NULL COMMENT '资产大类',
  `asset_sub_type` VARCHAR(50) NOT NULL COMMENT '资产小类',
  `asset_name` VARCHAR(200) NOT NULL COMMENT '资产名称',
  `ownership_ratio` DECIMAL(5,2) DEFAULT NULL COMMENT '产权占比',
  `purchase_eval_date` DATE DEFAULT NULL COMMENT '购买/评估日期',
  `original_value` DECIMAL(15,2) DEFAULT NULL COMMENT '资产原值',
  `current_value` DECIMAL(15,2) NOT NULL COMMENT '当前估值',
  `valuation_date` DATE DEFAULT NULL COMMENT '估值截止日期',
  `asset_status` VARCHAR(10) NOT NULL COMMENT '资产状态',
  `remarks` VARCHAR(500) DEFAULT NULL COMMENT '备注',
  `create_by` VARCHAR(64) DEFAULT '' COMMENT '创建者',
  `create_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_by` VARCHAR(64) DEFAULT '' COMMENT '更新者',
  `update_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`asset_id`),
  KEY `idx_family_id` (`family_id`),
  KEY `idx_person_id` (`person_id`),
  KEY `idx_asset_main_type` (`asset_main_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='员工资产信息表';
