📄 salchancebiz.java
字号:
package org.jb.y2t308.team3.biz;
import java.util.Iterator;
import java.util.List;
import org.hibernate.Query;
import org.hibernate.Session;
import org.jb.common.biz.BaseBiz;
import org.jb.common.dao.hibimpl.HibernateSessionFactory;
import org.jb.common.util.PageResult;
import org.jb.y2t308.team3.entity.SalChance;
import org.jb.y2t308.team3.entity.SysRole;
/*******************************************************************************
* 销售机会Biz
*
* @author Administrator
*
*/
public class SalChanceBiz extends BaseBiz {
/**
* 获得分页list和进行模糊查询
*
* @param salChances
* @param pageResult
*/
public void getSaleList(SalChance salChances, PageResult pageResult) {
String hql = "select chance from SalChance chance where 1=1 and chance.chcStatus=1";
/**
* 根据客户名称、联系人、概要进行模糊查询
*/
if (null != salChances) {
if (isNotNullOrEmpty(salChances.getChcCustName())) {
hql += " and chance.chcCustName like '%"
+ salChances.getChcCustName() + "%'";
}
if (isNotNullOrEmpty(salChances.getChcTitle())) {
hql += " and chance.chcTitle like '%"
+ salChances.getChcTitle() + "%'";
}
if (isNotNullOrEmpty(salChances.getChcLinkman())) {
hql += " and chance.chcLinkman like '%"
+ salChances.getChcLinkman() + "%'";
}
}
/**
* 排序
*/
if (isNotNullOrEmpty(pageResult.getOrderBy())) {
String sort = pageResult.getSort();
hql += "order by" + pageResult.getOrderBy() + "" + sort;
if ("asc".equals(sort)) {
pageResult.setSort("desc");
} else {
pageResult.setSort("asc");
}
} else {
hql += "order by chance.chcId asc";
}
this.getCommonDAO().listByPage(hql, pageResult);
}
/***************************************************************************
* 新建销售机会
*
* @param salChance
*/
public void addSaleChance(SalChance salChance) {
this.getCommonDAO().add(salChance);
}
/***************************************************************************
* 删除销售机会
*
* @param chanceId
*/
public void delSaleChance(long chanceId) {
this.getCommonDAO().del(SalChance.class, chanceId);
}
/***************************************************************************
* 通过ChanceId获得销售机会信息
*
* @param chanceIds
*/
public SalChance getSaleChanceByChanceId(long chanceId) {
return (SalChance) this.getCommonDAO().get(SalChance.class, chanceId);
}
/***************************************************************************
* 更新SalChance记录
*
* @param salChance
*/
public void updateSaleChance(SalChance salChance) {
this.getCommonDAO().update(salChance);
}
/***************************************************************************
* 获得客户经理的一个集合
*
* @return
*/
public List getCustomerManagerList(int id) {
String hql = "select o from SysUser o where o.usrRole.roleId=" + id;
List list = this.getCommonDAO().list(hql);
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -