首页>代码>S2SH(spring+struts2+hibernate)整合开发java web人事后台管理系统>/sshDemo/src/com/wgc/action/DeptAction.java
package com.wgc.action; import java.util.List; import com.wgc.entity.Dept; public class DeptAction extends AbstractAction { private List<Dept> depts; private Dept dept; public List<Dept> getDepts() { return depts; } public void setDepts(List<Dept> depts) { this.depts = depts; } public Dept getDept() { return dept; } public void setDept(Dept dept) { this.dept = dept; } public String selectDept() throws Exception { //设置请求的页数 if(this.pageIndex != null) { this.pageModel.setPageIndex(pageIndex); } //查询总条数 Integer recordCount = sshService.getDeptCount(); //把总数设置到poageModel当中 this.pageModel.setRecordCount(recordCount); //查询数据 depts = sshService.selectDeptPage(this.pageModel); return SUCCESS; } //通过部门名称查询 public String selectDeptByName() throws Exception { //设置请求的页数 if(this.pageIndex != null) { this.pageModel.setPageIndex(pageIndex); } //查询总条数 Integer recordCount = sshService.getCountByName(dept.getName()); //把总数设置到poageModel当中 this.pageModel.setRecordCount(recordCount); //查询数据 depts = sshService.selectDeptByName(pageModel, dept.getName()); return SUCCESS; } /** * 1 跳转带添加页面 * 2 提交到数据库 */ public String addDept() throws Exception { if(flag.equals("1")) { return "showAddDept"; }else { sshService.saveDept(dept); return SUCCESS; } } /** * 1 跳转修改页面 * 2 提交到数据库 */ public String updateDpet() throws Exception { if(flag.equals("1")) { dept = sshService.findDeptId(id); return "showUpdateDept"; }else { sshService.updateDept(dept); return SUCCESS; } } }

程健飞 LV2
2023年3月30日
Hugo_0901 LV5
2022年4月27日
wanglinddad LV55
2022年4月19日
wangzile1994 LV12
2022年4月16日
槛外人 LV6
2022年3月29日
afei115 LV4
2021年11月29日
864152530 LV5
2021年6月7日
zuihaofdfdfdfdddd LV10
2021年5月30日
1207748096 LV6
2021年5月12日
and123456 LV11
2021年4月20日

黄志琴 LV1
前天
微信网友_7407113009926144 LV1
3月3日
charies778
1月7日
暂无贡献等级
AOAO1234 LV2
2024年12月23日
asfsghjhgsfadaas
2024年12月16日
暂无贡献等级
isssssss7
2024年10月13日
暂无贡献等级
lqzixi LV4
2024年10月9日
WBelong LV8
2023年12月15日
zhangyanghao
2023年9月21日
暂无贡献等级
lcqlcl LV11
2023年8月29日