67,512
社区成员
发帖
与我相关
我的任务
分享
return getHibernateTemplate().execute(new HibernateCallback<List<Brand>>() {
@SuppressWarnings("unchecked")
@Override
public List<Brand> doInHibernate(Session session)
throws HibernateException, SQLException {
return session.createQuery("select distinct o.brand from ProductInfo o where o.productType.id in(:typeids)")
.setParameterList("typeids", typeids)//typeids为集合对象,如果是数组可以自己转下Arrays.asList();
.list();
}
});
// 根据公司ID和指定年月获得业务员完成的业绩
public BigDecimal getConstFeeAll(Integer year, Integer month, String deptId) {
String hql = "select sum(finalMoney) from DecoConstruction where year(createDate)=? and month(createDate)=? and decoDecoration.id in (select decoDecoration.id from DecoDistribute where coreEmployee.department.id in (" + deptId + ") and type=? and isAvalibled=?)";
Object object = getObject(hql, new Object[]{ year, month, DecoDistribute.TYPE_SALESMAN, true });
return (null != object ? (BigDecimal) object : new BigDecimal(0d));
}