forked from profuhifv/1111
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
917 B
30 lines
917 B
package com.example.mapper;
|
|
|
|
import com.example.entity.Grade;
|
|
import org.apache.ibatis.annotations.Delete;
|
|
import org.apache.ibatis.annotations.Insert;
|
|
import org.apache.ibatis.annotations.Select;
|
|
import org.apache.ibatis.annotations.Update;
|
|
|
|
import java.util.List;
|
|
|
|
public interface GradeMapper {
|
|
|
|
@Insert("insert into grade (course_id,student_id,score,comment,feedback) " +
|
|
"values (#{courseId},#{studentId},#{score},#{comment},#{feedback})")
|
|
void insert(Grade grade);
|
|
|
|
List<Grade> selectAll(Grade grade); //关联查询
|
|
|
|
@Update("update grade set score = #{score}, comment =#{comment}, feedback =#{feedback} where id = #{id}")
|
|
void update(Grade grade);
|
|
|
|
|
|
@Select("select * from grade where student_id = #{studentId} and course_id =#{courseId}")
|
|
Grade selectByCondition(Grade grade);
|
|
|
|
@Delete("delete from grade where id = #{id}")
|
|
void deleteById(Integer id);
|
|
|
|
}
|