?? 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 + -