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

📄 dbiomapmain.java

📁 仓库管理系统毕业设计论文最好的参考资料!
💻 JAVA
字号:
package com.qhit.db.instance;

import java.util.List;

import com.qhit.UseException;
import com.qhit.po.IoMapList;
import com.qhit.po.IoMapMain;
import com.qhit.vo.IoMapMainQuery;

public class DbIoMapMain extends DbIoMapList {

	public DbIoMapMain() throws UseException {
		super();
	}

	public int insert(IoMapMain im) throws UseException {
		int ret = 0;
		String sql = "insert into out_in_maintab values(?,?,?,?,?,?,?)";
		Object obj[] = { im.getOiid(), im.getState(), im.getOutinsumnum(),
				im.getOutinman(), im.getOutindate(), im.getOutintype(),
				im.getOutindes() };
		ret = this.exeSql(sql, obj);
		return ret;
	}

	public int update(IoMapMain im) throws UseException {
		int ret = 0;
		String sql = "update out_in_maintab set state=?,outindate=?,outinman=?,outinsumnum=?,outintype=?,outindes=? where oiid = ?";
		Object obj[] = { im.getState(), im.getOutindate(), im.getOutinman(),
				im.getOutinsumnum(), im.getOutintype(), im.getOutindes(),
				im.getOiid() };
		ret = this.exeSql(sql, obj);
		return ret;
	}

	public int delete(IoMapMain im) throws UseException {
		int ret = 0;
		String sql = "delete from out_in_maintab where oiid = '" + im.getOiid()
				+ "'";
		ret = this.exeSql(sql);
		return ret;
	}

	public IoMapMain get(IoMapMain im) throws UseException {
		IoMapMain ibmain = null;
		String sql = "select * from out_in_maintab where oiid = '"
				+ im.getOiid() + "'";
		ibmain = (IoMapMain) this.getARecord(sql, IoMapMain.class);
		return ibmain;
	}

	public List query(IoMapMainQuery imq) throws UseException {
		List list = null;
		String sql = "select * from out_in_maintab where 1=1 ";
		if (!"".equals(imq.getOiid())) {
			sql = sql + " and oiid = '" + imq.getOiid() + "'";
		}
		if (!"".equals(imq.getState())) {
			sql = sql + " and state = '" + imq.getState() + "'";
		}
		if (!"".equals(imq.getOutindatebegin())) {
			sql = sql + " and outindate >= '" + imq.getOutindatebegin() + "'";
		}
		if (!"".equals(imq.getOutindateend())) {
			sql = sql + " and outindate <= '" + imq.getOutindateend() + "'";
		}
		if (!"".equals(imq.getOutintype())) {
			sql = sql + " and outintype = '" + imq.getOutintype() + "'";
		}
		list = this.getQuery(sql, IoMapMain.class);
		return list;
	}

	public List query(IoMapMainQuery imq, IoMapList iml) throws UseException {
		List list = null;
		String sql = "select c.mpid,c.mpname,sum(outinnum) from out_in_maintab a,out_in_listtab b,mptab c where a.oiid = b.oiid and b.mpid=c.mpid ";
		if (!"".equals(imq.getOutindatebegin())) {
			sql = sql + " and outindate >= '" + imq.getOutindatebegin() + "'";
		}
		if (!"".equals(imq.getOutindateend())) {
			sql = sql + " and outindate <= '" + imq.getOutindateend() + "'";
		}
		if (!"".equals(imq.getOutintype())) {
			sql = sql + " and outintype = '" + imq.getOutintype() + "'";
		}
		if (!"".equals(imq.getState())) {
			sql = sql + " and state = '" + imq.getState() + "'";
		}
		if (!"".equals(iml.getMpid())) {
			sql = sql + " and c.mpid = '" + iml.getMpid() + "'";
		}
		sql = sql + "group by c.mpid,c.mpname";
		list = this.getIoSum(sql);
		return list;
	}

	public int querysum(IoMapMainQuery imq, IoMapList iml) throws UseException {
		int sum = 0;
		String sql = "select sum(outinnum) from out_in_listtab a,out_in_maintab b where a.oiid=b.oiid ";
		if (!"".equals(imq.getOutindatebegin())) {
			sql = sql + " and outindate >= '" + imq.getOutindatebegin() + "'";
		}
		if (!"".equals(imq.getOutindateend())) {
			sql = sql + " and outindate <= '" + imq.getOutindateend() + "'";
		}
		if (!"".equals(imq.getOutintype())) {
			sql = sql + " and outintype = '" + imq.getOutintype() + "'";
		}
		if (!"".equals(imq.getState())) {
			sql = sql + " and state = '" + imq.getState() + "'";
		}
		if (!"".equals(iml.getMpid())) {
			sql = sql + " and mpid = '" + iml.getMpid() + "'";
		}
		sum = this.getSum(sql);
		return sum;
	}

}

⌨️ 快捷键说明

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