/**查处系统信息*/
public List<CfMessage> getmessage(String corId,Page page){
StringBuffer hql=new StringBuffer();
hql
.append("SELECT cf_message.Msg_ID,cf_message.Msg_To,cf_message.Msg_From,cf_message.Msg_Title,cf_message.Msg_Pro_Id,cf_message.Msg_Parent_Id,cf_message.Msg_IsRead,cf_message.Msg_IsDel FROM cf_message WHERE cf_message.Msg_IsDel=0 AND cf_message.Msg_From='system' and cf_message.Msg_To='"+corId+"' order by cf_message.Msg_Time desc");
Query query=this.getSession().createSQLQuery(hql.toString());
query.setFirstResult(page.getBeginIndex()).setMaxResults(page.getEveryPage());
List<CfMessage> list=query.list();
System.out.println(page.getBeginIndex()+"......."+page.getEveryPage());
if(getSession()!=null){
getSession().flush();
getSession().close();
}
/**查出系统信息的对大条数*/
public int getmessageCount(String name){
StringBuffer sql = new StringBuffer();
sql.append("SELECT COUNT(mess.Msg_ID) FROM cf_message mess where mess.Msg_From='system' and mess.Msg_To='"+name+"'");
Query query=getSession().createSQLQuery(sql.toString());
List list =query.list();
System.out.println("}}}}}}}}}}}"+list.size()+".............");
if(getSession()!=null){
getSession().flush();
getSession().close();
}
System.out.println("-----"+sql.toString());
return Integer.valueOf(list.get(0).toString());
}