SignTypeManager.java
资源名称:OA.rar [点击查看]
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:4k
源码类别:
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 1.0
- */
- import com.gforce.currency.database.*;
- import java.util.*;
- public class SignTypeManager
- extends RecordManager {
- public SignTypeManager() {
- }
- protected final static String TableName = "SignTypeInfo"; //定义声明本类操作表名称
- protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
- protected final static String[] NumericFieldsName = {}; //声明数值型字段名称
- protected final static String[] StringFieldsName = {"TypeName","StartTime","EndTime","BeforeBeign","AfterEnd","Remark","WorkDay","NoSignUserIDs"}; //声明字符型字段名称
- protected final static String[] DatetimeFieldsName = {}; //声明日期时间型字段名称
- 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;
- }
- /**
- * 获取所有签到类型数据集
- * @return 所有签到类型数据集
- */
- public static Vector getAllRecord()
- {
- Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName + " Order By ID");
- return vt;
- }
- /**
- * 获取签到类型名称
- * @param iTypeID 签到类型ID
- * @return 指定签到类型名称
- */
- public static String getTypeNameByID(int iTypeID)
- {
- String strReturnValue="未知分类";
- Vector vt =SQLManager.GetResultSet("SELECT TypeName FROM "+ TableName +
- " WHERE ID = " + iTypeID + "");
- if (vt.size() == 1)
- {
- strReturnValue = ((Vector)vt.get(0)).get(0).toString();
- }
- return strReturnValue;
- }
- /**
- * 获取指定ID的签到类型记录数据集
- * @param iID 签到类型ID
- * @return 指定ID的签到类型记录数据集
- */
- public static Vector getRecordByID(int iID)
- {
- Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName + " where ID = " + iID);
- return vt;
- }
- /**
- * 获取指定用户当前有效的签到类型数据集
- * @return 指定用户当前有效的签到类型数据集
- */
- public static Vector getUsefulSignType(int iUserID,int iWeekDay,String strSignTime)
- {
- String strSQL ="";
- if(strSignTime.length()>0)
- {
- strSQL = "SELECT * FROM " + TableName + " where WorkDay like '%" + iWeekDay + "%' and StartTime<='" + strSignTime + "' and EndTime>='" + strSignTime + "' and not(',' + NoSignUserIDs + ',' like '%," + iUserID + ",%') and not ID in (Select SignTypeID from SignInfo where DateDiff(Day,SignTime,GetDate())=0 and UserID=" + iUserID + " and IsNormal=1)";
- }
- else
- {
- strSQL = "SELECT * FROM " + TableName + " where WorkDay like '%" + iWeekDay + "%' and not(',' + NoSignUserIDs + ',' like '%," + iUserID + ",%') and not ID in (Select SignTypeID from SignInfo where DateDiff(Day,SignTime,GetDate())=0 and UserID=" + iUserID + " and IsNormal=1)";
- }
- Vector vt = SQLManager.GetResultSet(strSQL);
- return vt;
- }
- }