Merge remote-tracking branch 'origin/master'

This commit is contained in:
chuyan 2020-09-12 21:09:56 +08:00
commit 1e580181a4
4 changed files with 43 additions and 1 deletions

View File

@ -1,12 +1,16 @@
package com.codesdream.ase.model.parent; package com.codesdream.ase.model.parent;
import com.codesdream.ase.model.mark.Tag;
import com.codesdream.ase.model.permission.User; import com.codesdream.ase.model.permission.User;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import javax.persistence.Entity; import javax.annotation.Generated;
import javax.persistence.*;
import java.util.List;
@Entity @Entity
@Table
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
public class Parent extends User { public class Parent extends User {

View File

@ -0,0 +1,17 @@
package com.codesdream.ase.repository.parent;
import com.codesdream.ase.model.parent.Parent;
import com.codesdream.ase.model.student.Student;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
import java.util.Optional;
@Repository
public interface ParentRepository extends JpaRepository<Parent,Integer> {
List<Parent> findByStudentId(String studentId);
List<Parent> findByStudentId(String studentId, Sort sort);
}

View File

@ -0,0 +1,17 @@
package com.codesdream.ase.repository.robot;
import com.codesdream.ase.model.robot.Faq;
import com.codesdream.ase.model.student.Honor;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface FaqRepository extends JpaRepository<Faq, Integer> {
Faq findByAnswer(String answer);
Faq findByAnswer(String answer, Sort sort);
}

View File

@ -1,6 +1,7 @@
package com.codesdream.ase.repository.student; package com.codesdream.ase.repository.student;
import com.codesdream.ase.model.student.Student; import com.codesdream.ase.model.student.Student;
import com.codesdream.ase.model.student.StudentCourse;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@ -11,4 +12,7 @@ import java.util.Optional;
@Repository @Repository
public interface StudentRepository extends JpaRepository<Student, Integer> { public interface StudentRepository extends JpaRepository<Student, Integer> {
Student findByParentId(String parentId);
Student findByParentId(String parentId, Sort sort);
} }