
演示视频:
基于springboot jsp篮球馆会员管理系统源码和论文
package com.hdaccp.gymxmjpa.Controller;
import com.hdaccp.gymxmjpa.Dao.*;
import com.hdaccp.gymxmjpa.Service.PrivateCoachInfoDaoImpl;
import com.hdaccp.gymxmjpa.entity.PrivateCoachInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.*;
@Controller
@RequestMapping("/privateinfo")
public class PrivateCoachInfoController {
@Autowired
private CoachDao coachDao;
@Autowired
private SubjectDao subjectDao;
@Autowired
private MenberDao menberDao;
@Autowired
private PrivateCoachInfoDao privateCoachInfoDao;
@Autowired
private PrivateCoachInfoDaoImpl privateCoachInfoDaoImpl;
@RequestMapping("/jin3")
public String jin3(){
return "WEB-INF/jsp/privatecoach";
}
@RequestMapping("/ddaa")
@ResponseBody
public List<PrivateCoachInfo> query(){
List<PrivateCoachInfo> list=privateCoachInfoDao.findAll();
return list;
}
@ModelAttribute("a")
public Model cha(Model model){
model.addAttribute("coach",coachDao.findAll());
model.addAttribute("subject",subjectDao.findAll());
model.addAttribute("menber",menberDao.findAll());
return model;
}
@RequestMapping("/query")
@ResponseBody
public Map<String,Object> query2(Model model,Integer coachid, Integer subjectid, Integer memberid, int pageSize, int pageNumber){
Map<String,Object> map1=new HashMap<String,Object>();
map1.put("coachid",coachid);
map1.put("subjectid",subjectid);
map1.put("memberid",memberid);
map1.put("qi",(pageNumber-1)*pageSize);
map1.put("shi",pageSize);
return privateCoachInfoDaoImpl.query(map1);
}
@RequestMapping("/query2")
@ResponseBody
public List<PrivateCoachInfo> query3(long pid){
List<PrivateCoachInfo> list = new ArrayList<PrivateCoachInfo>();
list.add(privateCoachInfoDao.findById(pid).get());
return list;
}
@RequestMapping("/cha")
@ResponseBody
public Optional<PrivateCoachInfo> one(long id){
return privateCoachInfoDao.findById(id);
}
@RequestMapping("/del")
@ResponseBody
public Map<String,Object> del(long id,Integer coachid,Integer subjectid, Integer memberid, int pageSize, int pageNumber){
privateCoachInfoDao.deleteById(id);
Map<String,Object> map1=new HashMap<String,Object>();
map1.put("coachid",coachid);
map1.put("subjectid",subjectid);
map1.put("memberid",memberid);
map1.put("qi",(pageNumber-1)*pageSize);
map1.put("shi",pageSize);
return privateCoachInfoDaoImpl.query(map1);
}
@RequestMapping("/upd")
@ResponseBody
public void upd(PrivateCoachInfo privateCoachInfo){
privateCoachInfoDaoImpl.update(privateCoachInfo);
}
@RequestMapping("/count")
@ResponseBody
public Long count (Integer memid){
privateCoachInfoDaoImpl.count(memid);
System.out.println(privateCoachInfoDaoImpl.count(memid));
return privateCoachInfoDaoImpl.count(memid);
}
@RequestMapping("/byid")
@ResponseBody
public List<PrivateCoachInfo> queryid(Long memberid){
return privateCoachInfoDaoImpl.ByMemberid(memberid);
}
}
该文章展示了一个基于SpringBoot的JSP应用,用于篮球馆会员管理系统的控制器代码,包括数据访问对象(DAO)和实体类。功能涵盖教练信息查询、分页查询、添加、删除和更新操作。
658

被折叠的 条评论
为什么被折叠?



