package com.ssj.dao.sys.homework.dao;

import com.ssj.bean.sys.homework.domain.HomeworkPictureErrorCheck;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: chchen
 * @Description
 * @Date Create in 15:31 2019/10/9
 * @Modified By
 */

@Repository
public interface HomeworkPictureErrorCheckDao extends JpaRepository<HomeworkPictureErrorCheck, String> {

    List<HomeworkPictureErrorCheck> findByTypeAndErrorHowDetailsIsNull (int type);

    @Query(nativeQuery = true, value = "select * from scon_homework_picture_errorcheck where homework_picture_id = ?1 and type=?2 order by create_time desc limit 1")
    HomeworkPictureErrorCheck findByHomeworkPictureIdAndType(String homeworkPictureId, int type);
}
