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

📄 c33mgritemdao.java

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

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.je.ims.hibernate.MgrItem;
import com.je.ims.hibernate.MgrItemId;
import com.je.ims.hibernate.MgrKind;
import com.je.ims.hibernate.MgrOrg;
import com.chttl.im.organization.Person;

public class c33MgrItemDao extends HibernateDaoSupport {
	
	
	
	public List getMgrItem(Long year,Long month)
    {
		Long yea=new Long(year.intValue()+1911);
	 	String condition = "where mgritem.id.mgrOrgPk =mgrorg.mgrOrgPk and mgrorg.year="+yea+" and mgrorg.month="+month;
		List c = getHibernateTemplate().find("select  mgritem from  MgrItem mgritem,MgrOrg mgrorg "+condition); 
		return c;
    	   
    	  
    }

	public List getMgrItem(Long year,Long month,Long areapk,String orgid)
    {
		Long yea=new Long(year.intValue()+1911);
	 	String condition = "where mgritem.id.mgrOrgPk =mgrorg.mgrOrgPk and mgrorg.year="+yea+" and mgrorg.month="+month+" and mgrorg.areaPk="+areapk+" and mgrorg.orgId='"+orgid+"'";
		List c = getHibernateTemplate().find("select  mgritem from  MgrItem mgritem,MgrOrg mgrorg "+condition); 
		return c;
    	   
    	  
    }
	 public void saveMgrItem(Long mgrOrgPk,String itemId,String nodeName)
	    {
	    	MgrItem c1=new MgrItem();
	    	
	    	c1.setNodeName(nodeName);
	    	MgrItemId c2=new MgrItemId();
	    	c2.setItemId(itemId);
	    	c2.setMgrOrgPk(mgrOrgPk);
	    	c1.setId(c2);
	    	
	    	
	    	
	    	
	    	
	        getHibernateTemplate().saveOrUpdate(c1);
	    }
	 public MgrItem getMgrItem(Long mgrOrgPk,String itemId)
	    {
		 List L1=getHibernateTemplate().find("from MgrItem c where c.id.mgrOrgPk="+mgrOrgPk+"and c.id.itemId='"+itemId+"'");
	    	if(L1.size()>0){return (MgrItem)L1.get(0);}
	    	else return null;
	    }
	 
	 public List getMgrItem(Long year,Long month,Long areapk,String orgid,String kindid)
	    {
			Long yea=new Long(year.intValue()+1911);
		 	String condition = "where mgritem.id.mgrOrgPk =mgrorg.mgrOrgPk and mgrorg.year="+yea+" and mgrorg.month="+month+" and mgrorg.areaPk="+areapk+" and mgrorg.orgId='"+orgid+"'"+" and mgrorg.kindId='"+kindid+"'";
			List c = getHibernateTemplate().find("select  mgritem from  MgrItem mgritem,MgrOrg mgrorg "+condition); 
			return c;
	    	   
	    	  
	    }
	 public MgrItem getMgrItem(Long year,Long month,Long areapk,String orgid,String kindid,String itemId)
	    {
			Long yea=new Long(year.intValue()+1911);
		 	String condition = "where mgritem.id.mgrOrgPk =mgrorg.mgrOrgPk and mgrorg.year="+yea+" and mgrorg.month="+month+" and mgrorg.areaPk="+areapk+" and mgrorg.orgId='"+orgid+"'"+" and mgrorg.kindId='"+kindid+"'"+" and mgritem.id.itemId='"+itemId+"'";
			List c = getHibernateTemplate().find("select  mgritem from  MgrItem mgritem,MgrOrg mgrorg "+condition); 
			if(c.size()>0)
				return (MgrItem)c.get(0);
			else
				return null;
	    	  
	    }
	 public List getMgrItem(Long year,Long month,String kindid){
		 
		 Long yea=new Long(year.intValue()+1911);
		 	String condition = "where mgritem.id.mgrOrgPk =mgrorg.mgrOrgPk and mgrorg.year="+yea+" and mgrorg.month="+month+" and mgrorg.kindId='"+kindid+"'";
			List c = getHibernateTemplate().find("select  mgritem from  MgrItem mgritem,MgrOrg mgrorg "+condition); 
			return c;
	    	   
	 }
	 
	 public void delMgrItem(Long year,Long month,Long areapk,String orgid,String kindid){
		 List l1=getMgrItem( year, month, areapk, orgid, kindid);
		 getHibernateTemplate().deleteAll(l1);
	 }
	 public void delMgrItem(Long year,Long month,Long areapk,String orgid,String kindid,String itemid){
		 MgrItem l1=getMgrItem( year, month, areapk, orgid, kindid,itemid);
		 getHibernateTemplate().delete(l1);
	 }
	 
	 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -