岗位列表接口

This commit is contained in:
zk
2026-03-20 18:32:03 +08:00
parent 13520a6e39
commit 28e551285d
14 changed files with 734 additions and 19 deletions
@@ -0,0 +1,85 @@
<?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="org.jiayunet.mapper.JobMapper">
<select id="selectJobPage" resultType="org.jiayunet.pojo.vo.JobListItemVo">
SELECT
j.id,
j.title,
j.salary,
j.tags,
j.source_url,
j.required_industry_id,
j.min_experience,
c.id AS company_id,
c.name AS company_name,
c.short_name AS company_short_name,
c.company_type,
c.logo_url AS company_logo_url,
c.region_code,
r.name AS region_name,
cat.id AS category_id,
cat.name AS category_name
FROM bg_job j
INNER JOIN bg_company c ON j.company_id = c.id
INNER JOIN bg_china_regions_code r ON c.region_code = r.code
INNER JOIN bg_job_category cat ON j.category_id = cat.id
WHERE j.status = 0
AND c.status = 1
<!-- 排除不感兴趣的岗位 -->
<if test="excludeJobIds != null and excludeJobIds.size() > 0">
AND j.id NOT IN
<foreach collection="excludeJobIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 排除不感兴趣的公司 -->
<if test="excludeCompanyIds != null and excludeCompanyIds.size() > 0">
AND c.id NOT IN
<foreach collection="excludeCompanyIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 排除不感兴趣的地区(含子级) -->
<if test="excludeRegionCodes != null and excludeRegionCodes.size() > 0">
AND c.region_code NOT IN
<foreach collection="excludeRegionCodes" item="code" open="(" separator="," close=")">
#{code}
</foreach>
</if>
<!-- 排除不感兴趣的行业(含子级) -->
<if test="excludeIndustryIds != null and excludeIndustryIds.size() > 0">
AND (j.required_industry_id IS NULL OR j.required_industry_id NOT IN
<foreach collection="excludeIndustryIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>)
</if>
<!-- 筛选条件:地区(含子级) -->
<if test="regionCodes != null and regionCodes.size() > 0">
AND c.region_code IN
<foreach collection="regionCodes" item="code" open="(" separator="," close=")">
#{code}
</foreach>
</if>
<!-- 筛选条件:岗位类型(含子级) -->
<if test="categoryIds != null and categoryIds.size() > 0">
AND j.category_id IN
<foreach collection="categoryIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 筛选条件:行业(含子级) -->
<if test="industryIds != null and industryIds.size() > 0">
AND j.required_industry_id IN
<foreach collection="industryIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 筛选条件:工作类型 -->
<if test="employmentType != null">
AND j.employment_type = #{employmentType}
</if>
ORDER BY j.create_time DESC
</select>
</mapper>