查询有招聘会的日期列表

This commit is contained in:
2026-01-13 17:22:08 +08:00
parent beeaa0e6b3
commit 2d11855b56
6 changed files with 32 additions and 42 deletions

View File

@@ -82,12 +82,12 @@ public class PublicJobFairController extends BaseController {
}
/**
* 按年份查询每日招聘会数量
* 查询有招聘会的日期列表
*/
@BussinessLog(title = "按年份查询每日招聘会数量")
@ApiOperation("按年份查询每日招聘会数量")
@GetMapping("/dailyCount/{year}")
public AjaxResult dailyCountByYear(@ApiParam("年份") @PathVariable Integer year) {
return success(publicJobFairService.getDailyCountByYear(year));
@BussinessLog(title = "查询有招聘会的日期列表")
@ApiOperation("查询有招聘会的日期列表")
@GetMapping("/dates")
public AjaxResult getJobFairDates() {
return success(publicJobFairService.getJobFairDates());
}
}

View File

@@ -48,9 +48,9 @@ public interface PublicJobFairMapper extends BaseMapper<PublicJobFair> {
List<PublicJobFair> getCurrentMonthFairs();
/**
* 按年份查询每日招聘会数量
* 查询有招聘会的日期列表
*/
List<JobFairDailyCountVO> getDailyCountByYear(@Param("year") Integer year);
List<String> getJobFairDates();
// ========== CMS后台管理接口 ==========

View File

@@ -35,9 +35,9 @@ public interface IPublicJobFairService {
List<PublicJobFair> getCurrentMonthFairs();
/**
* 按年份查询每日招聘会数量
* 查询有招聘会的日期列表
*/
List<JobFairDailyCountVO> getDailyCountByYear(Integer year);
List<String> getJobFairDates();
// ========== CMS后台管理接口 ==========

View File

@@ -114,8 +114,8 @@ public class PublicJobFairServiceImpl implements IPublicJobFairService {
}
@Override
public List<JobFairDailyCountVO> getDailyCountByYear(Integer year) {
return publicJobFairMapper.getDailyCountByYear(year);
public List<String> getJobFairDates() {
return publicJobFairMapper.getJobFairDates();
}
// ========== CMS后台管理接口实现 ==========

View File

@@ -251,9 +251,8 @@
order by job_fair_start_time desc
</select>
<select id="getDailyCountByYear" resultType="com.ruoyi.cms.domain.rc.JobFairDailyCountVO">
SELECT TO_CHAR(d.date, 'YYYY-MM-DD') AS date,
COUNT(*) AS count
<select id="getJobFairDates" resultType="java.lang.String">
SELECT DISTINCT TO_CHAR(d.date, 'YYYY-MM-DD') AS date
FROM public_job_fair f,
generate_series(
DATE_TRUNC('day', f.job_fair_start_time),
@@ -261,8 +260,6 @@
'1 day'::interval
) AS d(date)
WHERE f.del_flag = '0'
AND TO_CHAR(d.date, 'YYYY') = CAST(#{year} AS VARCHAR)
GROUP BY TO_CHAR(d.date, 'YYYY-MM-DD')
ORDER BY date
</select>