-- 补齐实体缺失字段的DDL语句

-- PmsReport
ALTER TABLE pms_report ADD COLUMN prj_id BIGINT COMMENT '项目ID';
ALTER TABLE pms_report ADD COLUMN prj_name VARCHAR(200) COMMENT '项目名称';
ALTER TABLE pms_report ADD COLUMN num BIGINT COMMENT '报告编号';
ALTER TABLE pms_report ADD COLUMN tm DATETIME COMMENT '报告时间';
ALTER TABLE pms_report ADD COLUMN addr VARCHAR(500) COMMENT '报告地点';
ALTER TABLE pms_report ADD COLUMN rpt_user VARCHAR(100) COMMENT '报告人';
ALTER TABLE pms_report ADD COLUMN rpt_date DATE COMMENT '报告日期';
ALTER TABLE pms_report ADD COLUMN view_num BIGINT DEFAULT 0 COMMENT '浏览次数';
ALTER TABLE pms_report ADD COLUMN down_num BIGINT DEFAULT 0 COMMENT '下载次数';

-- PmsContact
ALTER TABLE pms_contact ADD COLUMN prj_id BIGINT COMMENT '项目ID';
ALTER TABLE pms_contact ADD COLUMN unit_type VARCHAR(50) COMMENT '单位类型';
ALTER TABLE pms_contact ADD COLUMN unit_name VARCHAR(200) COMMENT '单位名称';
ALTER TABLE pms_contact ADD COLUMN position VARCHAR(100) COMMENT '职位';
ALTER TABLE pms_contact ADD COLUMN note VARCHAR(500) COMMENT '备注';

-- PmsContract
ALTER TABLE pms_contract ADD COLUMN con_pid BIGINT COMMENT '父合同ID';
ALTER TABLE pms_contract ADD COLUMN con_stdt DATE COMMENT '合同开始日期';
ALTER TABLE pms_contract ADD COLUMN con_eddt DATE COMMENT '合同结束日期';
ALTER TABLE pms_contract ADD COLUMN con_note VARCHAR(1000) COMMENT '合同备注';

-- PmsProject
ALTER TABLE pms_project ADD COLUMN prj_pid BIGINT COMMENT '父项目ID';
ALTER TABLE pms_project ADD COLUMN if_ztb VARCHAR(10) COMMENT '是否招标';
ALTER TABLE pms_project ADD COLUMN opt_user VARCHAR(100) COMMENT '操作人';
ALTER TABLE pms_project ADD COLUMN opt_date DATETIME COMMENT '操作时间';

-- PmsContractBill
ALTER TABLE pms_contract_bill ADD COLUMN bill_user VARCHAR(100) COMMENT '开票人';
ALTER TABLE pms_contract_bill ADD COLUMN bill_state VARCHAR(50) COMMENT '开票状态';
ALTER TABLE pms_contract_bill ADD COLUMN opt_user VARCHAR(100) COMMENT '操作人ID';
ALTER TABLE pms_contract_bill ADD COLUMN opt_date DATETIME COMMENT '操作时间';
ALTER TABLE pms_contract_bill ADD COLUMN opt_name VARCHAR(100) COMMENT '操作人姓名';
ALTER TABLE pms_contract_bill ADD COLUMN bill_title VARCHAR(200) COMMENT '发票标题';
ALTER TABLE pms_contract_bill ADD COLUMN bill_text VARCHAR(1000) COMMENT '发票内容';

-- PmsContractFee
ALTER TABLE pms_contract_fee ADD COLUMN fee_type VARCHAR(50) COMMENT '费用类型';
ALTER TABLE pms_contract_fee ADD COLUMN fee_date DATE COMMENT '费用日期';
ALTER TABLE pms_contract_fee ADD COLUMN fee_note VARCHAR(500) COMMENT '费用备注';
ALTER TABLE pms_contract_fee ADD COLUMN opt_user VARCHAR(100) COMMENT '操作人ID';
ALTER TABLE pms_contract_fee ADD COLUMN opt_date DATETIME COMMENT '操作时间';
ALTER TABLE pms_contract_fee ADD COLUMN opt_name VARCHAR(100) COMMENT '操作人姓名';

-- PmsContractPayment
ALTER TABLE pms_contract_payment ADD COLUMN pay_type VARCHAR(50) COMMENT '支付类型';
ALTER TABLE pms_contract_payment ADD COLUMN pay_state VARCHAR(50) COMMENT '支付状态';
ALTER TABLE pms_contract_payment ADD COLUMN fee_note VARCHAR(500) COMMENT '费用备注';
ALTER TABLE pms_contract_payment ADD COLUMN opt_user VARCHAR(100) COMMENT '操作人ID';
ALTER TABLE pms_contract_payment ADD COLUMN opt_name VARCHAR(100) COMMENT '操作人姓名';
ALTER TABLE pms_contract_payment ADD COLUMN opt_date DATETIME COMMENT '操作时间';

-- PmsPhaseLog
ALTER TABLE pms_phase_log ADD COLUMN prj_id BIGINT COMMENT '项目ID';
ALTER TABLE pms_phase_log ADD COLUMN rcd_date DATE COMMENT '记录日期';
ALTER TABLE pms_phase_log ADD COLUMN rcd_ratio DECIMAL(5,2) COMMENT '完成比例';
ALTER TABLE pms_phase_log ADD COLUMN rcd_user VARCHAR(100) COMMENT '记录人ID';
ALTER TABLE pms_phase_log ADD COLUMN rcd_name VARCHAR(100) COMMENT '记录人姓名';

-- PmsPhaseTask
ALTER TABLE pms_phase_task ADD COLUMN prj_id BIGINT COMMENT '项目ID';
ALTER TABLE pms_phase_task ADD COLUMN plan_start DATE COMMENT '计划开始日期';
ALTER TABLE pms_phase_task ADD COLUMN plan_end DATE COMMENT '计划结束日期';
ALTER TABLE pms_phase_task ADD COLUMN recipient_id VARCHAR(100) COMMENT '接收人ID';
ALTER TABLE pms_phase_task ADD COLUMN task_seq BIGINT COMMENT '任务序号';
ALTER TABLE pms_phase_task ADD COLUMN audit_id VARCHAR(100) COMMENT '审核人ID';
ALTER TABLE pms_phase_task ADD COLUMN audit_name VARCHAR(100) COMMENT '审核人姓名';

-- PmsMeeting
ALTER TABLE pms_meeting ADD COLUMN prj_name VARCHAR(200) COMMENT '项目名称';
ALTER TABLE pms_meeting ADD COLUMN enter_into VARCHAR(1000) COMMENT '签到信息';
ALTER TABLE pms_meeting ADD COLUMN view_num BIGINT DEFAULT 0 COMMENT '浏览次数';

-- PmsPhase
ALTER TABLE pms_phase ADD COLUMN paz_note VARCHAR(500) COMMENT '阶段备注';
ALTER TABLE pms_phase ADD COLUMN state_note VARCHAR(200) COMMENT '状态说明';
ALTER TABLE pms_phase ADD COLUMN duty_uname VARCHAR(100) COMMENT '责任人姓名';

-- PmsCompany
ALTER TABLE pms_company ADD COLUMN note VARCHAR(500) COMMENT '备注';

-- PmsAccessory
ALTER TABLE pms_accessory ADD COLUMN prj_id BIGINT COMMENT '项目ID';
ALTER TABLE pms_accessory ADD COLUMN file_viewname VARCHAR(200) COMMENT '显示文件名';
ALTER TABLE pms_accessory ADD COLUMN file_savename VARCHAR(200) COMMENT '存储文件名';
ALTER TABLE pms_accessory ADD COLUMN file_date DATETIME COMMENT '文件日期';
ALTER TABLE pms_accessory ADD COLUMN opt_user VARCHAR(100) COMMENT '操作人ID';
ALTER TABLE pms_accessory ADD COLUMN opt_name VARCHAR(100) COMMENT '操作人姓名';