各位大佬,批量删除怎么写?其他都写完了
这是Dao层
public interface StudentDao {
// 查询所有学生信息,获取页码,条数,输入的姓名和年龄
List<Student> findall(@Param("page")Integer page,@Param("limit")Integer limit,@Param("name")String name,@Param("age")Integer age);
// 查询学生的姓名和年龄
Integer StuCon(@Param("name")String name,@Param("age")Integer age);
// 添加学生
Integer addStu(Student student);
// 修改学生
Integer updateStu(Student student);
// 删除学生
Integer deleteStu(Integer id);
}
这是Mapper.xml
<mapper namespace="com.yzd.dao.StudentDao">
<!-- 查询所有 -->
<select id="findall" resultType="com.yzd.entity.Student">
select * from student
<where>
<if test="name!=null and name!='' ">
and name like '%${name}%'
</if>
<if test="age!=null and age!=0">
and age=#{age}
</if>
</where>
order by id
limit #{page},#{limit}
</select>
<!-- 查询学生的姓名和年龄 -->
<select id="StuCon" resultType="Integer">
select count(*) from student
<where>
<if test="name!=null and name!='' ">
and name like '%${name}%'
</if>
<if test="age!=null and age!=0">
and age=#{age}
</if>
</where>
</select>
<!-- 添加学生 -->
<insert id="addStu" parameterType="com.yzd.entity.Student">
insert into student(name,sex,age) values(#{name},#{sex},#{age})
</insert>
</mapper>
这是Service层
public interface StudentService {
// 查询所有学生信息
List<Student> findall(Integer page,Integer li