添加热门城市 行业 地区
This commit is contained in:
@@ -4,6 +4,9 @@ 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.Job;
|
||||
import org.jiayunet.pojo.vo.HotCityVo;
|
||||
import org.jiayunet.pojo.vo.HotIndustryVo;
|
||||
import org.jiayunet.pojo.vo.HotJobCategoryVo;
|
||||
import org.jiayunet.pojo.vo.JobListItemVo;
|
||||
|
||||
import java.time.Instant;
|
||||
@@ -27,4 +30,22 @@ public interface JobMapper extends CommonMapper<Job> {
|
||||
* <p>过滤条件与 selectJobPage 共用同一段 SQL(jobPageWhere),保证列表与总数口径一致</p>
|
||||
*/
|
||||
Long countJobPage(@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);
|
||||
|
||||
/**
|
||||
* 查询热门行业(二级行业)
|
||||
* <p>岗位关联公司、公司关联行业,按上架岗位数量倒序取前 limit 个</p>
|
||||
*/
|
||||
List<HotIndustryVo> selectHotIndustries(@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 查询热门岗位类型(二级岗位类型)
|
||||
* <p>岗位类型表自关联,从三级叶子上溯到二级后分组,按上架岗位数量倒序取前 limit 个</p>
|
||||
*/
|
||||
List<HotJobCategoryVo> selectHotJobCategories(@Param("limit") Integer limit);
|
||||
|
||||
/**
|
||||
* 查询热门城市
|
||||
* <p>岗位关联公司、公司关联地区,按上架岗位数量倒序取前 limit 个</p>
|
||||
*/
|
||||
List<HotCityVo> selectHotCities(@Param("limit") Integer limit);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.jiayunet.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 热门城市VO
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class HotCityVo {
|
||||
|
||||
/** 地区编码 */
|
||||
private String code;
|
||||
|
||||
/** 地区名称 */
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.jiayunet.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 热门行业VO(二级行业)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class HotIndustryVo {
|
||||
|
||||
/** 行业ID */
|
||||
private Long id;
|
||||
|
||||
/** 行业名称 */
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package org.jiayunet.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 热门岗位类型VO(二级岗位类型)
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class HotJobCategoryVo {
|
||||
|
||||
/** 岗位类型ID */
|
||||
private Long id;
|
||||
|
||||
/** 岗位类型名称 */
|
||||
private String name;
|
||||
}
|
||||
@@ -188,4 +188,65 @@
|
||||
<include refid="jobPageWhere"/>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
热门行业查询(二级行业)
|
||||
岗位 → 公司 → 公司所属行业,按上架岗位数量倒序取前 limit 个
|
||||
-->
|
||||
<select id="selectHotIndustries" resultType="org.jiayunet.pojo.vo.HotIndustryVo">
|
||||
SELECT
|
||||
i.id,
|
||||
i.name
|
||||
FROM bg_job j
|
||||
INNER JOIN bg_company c ON j.company_id = c.id
|
||||
INNER JOIN bg_industry i ON c.industry_id = i.id
|
||||
WHERE j.status = 0
|
||||
AND c.status = 1
|
||||
AND i.level = 2
|
||||
GROUP BY i.id, i.name
|
||||
ORDER BY COUNT(j.id) DESC
|
||||
<if test="limit != null">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
热门岗位类型查询(二级岗位类型)
|
||||
bg_job.category_id 存三级叶子,自关联上溯到二级后按二级分组,按上架岗位数量倒序取前 limit 个
|
||||
-->
|
||||
<select id="selectHotJobCategories" resultType="org.jiayunet.pojo.vo.HotJobCategoryVo">
|
||||
SELECT
|
||||
cat2.id,
|
||||
cat2.name
|
||||
FROM bg_job j
|
||||
INNER JOIN bg_job_category cat3 ON j.category_id = cat3.id
|
||||
INNER JOIN bg_job_category cat2 ON cat3.parent_id = cat2.id
|
||||
WHERE j.status = 0
|
||||
AND cat2.level = 2
|
||||
GROUP BY cat2.id, cat2.name
|
||||
ORDER BY COUNT(j.id) DESC
|
||||
<if test="limit != null">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!--
|
||||
热门城市查询
|
||||
岗位 → 公司 → 公司所在地区,按上架岗位数量倒序取前 limit 个
|
||||
-->
|
||||
<select id="selectHotCities" resultType="org.jiayunet.pojo.vo.HotCityVo">
|
||||
SELECT
|
||||
r.code,
|
||||
r.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
|
||||
WHERE j.status = 0
|
||||
AND c.status = 1
|
||||
GROUP BY r.code, r.name
|
||||
ORDER BY COUNT(j.id) DESC
|
||||
<if test="limit != null">
|
||||
LIMIT #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user