📄 c71dao.java
字号:
package com.je.ims.dao;
import java.util.Date;
import java.util.List;
import com.je.ims.hibernate.Docflow;
import com.je.ims.hibernate.Notion;
import com.je.ims.hibernate.Role;
import com.je.ims.hibernate.RoleId;
import com.je.ims.hibernate.RoleType;
public class C71DAO extends CommonDAO {
public Object[] getCount(int start, int count) {
// TODO Auto-generated method stub
return null;
}
public Object[] getCount(int start, int count, List l) {
List list=l;
Docflow[] app = new Docflow[count];
for (int i=0;i<count;i++)
{
app[i]=new Docflow();
app[i]=(Docflow)list.get(i+start);
}
return app;
}
public List getUnHandledEvent(RoleId id)
{
String hql="from Docflow where userRoleid=? and userType=?";
List list=getHibernateTemplate().find(hql,new Object[]{id.getRoleId(),id.getRoleTypeId()});
return list;
}
public Docflow getLastEditor(Long id,RoleId roleid)
{
String hql="from Docflow where docId=? and userRoleid!=? and userType!=? order by step desc";
List list=getHibernateTemplate().find(hql,new Object[]{id,roleid.getRoleId(),roleid.getRoleTypeId()});
Docflow f=null;
if(list.size()>0)
f=(Docflow)list.get(0);
return f;
}
public List getHistoryList(Long docId,Long step)
{
String hql="from Docflow where docId=? and step!=? order by step";
List list=getHibernateTemplate().find(hql,new Object[]{docId,step});
return list;
}
public Docflow getCurrent(Long docId,RoleId id,Long step)
{
String hql="from Docflow where docId=? and userRoleid=? and userType=? and step=?";
List list=getHibernateTemplate().find(hql,new Object[]{docId,id.getRoleId(),id.getRoleTypeId(),step});
Docflow flow=null;
if(list.size()>0)
flow=(Docflow)list.get(0);
return flow;
}
public void saveCheckTemp(Docflow flow)
{
getHibernateTemplate().saveOrUpdate(flow);
}
public String getTypeName(Long roletypeid)
{
String hql="from RoleType where roleTypeId=?";
List list=getHibernateTemplate().find(hql,roletypeid);
String name=null;
if(list.size()>0)
name=((RoleType)list.get(0)).getRoleTypeName();
return name;
}
public void saveLimit(Long docId)
{
}
public void addCheck(Docflow flow)
{
}
public int getSize(RoleId id)
{
List list=getUnHandledEvent(id);
return list.size();
}
public Role getRole(Long roletypeid,String nodeId,Long year,Long month,Long teamPk)
{
Role role=null;
String hql="from Role where id.roleTypeId=? and nodeId=? and year=? and month=? and teamPk=?";
List list=getHibernateTemplate().find(hql,new Object[]{roletypeid,nodeId,year,month,teamPk});
return role;
}
public Date getDate(Long id)
{
String hql="from Notion where notionId=?";
List list=getHibernateTemplate().find(hql,id);
Date date=null;
Notion n=null;
if(list.size()>0)
{
n=(Notion)list.get(0);
}
if(n!=null)
date=n.getLimitDate();
return date;
}
public void saveLimit(Long id,Date date)
{
String hql="from Notion where notionId=?";
List list=getHibernateTemplate().find(hql,id);
Notion no=(Notion)list.get(0);
no.setLimitDate(date);
getHibernateTemplate().saveOrUpdate(no);
}
public void saveEditState(Long id,Long state)
{
String hql="from Notion where notionId=?";
List list=getHibernateTemplate().find(hql,id);
Notion no=(Notion)list.get(0);
no.setEditState(state);
getHibernateTemplate().saveOrUpdate(no);
}
public void saveReply(Long id,Long state,Date date,String reply_name,String reply_id)
{
String hql="from Notion where notionId=?";
List list=getHibernateTemplate().find(hql,id);
Notion no=(Notion)list.get(0);
no.setReplyState(state);
no.setReplyDate(date);
no.setReplyAcceptor(reply_name);
no.setReplyAcceptorId(reply_id);
getHibernateTemplate().saveOrUpdate(no);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -