📄 c44reportdraftdao.java
字号:
package com.je.ims.dao;
import java.util.Date;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.je.ims.hibernate.Notion;
import com.je.ims.hibernate.ReportDraft;
public class C44ReportDraftDAO extends CommonDAO{
public Object[] getCount(int start, int size)
{
List list = getAll();
ReportDraft[] rds = new ReportDraft[size];
for (int i=0;i<size;i++)
{
rds[i] = new ReportDraft();
rds[i] = (ReportDraft)list.get(i+start);
}
return rds;
}
public Object[] getCount(int start, int size,List l){
List list=l;
ReportDraft[] rds = new ReportDraft[size];
for (int i=0;i<size;i++)
{
rds[i]=new ReportDraft();
rds[i]=(ReportDraft)list.get(i+start);
}
return rds;
}
public List getAll()
{
String hql = "from ReportDraft";
List list = this.getHibernateTemplate().find(hql);
return list;
}
public List getAllByDesc() {
String hql="from ReportDraft order by REPORT_DRAFT_ID desc";
List list=this.getHibernateTemplate().find(hql);
return list;
}
public List queryReportDraft(String year,String month){
// int i=new Integer(year).intValue();
//int i=Integer.parseInt(year);
Long i=new Long(year);
long m=i.longValue();
long tempYear=m+1911;
Long yearL=new Long(tempYear);
Long monthL=new Long(month);
// Long yearL=new Long(2006);
//Long monthL=new Long(01);
String hql="from ReportDraft where year="+yearL+"and month="+monthL + " and (editState=1 or editState = 6 or editState =7)";
List list=this.getHibernateTemplate().find(hql);
return list;
}
public void saveReportDraft(){
//this.getHibernateTemplate().saveOrUpdate(notion);
//this.getHibernateTemplate().flush();
}
/*
public Notion getNotionById(String sid){
try{
Long l=new Long(sid);
Notion notion=(Notion)this.getHibernateTemplate().get(Notion.class,l);
return notion;
}catch(Exception e){
return null;
}
}
public List getFoundProceeding(Long notionId){
List l=getHibernateTemplate().find("from FoundProceeding c where c.id.notionId="+notionId);
//if(l.size()>0) return ((FoundProceeding)l.get(l.size()-1));
//else return null;
return l;
}
public List getAdviceDeal(Long notionId,Long foundItem){
List l=getHibernateTemplate().find("from AdviceDeal c where c.id.notionId="+notionId+"and c.id.foundItem="+foundItem);
//if(l.size()>0) return ((AdviceDeal)l.get(l.size()-1));
//else return null;
return l;
}
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -