DocFieldsValueManager.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:5k
源码类别:
OA系统
开发平台:
Java
- package com.gforce.gfoa;
- /**
- * <p>Title: 吉力科技办公自动化系统</p>
- * <p>Description: 吉力科技办公自动化系统</p>
- * <p>Copyright: 版权所有 2003 (c) 西安吉力科技发展有限公司 Copyright (c) 2003 GForce Sceince & Technology</p>
- * <p>Company: 西安吉力科技发展有限公司 (GForce Sceince & Technology)</p>
- * @author 常兵
- * @version 2.0
- * DATE : 2003-12-30
- * 公文字段值信息管理类
- */
- import com.gforce.currency.database.*;
- import java.util.*;
- import com.gforce.currency.*;
- public class DocFieldsValueManager extends RecordManager
- {
- public DocFieldsValueManager()
- {}
- protected final static String TableName = "DocFieldsValue"; //定义声明本类操作表名称
- protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
- protected final static String[] NumericFieldsName = {"DocumentID","DocTempletFieldsID","ApproveFlowID"}; //声明数值型字段名称
- protected final static String[] DatetimeFieldsName = {}; //声明日期时间型字段名称
- protected final static String[] StringFieldsName = {"FieldValue"}; //声明字符型字段名称
- protected final static String[] TextFieldsName = {}; //声明大字符串型字段名称
- /* * 根据字段名称获取插入数据时表单元素名称
- * @param strFieldName 字段名称
- * @return 表单素名称
- */
- protected String InsertParament(String strFieldName)
- {
- return "" + strFieldName + ""; //可以根据需要加前缀、后缀
- }
- /**
- * 根据字段名称获取修改数据时表单元素名称
- * @param strFieldName 字段名称
- * @return 表单素名称
- */
- protected String UpdateParament(String strFieldName)
- {
- return "" + strFieldName + ""; //可以根据需要加前缀、后缀
- }
- /**
- * 获取本类操作表名称
- * @return 表名称
- */
- public String getTableName()
- { //获取本类操作表名称
- return TableName;
- }
- protected String getIDFieldName()
- { //获取主键或者可以确定唯一记录的字段名称
- return IDFieldName;
- }
- protected String[] getNumericFieldsName()
- { //获取数值型字段名称
- return NumericFieldsName;
- }
- protected String[] getStringFieldsName()
- { //获取字符型字段名称
- return StringFieldsName;
- }
- protected String[] getDatetimeFieldsName()
- { //获取日期时间型字段名称
- return DatetimeFieldsName;
- }
- protected String[] getTextFieldsName()
- { //获取大字符串型字段名称
- return TextFieldsName;
- }
- /**
- * 返回待处理公文字段值列表
- * @param strID 字段值ID
- * @param strDocumentID 公文ID
- * @param strDocumentName 公文名称
- * @param strDocTempletFieldsID 字段ID
- * @param strFieldValue 字段值
- * @param strApproveFlowID 审批记录ID
- * @param strOrderBy 排序字段
- * @param strIsDesc 是否降序排序
- * @return 符合条件记录向量集
- */
- public static Vector getRecordBySearch(String strID,String strDocumentID,String strDocumentName,String strDocTempletFieldsID,
- String strFieldValue,String strApproveFlowID,String strOrderBy,String strIsDesc)
- {
- String strSQL="SELECT a.[ID],a.[DocumentID],a.[DocTempletFieldsID],a.[FieldValue],a.[ApproveFlowID],b.[DocumentName]"
- + ",c.[ID],c.[FlowTacheID],c.[ApproveUserID],c.[ApproveTime],c.[ApproveFromIP],c.[IsRead] FROM [DocFieldsValue] AS a"
- + " LEFT OUTER JOIN [Document] AS b ON (a.[DocumentID] = b.[ID]) LEFT OUTER JOIN [ApproveRecordInfo] AS c ON"
- + " (a.[ApproveFlowID]=c.[ID]) WHERE a.[ID]>0";
- if (strID.trim().length()>0)
- {
- strSQL += " and a.[ID] ='" + strID + "'";
- }
- if (strDocumentID.trim().length()>0)
- {
- strSQL += " and a.[DocumentID] ='" + strDocumentID + "'";
- }
- if (strDocumentName.trim().length()>0)
- {
- strSQL += " and b.[DocumentName] LIKE'%" + strDocumentName + "%'";
- }
- if (strDocTempletFieldsID.trim().length()>0)
- {
- strSQL += " and a.[DocTempletFieldsID] ='" + strDocTempletFieldsID + "'";
- }
- if (strFieldValue.trim().length()>0)
- {
- strSQL += " and a.[FieldValue] LIKE'%" + strFieldValue + "%'";
- }
- if (strApproveFlowID.trim().length()>0)
- {
- strSQL += " and a.[ApproveFlowID] ='" + strApproveFlowID + "'";
- }
- if (strOrderBy.trim().length() > 0)
- {
- if (strIsDesc.equalsIgnoreCase("True"))
- strSQL += " Order by " + strOrderBy + " desc";
- else
- strSQL += " Order by " + strOrderBy + "";
- }
- Vector vt = SQLManager.GetResultSet(strSQL);
- return vt;
- }
- /**
- * 重载getRecordBySearch方法,按字段值ID返回
- * @param strID 字段值ID
- * @return 符合条件记录向量集
- */
- public static Vector getRecordBySearch(String strID)
- {
- Vector vt = getRecordBySearch(strID,"","","","","","","");
- return vt;
- }
- /**
- * 插入字段值信息
- * @param DocumentID 公文ID
- * @param DocTempletFieldsID 字段ID
- * @param FieldValue 字段值
- * @param ApproveFlowID 审批记录ID
- * @return 整型值
- */
- public static int InsertFieldValue(String DocumentID,String DocTempletFieldsID,String FieldValue,String ApproveFlowID)
- {
- String strSQL="INSERT " + TableName + "(DocumentID,DocTempletFieldsID,FieldValue,ApproveFlowID) values " +
- "('" + DocumentID + "','" + DocTempletFieldsID + "','" + FieldValue + "','" + ApproveFlowID + "')";
- return SQLManager.ExcuteSQL(strSQL);
- }
- }