📄 empbiz.java
字号:
package com.parddu.crm.biz.impl;
import java.util.ArrayList;
import java.util.List;
import com.parddu.crm.biz.IempBiz;
import com.parddu.crm.entity.Employee;
import com.parddu.crm.pers.IcommonDAO;
import com.parddu.crm.util.Page;
public class EmpBiz implements IempBiz {
private IcommonDAO cdao;
public IcommonDAO getCdao() {
return cdao;
}
public void setCdao(IcommonDAO cdao) {
this.cdao = cdao;
}
/**
* 员工登陆
*/
public Employee userLoginQuery(String account, String pwd) throws Exception {
Employee emp = null;
String hql = "select e from Employee as e where e.empName=? and e.empPwd=?";
List param = new ArrayList();
param.add(account);
param.add(pwd);
List<Employee> list = this.getCdao().queryHQL(hql, param);
if(list!=null && list.size()>0){
emp = list.get(0);
}
return emp;
}
public boolean notEmptyByName(String name) throws Exception {
String hql = "from Employee where empName=?";
List param = new ArrayList();
param.add(name);
List<Employee> list = this.getCdao().queryHQL(hql, param);
if(list!=null && list.size()>0){
return true;
}
return false;
}
public List<Employee> empByNameAndIdQuery(String name,int pageNumber,int pageIndex) throws Exception{
List<Employee> list = new ArrayList<Employee>();
String chql = "select count(e) from Employee as e where e.empName like ?";
String hql = "select e from Employee as e where e.empName like ?";
List param = new ArrayList();
param.add("%"+name+"%");
List a = this.getCdao().queryHQL(chql, param);
int count = 0;
if(a!=null&& a.size()>0){
count = (Integer)a.get(0);
}
if(count>0){
Page p = new Page();
p.setPage(count, pageNumber, pageIndex);
list = this.getCdao().queryPageHQL(hql, param, p);
}
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -