添加岗位分页列表
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jiayunet.pojo.po.RecruitAnnouncement;
|
||||
import org.jiayunet.pojo.vo.RecruitAnnouncementListItemVo;
|
||||
import org.jiayunet.pojo.vo.RecruitAnnouncementStatisticsVo;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告主表Mapper
|
||||
@@ -29,4 +32,10 @@ public interface RecruitAnnouncementMapper extends CommonMapper<RecruitAnnouncem
|
||||
* @param monthStart 本月开始时间
|
||||
*/
|
||||
RecruitAnnouncementStatisticsVo selectStatistics(@Param("dayStart") Instant dayStart, @Param("monthStart") Instant monthStart);
|
||||
|
||||
/**
|
||||
* 分页查询招聘公告列表
|
||||
* <p>各筛选条件为“且”关系,为空则不参与筛选;多值维度不在此查询,由Java侧按id批量组装</p>
|
||||
*/
|
||||
Page<RecruitAnnouncementListItemVo> selectAnnouncementPage(Page<RecruitAnnouncementListItemVo> page, @Param("publishTimeStart") Instant publishTimeStart, @Param("publishTimeEnd") Instant publishTimeEnd, @Param("applyEndTimeStart") Instant applyEndTimeStart, @Param("applyEndTimeEnd") Instant applyEndTimeEnd, @Param("companyTypes") List<String> companyTypes, @Param("educationNames") List<String> educationNames, @Param("recruitYears") List<Integer> recruitYears, @Param("batchNames") List<String> batchNames, @Param("categoryNames") List<String> categoryNames, @Param("cityNames") List<String> cityNames, @Param("industryNames") List<String> industryNames, @Param("tagNames") List<String> tagNames);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package org.jiayunet.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招聘公告查询条件(Mapper入参)
|
||||
* <p>各条件之间为“且”关系,为空则不参与筛选</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementQueryDto {
|
||||
|
||||
/** 发布时间起(不含) */
|
||||
private Instant publishTimeStart;
|
||||
|
||||
/** 发布时间止(含) */
|
||||
private Instant publishTimeEnd;
|
||||
|
||||
/** 投递截止时间起(不含) */
|
||||
private Instant applyEndTimeStart;
|
||||
|
||||
/** 投递截止时间止(含) */
|
||||
private Instant applyEndTimeEnd;
|
||||
|
||||
/** 公司类型列表 */
|
||||
private List<String> companyTypes;
|
||||
|
||||
/** 学历要求列表 */
|
||||
private List<String> educationNames;
|
||||
|
||||
/** 招聘届数列表 */
|
||||
private List<Integer> recruitYears;
|
||||
|
||||
/** 批次列表 */
|
||||
private List<String> batchNames;
|
||||
|
||||
/** 岗位大类列表 */
|
||||
private List<String> categoryNames;
|
||||
|
||||
/** 热招城市列表 */
|
||||
private List<String> cityNames;
|
||||
|
||||
/** 行业列表 */
|
||||
private List<String> industryNames;
|
||||
|
||||
/** 标签列表 */
|
||||
private List<String> tagNames;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.jiayunet.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 招聘公告列表项VO(SQL查询结果,多值维度由Java侧组装)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class RecruitAnnouncementListItemVo {
|
||||
|
||||
/** 公告ID */
|
||||
private Long id;
|
||||
|
||||
/** 公司ID */
|
||||
private Long companyId;
|
||||
|
||||
/** 公司名称 */
|
||||
private String companyName;
|
||||
|
||||
/** 公司logo */
|
||||
private String logoUrl;
|
||||
|
||||
/** 公告标题 */
|
||||
private String title;
|
||||
|
||||
/** 专业要求 */
|
||||
private String majorRequire;
|
||||
|
||||
/** 投递结束时间 */
|
||||
private Instant applyEndTime;
|
||||
|
||||
/** 投递截止描述 */
|
||||
private String applyEndDesc;
|
||||
}
|
||||
@@ -25,4 +25,131 @@
|
||||
FROM bg_recruit_announcement
|
||||
</select>
|
||||
|
||||
<resultMap id="RecruitAnnouncementListItemVoMap" type="org.jiayunet.pojo.vo.RecruitAnnouncementListItemVo">
|
||||
<id column="id" property="id"/>
|
||||
<result column="company_id" property="companyId"/>
|
||||
<result column="company_name" property="companyName"/>
|
||||
<result column="logo_url" property="logoUrl"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="major_require" property="majorRequire"/>
|
||||
<result column="apply_end_time" property="applyEndTime"/>
|
||||
<result column="apply_end_desc" property="applyEndDesc"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 分页查询公告列表:多值维度不在此取,由Java侧按id批量组装 -->
|
||||
<select id="selectAnnouncementPage" resultMap="RecruitAnnouncementListItemVoMap">
|
||||
SELECT
|
||||
ra.id,
|
||||
ra.company_id,
|
||||
ra.company_name,
|
||||
c.logo_url,
|
||||
ra.title,
|
||||
ra.major_require,
|
||||
ra.apply_end_time,
|
||||
ra.apply_end_desc
|
||||
FROM bg_recruit_announcement ra
|
||||
INNER JOIN bg_company c ON ra.company_id = c.id
|
||||
WHERE c.status = 1
|
||||
AND ra.status = 1
|
||||
<!-- 筛选条件:发布时间区间 -->
|
||||
<if test="publishTimeStart != null">
|
||||
AND ra.publish_time <![CDATA[>]]> #{publishTimeStart}
|
||||
</if>
|
||||
<if test="publishTimeEnd != null">
|
||||
AND ra.publish_time <![CDATA[<=]]> #{publishTimeEnd}
|
||||
</if>
|
||||
<!-- 筛选条件:投递截止时间区间 -->
|
||||
<if test="applyEndTimeStart != null">
|
||||
AND ra.apply_end_time <![CDATA[>]]> #{applyEndTimeStart}
|
||||
</if>
|
||||
<if test="applyEndTimeEnd != null">
|
||||
AND ra.apply_end_time <![CDATA[<=]]> #{applyEndTimeEnd}
|
||||
</if>
|
||||
<!-- 筛选条件:公司类型 -->
|
||||
<if test="companyTypes != null and companyTypes.size() > 0">
|
||||
AND c.company_type IN
|
||||
<foreach collection="companyTypes" item="type" open="(" separator="," close=")">
|
||||
#{type}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 筛选条件:学历要求 -->
|
||||
<if test="educationNames != null and educationNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rae.announcement_id
|
||||
FROM bg_recruit_announcement_education rae
|
||||
WHERE rae.education_name IN
|
||||
<foreach collection="educationNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:招聘届数 -->
|
||||
<if test="recruitYears != null and recruitYears.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT ray.announcement_id
|
||||
FROM bg_recruit_announcement_year ray
|
||||
WHERE ray.recruit_year IN
|
||||
<foreach collection="recruitYears" item="year" open="(" separator="," close=")">
|
||||
#{year}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:批次 -->
|
||||
<if test="batchNames != null and batchNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rab.announcement_id
|
||||
FROM bg_recruit_announcement_batch rab
|
||||
WHERE rab.batch_name IN
|
||||
<foreach collection="batchNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:岗位大类 -->
|
||||
<if test="categoryNames != null and categoryNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rac.announcement_id
|
||||
FROM bg_recruit_announcement_category rac
|
||||
WHERE rac.category_name IN
|
||||
<foreach collection="categoryNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:热招城市 -->
|
||||
<if test="cityNames != null and cityNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT ract.announcement_id
|
||||
FROM bg_recruit_announcement_city ract
|
||||
WHERE ract.city_name IN
|
||||
<foreach collection="cityNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:行业 -->
|
||||
<if test="industryNames != null and industryNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rai.announcement_id
|
||||
FROM bg_recruit_announcement_industry rai
|
||||
WHERE rai.industry_name IN
|
||||
<foreach collection="industryNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
<!-- 筛选条件:标签 -->
|
||||
<if test="tagNames != null and tagNames.size() > 0">
|
||||
AND ra.id IN (
|
||||
SELECT rat.announcement_id
|
||||
FROM bg_recruit_announcement_tag rat
|
||||
WHERE rat.tag_name IN
|
||||
<foreach collection="tagNames" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
ORDER BY ra.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user