Layui+SSM数据表格操作(增删改查)

这篇博客探讨了如何使用Layui前端框架与SSM(Spring、MyBatis、Servlet)后端框架进行数据表格的增删改查功能实现。博主已经完成了大部分代码,但在批量删除的功能上遇到了困扰,具体涉及到Dao层、Mapper.xml、Service层、ServiceImpl层和Controller层以及jsp页面的设计。现博主寻求帮助,希望得到批量删除功能的实现方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

各位大佬,批量删除怎么写?其他都写完了

 

这是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 limit,
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值