query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"' and MaterialId ="+MId+" and jsh_depothead.OperTime <'"+MonthTime+"-01 00:00:00' "+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
queryString="select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"'";
if(ProjectId!=null){
queryString+=" and ProjectId='"+ProjectId+"'";
}
queryString+=" and MaterialId ="+MId+" and jsh_depothead.OperTime <'"+MonthTime+"-01 00:00:00' ";
query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"' and MaterialId ="+MId+" and jsh_depothead.OperTime >='"+MonthTime+"-01 00:00:00' and jsh_depothead.OperTime <='"+MonthTime+"-31 00:00:00' "+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
queryString="select sum(OperNumber) as OperNumber from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"'";
if(ProjectId!=null){
queryString+=" and ProjectId='"+ProjectId+"'";
}
queryString+=" and MaterialId ="+MId+" and jsh_depothead.OperTime >='"+MonthTime+"-01 00:00:00' and jsh_depothead.OperTime <='"+MonthTime+"-31 00:00:00' ";
query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"' and MaterialId ="+MId+" and jsh_depothead.OperTime <'"+MonthTime+"-01 00:00:00' "+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
queryString="select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"'";
if(ProjectId!=null){
queryString+=" and ProjectId='"+ProjectId+"'";
}
queryString+=" and MaterialId ="+MId+" and jsh_depothead.OperTime <'"+MonthTime+"-01 00:00:00' ";
query=this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery("select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"' and MaterialId ="+MId+" and jsh_depothead.OperTime >='"+MonthTime+"-01 00:00:00' and jsh_depothead.OperTime <='"+MonthTime+"-31 00:00:00' "+SearchConditionUtil.getCondition(pageUtil.getAdvSearch()));
queryString="select sum(AllPrice) as AllPrice from jsh_depotitem,jsh_depothead where jsh_depotitem.HeaderId = jsh_depothead.id and type='"+type+"'";
if(ProjectId!=null){
queryString+=" and ProjectId='"+ProjectId+"'";
}
queryString+=" and MaterialId ="+MId+" and jsh_depothead.OperTime >='"+MonthTime+"-01 00:00:00' and jsh_depothead.OperTime <='"+MonthTime+"-31 00:00:00' ";