• 大小: 36.2MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-23
  • 语言: 其他
  • 标签: spring  mybaits  springmvc  

资源简介

该项目基于spring mv c+spring+mybaits框架技术来实现的,该项目环境为jdk1.8,tomcat8.0,使用了数据源c3p0数据源

资源截图

代码片段和文件信息

package org.fkit.hrm.controller;

import java.util.List;

import org.fkit.hrm.domain.Dept;
import org.fkit.hrm.service.HrmService;
import org.fkit.hrm.util.tag.PageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
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.servlet.ModelAndView;

/**   
 * @Description: 处理部门请求控制器
 * 
网站:疯狂Java 
 * @author 肖文吉 36750064@qq.com   
 * @version V1.0   
 */

@Controller
public class DeptController {

/**
 * 自动注入UserService
 * */
@Autowired
@Qualifier(“hrmService“)
private HrmService hrmService;

/**
 * 处理/login请求
 * */
@RequestMapping(value=“/dept/selectDept“)
 public String selectDept(Model modelInteger pageIndex
 @ModelAttribute Dept dept){
System.out.println(“selectDept -->>“);
System.out.println(“pageIndex = “ + pageIndex);
System.out.println(“dept = “ + dept);
PageModel pageModel = new PageModel();
System.out.println(“getPageIndex = “ + pageModel.getPageIndex());
System.out.println(“getPageSize = “ + pageModel.getPageSize());
System.out.println(“getRecordCount = “ + pageModel.getRecordCount());
if(pageIndex != null){
pageModel.setPageIndex(pageIndex);
}
/** 查询用户信息     */
List depts = hrmService.findDept(dept pageModel);
model.addAttribute(“depts“ depts);
model.addAttribute(“pageModel“ pageModel);
return “dept/dept“;

}

/**
 * 处理删除部门请求
 * @param String ids 需要删除的id字符串
 * @param ModelAndView mv
 * */
@RequestMapping(value=“/dept/removeDept“)
 public ModelAndView removeDept(String idsModelAndView mv){
// 分解id字符串
String[] idArray = ids.split(““);
for(String id : idArray){
// 根据id删除部门
hrmService.removeDeptById(Integer.parseInt(id));
}
// 设置客户端跳转到查询请求
mv.setViewName(“redirect:/dept/selectDept“);
// 返回ModelAndView
return mv;
}

/**
 * 处理添加请求
 * @param String flag 标记, 1表示跳转到添加页面,2表示执行添加操作
 * @param Dept  dept  要添加的部门对象
 * @param ModelAndView mv
 * */
@RequestMapping(value=“/dept/addDept“)
 public ModelAndView addDept(
 String flag
 @ModelAttribute Dept dept
 ModelAndView mv){
if(flag.equals(“1“)){
// 设置跳转到添加页面
mv.setViewName(“dept/showAddDept“);
}else{
// 执行添加操作
hrmService.addDept(dept);
// 设置客户端跳转到查询请求
mv.setViewName(“redirect:/dept/selectDept“);
}
// 返回
return mv;
}


/**
 * 处理修改部门请求
 * @param String flag 标记, 1表示跳转到修改页面,2表示执行修改操作
 * @param Dept dept 要修改部门的对象
 * @param ModelAndView mv
 * */
@RequestMapping(value=“/dept/updateDept“)
 public ModelAndView updateDpet(
 String flag
 @ModelAttribute Dept dept
 ModelAndView mv){
if(flag.equals

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        845  2016-07-09 17:11  hrmapp\.classpath

     文件       1039  2016-07-09 17:11  hrmapp\.project

     文件        503  2016-07-09 17:11  hrmapp\.settings\.jsdtscope

     文件        364  2016-07-09 17:11  hrmapp\.settings\org.eclipse.jdt.core.prefs

     文件        470  2016-07-09 17:11  hrmapp\.settings\org.eclipse.wst.common.component

     文件        345  2016-07-09 17:11  hrmapp\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2016-07-09 17:11  hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2016-07-09 17:11  hrmapp\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件        261  2016-07-10 07:46  hrmapp\build\classes\db.properties

     文件        622  2016-07-17 15:14  hrmapp\build\classes\log4j.properties

     文件       4407  2016-07-28 16:24  hrmapp\build\classes\org\fkit\hrm\controller\DeptController.class

     文件       6855  2016-07-28 22:47  hrmapp\build\classes\org\fkit\hrm\controller\DocumentController.class

     文件       5503  2016-07-28 16:23  hrmapp\build\classes\org\fkit\hrm\controller\EmployeeController.class

     文件        762  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\controller\FormController.class

     文件       4031  2016-07-28 16:24  hrmapp\build\classes\org\fkit\hrm\controller\JobController.class

     文件       4490  2016-07-28 16:27  hrmapp\build\classes\org\fkit\hrm\controller\NoticeController.class

     文件       4927  2016-07-28 20:51  hrmapp\build\classes\org\fkit\hrm\controller\UserController.class

     文件       1233  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\DeptDao.class

     文件       1546  2016-07-28 13:37  hrmapp\build\classes\org\fkit\hrm\dao\DocumentDao.class

     文件       1978  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\EmployeeDao.class

     文件       1220  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\JobDao.class

     文件       1526  2016-07-28 13:34  hrmapp\build\classes\org\fkit\hrm\dao\NoticeDao.class

     文件       1233  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$1.class

     文件       1230  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$2.class

     文件       1187  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$3.class

     文件       1066  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider$4.class

     文件       2096  2016-07-28 13:28  hrmapp\build\classes\org\fkit\hrm\dao\provider\DeptDynaSqlProvider.class

     文件       1280  2016-07-28 13:37  hrmapp\build\classes\org\fkit\hrm\dao\provider\DocumentDynaSqlProvider$1.class

     文件       1277  2016-07-28 13:37  hrmapp\build\classes\org\fkit\hrm\dao\provider\DocumentDynaSqlProvider$2.class

     文件       1513  2016-07-28 13:37  hrmapp\build\classes\org\fkit\hrm\dao\provider\DocumentDynaSqlProvider$3.class

............此处省略1449个文件信息

评论

共有 条评论