Merge branch 'main' of ssh://124.243.245.42:2222/zkr/shz-backend

This commit is contained in:
2026-06-27 22:45:00 +08:00
39 changed files with 229 additions and 51 deletions

View File

@@ -141,13 +141,24 @@
and latest_ii.job_id = a.job_id
and latest_ii.del_flag = '0'
where a.del_flag='0'
<if test="company != null and company.jobTitle != null and company.jobTitle != ''"> and b.job_title like concat('%', cast(#{company.jobTitle, jdbcType=VARCHAR} as varchar), '%')</if>
<if test="company != null and company.education != null and company.education != ''"> and b.education = #{company.education}</if>
<if test="company != null and company.experience != null and company.experience != ''"> and b.experience = #{company.experience}</if>
<if test="company != null and company.companyName != null and company.companyName != ''"> and b.company_name like concat('%', cast(#{company.companyName, jdbcType=VARCHAR} as varchar), '%')</if>
<if test="company != null and company.companyId != null "> and b.company_id = #{company.companyId}</if>
<if test="company != null and company.code != null "> and l.code =#{company.code}</if>
<if test="name != null and name != '' "> and b.job_title like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
<!-- 求职者用户名搜索 -->
<if test="name != null and name != ''"> and e.name like concat('%', cast(#{name, jdbcType=VARCHAR} as varchar), '%')</if>
<!-- 手机号搜索 -->
<if test="phone != null and phone != ''"> and e.phone like concat('%', cast(#{phone, jdbcType=VARCHAR} as varchar), '%')</if>
<!-- 学历筛选 -->
<if test="education != null and education != ''"> and e.education = #{education}</if>
<!-- 性别筛选 -->
<if test="sex != null and sex != ''"> and e.sex = #{sex}</if>
<!-- 区域筛选 -->
<if test="area != null and area != ''"> and e.area = #{area}</if>
<!-- 政治面貌筛选 -->
<if test="politicalAffiliation != null and politicalAffiliation != ''"> and e.political_affiliation = #{politicalAffiliation}</if>
<!-- 身份证搜索 -->
<if test="idCard != null and idCard != ''"> and e.id_card like concat('%', cast(#{idCard, jdbcType=VARCHAR} as varchar), '%')</if>
<!-- 出生日期筛选 -->
<if test="birthDate != null and birthDate != ''"> and e.birth_date = #{birthDate}</if>
<!-- 职位名称搜索 -->
<if test="jobName != null and jobName != ''"> and b.job_title like concat('%', cast(#{jobName, jdbcType=VARCHAR} as varchar), '%')</if>
</select>
<select id="selectJobApplyListJob" parameterType="JobApply" resultType="com.ruoyi.cms.domain.Job">

View File

@@ -26,6 +26,7 @@
<result property="view" column="view" />
<result property="companyId" column="company_id" />
<result property="isHot" column="is_hot" />
<result property="isUrgent" column="is_urgent" />
<result property="dataSource" column="data_source" />
<result property="jobUrl" column="job_url" />
<result property="rowId" column="row_id" />
@@ -61,6 +62,7 @@
<result property="view" column="view" />
<result property="companyId" column="company_id" />
<result property="isHot" column="is_hot" />
<result property="isUrgent" column="is_urgent" />
<result property="applyNum" column="apply_num" />
<result property="dataSource" column="data_source" />
<result property="jobLocationAreaCode" column="job_location_area_code" />
@@ -99,7 +101,7 @@
</resultMap>
<sql id="selectJobVo">
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view", company_id , is_hot ,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,is_explain,explain_url,cover,job_type,job_address, review_status from job
select job_id, job_title, min_salary, max_salary, education, experience, company_name, job_location, posting_date, vacancies, del_flag, create_by, create_time, update_by, update_time, remark, latitude, longitude, "view", company_id , is_hot ,is_urgent,apply_num,is_publish, description,job_location_area_code,data_source,job_url,job_category,is_explain,explain_url,cover,job_type,job_address, review_status from job
</sql>
<insert id="insertBatchRowWork">
INSERT INTO row_work (
@@ -128,7 +130,7 @@
INSERT INTO job (
job_title, min_salary, max_salary, education, experience, company_name, job_location,
job_location_area_code, posting_date, vacancies, latitude, longitude, "view", company_id,
is_hot, apply_num, description, is_publish, data_source, job_url, remark, del_flag,
is_hot, is_urgent, apply_num, description, is_publish, data_source, job_url, remark, del_flag,
create_by, create_time, row_id, job_category,job_type,job_address
) VALUES
<foreach collection="list" item="job" separator=",">
@@ -136,7 +138,7 @@
#{job.jobTitle}, #{job.minSalary}, #{job.maxSalary}, #{job.education}, #{job.experience},
#{job.companyName}, #{job.jobLocation}, #{job.jobLocationAreaCode}, #{job.postingDate},
#{job.vacancies}, #{job.latitude}, #{job.longitude}, #{job.view}, #{job.companyId},
#{job.isHot}, #{job.applyNum}, #{job.description}, #{job.isPublish}, #{job.dataSource},
#{job.isHot}, #{job.isUrgent}, #{job.applyNum}, #{job.description}, #{job.isPublish}, #{job.dataSource},
#{job.jobUrl}, #{job.remark}, #{job.delFlag}, #{job.createBy}, #{job.createTime},
#{job.rowId}, #{job.jobCategory},#{job.jobType},#{job.jobAddress}
)
@@ -365,4 +367,49 @@
<delete id="delRowWork">
delete from row_work
</delete>
<select id="getRecommendByJobId" resultType="com.ruoyi.common.core.domain.entity.AppUser">
SELECT
*,
CASE match_level
WHEN 1 THEN '一级: 学历+区域+薪资+岗位类别'
WHEN 2 THEN '二级: 区域+薪资+岗位类别'
WHEN 3 THEN '三级: 薪资+岗位类别'
WHEN 4 THEN '四级: 仅岗位类别'
WHEN 5 THEN '五级: 无满足条件'
END AS match_level_desc
FROM (
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY user_id ORDER BY match_level asc) AS best_rn
FROM (
SELECT
r.*,
CASE
WHEN CAST(j.job_id AS TEXT) = ANY(string_to_array(r.job_title_id, ','))
AND ((CAST(r.salary_min AS INTEGER) &lt;= p.max_salary AND CAST(r.salary_max AS INTEGER) >= p.min_salary) OR p.max_salary IS NULL)
AND (CAST(r.area AS INTEGER) = CAST(p.job_location_area_code AS INTEGER) OR p.job_location_area_code IS NULL)
AND (CAST(r.education AS INTEGER) >=CAST(p.education AS INTEGER) OR p.education IS NULL OR p.education = '-1')
THEN 1
WHEN CAST(j.job_id AS TEXT) = ANY(string_to_array(r.job_title_id, ','))
AND ((CAST(r.salary_min AS INTEGER) &lt;= p.max_salary AND CAST(r.salary_max AS INTEGER) >= p.min_salary) OR p.max_salary IS NULL)
AND (CAST(r.area AS INTEGER) = CAST(p.job_location_area_code AS INTEGER) OR p.job_location_area_code IS NULL)
THEN 2
WHEN CAST(j.job_id AS TEXT) = ANY(string_to_array(r.job_title_id, ','))
AND ((CAST(r.salary_min AS INTEGER) &lt;= p.max_salary AND CAST(r.salary_max AS INTEGER) >= p.min_salary) OR p.max_salary IS NULL)
THEN 3
WHEN (CAST(j.job_id AS TEXT) = ANY(string_to_array(r.job_title_id, ',')) OR p.job_category IS NULL)
THEN 4
ELSE 5
END AS match_level
FROM shz.job p
JOIN shz.app_user r ON r.del_flag = '0'
JOIN shz.job_title j ON j.job_name = p.job_category
WHERE p.job_id = #{jobId}
) c
) t
WHERE best_rn = 1
ORDER BY match_level ASC, login_date DESC
LIMIT (SELECT vacancies FROM shz.job WHERE job_id = #{jobId})
</select>
</mapper>