oa_archive_borrowbean.java

来自「java开发的办公系统 1.系统管理 (地区管理,部门管理,菜单管理,用户管理」· Java 代码 · 共 945 行 · 第 1/3 页

JAVA
945
字号
				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".back_confirm_user like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getBack_confirm_name();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".back_confirm_name like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getComplete_info();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".complete_info like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getWorkflow_state_id();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".workflow_state_id ="+fvalue+" ");					b=true;				}				fvalue=aItem.getWorkflow_state_name();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".workflow_state_name like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getApproval_type();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".approval_type ="+fvalue+" ");					b=true;				}				fvalue=aItem.getAppraisal_method();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".appraisal_method ="+fvalue+" ");					b=true;				}				fvalue=aItem.getApproval_user();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" (','+"+T.OA_ARCHIVE_BORROW+".approval_user+',' like ',%"+fvalue+"%,' or "+T.OA_ARCHIVE_BORROW+".approval_user='all_users') ");					b=true;				}				fvalue=aItem.getApproval_name();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".approval_name like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getApproval_departmentid();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".approval_departmentid like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getApproval_department();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".approval_department like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getReceive_user();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".receive_user like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getReceive_name();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".receive_name like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getFunc_id();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".func_id like '%"+fvalue+"%' ");					b=true;				}				fvalue=aItem.getState_type();				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".state_type ="+fvalue+" ");					b=true;				}				fvalue="has_link_table";				if(fvalue!=null &&   fvalue.length()>0)				{					if(b) filter.append(" and");					filter.append(" "+T.OA_ARCHIVE_BORROW+".archive_category_id = "+T.OA_ARCHIVE_CATEGORY+".id  and ");					filter.append("  "+T.OA_ARCHIVE_BORROW+".appraisal_result="+T.OA_DICTIONARY+".code and "+T.OA_DICTIONARY+".num=9   ");					b=true;				}							StringBuffer sql=new StringBuffer();				sql.append(" select  top "+pageSize+"  "+T.OA_ARCHIVE_BORROW+".* ,"+T.OA_ARCHIVE_CATEGORY+".name as  "+T.OA_ARCHIVE_CATEGORY+"_name,"+T.OA_DICTIONARY+".code_name     from   "+T.OA_ARCHIVE_BORROW+","+T.OA_ARCHIVE_CATEGORY+","+T.OA_DICTIONARY+"     where ");				if(b)				{					sql.append("  "+filter.toString()+" and ");				}				sql.append("  ("+T.OA_ARCHIVE_BORROW+".id not in (SELECT TOP "+Integer.toString(nextPageSize)+" "+T.OA_ARCHIVE_BORROW+".id from   "+T.OA_ARCHIVE_BORROW+","+T.OA_ARCHIVE_CATEGORY+","+T.OA_DICTIONARY+"    ");				if(b)				{					sql.append(" where "+filter.toString()+"  ");				}				sql.append(" order by "+T.OA_ARCHIVE_BORROW+".id desc  ))  order by "+T.OA_ARCHIVE_BORROW+".id desc ");				rs = executeQuery(sql.toString());				while(rs.next()){					Oa_archive_borrowItem item=new Oa_archive_borrowItem();					item.setId(rs.getString("id"));					item.setArchive_information_id(rs.getString("archive_information_id"));					item.setArchive_category_id(rs.getString("archive_category_id"));					item.setArchive_category_nodepath(rs.getString("archive_category_nodepath"));					item.setArchive_no(rs.getString("archive_no"));					item.setArchive_title(rs.getString("archive_title"));					item.setCopies_num(rs.getString("copies_num"));					item.setPage_num(rs.getString("page_num"));					item.setBorrow_destination(rs.getString("borrow_destination"));					item.setBorrow_user(rs.getString("borrow_user"));					item.setBorrow_name(rs.getString("borrow_name"));					item.setBorrow_departmentid(rs.getString("borrow_departmentid"));					item.setBorrow_department(rs.getString("borrow_department"));					item.setBorrow_date(rs.getString("borrow_date"));					item.setBack_date(rs.getString("back_date"));					item.setBack_user(rs.getString("back_user"));					item.setBack_name(rs.getString("back_name"));					item.setRealback_date(rs.getString("realback_date"));					item.setBack_confirm_user(rs.getString("back_confirm_user"));					item.setBack_confirm_name(rs.getString("back_confirm_name"));					item.setComplete_info(rs.getString("complete_info"));					item.setWorkflow_id(rs.getString("workflow_id"));					item.setWorkflow_state_id(rs.getString("workflow_state_id"));					item.setWorkflow_state_name(rs.getString("workflow_state_name"));					item.setApproval_type(rs.getString("approval_type"));					item.setAppraisal_method(rs.getString("appraisal_method"));					item.setApproval_user(rs.getString("approval_user"));					item.setApproval_name(rs.getString("approval_name"));					item.setApproval_departmentid(rs.getString("approval_departmentid"));					item.setApproval_department(rs.getString("approval_department"));					item.setReceive_user(rs.getString("receive_user"));					item.setReceive_name(rs.getString("receive_name"));					item.setFunc_id(rs.getString("func_id"));					item.setState_type(rs.getString("state_type"));					item.setAppraisal_result(rs.getString("appraisal_result"));					Oa_archive_categoryItem oa_archive_categoryItem=new Oa_archive_categoryItem();					oa_archive_categoryItem.setName(rs.getString(T.OA_ARCHIVE_CATEGORY+"_name"));					item.setOa_archive_categoryItem(oa_archive_categoryItem);					Oa_dictionaryItem dictionaryItem =new Oa_dictionaryItem();					dictionaryItem.setCode_name(rs.getString("code_name"));					item.setAppraisal_resultItem(dictionaryItem);					list.add(item);				}				String sql1="select count(*) as total from   "+T.OA_ARCHIVE_BORROW+" ,"+T.OA_ARCHIVE_CATEGORY+","+T.OA_DICTIONARY+"   ";				if(b)					sql1+=" where "+filter.toString();				rs = executeQuery(sql1);				if(rs.next()){					totalRecord=rs.getInt("total");				}			}catch(SQLException e){				System.out.print(e.toString());			}			finally{				DBclose();			}			return list;		}		/**		 * @author	Administrator		 * @param	无		 * @return	KeyId:插入记录时当前记录的id号		 * @see		获得插入记录时当前记录的id号		 */		public int getKey(){			return keyId;		}		/**		 * @author	Administrator		 * @param	无		 * @return	(totalRecord):插入记录时当前记录的id号		 * @see		获得插入记录时当前记录的id号		 */		public int getTotalRecord(){	        return totalRecord;	    }		/**		 * @author	Administrator		 * @param	item:要添加的数据对象Oa_archive_borrowItem		 * @return	boolean:是否添加成功,如果添加成功返回true,否则返回false		 * @see		添加一条记录		 */		public boolean addItem(Oa_archive_borrowItem item){			try{				String sql="insert into "+T.OA_ARCHIVE_BORROW+"("+							"archive_information_id,"+							"archive_category_id,"+							"archive_category_nodepath,"+							"archive_no,"+							"archive_title,"+							"copies_num,"+							"page_num,"+							"borrow_destination,"+							"borrow_user,"+							"borrow_name,"+							"borrow_departmentid,"+							"borrow_department,"+							"borrow_date,"+							"back_date,"+							"back_user,"+							"back_name,"+							"realback_date,"+							"back_confirm_user,"+							"back_confirm_name,"+							"complete_info,"+							"workflow_id,"+							"workflow_state_id,"+							"workflow_state_name,"+							"approval_type,"+							"appraisal_method,"+							"approval_user,"+							"approval_name,"+							"approval_departmentid,"+							"approval_department,"+							"receive_user,"+							"receive_name,"+							"func_id,"+							"appraisal_result,"+							"state_type)values("+							""+item.getArchive_information_id()+","+							""+item.getArchive_category_id()+","+							"'"+item.getArchive_category_nodepath()+"',"+							"'"+item.getArchive_no()+"',"+							"'"+item.getArchive_title()+"',"+							""+item.getCopies_num()+","+							""+item.getPage_num()+","+							"'"+item.getBorrow_destination()+"',"+							"'"+item.getBorrow_user()+"',"+							"'"+item.getBorrow_name()+"',"+							""+item.getBorrow_departmentid()+","+							"'"+item.getBorrow_department()+"',"+							"'"+item.getBorrow_date()+"',"+							"'"+item.getBack_date()+"',"+							"'"+item.getBack_user()+"',"+							"'"+item.getBack_name()+"',"+							"'"+item.getRealback_date()+"',"+							"'"+item.getBack_confirm_user()+"',"+							"'"+item.getBack_confirm_name()+"',"+							"'"+item.getComplete_info()+"',"+							""+item.getWorkflow_id()+","+							""+item.getWorkflow_state_id()+","+							"'"+item.getWorkflow_state_name()+"',"+							""+item.getApproval_type()+","+							""+item.getAppraisal_method()+","+							"'"+item.getApproval_user()+"',"+							"'"+item.getApproval_name()+"',"+							"'"+item.getApproval_departmentid()+"',"+							"'"+item.getApproval_department()+"',"+							"'"+item.getReceive_user()+"',"+							"'"+item.getReceive_name()+"',"+							"'"+item.getFunc_id()+"',"+							""+item.getAppraisal_result()+","+							""+item.getState_type()+")";				return executeUpdate(sql);			}catch(Exception e){				System.out.println(e.toString());				return false;			}			finally{				DBclose();			}		}		public boolean updateWorkflowState(Oa_archive_borrowItem item){			try{				String sql="update "+T.OA_ARCHIVE_BORROW+" set "+							"workflow_state_id="+item.getWorkflow_state_id()+","+							"workflow_state_name='"+item.getWorkflow_state_name()+"',"+							"approval_type="+item.getApproval_type()+","+							"appraisal_method="+item.getAppraisal_method()+","+							"approval_user='"+item.getApproval_user()+"',"+							"approval_name='"+item.getApproval_name()+"',"+							"approval_departmentid='"+item.getApproval_departmentid()+"',"+							"approval_department='"+item.getApproval_department()+"',"+							"receive_user='"+item.getReceive_user()+"',"+							"func_id='"+item.getFunc_id()+"',"+		   	 			   	"receive_name='"+item.getReceive_name()+"' where id="+item.getId();				return executeUpdate(sql);			}catch(Exception e){				System.out.println(e.toString());				return false;			}			finally{				DBclose();

⌨️ 快捷键说明

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