📄 friendsitemanager.java
字号:
package com.gforce.gfoa;
/**
* <p>Title: 西部信托网站项目</p>
* <p>Description: 西部信托网站项目</p>
* <p>Copyright: 版权所有 2004 (c) 西安吉力科技发展有限公司 Copyright (c) 2004 GForce Sceince & Technology</p>
* <p>Company: 西安吉力科技发展有限公司 (GForce Sceince & Technology)</p>
* @author 马登军
* @version 1.0
*/
import com.gforce.currency.*;
import com.gforce.currency.database.*;
import java.sql.*;
import java.util.*;
public class FriendSiteManager
extends RecordManager {
public FriendSiteManager() {
}
protected final static String TableName = "WebLinkInfo"; //定义声明本类操作表名称
protected final static String IDFieldName = "ID"; //定义声明主键或者可以确定唯一记录的字段名称为“ID”,必须为自增整型
protected final static String[] NumericFieldsName = {"UpdateUserID","IsPicLink","IsShow"}; //声明数值型字段名称
protected final static String[] StringFieldsName = {"WebName","LinkURL","PicURL","MultUserID","MultSysID","Remark"}; //声明字符型字段名称
protected final static String[] DatetimeFieldsName = {"UpdateTime",}; //声明日期时间型字段名称
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;
}
/**
* 获取指定系统、指定用户ID的图片友情链接记录
* @return 指定系统、指定用户ID的图片友情链接记录
*/
public static Vector getPicRecordBySysAndUserID(String strSysID,String strUserID)
{
Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName + " where MultSysID = '"+ strSysID +"'and MultUserID = '"+ strUserID +"' and IsPicLink = '1' and IsShow = '1' order by UpdateTime desc ");
return vt;
}
/**
* 获取指定系统、指定用户ID的文字友情链接记录
* @return 指定系统、指定用户ID的图片友情链接记录
*/
public static Vector getWordRecordBySysAndUserID(String strSysID,String strUserID)
{
Vector vt = SQLManager.GetResultSet("SELECT * FROM " + TableName + " where MultSysID = '"+ strSysID +"'and MultUserID = '"+ strUserID +"' and IsPicLink = '0' and IsShow = '1' order by UpdateTime desc ");
return vt;
}
/**
* 获取风格名称
* @param iStyleID 风格ID
* @return 指定风格名称
*/
public static String getStyleNameByID(int iStyleID)
{
String strReturnValue="未知风格";
Vector vt =SQLManager.GetResultSet("SELECT Name FROM "+ TableName +
" WHERE ID = " + iStyleID + "");
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;
}
public static Vector getRecordByIDs(String strIDs)
{
return getRecordBySearch(strIDs,"","","","","","","","","","","","","","","");
}
/**
* 获取符合条件的数据集
* @param strIDs String
* @param strWebName String
* @param strLinkURL String
* @param strIsPicLink String
* @param strPicURL String
* @param strIsShow String
* @param strUpdateStartDate String
* @param strUpdateEndDate String
* @param strUpdateUserID String
* @param strMultUserID String
* @param strMultSysID String
* @param strRemark String
* @param strOrderBy String
* @param strIsDesc String
* @return Vector 获取符合条件的数据集
*/
public static Vector getRecordBySearch(String strIDs,String strWebName,String strLinkURL,String strIsPicLink,String strPicURL,String strIsShow,String strUpdateStartDate,String strUpdateEndDate,String strUpdateUserID,String strMultUserID,String strMultSysID,String strRemark,String strOrderBy,String strIsDesc)
{
String strSQL = "select ID,WebName,LinkURL,IsPicLink,PicURL,IsShow,UpdateTime,UpdateUserID,MultUserID,MultSysID,Remark from " + TableName + " WHERE ID > 0";
if (strIDs.trim().length() > 0)
{
strSQL += " and ([ID] in (" + strIDs + "))";
}
if (strWebName.trim().length() > 0)
{
strSQL += " and [WebName] like '%" + strWebName + "%'";
}
if (strLinkURL.trim().length() > 0)
{
strSQL += " and [LinkURL] like '%" + strLinkURL + "%'";
}
if (strIsPicLink.trim().length() > 0)
{
if (strIsPicLink.equalsIgnoreCase("True"))
{
strSQL += " and [IsPicLink] = 1";
}
else if (strIsPicLink.equalsIgnoreCase("False"))
{
strSQL += " and [IsPicLink] = 0";
}
}
if (strPicURL.trim().length() > 0)
{
strSQL += " and [PicURL] like '%" + strPicURL + "%'";
}
if (strIsShow.trim().length() > 0)
{
if (strIsShow.equalsIgnoreCase("True"))
{
strSQL += " and [IsShow] = 1";
}
else if (strIsShow.equalsIgnoreCase("False"))
{
strSQL += " and [IsShow] = 0";
}
}
if (strUpdateStartDate.trim().length() > 0 && strUpdateEndDate.trim().length() > 0 )
{
strSQL += " and [UpdateTime] >= " + strUpdateStartDate + " and [UpdateTime]<=" + strUpdateEndDate + " ";
}
if (strUpdateUserID.trim().length() > 0)
{
strSQL += " and ([UpdateUserID] in (" + strUpdateUserID + "))";
}
if (strMultUserID.trim().length() > 0)
{
strSQL += " and [MultUserID] like '%" + strMultUserID + "%'";
}
if (strMultSysID.trim().length() > 0)
{
strSQL += " and [MultSysID] like '%" + strMultSysID + "%'";
}
if (strRemark.trim().length() > 0)
{
strSQL += " and [Remark] like '%" + strRemark + "%'";
}
if (strOrderBy.trim().length() > 0)
{
if (strIsDesc.equalsIgnoreCase("True"))
{
strSQL += " Order by " + strOrderBy + " desc";
}
else
{
strSQL += " Order by " + strOrderBy + "";
}
}
else
{
strSQL += " Order by UpdateTime";
}
Vector vt = SQLManager.GetResultSet(strSQL);
return vt;
}
/**
* 获取符合条件的数据集
* @param strIDs String
* @param strWebName String
* @param strLinkURL String
* @param strIsPicLink String
* @param strPicURL String
* @param strIsShow String
* @param strUpdateStartDate String
* @param strUpdateEndDate String
* @param strUpdateUserID String
* @param strUserID String
* @param strUserName String
* @param strMultUserID String
* @param strMultSysID String
* @param strRemark String
* @param strOrderBy String
* @param strIsDesc String
* @return Vector 获取符合条件的数据集
*/
public static Vector getRecordBySearch(String strIDs,String strWebName,String strLinkURL,String strIsPicLink,String strPicURL,String strIsShow,String strUpdateStartDate,String strUpdateEndDate,String strUpdateUserID,String strUserID,String strUserName,String strMultUserID,String strMultSysID,String strRemark,String strOrderBy,String strIsDesc)
{
String strSQL = "select a.[ID],a.[WebName],a.[LinkURL],a.[IsPicLink],a.[PicURL],a.[IsShow],a.[UpdateTime],a.[UpdateUserID],b.[ID],b.[UserName],a.[MultUserID],a.[MultSysID],a.[Remark],c.[Name] from " + TableName + " as a left outer join UserInfo as b on (a.[ID]=b.[ID]) left outer join PersonnelInfo as c on (c.[ID]=b.[PersonnelID]) WHERE a.[ID] > 0";
if (strIDs.trim().length() > 0)
{
strSQL += " and (a.[ID] in (" + strIDs + "))";
}
if (strWebName.trim().length() > 0)
{
strSQL += " and a.[WebName] like '%" + strWebName + "%'";
}
if (strLinkURL.trim().length() > 0)
{
strSQL += " and a.[LinkURL] like '%" + strLinkURL + "%'";
}
if (strIsPicLink.trim().length() > 0)
{
if (strIsPicLink.equalsIgnoreCase("True"))
{
strSQL += " and a.[IsPicLink] = 1";
}
else if (strIsPicLink.equalsIgnoreCase("False"))
{
strSQL += " and a.[IsPicLink] = 0";
}
}
if (strPicURL.trim().length() > 0)
{
strSQL += " and a.[PicURL] like '%" + strPicURL + "%'";
}
if (strIsShow.trim().length() > 0)
{
if (strIsShow.equalsIgnoreCase("True"))
{
strSQL += " and a.[IsShow] = 1";
}
else if (strIsShow.equalsIgnoreCase("False"))
{
strSQL += " and a.[IsShow] = 0";
}
}
if (strUpdateStartDate.trim().length() > 0 && strUpdateEndDate.trim().length() > 0 )
{
strSQL += " and a.[UpdateTime] >= '" + strUpdateStartDate + " 00:00:00.000' and a.[UpdateTime]<='" + strUpdateEndDate + " 23:59:59.999'";
}
if (strUpdateUserID.trim().length() > 0)
{
strSQL += " and (a.[UpdateUserID] in (" + strUpdateUserID + "))";
}
if (strUserID.trim().length() > 0)
{
strSQL += " and (b.[ID] in (" + strUserID + "))";
}
if (strUserName.trim().length() > 0)
{
strSQL += " and c.[Name] like '%" + strUserName + "%'";
}
if (strMultUserID.trim().length() > 0)
{
strSQL += " and a.[MultUserID] like '%" + strMultUserID + "%'";
}
if (strMultSysID.trim().length() > 0)
{
strSQL += " and a.[MultSysID] like '%" + strMultSysID + "%'";
}
if (strRemark.trim().length() > 0)
{
strSQL += " and a.[Remark] like '%" + strRemark + "%'";
}
if (strOrderBy.trim().length() > 0)
{
if (strIsDesc.equalsIgnoreCase("True"))
{
strSQL += " Order by " + strOrderBy + " desc";
}
else
{
strSQL += " Order by " + strOrderBy + "";
}
}
else
{
strSQL += " Order by a.[UpdateTime]";
}
Vector vt = SQLManager.GetResultSet(strSQL);
return vt;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -