package com.rongwei.sfcommon.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rongwe.scentity.domian.FsFileDataListDo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * <p>
 * 奥克宁可——文件清单 Mapper 接口
 * </p>
 *
 * @author trj
 * @since 2023-07-17
 */
@Mapper
public interface FsFileDataListDao extends BaseMapper<FsFileDataListDo> {

    @Select("select * from fs_file_data_list where DELETED = 0 AND DATE_FORMAT(NOW(),'%Y-%m-%d 00:00:00') >= DATE_SUB(DATE_FORMAT(TRAININGSTARTDATE,'%Y-%m-%d 00:00:00'), INTERVAL 2 DAY) AND DATE_FORMAT(NOW(),'%Y-%m-%d 00:00:00') <= DATE_FORMAT(TRAININGSTARTDATE,'%Y-%m-%d 00:00:00') AND PROCESSINSTSTATUS = '20' AND FILESTATE = '1'")
    List<FsFileDataListDo> selectByTrainingStartDate();

    @Select("select USERID from fs_training_staff where MASTERID = #{id}")
    List<String> selectPeopleIdListByFileId(String id);
}
