📄 contractinstalment.java
字号:
//Source file: D:\tomcat\webapps\wuyang\WEB-INF\classes\src\wuyang\src\ContractInstalment.java
package src.wuyang;
import src.com.*;
import java.sql.*;
import java.io.*;
public class ContractInstalment extends ShangObject
{
/**
序号
*/
private int no;
/**
合同号
*/
private String contractId;
/**
付款数
*/
private float paymentNum;
/**
交货数
*/
private float deliverNum;
/**
截止日
*/
private Timestamp endTime;
/**
备注
*/
private String comment;
/**
* Access method for the no property.
*
* @return the current value of the no property
*/
public int getNo()
{
return no;
}
/**
* Sets the value of the no property.
*
* @param aContractId the new value of the no property
*/
public void setNo(int aNo)
{
no = aNo;
}
/**
* Access method for the contractId property.
*
* @return the current value of the contractId property
*/
public String getContractId()
{
return contractId;
}
/**
* Sets the value of the contractId property.
*
* @param aContractId the new value of the contractId property
*/
public void setContractId(String aContractId)
{
contractId = aContractId;
}
/**
* Access method for the paymentNum property.
*
* @return the current value of the paymentNum property
*/
public float getPaymentNum()
{
return paymentNum;
}
/**
* Sets the value of the paymentNum property.
*
* @param aPaymentNum the new value of the paymentNum property
*/
public void setPaymentNum(float aPaymentNum)
{
paymentNum = aPaymentNum;
}
/**
* Access method for the deliverNum property.
*
* @return the current value of the deliverNum property
*/
public float getDeliverNum()
{
return deliverNum;
}
/**
* Sets the value of the deliverNum property.
*
* @param aDeliverNum the new value of the deliverNum property
*/
public void setDeliverNum(float aDeliverNum)
{
deliverNum = aDeliverNum;
}
/**
* Access method for the endTime property.
*
* @return the current value of the endTime property
*/
public Timestamp getEndTime()
{
return endTime;
}
/**
* Sets the value of the endTime property.
*
* @param aEndTime the new value of the endTime property
*/
public void setEndTime(Timestamp aEndTime)
{
endTime = aEndTime;
}
/**
* Access method for the comment property.
*
* @return the current value of the comment property
*/
public String getComment()
{
return comment;
}
/**
* Sets the value of the comment property.
*
* @param aComment the new value of the comment property
*/
public void setComment(String aComment)
{
comment = aComment;
}
public ContractInstalment()
{
primarykey1Name="contractId" ;
primarykey1Type=1;
tableName ="ContractInstalment";
viewName="ContractInstalment";
numInOnePager=10;}
public String getWhereClause(javax.servlet.ServletRequest request) {
String whereClause = "";
whereClause = addWhereClause(whereClause, "contractId", "=", "'",request.getParameter("contractId"));
whereClause = addWhereClause(whereClause, "paymentNum", "like", "'",request.getParameter("paymentNum"));
whereClause = addWhereClause(whereClause, "deliverNum", "like", "'",request.getParameter("deliverNum"));
if((request.getParameter("endTimen")!=null)&&(request.getParameter("endTimey")!=null)&&(request.getParameter("endTimer")!=null)&&(!request.getParameter("endTimen").equals(""))&&(!request.getParameter("endTimey").equals(""))&&(!request.getParameter("endTimer").equals(""))){
whereClause = addWhereClause(whereClause, "endTime", "like", "'",""+endTime);
}
whereClause = addWhereClause(whereClause, "comment", "like", "'",request.getParameter("comment"));
return whereClause;
}
public int loadAttr() {
try {
no= rs.getInt("no");
contractId= getRsString(rs,"contractId");
paymentNum= rs.getFloat("paymentNum");
deliverNum= rs.getFloat("deliverNum");
endTime= rs.getTimestamp("endTime");
comment= getRsString(rs,"comment");
} catch(SQLException e) {
e.printStackTrace();
System.out.println("query failed!");
return -1;
}
return 1;
}
public int update() {
String sql= "{?=call sp_UpdateContractInstalment(?,?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,contractId);
updStmt.setFloat(3,paymentNum);
updStmt.setFloat(4,deliverNum);
updStmt.setTimestamp(5,endTime);
setStmtString(updStmt,6,comment);
updStmt.setInt(7,no);
updStmt.executeUpdate();
int rtcode = updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
public int insert() {
String sql= "{?=call sp_InsertContractInstalment(?,?,?,?,?)}";
try{
CallableStatement updStmt=conn.prepareCall(sql);
updStmt.registerOutParameter(1, java.sql.Types.INTEGER);
setStmtString(updStmt,2,contractId);
updStmt.setFloat(3,paymentNum);
updStmt.setFloat(4,deliverNum);
updStmt.setTimestamp(5,endTime);
setStmtString(updStmt,6,comment);
updStmt.executeUpdate();
int rtcode = 0;//updStmt.getInt(1);
updStmt.close();
return rtcode;
}catch(SQLException E){
System.out.println(E.getMessage());
return -102;
}
}
public int delete() {
String sql ="delete from ContractInstalment where no = "+getNo();
try {
Statement stmt=conn.createStatement();
stmt.execute(sql);
return 0;
}
catch(SQLException E)
{
System.out.println(E.getMessage());
return -102;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -