添加发布时间筛选 和 教育筛选
This commit is contained in:
@@ -4,6 +4,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.jiayunet.pojo.PageParam;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -44,4 +45,13 @@ public class JobQueryParam extends PageParam {
|
||||
|
||||
/** 公司ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 学历要求列表 0=不限 1=大专 2=本科 3=硕士 4=博士(可多选,null或空=不限制) */
|
||||
private List<Integer> educations;
|
||||
|
||||
/** 发布开始时间(对应 bg_job.expire_at,闭区间) */
|
||||
private Instant publishStartTime;
|
||||
|
||||
/** 发布截止时间(对应 bg_job.expire_at,闭区间) */
|
||||
private Instant publishEndTime;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class JobService {
|
||||
// 6. 执行分页查询
|
||||
Page<JobListItemVo> pageParam = param.toPage();
|
||||
pageParam.setSearchCount(false);
|
||||
Page<JobListItemVo> page = jobMapper.selectJobPage(pageParam, param.getJobIds(),param.getStatusFilter(), param.getKeyword(), expandedRegionCodes, expandedCategoryIds, expandedIndustryIds, param.getEmploymentType(), excludeJobIds, excludeCompanyIds, excludeRegionCodes, excludeIndustryIds, param.getRecruitCategory(), param.getCompanyTypes(), param.getCompanyId());
|
||||
Page<JobListItemVo> page = jobMapper.selectJobPage(pageParam, param.getJobIds(),param.getStatusFilter(), param.getKeyword(), expandedRegionCodes, expandedCategoryIds, expandedIndustryIds, param.getEmploymentType(), excludeJobIds, excludeCompanyIds, excludeRegionCodes, excludeIndustryIds, param.getRecruitCategory(), param.getCompanyTypes(), param.getCompanyId(), param.getEducations(), param.getPublishStartTime(), param.getPublishEndTime());
|
||||
|
||||
// 7. 查询收藏状态
|
||||
List<Long> jobIds = page.getRecords().stream().map(JobListItemVo::getId).collect(Collectors.toList());
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.jiayunet.pojo.po.Job;
|
||||
import org.jiayunet.pojo.vo.JobListItemVo;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -19,5 +20,5 @@ public interface JobMapper extends CommonMapper<Job> {
|
||||
/**
|
||||
* 分页查询岗位列表
|
||||
*/
|
||||
Page<JobListItemVo> selectJobPage(Page<JobListItemVo> page, @Param("jobIds") List<Long> jobIds, @Param("statusFilter") List<Integer> statusFilter, @Param("keyword") String keyword, @Param("regionCodes") List<String> regionCodes, @Param("categoryIds") List<Long> categoryIds, @Param("industryIds") List<Long> industryIds, @Param("employmentType") Integer employmentType, @Param("excludeJobIds") List<Long> excludeJobIds, @Param("excludeCompanyIds") List<Long> excludeCompanyIds, @Param("excludeRegionCodes") List<String> excludeRegionCodes, @Param("excludeIndustryIds") List<Long> excludeIndustryIds, @Param("recruitCategory") Integer recruitCategory, @Param("companyTypes") List<String> companyTypes, @Param("companyId") Long companyId);
|
||||
Page<JobListItemVo> selectJobPage(Page<JobListItemVo> page, @Param("jobIds") List<Long> jobIds, @Param("statusFilter") List<Integer> statusFilter, @Param("keyword") String keyword, @Param("regionCodes") List<String> regionCodes, @Param("categoryIds") List<Long> categoryIds, @Param("industryIds") List<Long> industryIds, @Param("employmentType") Integer employmentType, @Param("excludeJobIds") List<Long> excludeJobIds, @Param("excludeCompanyIds") List<Long> excludeCompanyIds, @Param("excludeRegionCodes") List<String> excludeRegionCodes, @Param("excludeIndustryIds") List<Long> excludeIndustryIds, @Param("recruitCategory") Integer recruitCategory, @Param("companyTypes") List<String> companyTypes, @Param("companyId") Long companyId, @Param("educations") List<Integer> educations, @Param("publishStartTime") Instant publishStartTime, @Param("publishEndTime") Instant publishEndTime);
|
||||
}
|
||||
|
||||
@@ -153,6 +153,21 @@
|
||||
<if test="companyId != null">
|
||||
AND j.company_id = #{companyId}
|
||||
</if>
|
||||
<!-- 筛选条件:学历要求(可多选) -->
|
||||
<if test="educations != null and educations.size() > 0">
|
||||
AND j.education IN
|
||||
<foreach collection="educations" item="education" open="(" separator="," close=")">
|
||||
#{education}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 筛选条件:发布开始时间 -->
|
||||
<if test="publishStartTime != null">
|
||||
AND j.expire_at >= #{publishStartTime}
|
||||
</if>
|
||||
<!-- 筛选条件:发布截止时间 -->
|
||||
<if test="publishEndTime != null">
|
||||
AND j.expire_at <= #{publishEndTime}
|
||||
</if>
|
||||
ORDER BY j.id DESC
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user