package com.yihu.jw.base.service.course;

import com.yihu.jw.base.dao.course.RecruitStudentsDao;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import com.yihu.mysql.query.BaseJpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/12
 * @Description:
 */
@Service
public class RecruitStudentsService extends BaseJpaService<RecruitStudentsDO, RecruitStudentsDao> {

    @Autowired
    private RecruitStudentsDao recruitStudentsDao;

    /**
     * 伪删除
     * @param ids
     */
    public void deletes(String ids){
        List<RecruitStudentsDO> recruitStudentsDOList = new ArrayList<>();
        for(String id:ids.split(",")){
            RecruitStudentsDO recruitStudentsDO = recruitStudentsDao.findOne(id);
            recruitStudentsDO.setDel(0);
            recruitStudentsDOList.add(recruitStudentsDO);
        }
        recruitStudentsDao.save(recruitStudentsDOList);
    }

}
