添加基础过滤查询接口

This commit is contained in:
zk
2026-07-30 18:43:04 +08:00
parent c115f8b655
commit f4c60efdf2
9 changed files with 236 additions and 0 deletions
@@ -0,0 +1,67 @@
package org.jiayunet.controller;
import lombok.AllArgsConstructor;
import org.jiayunet.service.RecruitAnnouncementService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 招聘公告接口
* <p>提供公告筛选项(批次/岗位大类/热招城市/学历要求/行业/标签/招聘届数)的去重查询</p>
*
* @author zk
*/
@RestController
@RequestMapping("/public/recruitAnnouncement")
@AllArgsConstructor
@Validated
public class RecruitAnnouncementController {
private RecruitAnnouncementService recruitAnnouncementService;
/** 查询公告批次列表(去重) */
@GetMapping("/batch")
public List<String> listBatchName() {
return recruitAnnouncementService.listBatchName();
}
/** 查询公告岗位大类列表(去重) */
@GetMapping("/category")
public List<String> listCategoryName() {
return recruitAnnouncementService.listCategoryName();
}
/** 查询公告热招城市列表(去重) */
@GetMapping("/city")
public List<String> listCityName() {
return recruitAnnouncementService.listCityName();
}
/** 查询公告学历要求列表(去重) */
@GetMapping("/education")
public List<String> listEducationName() {
return recruitAnnouncementService.listEducationName();
}
/** 查询公告行业列表(去重) */
@GetMapping("/industry")
public List<String> listIndustryName() {
return recruitAnnouncementService.listIndustryName();
}
/** 查询公告标签列表(去重) */
@GetMapping("/tag")
public List<String> listTagName() {
return recruitAnnouncementService.listTagName();
}
/** 查询公告招聘届数列表(去重) */
@GetMapping("/year")
public List<Integer> listRecruitYear() {
return recruitAnnouncementService.listRecruitYear();
}
}
@@ -0,0 +1,106 @@
package org.jiayunet.service;
import lombok.extern.slf4j.Slf4j;
import org.jiayunet.mapper.RecruitAnnouncementBatchMapper;
import org.jiayunet.mapper.RecruitAnnouncementCategoryMapper;
import org.jiayunet.mapper.RecruitAnnouncementCityMapper;
import org.jiayunet.mapper.RecruitAnnouncementEducationMapper;
import org.jiayunet.mapper.RecruitAnnouncementIndustryMapper;
import org.jiayunet.mapper.RecruitAnnouncementTagMapper;
import org.jiayunet.mapper.RecruitAnnouncementYearMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 招聘公告服务
* <p>依赖:无</p>
* <p>使用表:bg_recruit_announcement(公告主表)、bg_recruit_announcement_year(招聘届数)、
* bg_recruit_announcement_batch(批次)、bg_recruit_announcement_tag(标签组)、
* bg_recruit_announcement_city(热招城市)、bg_recruit_announcement_category(岗位大类)、
* bg_recruit_announcement_industry(行业)、bg_recruit_announcement_education(学历要求)</p>
*
* @author zk
*/
@Service
@Slf4j
public class RecruitAnnouncementService {
@Autowired
private RecruitAnnouncementBatchMapper batchMapper;
@Autowired
private RecruitAnnouncementCategoryMapper categoryMapper;
@Autowired
private RecruitAnnouncementCityMapper cityMapper;
@Autowired
private RecruitAnnouncementEducationMapper educationMapper;
@Autowired
private RecruitAnnouncementIndustryMapper industryMapper;
@Autowired
private RecruitAnnouncementTagMapper tagMapper;
@Autowired
private RecruitAnnouncementYearMapper yearMapper;
/**
* 查询公告批次列表
* <p>按batch_name分组去重后返回</p>
*/
public List<String> listBatchName() {
return batchMapper.selectBatchNameGroup();
}
/**
* 查询公告岗位大类列表
* <p>按category_name分组去重后返回</p>
*/
public List<String> listCategoryName() {
return categoryMapper.selectCategoryNameGroup();
}
/**
* 查询公告热招城市列表
* <p>按city_name分组去重后返回</p>
*/
public List<String> listCityName() {
return cityMapper.selectCityNameGroup();
}
/**
* 查询公告学历要求列表
* <p>按education_name分组去重后返回</p>
*/
public List<String> listEducationName() {
return educationMapper.selectEducationNameGroup();
}
/**
* 查询公告行业列表
* <p>按industry_name分组去重后返回</p>
*/
public List<String> listIndustryName() {
return industryMapper.selectIndustryNameGroup();
}
/**
* 查询公告标签列表
* <p>按tag_name分组去重后返回</p>
*/
public List<String> listTagName() {
return tagMapper.selectTagNameGroup();
}
/**
* 查询公告招聘届数列表
* <p>按recruit_year分组去重后返回</p>
*/
public List<Integer> listRecruitYear() {
return yearMapper.selectRecruitYearGroup();
}
}
@@ -1,8 +1,11 @@
package org.jiayunet.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jiayunet.pojo.po.RecruitAnnouncementBatch;
import java.util.List;
/**
* 招聘公告-批次关联Mapper
*
@@ -10,4 +13,10 @@ import org.jiayunet.pojo.po.RecruitAnnouncementBatch;
*/
@Mapper
public interface RecruitAnnouncementBatchMapper extends CommonMapper<RecruitAnnouncementBatch> {
/**
* 查询去重后的批次名称列表
*/
@Select("SELECT batch_name FROM bg_recruit_announcement_batch GROUP BY batch_name")
List<String> selectBatchNameGroup();
}
@@ -1,8 +1,11 @@
package org.jiayunet.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jiayunet.pojo.po.RecruitAnnouncementCategory;
import java.util.List;
/**
* 招聘公告-岗位大类关联Mapper
*
@@ -10,4 +13,10 @@ import org.jiayunet.pojo.po.RecruitAnnouncementCategory;
*/
@Mapper
public interface RecruitAnnouncementCategoryMapper extends CommonMapper<RecruitAnnouncementCategory> {
/**
* 查询去重后的岗位大类名称列表
*/
@Select("SELECT category_name FROM bg_recruit_announcement_category GROUP BY category_name")
List<String> selectCategoryNameGroup();
}
@@ -1,8 +1,11 @@
package org.jiayunet.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jiayunet.pojo.po.RecruitAnnouncementCity;
import java.util.List;
/**
* 招聘公告-热招城市关联Mapper
*
@@ -10,4 +13,10 @@ import org.jiayunet.pojo.po.RecruitAnnouncementCity;
*/
@Mapper
public interface RecruitAnnouncementCityMapper extends CommonMapper<RecruitAnnouncementCity> {
/**
* 查询去重后的热招城市名称列表
*/
@Select("SELECT city_name FROM bg_recruit_announcement_city GROUP BY city_name")
List<String> selectCityNameGroup();
}
@@ -1,8 +1,11 @@
package org.jiayunet.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jiayunet.pojo.po.RecruitAnnouncementEducation;
import java.util.List;
/**
* 招聘公告-学历要求关联Mapper
*
@@ -10,4 +13,10 @@ import org.jiayunet.pojo.po.RecruitAnnouncementEducation;
*/
@Mapper
public interface RecruitAnnouncementEducationMapper extends CommonMapper<RecruitAnnouncementEducation> {
/**
* 查询去重后的学历要求名称列表
*/
@Select("SELECT education_name FROM bg_recruit_announcement_education GROUP BY education_name")
List<String> selectEducationNameGroup();
}
@@ -1,8 +1,11 @@
package org.jiayunet.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jiayunet.pojo.po.RecruitAnnouncementIndustry;
import java.util.List;
/**
* 招聘公告-行业关联Mapper
*
@@ -10,4 +13,10 @@ import org.jiayunet.pojo.po.RecruitAnnouncementIndustry;
*/
@Mapper
public interface RecruitAnnouncementIndustryMapper extends CommonMapper<RecruitAnnouncementIndustry> {
/**
* 查询去重后的行业名称列表
*/
@Select("SELECT industry_name FROM bg_recruit_announcement_industry GROUP BY industry_name")
List<String> selectIndustryNameGroup();
}
@@ -1,8 +1,11 @@
package org.jiayunet.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jiayunet.pojo.po.RecruitAnnouncementTag;
import java.util.List;
/**
* 招聘公告-标签组关联Mapper
*
@@ -10,4 +13,10 @@ import org.jiayunet.pojo.po.RecruitAnnouncementTag;
*/
@Mapper
public interface RecruitAnnouncementTagMapper extends CommonMapper<RecruitAnnouncementTag> {
/**
* 查询去重后的标签名称列表
*/
@Select("SELECT tag_name FROM bg_recruit_announcement_tag GROUP BY tag_name")
List<String> selectTagNameGroup();
}
@@ -1,8 +1,11 @@
package org.jiayunet.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jiayunet.pojo.po.RecruitAnnouncementYear;
import java.util.List;
/**
* 招聘公告-招聘届数关联Mapper
*
@@ -10,4 +13,10 @@ import org.jiayunet.pojo.po.RecruitAnnouncementYear;
*/
@Mapper
public interface RecruitAnnouncementYearMapper extends CommonMapper<RecruitAnnouncementYear> {
/**
* 查询去重后的招聘届数列表
*/
@Select("SELECT recruit_year FROM bg_recruit_announcement_year GROUP BY recruit_year")
List<Integer> selectRecruitYearGroup();
}