Queryquery=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from AccountHead accountHead where 1=1 "+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum("+modeName+") as allMoney from AccountHead accountHead where Type='"+type+"' and OrganId ="+supplierId+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum("+modeName+") as allMoney from AccountHead accountHead where Type='"+type+"' and OrganId ="+supplierId+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
Queryquery=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select max(Id) as Id from DepotHead depotHead where 1=1 "+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum("+modeName+") as allMoney from DepotHead depotHead where Type='"+type+"' and SubType = '"+subType+"' and OrganId ="+supplierId+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createQuery("select sum("+modeName+") as allMoney from DepotHead depotHead where Type='"+type+"' and SubType = '"+subType+"' and OrganId ="+supplierId+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
queryString.append("select dh.Number,concat(dh.SubType,dh.Type) as newType,dh.DiscountLastMoney,dh.ChangeAmount,s.supplier,date_format(dh.OperTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_depothead dh "+
"inner join jsh_supplier s on s.id=dh.OrganId where s.type='"+supType+"' and dh.SubType!='其它' "+
"and dh.OperTime >='"+beginTime+"' and dh.OperTime<='"+endTime+"' ");
if(organId!=null&&!organId.equals("")){
queryString.append(" and dh.OrganId='"+organId+"' ");
"and dh.OperTime >='"+beginTime+"' and dh.OperTime<='"+endTime+"' ");
if(organId!=null&&!organId.equals("")){
queryString.append(" and dh.OrganId='"+organId+"' ");
}
queryString.append("UNION ALL "+
"select ah.BillNo,ah.Type as newType,ah.TotalPrice,ah.ChangeAmount,s.supplier,date_format(ah.BillTime,'%Y-%m-%d %H:%i:%S') as oTime from jsh_accounthead ah "+
"inner join jsh_supplier s on s.id=ah.OrganId where s.type='"+supType+"' "+
"and ah.BillTime >='"+beginTime+"' and ah.BillTime<='"+endTime+"' ");
if(organId!=null&&!organId.equals("")){
queryString.append(" and ah.OrganId='"+organId+"' ");
"and ah.BillTime >='"+beginTime+"' and ah.BillTime<='"+endTime+"' ");
if(organId!=null&&!organId.equals("")){
queryString.append(" and ah.OrganId='"+organId+"' ");
}
queryString.append(" ORDER BY oTime");
Queryquery;
...
...
@@ -191,11 +183,11 @@ public class DepotHeadDAO extends BaseDAO<DepotHead> implements DepotHeadIDAO {