修改查询下架岗位sql

This commit is contained in:
sh
2026-04-02 13:08:52 +08:00
parent 403e43944e
commit ebd681e99b
3 changed files with 3 additions and 4 deletions

View File

@@ -65,7 +65,7 @@ public interface JobMapper extends BaseMapper<Job>
public int updateStatus(Job job); public int updateStatus(Job job);
List<Job> getJobDownList(); List<Long> getJobDownList();
void updateJobDown(List<Long> list); void updateJobDown(List<Long> list);
} }

View File

@@ -1405,8 +1405,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper,Job> implements IJobSe
@Override @Override
public void updateJobDown() { public void updateJobDown() {
//查询下架岗位 //查询下架岗位
List<Job> list=jobMapper.getJobDownList(); List<Long> ids=jobMapper.getJobDownList();
List<Long> ids=list.stream().map(Job::getJobId).collect(Collectors.toList());
//更新岗位状态 //更新岗位状态
jobMapper.updateJobDown(ids); jobMapper.updateJobDown(ids);
//刷新es //刷新es

View File

@@ -391,7 +391,7 @@
update job set job_status=#{jobStatus},down_time=#{downTime},update_time=#{updateTime},update_by=#{updateBy} where job_id=#{jobId} update job set job_status=#{jobStatus},down_time=#{downTime},update_time=#{updateTime},update_by=#{updateBy} where job_id=#{jobId}
</update> </update>
<select id="getJobDownList" resultType="java.util.List"> <select id="getJobDownList" resultType="java.lang.Long">
select job_id from job where down_time &lt;=now() and job_status='0' select job_id from job where down_time &lt;=now() and job_status='0'
</select> </select>