DeptService (service.impl)
来源:互联网 发布:聚美优品有假货吗 知乎 编辑:程序博客网 时间:2024/06/03 01:42
package cn.et.food.service.impl;import java.util.ArrayList;import java.util.List;import org.apache.ibatis.session.RowBounds;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Service;import cn.et.food.Tools.EPageTools;import cn.et.food.dao.DeptMapper;import cn.et.food.dao.EmpMapper;import cn.et.food.entity.Dept;import cn.et.food.entity.DeptExample;import cn.et.food.entity.Emp;import cn.et.food.entity.EmpExample;import cn.et.food.entity.Student;import cn.et.food.entity.TreeNode;import cn.et.food.entity.EmpExample.Criteria;import cn.et.food.service.DeptService;@Servicepublic class DeptServiceImpl implements DeptService {@AutowiredDeptMapper dm;@AutowiredEmpMapper em;/* (non-Javadoc) * @see cn.et.food.service.impl.StudentService#queryStudent(java.lang.String) *//* (non-Javadoc) * @see cn.et.food.service.impl.deptService#queryTreeNode(java.lang.Integer) */public List<TreeNode> queryTreeNode(Integer pid){DeptExample de=new DeptExample();de.createCriteria().andPidEqualTo(pid);List<Dept> dept=dm.selectByExample(de);List<TreeNode> deptList=new ArrayList<TreeNode>();for(Dept d:dept){TreeNode tn=new TreeNode();tn.setId(d.getId());tn.setText(d.getDname());// 判断当前节点是否还存在自节点if(queryTreeNode(d.getId()).size()==0){tn.setState("onpen");}deptList.add(tn);}return deptList;}public EPageTools queryEmp(Integer id,String sname,Integer page,Integer rows){EmpExample ee=new EmpExample();Criteria cr = ee.createCriteria();if(id!=null){ cr.andDeptidEqualTo(id);}if(sname !=null){cr.andEnameLike("%"+sname+"%");}int total=queryEmpCount(ee);//发起sql语句查询总记录数EPageTools p=new EPageTools(page, rows, total);RowBounds rb=new RowBounds(p.getStartIndex()-1, rows);List<Emp> empList=em.selectByExampleWithRowbounds(ee, rb);p.setRows(empList);return p;}public int queryEmpCount(EmpExample ee){int total=(int)em.countByExample(ee);return total;}public void deleteemp(Integer id){em.deleteByPrimaryKey(id);}public void updateEmp(Emp e){em.updateByPrimaryKey(e);}public void saveEmp(Emp e){em.insertSelective(e);}}
阅读全文
0 0
- DeptService (service.impl)
- DeptService (service接口)
- dispatch.service.impl
- 向service.Impl注入DAO
- No qualifying bean of type [com.it.service.DeptService] found for dependency
- SSH 的 action , Service , impl 关系 ?
- $Proxy11 cannot be cast to cn.oa.service.impl.UserServiceImpl
- 关于java中dao,model,service,impl,util的理解
- cn.springmvc.service.impl.AFDCityServiceImpl cannot be cast to cn.springmvc.service.AFDCityService
- java.lang.ClassCastException: $Proxy17 cannot be cast to *.*.*.service.impl.DeviceService
- mysql根据数据库自动生成实体(dto,service,impl,mybatis,xml)
- 解惑java下dao,model,service,impl,util包名含义
- No operation was found with the name {http://impl.service.xq.com/}sayHi
- 解惑java下dao,model,service,impl,util包名含义
- 暑假学习SpringMvc01-java中dao,javabean,dto,model,service,impl,util各个的含义
- java下main,dao,model,service,impl,util包名含义
- Could not autowire field: private java.lang.Integer com.taotao.sso.service.impl.UserServiceImpl.SSO_
- mysql根据数据库自动生成实体(dto,service,impl,mybatis,xml)
- 数组和指针
- linux texlive 中latex中文字体 (设置目录书签)
- node学习笔记(四)cookie和session
- python从提供的api中提取数据信息解析json
- 微信小程序----页面生命周期
- DeptService (service.impl)
- 1053. 住房空置率 (20)
- Windows下cmake编译Eigen3.3.4
- layui的select联动
- Centos7/RHEL7 开启kdump
- 图片没有访问权限
- Python全栈开发零基础学习通关秘籍:2018新手入门指南
- 树的子结构
- 1054. 求平均值 (20)