reportdao.java
来自「本系统基本完善了CRM管理系统的各个模块」· Java 代码 · 共 28 行
JAVA
28 行
package com.accp.dao.jb_crm_team0.Imp;
import org.hibernate.Query;
import org.hibernate.Session;
import com.accp.util.PageResult;
import com.accp.hib.HibernateSessionFactory;
public class ReportDAO {
//查询客户构成
public PageResult finCustStructure(String type) {
PageResult pgr = new PageResult();
Session session = HibernateSessionFactory.getSession();
String hql = null;
if (type == "cstLevel") {
hql = "select (select b.dictItem from BasDict b where dictType='客户等级' and b.dictId=c.basDictByCustLevel.dictId) as 等级,count(*) from CstCustomer c group by c.basDictByCustLevel.dictId";
} else if (type == "cstSatisfy") {
hql = "select c.custSatisfy,count(*) from CstCustomer c group by c.custSatisfy";
} else if (type == "cstCredit") {
hql = "select c.custCredit,count(*) from CstCustomer c group by c.custCredit";
}
Query query = session.createQuery(hql);
pgr.setData(query.list());
pgr.setRowCount(query.list().size());
return pgr;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?