⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmslist.java

📁 java swing源码 欢迎下载 有问题请联系 我一定负责到底
💻 JAVA
字号:
/**
 * CMS文章发布
 */
package com.NCL;

import com.sinosoft.common.*;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;

public class CMSList{

	protected IndexMap propList;	
	protected HashSet Property;
	private boolean EOF = false;
	private int COUNT;
	/**
	 * 构造函数
	 *
	 */
	public CMSList(){
		propList=new IndexMap();
		Property=new HashSet();
		Property.add("DocID");			//文章ID	
		Property.add("DocChannel");		//栏目
		Property.add("DocTitle");		//文章标题
		Property.add("DocPubURL");		//重点推荐	
		Property.add("DocRelTime");		//创建时间
	}
	/**
	 * 初始化
	 * @param DocID 文章ID	
	 */
	public void init(String DocID){
		DBAccess d = new DBAccess();	
		String SQL = "SELECT DocID,DocChannel,DocTitle,DocPubURL,DocRelTime from wcmdocument where DocID=?";
		this.propList=d.init(SQL, DocID, this.Property);
		
	}
	/**
	 * 根据条件查询
	 * @param cms 对象
	 * @param pageSize 分页大小
	 * @param pageIndex 分页页码
	 * @return String
	 */	
	public String find(CMSList cms,int pageSize,int pageIndex){		
		String result="";
		StringBuffer sql = new StringBuffer("select DocID from wcmdocument where 1=1 and DOCSTATUS=10 ");	
		if(Data.hasValue(cms.get("DocChannel")))
			sql.append("  and DocChannel=?");	
		sql.append(" order by DocRelTime desc");
		DBAccess q = new DBAccess();
		result = q.executeQuery(sql.toString(), this.propList, pageSize, pageIndex);
		setCOUNT(q.COUNT);
		setEOF(q.EOF);
		return result;		
	}
	
	/**
	 * 查询文章
	 * @param ID 文章所属的类型
	 * @return List
	 */
	public List findMulti(String ID){
		if(!Data.hasValue(ID))return null;
		String tmp[] = ID.split(","); 
		List l = new ArrayList();
		String sql = "select DocID from wcmdocument where 1=1 and DOCSTATUS=10 and DocChannel in (";
		for(int i=0;i<tmp.length;i++){
			if(Data.hasValue(tmp[i])){
				sql +="?,";
				l.add(tmp[i]);
			}
		}
		sql = sql.substring(0,sql.length()-1);
		sql += ") order by DocRelTime desc";
		DBAccess d = new DBAccess();
		return d.parseSQL(sql.toString(),l);
	}
	
	/**
	 * 在此映射中关联指定值与指定键
	 * @param name 指定键
	 * @param value 指定值
	 */
	public boolean set(String name, Object value){
		if(Property.contains(name)){
			propList.put(name,value);
			return true;
		}else
			return false;		
	}
	/**
	 * 返回指定键在此映射中所映射的值
	 * @param name 指定键
	 * @return
	 */
	public String get(String name){
		if (Property.contains(name)){
			String value = (String)propList.get(name);
			if(value != null && !value.equals(""))
				return value;
			else
				return "";
		}else 
			return "";
	}
	/**
	 * 返回COUNT
	 * @return int
	 */
	public int getCOUNT() {
		return COUNT;
	}
	/**
	 * 设置COUNT
	 * @param count
	 */
	public void setCOUNT(int count) {
		COUNT = count;
	}
	/**
	 * 返回EOF
	 * @return boolean
	 */
	public boolean isEOF() {
		return EOF;
	}
	/**
	 * 设置EOF
	 * @param eof
	 */
	public void setEOF(boolean eof) {
		EOF = eof;
	}
	/**
	 * 清空propList
	 *
	 */
	public void clear(){
		propList.clear();
	}
	
	public static void main(String[] args) {
	}
}

⌨️ 快捷键说明

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