feat: add recruitment fair participant export

This commit is contained in:
2026-07-23 18:35:18 +08:00
parent 3f11837e94
commit e558e70b45
7 changed files with 1013 additions and 0 deletions

View File

@@ -0,0 +1,278 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.cms.mapper.RecruitmentFairExportMapper">
<sql id="publicFairWhere">
pf.del_flag = '0'
<if test="query.title != null and query.title != ''">
AND pf.job_fair_title LIKE CONCAT('%', CAST(#{query.title, jdbcType=VARCHAR} AS VARCHAR), '%')
</if>
<if test="query.hostUnit != null and query.hostUnit != ''">
AND pf.job_fair_host_unit LIKE CONCAT('%', CAST(#{query.hostUnit, jdbcType=VARCHAR} AS VARCHAR), '%')
</if>
<if test="query.fairType != null and query.fairType != ''">
AND pf.job_fair_type = #{query.fairType}
</if>
<if test="query.region != null and query.region != ''">
AND pf.job_fair_region_type = #{query.region}
</if>
<if test="query.address != null and query.address != ''">
AND pf.job_fair_address LIKE CONCAT('%', CAST(#{query.address, jdbcType=VARCHAR} AS VARCHAR), '%')
</if>
<if test="query.startTime != null">
AND pf.job_fair_start_time &gt;= #{query.startTime}
</if>
<if test="query.endTime != null">
AND pf.job_fair_end_time &lt;= #{query.endTime}
</if>
<if test="query.applyStartTime != null">
AND pf.job_fair_sign_up_start_time &gt;= #{query.applyStartTime}
</if>
<if test="query.applyEndTime != null">
AND pf.job_fair_sign_up_end_time &lt;= #{query.applyEndTime}
</if>
<if test="query.createStartTime != null">
AND pf.create_time &gt;= #{query.createStartTime}
</if>
<if test="query.createEndTime != null">
AND pf.create_time &lt;= #{query.createEndTime}
</if>
<if test="query.isCrossDomain != null and query.isCrossDomain != ''">
AND UPPER(COALESCE(pf.is_cross_domain, 'N')) = UPPER(#{query.isCrossDomain})
</if>
<if test="query.fairStatus == 'NOT_STARTED'">
AND pf.job_fair_start_time &gt; CURRENT_TIMESTAMP
</if>
<if test="query.fairStatus == 'ONGOING'">
AND pf.job_fair_start_time &lt;= CURRENT_TIMESTAMP
AND pf.job_fair_end_time &gt;= CURRENT_TIMESTAMP
</if>
<if test="query.fairStatus == 'ENDED'">
AND pf.job_fair_end_time &lt; CURRENT_TIMESTAMP
</if>
</sql>
<sql id="outdoorFairWhere">
pf.del_flag = '0'
<if test="query.title != null and query.title != ''">
AND pf.title LIKE CONCAT('%', CAST(#{query.title, jdbcType=VARCHAR} AS VARCHAR), '%')
</if>
<if test="query.hostUnit != null and query.hostUnit != ''">
AND pf.host_unit LIKE CONCAT('%', CAST(#{query.hostUnit, jdbcType=VARCHAR} AS VARCHAR), '%')
</if>
<if test="query.fairType != null and query.fairType != ''">
AND pf.fair_type = #{query.fairType}
</if>
<if test="query.region != null and query.region != ''">
AND pf.region = #{query.region}
</if>
<if test="query.venueId != null">
AND pf.venue_id = #{query.venueId}
</if>
<if test="query.venueName != null and query.venueName != ''">
AND pf.venue_name LIKE CONCAT('%', CAST(#{query.venueName, jdbcType=VARCHAR} AS VARCHAR), '%')
</if>
<if test="query.address != null and query.address != ''">
AND pf.address LIKE CONCAT('%', CAST(#{query.address, jdbcType=VARCHAR} AS VARCHAR), '%')
</if>
<if test="query.onlineApply != null">
AND pf.online_apply = #{query.onlineApply}
</if>
<if test="query.startTime != null">
AND pf.hold_time &gt;= #{query.startTime}
</if>
<if test="query.endTime != null">
AND pf.end_time &lt;= #{query.endTime}
</if>
<if test="query.applyStartTime != null">
AND pf.apply_start_time &gt;= #{query.applyStartTime}
</if>
<if test="query.applyEndTime != null">
AND pf.apply_end_time &lt;= #{query.applyEndTime}
</if>
<if test="query.createStartTime != null">
AND pf.create_time &gt;= #{query.createStartTime}
</if>
<if test="query.createEndTime != null">
AND pf.create_time &lt;= #{query.createEndTime}
</if>
<if test="query.fairStatus == 'NOT_STARTED'">
AND pf.hold_time &gt; CURRENT_TIMESTAMP
</if>
<if test="query.fairStatus == 'ONGOING'">
AND pf.hold_time &lt;= CURRENT_TIMESTAMP
AND pf.end_time &gt;= CURRENT_TIMESTAMP
</if>
<if test="query.fairStatus == 'ENDED'">
AND pf.end_time &lt; CURRENT_TIMESTAMP
</if>
</sql>
<sql id="publicFairColumns">
'online' AS channel,
pf.job_fair_id AS fair_id,
pf.job_fair_title AS fair_title,
pf.job_fair_address AS fair_address,
pf.job_fair_type AS fair_type,
pf.job_fair_region_type AS fair_region,
NULL AS fair_venue_name,
pf.is_cross_domain,
NULL AS online_apply,
pf.job_fair_start_time AS fair_start_time,
pf.job_fair_end_time AS fair_end_time,
pf.job_fair_sign_up_start_time AS apply_start_time,
pf.job_fair_sign_up_end_time AS apply_end_time,
pf.create_time AS fair_create_time,
pf.job_fair_host_unit AS fair_host_unit,
pf.job_fair_help_unit AS fair_help_unit,
pf.job_fair_organize_unit AS fair_organize_unit,
pf.job_fair_phone AS fair_phone,
pf.job_fair_category AS fair_category
</sql>
<sql id="outdoorFairColumns">
'outdoor' AS channel,
CAST(pf.id AS VARCHAR) AS fair_id,
pf.title AS fair_title,
pf.address AS fair_address,
pf.fair_type,
pf.region AS fair_region,
pf.venue_name AS fair_venue_name,
NULL AS is_cross_domain,
pf.online_apply,
pf.hold_time AS fair_start_time,
pf.end_time AS fair_end_time,
pf.apply_start_time,
pf.apply_end_time,
pf.create_time AS fair_create_time,
pf.host_unit AS fair_host_unit,
NULL AS fair_help_unit,
NULL AS fair_organize_unit,
NULL AS fair_phone,
NULL AS fair_category
</sql>
<sql id="companyColumns">
c.company_id,
c.name AS company_name,
COALESCE(c.company_nature, c.nature) AS company_type,
c.industry AS company_industry,
c.scale AS company_scale,
c.location AS company_location,
c.code AS company_code,
c.contact_person,
c.contact_person_phone AS contact_phone,
c.status AS company_status
</sql>
<sql id="jobColumns">
j.job_id,
j.job_title,
j.min_salary,
j.max_salary,
j.salary_composition,
j.welfare_benefits,
j.work_schedule,
j.education,
j.experience,
j.job_type,
j.job_category,
j.job_location,
j.job_address,
j.vacancies,
j.posting_date,
j.description
</sql>
<select id="selectPublicCompanyRows" resultType="com.ruoyi.cms.domain.export.RecruitmentFairExportRow">
SELECT
<include refid="publicFairColumns"/>,
<include refid="companyColumns"/>,
pfc.review_status AS company_review_status,
pfc.review_remark AS company_review_remark
FROM public_job_fair_company pfc
INNER JOIN public_job_fair pf ON pf.job_fair_id = pfc.job_fair_id
LEFT JOIN company c ON c.company_id = pfc.company_id
<where>
<include refid="publicFairWhere"/>
AND pfc.del_flag = '0'
<if test="query.reviewStatus != null and query.reviewStatus != ''">
AND COALESCE(pfc.review_status, '1') = #{query.reviewStatus}
</if>
</where>
ORDER BY pf.job_fair_start_time DESC NULLS LAST, c.name ASC NULLS LAST
</select>
<select id="selectPublicJobRows" resultType="com.ruoyi.cms.domain.export.RecruitmentFairExportRow">
SELECT
<include refid="publicFairColumns"/>,
<include refid="companyColumns"/>,
pfc.review_status AS company_review_status,
pfc.review_remark AS company_review_remark,
j.review_status AS job_review_status,
NULL AS job_review_remark,
<include refid="jobColumns"/>
FROM public_job_fair_job pfj
INNER JOIN public_job_fair pf ON pf.job_fair_id = pfj.job_fair_id
INNER JOIN public_job_fair_company pfc
ON pfc.job_fair_id = pfj.job_fair_id
AND pfc.company_id = pfj.company_id
AND pfc.del_flag = '0'
INNER JOIN job j ON j.job_id = pfj.job_id AND j.del_flag = '0'
LEFT JOIN company c ON c.company_id = pfj.company_id
<where>
<include refid="publicFairWhere"/>
AND pfj.del_flag = '0'
<if test="query.reviewStatus != null and query.reviewStatus != ''">
AND COALESCE(pfc.review_status, '1') = #{query.reviewStatus}
</if>
</where>
ORDER BY pf.job_fair_start_time DESC NULLS LAST, c.name ASC NULLS LAST, j.job_title ASC NULLS LAST
</select>
<select id="selectOutdoorCompanyRows" resultType="com.ruoyi.cms.domain.export.RecruitmentFairExportRow">
SELECT
<include refid="outdoorFairColumns"/>,
<include refid="companyColumns"/>,
COALESCE(fc.review_status, '1') AS company_review_status,
fc.review_remark AS company_review_remark
FROM fair_company fc
INNER JOIN cms_outdoor_fair pf ON pf.id = fc.job_fair_id
LEFT JOIN company c ON c.company_id = fc.company_id
<where>
<include refid="outdoorFairWhere"/>
AND COALESCE(fc.del_flag, '0') = '0'
<if test="query.reviewStatus != null and query.reviewStatus != ''">
AND COALESCE(fc.review_status, '1') = #{query.reviewStatus}
</if>
</where>
ORDER BY pf.hold_time DESC NULLS LAST, c.name ASC NULLS LAST
</select>
<select id="selectOutdoorJobRows" resultType="com.ruoyi.cms.domain.export.RecruitmentFairExportRow">
SELECT
<include refid="outdoorFairColumns"/>,
<include refid="companyColumns"/>,
COALESCE(fc.review_status, '1') AS company_review_status,
fc.review_remark AS company_review_remark,
COALESCE(pfj.review_status, '1') AS job_review_status,
pfj.review_remark AS job_review_remark,
<include refid="jobColumns"/>
FROM cms_outdoor_fair_job pfj
INNER JOIN cms_outdoor_fair pf ON pf.id = pfj.fair_id
LEFT JOIN fair_company fc
ON fc.job_fair_id = pfj.fair_id
AND fc.company_id = pfj.company_id
AND COALESCE(fc.del_flag, '0') = '0'
INNER JOIN job j ON j.job_id = pfj.job_id AND j.del_flag = '0'
LEFT JOIN company c ON c.company_id = pfj.company_id
<where>
<include refid="outdoorFairWhere"/>
AND COALESCE(pfj.del_flag, '0') = '0'
<if test="query.reviewStatus != null and query.reviewStatus != ''">
AND COALESCE(pfj.review_status, fc.review_status, '1') = #{query.reviewStatus}
</if>
</where>
ORDER BY pf.hold_time DESC NULLS LAST, c.name ASC NULLS LAST, j.job_title ASC NULLS LAST
</select>
</mapper>