⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c431notiondao.java

📁 使用spring ,hibernate 框架的稽查管理系统
💻 JAVA
字号:
package com.je.ims.dao;

//import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import java.util.*;

//import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
//import org.springframework.orm.hibernate3.*;
//import java.util.*;
//import java.sql.Clob;
//import java.text.*;

//import com.je.ims.util.*;

//import org.hibernate.*;
//import com.je.ims.hibernate.*;

//import com.je.ims.dao.*;
import com.je.ims.hibernate.Notion;;
public class C431NotionDAO extends CommonDAO {
	public Object[] getCount(int start, int size) {
        List list=getAll();
    	
    	Notion[] app = new Notion[size];
		
		for (int i=0;i<size;i++)
		{
			app[i]=new Notion();
			app[i]=(Notion)list.get(i+start);
		}
		return app;
	}
	
	public Object[] getCount(int start, int size,List l){

    	List list=l;
    	
    	Notion[] app = new Notion[size];
		
		for (int i=0;i<size;i++)
		{
			app[i]=new Notion();
			app[i]=(Notion)list.get(i+start);
		}
		return app;
    }
	
	public List getAll() {
    	
		   String hql="from Notion";
		   List list=this.getHibernateTemplate().find(hql);
		   return list;
		}
	public List getAllByDesc() {
    	
		   String hql="from Notion  order by NOTION_ID desc";
		   List list=this.getHibernateTemplate().find(hql);
		   return list;
		}	
	public List queryNotion(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 Notion where year="+yearL+"and month="+monthL;
		 List l=this.getHibernateTemplate().find(hql);
		 return l;
	}
	
	public void saveNotion(){
		Date ad_date=new Date();
		Date rl_date=new Date();
		//Notion notion=new Notion("123","作業意見",new Long(2006),new Long(02),"默認","公司","Jackie",ad_date,rl_date);
		Notion notion=new Notion();
		notion.setFileId("123");
		notion.setTitle("作業意見");
		notion.setYear(new Long(2006));
		notion.setMonth(new Long(01));
		notion.setNodeId("台北分公司");
		notion.setNodeName("默認");
		notion.setOrgName("公司");
		notion.setFoundDate(new Date());
		notion.setLimitDate(new Date());
		notion.setVersion(new Long(02));
		notion.setFillDate(new Date());
		notion.setEditorName("Jackie");
		notion.setAdviceVersion(new Long(01));
		notion.setAdviceDate(ad_date);
		notion.setAdviceUndertaker("Jackie");
		notion.setAdviceState(new Long(1));
		notion.setOrgDirector("Jackie");
		notion.setReplyState(new Long(1));
		notion.setReplyDate(rl_date);
		notion.setReplyAcceptor("Jackie");
		notion.setTraceState(new Long(1));
		notion.setTraceStartDate(new Date());
		notion.setTraceEndDate(new Date());
		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 + -