📄 wearhouse.java
字号:
//Source file: D:*\WEB_INF\classes\src\wuyang\Wearhouse.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class Wearhouse extends ShangObject
{
/**
仓库编号
*/
private String wearhouseId;
/**
仓库名称
*/
private String wearhouseName;
/**
仓库描述
*/
private String wearhouseDesc;
/**
公司编号
*/
private String companyId;
public Wearhouse(){
this.primarykey1Name = "wearhouseId";
this.primarykey1Type = 1;
this.primarykey2Name = "companyId";
this.primarykey1Type = 1;
this.tableName = "Wearhouse";
this.viewName = "Wearhouse";
this.numInOnePager = 10;
}
public int loadAttr() {
wearhouseId = getRsString(rs,"wearhouseId");
wearhouseName = getRsString(rs,"wearhouseName");
wearhouseDesc = getRsString(rs,"wearhouseDesc");
companyId = getRsString(rs,"companyId");
return 1;
}
/* 新增
@loginName varchar(30)
,@ip varchar(20)
,@machineName varchar(30)
,@wearhouseId varchar(10)
,@wearhouseName varchar310)
,@wearhouseDesc varchar(30)
,@companyId varchar(10)
*/
public int insert() {
String sql= "{?=call sp_InsertWearhouse(?,?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
setStmtString(updStmt,5,wearhouseId);
setStmtString(updStmt,6,wearhouseName);
setStmtString(updStmt,7,wearhouseDesc);
setStmtString(updStmt,8,companyId);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
/*
修改
@loginName varchar(30)
,@ip varchar(20)
,@machineName varchar(30)
,@wearhouseId varchar(10)
,@wearhouseName varchar310)
,@wearhouseDesc varchar(30)
,@companyId varchar(10)
*/
public int update() {
String sql= "{?=call sp_UpdateWearhouse(?,?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);/** 注册OUT参数 */
setStmtString(updStmt, 2, theGlobal.loginName);
setStmtString(updStmt, 3, theGlobal.ip);
setStmtString(updStmt, 4, theGlobal.machineName);
setStmtString(updStmt,5,wearhouseId);
setStmtString(updStmt,6,wearhouseName);
setStmtString(updStmt,7,wearhouseDesc);
setStmtString(updStmt,8,companyId);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
public String getWhereClause(javax.servlet.ServletRequest request) {
String whereClause = "";
String str;
int queryMode = (new Integer(request.getParameter("queryMode"))).intValue();
switch(queryMode)
{
case 1: // 综合查询
whereClause = addWhereClause(whereClause, "wearhouseId", "=", "'", request.getParameter("wearhouseId"));
whereClause = addWhereClause(whereClause, "wearhouseName", "like", "'", request.getParameter("wearhouseName"));
whereClause = addWhereClause(whereClause, "wearhouseDesc", "=", "'", request.getParameter("wearhouseDesc"));
whereClause = addWhereClause(whereClause, "companyId", "=", "'", request.getParameter("companyId"));
break;
case 2:
break;
}
return whereClause;
}
/**
* Access method for the wearhouseId property.
*
* @return the current value of the wearhouseId property
*/
public String getWearhouseId() {
return wearhouseId;
}
/**
* Sets the value of the wearhouseId property.
*
* @param awearhouseId the new value of the wearhouseId property
*/
public void setWearhouseId(String aWearhouseId) {
wearhouseId = setChnString(aWearhouseId);}
/**
* Access method for the wearhouseName property.
*
* @return the current value of the wearhouseName property
*/
public String getWearhouseName() {
return wearhouseName;
}
/**
* Sets the value of the wearhouseName property.
*
* @param aLocationDesc the new value of the wearhouseName property
*/
public void setWearhouseName(String aWearhouseName) {
wearhouseName = setChnString(aWearhouseName);
}
/**
* Access method for the wearhouseDesc property.
*
* @return the current value of the wearhouseDesc property
*/
public String getWearhouseDesc () {
return wearhouseDesc ;}
/**
* Sets the value of the wearhouseDesc property.
*
* @param aWearhouseId the new value of the wearhouseDesc property
*/
public void setWearhouseDesc (String aWearhouseDesc ) {
wearhouseDesc = setChnString(aWearhouseDesc) ;
}
/**
* Access method for the companyId property.
*
* @return the current value of the companyId property
*/
public String getCompanyId() {
return companyId;
}
/**
* Sets the value of the companyId property.
*
* @param awearhouseId the new value of the companyId property
*/
public void setCompanyId(String aCompanyId){
companyId = setChnString(aCompanyId);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -