packagecom.itheima.mapper;importcom.itheima.bean.Student;importcom.itheima.sql.ReturnSql;importorg.apache.ibatis.annotations.*;importjava.util.List;publicinterfaceStudentMapper{// 映射接口文件// 注解操作 实现接口对象的创建 不需要为每一个接口写xml映射文件// @Select("SELECT * FROM student")@SelectProvider(type =ReturnSql.class,method ="getSelectAll")publicList<Student>selectAll();// 新增功能@Insert("INSERT INTO student VALUES (#{id},#{name},#{age}")publicabstractIntegerinsert(Student stu);// 修改功能@Update("UPDATE student SET name = #{name} ,age = #{age} WHERE id = #{id}")publicabstractIntegerupdate(Student stu);// 删除功能@Delete("Delete FROM student WHERE id = #{id}")publicabstractIntegerdelete(Integer id);}
// 修改功能// @Update("UPDATE student SET name = #{name} ,age = #{age} WHERE id = #{id}")@UpdateProvider(type =ReturnSql.class,method ="getUpdate")publicabstractIntegerupdate(Student stu);