-- 就业援助管理列表视图（达梦数据库版）
-- 将 employment_assistance 和 personal_info 的关联查询封装为视图
-- 创建前先删除已存在的同名视图（兼容重复执行）
DROP VIEW IF EXISTS v_employment_assistance_list;

CREATE VIEW v_employment_assistance_list AS
SELECT
    ea.id,
    ea.personal_id,
    ea.province_record_id,
    ea.apply_number,
    ea.aid_type,
    ea.aid_status,
    ea.last_notice_time,
    pi.full_name,
    pi.gender,
    pi.education,
    pi.household_location,
    pi.contact_phone
FROM employment_assistance ea
LEFT JOIN personal_info pi ON ea.personal_id = pi.id;
