- 1 import org.apache.ibatis.annotations.Insert;
- 2 import org.apache.ibatis.annotations.Options;
- 3
- 4 import cn.zwj.pojo.Student;
- 5
- 6 public interface StudentMapper {
- 7 @Insert("INSERT INTO tb_student (STUDENT_NAME, STUDENT_PWD, STUDENT_STATUS, CREATE_DATE, STUDENT_ACCOUNT) VALUES (#{studentName}, #{studentPwd}, #{studentStatus}, #{createDate}, #{studentAccount})")
- 8 @Options(useGeneratedKeys = true, keyProperty = "studentId")
- 9 //@Options:注解声明生成主键
- 10 int insert(Student student);
- 11 }