基于javaweb+SSM的毕业设计管理系统(java+SSM+JSP+MYSQL+layui+Maven)

一、项目简述

功能包括:
课题管理,学生管理,内容管理,文件管理,提问管理,教师管理,进度管理等等。
二、项目运行

环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)。

项目技术:
JSP +Spring + SpringMVC + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等。请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

}
管理员登录控制层:
@Controller("adminLoginController")
@RequestMapping(value = "/adminLogin")
public class AdminLoginController extends MyController {
	
	@RequestMapping(value = "/login")
	public String index(Model model, HttpServletRequest request)throws Exception {
		return "/admin/login";
	}
	
	@RequestMapping(value = "/save")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String username,String password) throws Exception {
		String sql="select * from t_admin where username=?";
public class AdminLoginController extends MyController {
	
	@RequestMapping(value = "/login")
	public String index(Model model, HttpServletRequest request)throws Exception {
		return "/admin/login";
	}
	
	@RequestMapping(value = "/save")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String username,String password) throws Exception {
		String sql="select * from t_admin where username=?";
		List<Map> list = db.queryForList(sql, new Object[]{username});
		String result="1";
		if(list!=null&&list.size()>0){
			Map map = list.get(0);
			if(StringHelper.get(map, "password").equals(password)){
@Controller("adminLoginController")
@RequestMapping(value = "/adminLogin")
public class AdminLoginController extends MyController {
	
	@RequestMapping(value = "/login")
	public String index(Model model, HttpServletRequest request)throws Exception {
		return "/admin/login";
	}
	
	@RequestMapping(value = "/save")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String username,String password) throws Exception {
		String sql="select * from t_admin where username=?";
		List<Map> list = db.queryForList(sql, new Object[]{username});
		String result="1";
		if(list!=null&&list.size()>0){
			Map map = list.get(0);
			if(StringHelper.get(map, "password").equals(password)){
		int result = 0;
		if(id!=null){
			String sql="update t_user set username=?,password=?,name=?,gh=?,mobile=?,headPic=? where id=?";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic,id});
		}else{
			String sql="insert into t_user(username,password,name,gh,mobile,headPic) values(?,?,?,?,?,?)";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic});
		}
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}
	
	@RequestMapping(value = "/editDelete")
		}
		
	}
	
	@RequestMapping(value = "/edit")
	public String edit(Model model, HttpServletRequest request,Long id)throws Exception {
		if(id!=null){
			//修改
			String sql="select * from t_user where id=?";
			Map map = db.queryForMap(sql,new Object[]{id});
			model.addAttribute("map", map);
		}String sql="";
		return "/admin/user/edit";
	}
}
管理员登录控制层:
@Controller("adminLoginController")
@RequestMapping(value = "/adminLogin")
public class AdminLoginController extends MyController {
	
	@RequestMapping(value = "/editSave")
	public ResponseEntity<String> editSave(Model model,HttpServletRequest request,Long id
		,String username,String password,String name,String gh,String mobile,String headPic) throws Exception{
		int result = 0;
		if(id!=null){
			String sql="update t_user set username=?,password=?,name=?,gh=?,mobile=?,headPic=? where id=?";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic,id});
		}else{
			String sql="insert into t_user(username,password,name,gh,mobile,headPic) values(?,?,?,?,?,?)";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic});
		}
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}
	
	@RequestMapping(value = "/editDelete")
	
	@RequestMapping(value = "/list")
	public String list(Model model, HttpServletRequest request,String username,String name)throws Exception {
		String sql="select a.* from t_user a where 1=1";
	if(username!=null&&!"".equals(username)){
			sql+=" and username like '%"+username+"%'";
		}
	if(name!=null&&!"".equals(name)){
			sql+=" and name like '%"+name+"%'";
		}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/admin/user/list";
	}
	
	@RequestMapping(value = "/editSave")
	public ResponseEntity<String> editSave(Model model,HttpServletRequest request,Long id
	if(name!=null&&!"".equals(name)){
			sql+=" and name like '%"+name+"%'";
		}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/admin/user/list";
	}
	
	@RequestMapping(value = "/editSave")
	public ResponseEntity<String> editSave(Model model,HttpServletRequest request,Long id
		,String username,String password,String name,String gh,String mobile,String headPic) throws Exception{
		int result = 0;
		if(id!=null){
			String sql="update t_user set username=?,password=?,name=?,gh=?,mobile=?,headPic=? where id=?";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic,id});
		}else{
			String sql="insert into t_user(username,password,name,gh,mobile,headPic) values(?,?,?,?,?,?)";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic});
		}
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
	if(username!=null&&!"".equals(username)){
			sql+=" and username like '%"+username+"%'";
		}
	if(name!=null&&!"".equals(name)){
			sql+=" and name like '%"+name+"%'";
		}
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/admin/user/list";
	}
	
	@RequestMapping(value = "/editSave")
	public ResponseEntity<String> editSave(Model model,HttpServletRequest request,Long id
		,String username,String password,String name,String gh,String mobile,String headPic) throws Exception{
		int result = 0;
		if(id!=null){
			String sql="update t_user set username=?,password=?,name=?,gh=?,mobile=?,headPic=? where id=?";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic,id});
		}else{
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
	}
	
	@RequestMapping(value = "/editDelete")
	public ResponseEntity<String> editDelete(Model model,HttpServletRequest request,Long id) throws Exception {
		
		String sql="delete from t_user where id=?";
		int result = db.update(sql, new Object[]{id});
		if(result==1){
			return renderData(true,"操作成功",null);
		}else{
			return renderData(false,"操作失败",null);
		}
		
	}
	
		sql+=" order by id desc";
		List list = db.queryForList(sql);
		request.setAttribute("list", list);
		return "/admin/user/list";
	}
	
	@RequestMapping(value = "/editSave")
	public ResponseEntity<String> editSave(Model model,HttpServletRequest request,Long id
		,String username,String password,String name,String gh,String mobile,String headPic) throws Exception{
		int result = 0;
		if(id!=null){
			String sql="update t_user set username=?,password=?,name=?,gh=?,mobile=?,headPic=? where id=?";
			result = db.update(sql, new Object[]{username,password,name,gh,mobile,headPic,id});
		}else{
		return "/admin/user/edit";
	}
}
管理员登录控制层:
@Controller("adminLoginController")
@RequestMapping(value = "/adminLogin")
public class AdminLoginController extends MyController {
	
	@RequestMapping(value = "/login")
	public String index(Model model, HttpServletRequest request)throws Exception {
		return "/admin/login";
	}
	
	@RequestMapping(value = "/save")
	public ResponseEntity<String> loginSave(Model model,HttpServletRequest request,String username,String password) throws Exception {
		String sql="select * from t_admin where username=?";
		List<Map> list = db.queryForList(sql, new Object[]{username});
		String result="1";
		if(list!=null&&list.size()>0){
			Map map = list.get(0);
			if(StringHelper.get(map, "password").equals(password)){
				request.getSession().setMaxInactiveInterval(60*60*24);
				request.getSession().setAttribute("adminBean", map);
				result="1";
			}else{
				result="0";

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值