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

📄 merchantstorageinfodao.java

📁 基于struts的网上商店源码
💻 JAVA
字号:
/*
 * 作者:刘云云
 * 时间:2007年12月19日
 * 功能:库存销售管理->入库历史查询 
 */
package com.mole.struts.dao;

import java.util.ArrayList;
import java.util.Iterator;

import com.mole.struts.bean.MerchantStorageInfoBean;

public class MerchantStorageInfoDAO extends AbstractPageDAO {

	private String typeId;
	private String goodsName;
	private String startDate;
	private String endDate;

	public MerchantStorageInfoDAO() {
	}

	public MerchantStorageInfoDAO(String column, String where, String id,
			String group, String order, int pageSize) {
		this.setColumnCondition(column);
		this.setWhereCondition(where);
		this.setIdCondition(id);
		this.setGroupCondition(group);
		this.setOrderCondition(order);
		this.setPageSize(pageSize);
	}

	public void setWhere(String table, String storeId, String typeId,
			String goodsName, String startDate, String endDate) {
		this.typeId = typeId;
		this.goodsName = goodsName;
		this.startDate = startDate;
		this.endDate = endDate;

		String where = table + "WHERE StoreID=" + storeId;

		if (typeId != null && !typeId.equals("0")) {
			where = where + " AND goodsType=" + typeId;
		}
		if (goodsName != null && !goodsName.equals("")) {
			where = where + " AND Name LIKE '%" + goodsName + "%' ";
		}
		if (startDate != null && !startDate.equals("")) {
			where = where + " AND stockDate>='" + startDate + "' ";
		}
		if (endDate != null && !endDate.equals("")) {
			where = where + " AND stockDate<='" + endDate + "' ";
		}
		this.setWhereCondition(where);
	}

	// 获取入库操作信息记录集
	public MerchantStorageInfoBean[] getStorageInfoPage() {
		ArrayList<Object[]> arrayList = this.executeQuery(getSql());
		if (arrayList == null)
			return null;

		MerchantStorageInfoBean[] records = new MerchantStorageInfoBean[arrayList
				.size()];
		Iterator<Object[]> it = arrayList.iterator();
		int i = 0;
		while (it.hasNext()) {
			Object[] obj = it.next();
			MerchantStorageInfoBean record = new MerchantStorageInfoBean();
			record.setGoodsNumber(obj[0].toString());
			record.setGoodsName(obj[1].toString());
			record.setTypeName(obj[2].toString());
			record.setGoodsAmount(obj[3].toString());
			record.setGoodsPrice(obj[4].toString());
			record.setCreateDate(obj[5].toString().substring(0, 10));
			record.setMerchantName(obj[6].toString());
			records[i++] = record;
		}
		return records;
	}

	public String getTypeId() {
		return typeId;
	}

	public String getGoodsName() {
		return goodsName;
	}

	public String getStartDate() {
		return startDate;
	}

	public String getEndDate() {
		return endDate;
	}

}

⌨️ 快捷键说明

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