package com.cyksj.mapper.manage.sys;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyksj.model.entity.WorkOrder;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 *项目名: netflix
 *文件名: WorkOrderMapper
 *创建者: JavaZou
 *创建时间:2023/4/19 15:44
 */
public interface WorkOrderMapper extends BaseMapper<WorkOrder> {
	@Select("select id from work_order where created_time <= #{threeDaysBefore} and account in (select account from work_order group by account having count(*) = 1)")
	List<Long> selectOnlyOneWorkOrderBeforeThreeDays(DateTime threeDaysBefore);
}
