PactManager.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:10k
源码类别:
OA系统
开发平台:
Java
- package com.gforce.gfoa;
- import com.gforce.currency.database.*;
- import java.util.*;
- /**
- * <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 1.0
- * Date 2003/09/20
- * 合同管理类
- */
- public class PactManager
- extends RecordManager {
- public PactManager() {
- }
- protected final static String TableName = "PactInfo"; //定义声明本类操作表名称
- protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
- protected final static String[] NumericFieldsName = {"IntrustFund","AddUserID"}; //声明数值型字段名称
- protected final static String[] StringFieldsName = {"PactNumber","FirstSideName","FirstSideIDCardNumber",
- "FirstSideCorporation","FirstSideAddress",
- "FirstSideTel","FirstSideDeputy",
- "SecondSideName","SecondSideIDCardNumber","SecondSideCorporation",
- "SecondSideAddress","SecondSideTel","SecondSideDeputy",
- "PactTitle"}; //声明字符型字段名称
- protected final static String[] DatetimeFieldsName = {"FirstSideSignTime","SecondSideSignTime","AddTime","PactTermStart","PactTermEnd"}; //声明日期时间型字段名称
- protected final static String[] TextFieldsName = {"PactContent"}; //声明大字符串型字段名称
- /**
- * 根据字段名称获取插入数据时表单元素名称
- * @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;
- }
- /**
- * 获取所有记录
- * @return 数据集
- */
- public static Vector getAllRecord()
- {
- Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName +
- " ORDER BY AddTime DESC");
- return vt;
- }
- /**
- * 通过ID获取指定记录
- * @param intRecordID 记录ID
- * @return 指定记录向量集
- */
- public static Vector getRecordByID(int intRecordID)
- {
- Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName + " WHERE ID = " + intRecordID + "");
- return vt;
- }
- /**
- * 获取符合指定条件的合同模版记录集
- * @param strPactNumber 合同编号
- * @param strIntrustFund 信托资金
- * @param strPactTermStart 合同期限开始时间
- * @param strPactTermEnd 合同期限结束时间
- * @param strFirstSideName 甲方名称
- * @param strFirstSideIDCardNumber 甲方身份证或营业执照
- * @param strFirstSideCorporation 甲方法定代表人
- * @param strFirstSideAddress 甲方地址
- * @param strFirstSideTel 甲方电话
- * @param strFirstSideDeputy 己方代理人
- * @param strFirstSideSignTime 甲方签字日期
- * @param strSecondSideName 乙方名称
- * @param strSecondSideIDCardNumber 乙方身份证或者营业执照
- * @param strSecondSideCorporation 乙方法定代表人
- * @param strSecondSideAddress 乙方地址
- * @param strSecondSideTel 乙方电话
- * @param strSecondSideDeputy 乙方代理人
- * @param strSecondSideSignTime 乙方签字日期
- * @param strPactTitle 合同标题
- * @param strPactContent 合同内容
- * @param strBuildTimeFrom 建立时间起始
- * @param strBuildTimeTo 建立时间截至
- * @param strBuildUserName 建立用户姓名
- * @param strOrderBy 排序字段
- * @param bIsDesc 是否降序排序
- * @return 制定记录向量集
- */
- public static Vector getRecordByPactType(String strPactNumber, String strIntrustFund, String strPactTermStart, String strPactTermEnd,
- String strFirstSideName, String strFirstSideIDCardNumber, String strFirstSideCorporation, String strFirstSideAddress,
- String strFirstSideTel, String strFirstSideDeputy, String strFirstSideSignTime,
- String strSecondSideName, String strSecondSideIDCardNumber, String strSecondSideCorporation, String strSecondSideAddress,
- String strSecondSideTel, String strSecondSideDeputy, String strSecondSideSignTime,
- String strPactTitle, String strPactContent, String strBuildTimeFrom, String strBuildTimeTo,
- String strBuildUserName, String strOrderBy, boolean bIsDesc)
- {
- String strSQL="Select a.[ID],a.[PactNumber],a.[IntrustFund],a.[PactTermStart],a.[PactTermEnd],a.[FirstSideName],a.[FirstSideIDCardNumber],a.[FirstSideCorporation],a.[FirstSideAddress],a.[FirstSideTel],a.[FirstSideDeputy],a.[FirstSideSignTime],a.[SecondSideName],a.[SecondSideIDCardNumber],a.[SecondSideCorporation],a.[SecondSideAddress],a.[SecondSideTel],a.[SecondSideDeputy],a.[SecondSideSignTime],a.[PactTitle],a.[PactContent],a.[AddTime],a.[AddUserID],c.[Name] from [" + TableName + "] as a left outer join [UserInfo] as b on(a.AddUserID=b.ID) left outer join [PersonnelInfo] as c on (b.PersonnelID=c.ID) where a.[ID]>0";
- if(strPactNumber.trim().length()>0)
- strSQL += " and a.[PactNumber] like '%" + strPactNumber + "%'";
- if(strIntrustFund.trim().length()>0)
- strSQL += " and a.[IntrustFund] like '%" + strIntrustFund + "%'";
- if(strPactTermStart.trim().length()>0)
- strSQL += " and a.[PactTermStart] like '%" + strPactTermStart + "%'";
- if(strPactTermEnd.trim().length()>0)
- strSQL += " and a.[PactTermEnd] like '%" + strPactTermEnd + "%'";
- if(strFirstSideName.trim().length()>0)
- strSQL += " and a.[FirstSideName] like '%" + strFirstSideName + "%'";
- if(strFirstSideIDCardNumber.trim().length()>0)
- strSQL += " and a.[FirstSideIDCardNumber] like '%" + strFirstSideIDCardNumber + "%'";
- if(strFirstSideCorporation.trim().length()>0)
- strSQL += " and a.[FirstSideCorporation] like '%" + strFirstSideCorporation + "%'";
- if(strFirstSideAddress.trim().length()>0)
- strSQL += " and a.[FirstSideAddress] like '%" + strFirstSideAddress + "%'";
- if(strFirstSideTel.trim().length()>0)
- strSQL += " and a.[FirstSideTel] like '%" + strFirstSideTel + "%'";
- if(strFirstSideDeputy.trim().length()>0)
- strSQL += " and a.[FirstSideDeputy] like '%" + strFirstSideDeputy + "%'";
- if(strFirstSideSignTime.trim().length()>0)
- strSQL += " and a.[FirstSideSignTime] like '%" + strFirstSideSignTime + "%'";
- if(strSecondSideName.trim().length()>0)
- strSQL += " and a.[SecondSideName] like '%" + strSecondSideName + "%'";
- if(strSecondSideIDCardNumber.trim().length()>0)
- strSQL += " and a.[SecondSideIDCardNumber] like '%" + strSecondSideIDCardNumber + "%'";
- if(strSecondSideCorporation.trim().length()>0)
- strSQL += " and a.[SecondSideCorporation] like '%" + strSecondSideCorporation + "%'";
- if(strSecondSideAddress.trim().length()>0)
- strSQL += " and a.[SecondSideAddress] like '%" + strSecondSideAddress + "%'";
- if(strSecondSideTel.trim().length()>0)
- strSQL += " and a.[SecondSideTel] like '%" + strSecondSideTel + "%'";
- if(strSecondSideDeputy.trim().length()>0)
- strSQL += " and a.[SecondSideDeputy] like '%" + strSecondSideDeputy + "%'";
- if(strSecondSideSignTime.trim().length()>0)
- strSQL += " and a.[SecondSideSignTime] like '%" + strSecondSideSignTime + "%'";
- if(strPactTitle.trim().length()>0)
- strSQL += " and a.[PactTitle] like '%" + strPactTitle + "%'";
- if(strPactContent.trim().length()>0)
- strSQL += " and a.[PactContent] like '%" + strPactContent + "%'";
- if(strBuildTimeFrom.trim().length()>0)
- strSQL += " and a.[AddTime]>='" + strBuildTimeFrom + " 00:00:00.000'";
- if(strBuildTimeTo.trim().length()>0)
- strSQL += " and a.[AddTime]<='" + strBuildTimeTo + " 23:59:59.999'";
- if(strBuildUserName.trim().length()>0)
- strSQL += " and c.[Name] like '%" + strBuildUserName + "%'";
- if(strOrderBy.trim().length()>0)
- {
- if(bIsDesc)
- strSQL += " Order by " + strOrderBy + " desc";
- else
- strSQL += " Order by " + strOrderBy + "";
- }
- Vector vt = SQLManager.GetResultSet(strSQL);
- return vt;
- }
- }