public interface RecruitDao extends JpaRepository<Recruit,String>,JpaSpecificationExecutor<Recruit>{ /** * 查询推荐职位降序排序,查询前六条 * @param state * @return * SELECT * FROM tb_recruit WHERE state = xxx ORDER BY createtime DESC LIMIT 0,6 */ public List<Recruit> findTop6ByStateOrderByCreatetimeDesc(String state);// /** * 查询最新职位列表,查询状态不为0并以创建日期降序排序 * @param state * @return * SELECT * FROM tb_recruit WHERE state != xxx ORDER BY createtime DESC LIMIT 0,6 */ public List<Recruit> findTop6ByStateNotOrderByCreatetimeDesc(String state);//where state != xxx order by createtime Desc }