feat: 新增招聘会企业签到与未参会统计

This commit is contained in:
2026-07-24 12:35:25 +08:00
parent 357a861338
commit 0dc26a9e2e
18 changed files with 935 additions and 8 deletions

View File

@@ -41,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="companyStatus" column="company_status" />
<result property="isHrs" column="is_hrs" />
<result property="lcUserid" column="lc_userid" />
<result property="missedOutdoorFairCount" column="missed_outdoor_fair_count" />
<collection property="companyContactList" ofType="com.ruoyi.common.core.domain.entity.CompanyContact"
resultMap="CompanyContactResult"/>
@@ -53,7 +54,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectCompanyVo">
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,company_nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time,is_imp_company,imp_company_type,enterprise_type,legal_person,legal_id_card,legal_phone,is_hrs from company
select company_id, name, location, industry, scale, del_flag, create_by, create_time, update_by, update_time, remark,code,description,nature,company_nature,total_recruitment,registered_address,contact_person,contact_person_phone,is_abnormal,not_pass_reason,status,case when status='2' then update_time else null end reject_time,is_imp_company,imp_company_type,enterprise_type,legal_person,legal_id_card,legal_phone,is_hrs,
(select count(1)
from shz.fair_company fc
join shz.cms_outdoor_fair f on f.id = fc.job_fair_id and f.del_flag = '0'
left join shz.cms_outdoor_fair_company_attendance a
on a.fair_id = fc.job_fair_id and a.company_id = fc.company_id and a.del_flag = '0'
where fc.company_id = c.company_id
and fc.del_flag = '0'
and fc.review_status = '1'
and f.end_time &lt; CURRENT_TIMESTAMP
and coalesce(a.attendance_status, '0') &lt;&gt; '1') as missed_outdoor_fair_count
from company c
</sql>
<sql id="companyIndustryFilter">
@@ -148,6 +160,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endDate != null and endDate != ''">
and create_time &lt;= #{endDate}
</if>
<if test="missedOutdoorFairOnly == true">
and exists (
select 1
from shz.fair_company fc
join shz.cms_outdoor_fair f on f.id = fc.job_fair_id and f.del_flag = '0'
left join shz.cms_outdoor_fair_company_attendance a
on a.fair_id = fc.job_fair_id and a.company_id = fc.company_id and a.del_flag = '0'
where fc.company_id = c.company_id
and fc.del_flag = '0'
and fc.review_status = '1'
and f.end_time &lt; CURRENT_TIMESTAMP
and coalesce(a.attendance_status, '0') &lt;&gt; '1'
)
</if>
</where>
</select>
<select id="label" resultMap="CompanyResult">
@@ -197,6 +223,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select t.company_id, t.name, t.location, t.industry, t.scale, t.del_flag, t.create_by, t.create_time, t.update_by, t.update_time, t.remark,t.code,t.description,
t.nature,t.company_nature,t.total_recruitment,t.registered_address,t.contact_person,t.contact_person_phone,t.is_abnormal,t.not_pass_reason,t.status,case when t.status='2'
then t.update_time else null end reject_time,t.is_imp_company,t.imp_company_type,t.enterprise_type,t.legal_person,t.legal_id_card,t.legal_phone,t.is_hrs,
(select count(1)
from shz.fair_company fc
join shz.cms_outdoor_fair f on f.id = fc.job_fair_id and f.del_flag = '0'
left join shz.cms_outdoor_fair_company_attendance a
on a.fair_id = fc.job_fair_id and a.company_id = fc.company_id and a.del_flag = '0'
where fc.company_id = t.company_id
and fc.del_flag = '0'
and fc.review_status = '1'
and f.end_time &lt; CURRENT_TIMESTAMP
and coalesce(a.attendance_status, '0') &lt;&gt; '1') as missed_outdoor_fair_count,
su.lc_userid,su.user_id,cct.contact_person as con_contact_person,cct.contact_person_phone as con_contact_person_phone,cct.company_id as con_company_id from company t
left join sys_user su on t.code=su.id_card and su.del_flag='0'
left join company_contact cct on t.company_id=cct.company_id and cct.del_flag='0'
@@ -232,7 +268,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="endDate != null and endDate != ''">
and t.create_time &lt;= #{endDate}
</if>
<if test="missedOutdoorFairOnly == true">
and exists (
select 1
from shz.fair_company fc
join shz.cms_outdoor_fair f on f.id = fc.job_fair_id and f.del_flag = '0'
left join shz.cms_outdoor_fair_company_attendance a
on a.fair_id = fc.job_fair_id and a.company_id = fc.company_id and a.del_flag = '0'
where fc.company_id = t.company_id
and fc.del_flag = '0'
and fc.review_status = '1'
and f.end_time &lt; CURRENT_TIMESTAMP
and coalesce(a.attendance_status, '0') &lt;&gt; '1'
)
</if>
</where>
</select>
<select id="selectMissedOutdoorFairList"
parameterType="long"
resultType="com.ruoyi.cms.domain.vo.CompanyMissedOutdoorFairVO">
SELECT f.id AS fair_id,
f.title,
f.host_unit,
f.address,
f.hold_time,
f.end_time,
fc.create_time AS registration_time
FROM shz.fair_company fc
JOIN shz.cms_outdoor_fair f
ON f.id = fc.job_fair_id
AND f.del_flag = '0'
LEFT JOIN shz.cms_outdoor_fair_company_attendance a
ON a.fair_id = fc.job_fair_id
AND a.company_id = fc.company_id
AND a.del_flag = '0'
WHERE fc.company_id = #{companyId}
AND fc.del_flag = '0'
AND fc.review_status = '1'
AND f.end_time &lt; CURRENT_TIMESTAMP
AND COALESCE(a.attendance_status, '0') &lt;&gt; '1'
ORDER BY f.end_time DESC, f.id DESC
</select>
</mapper>

View File

@@ -0,0 +1,64 @@
<?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.OutdoorFairCompanyAttendanceMapper">
<resultMap id="OutdoorFairCompanyAttendanceResult"
type="com.ruoyi.cms.domain.vo.OutdoorFairCompanyAttendanceVO">
<id property="id" column="registration_id"/>
<result property="fairId" column="fair_id"/>
<result property="companyId" column="company_id"/>
<result property="companyName" column="company_name"/>
<result property="industry" column="industry"/>
<result property="scale" column="scale"/>
<result property="contactPerson" column="contact_person"/>
<result property="contactPhone" column="contact_phone"/>
<result property="reviewTime" column="review_time"/>
<result property="registrationTime" column="registration_time"/>
<result property="attendanceStatus" column="attendance_status"/>
<result property="checkInTime" column="check_in_time"/>
</resultMap>
<select id="selectCompanyAttendanceList"
resultMap="OutdoorFairCompanyAttendanceResult">
SELECT fc.id AS registration_id,
fc.job_fair_id AS fair_id,
fc.company_id,
c.name AS company_name,
c.industry,
c.scale,
c.contact_person,
c.contact_person_phone AS contact_phone,
fc.review_time,
fc.create_time AS registration_time,
COALESCE(a.attendance_status, '0') AS attendance_status,
a.check_in_time
FROM shz.fair_company fc
JOIN shz.company c ON c.company_id = fc.company_id AND c.del_flag = '0'
LEFT JOIN shz.cms_outdoor_fair_company_attendance a
ON a.fair_id = fc.job_fair_id
AND a.company_id = fc.company_id
AND a.del_flag = '0'
WHERE fc.del_flag = '0'
AND fc.job_fair_id = #{fairId}
AND fc.review_status = '1'
<if test="companyId != null">
AND fc.company_id = #{companyId}
</if>
<if test="companyName != null and companyName != ''">
AND c.name LIKE CONCAT('%', CAST(#{companyName} AS VARCHAR), '%')
</if>
<if test="checkedIn != null">
<choose>
<when test="checkedIn">
AND COALESCE(a.attendance_status, '0') = '1'
</when>
<otherwise>
AND COALESCE(a.attendance_status, '0') &lt;&gt; '1'
</otherwise>
</choose>
</if>
ORDER BY a.check_in_time DESC NULLS LAST, fc.id DESC
</select>
</mapper>