📄 daocustomer.java
字号:
package GDPE.follow.plan;
import levin.base.*;
import levin.util.DbAccess;
import levin.util.DataSet;
/**
* 合同管理 数据库访问类
* <p>Title: 企业合同</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006</p>
* <p>Company: </p>
* @author
* @version 1.0
*/
public class DAOCustomer extends DAOBase {
public DAOCustomer() {
}
public static EnEnt_Plan_Following [] searcheEnContract(DbAccess db,
EnEnt_Plan_Following SearchEnContract,String startTime,String endTime)
throws Exception
{
String eEnEnt_Customer_Enterprise="";
if ((SearchEnContract.getChFollowResult() != null && SearchEnContract.getChFollowResult().length() != 0)
||(SearchEnContract.getChStationCode() != null && SearchEnContract.getChStationCode().length() != 0)
||(SearchEnContract.getChStation() != null && SearchEnContract.getChStation().length() != 0)
||(startTime != null && startTime.length()!=0)
||(endTime != null && endTime.length()!=0)
||(SearchEnContract.getChCommitName() != null && SearchEnContract.getChCommitName().toString().length() != 0) )
{
eEnEnt_Customer_Enterprise = "(select * from Ent_Plan_Following where "+ DAOCustomer.searchSql(SearchEnContract,startTime,endTime)+") Ent_Plan_Following ";
//System.out.println("0000000000000000000"+SearchEnContract.getChEnterpriseName());
}else{
eEnEnt_Customer_Enterprise="Ent_Plan_Following";
}
//System.out.println(Auditor);
String sql="";
//String sql = "select * from Ent_Record_Contract where chContractNo='"+SearchEnContract.getChContractNo()+"'";
sql = sql + " select Ent_Plan_Following.*";
sql = sql + " from "+eEnEnt_Customer_Enterprise;
sql = sql + setDefaultSort();
//System.out.println("sq-------------------------"+sql);
EnEnt_Plan_Following [] aEnEnt_Plan_Following= null;
aEnEnt_Plan_Following =DAOCustomer.SetEnCustomert(db, sql);
return (aEnEnt_Plan_Following);
}
public static String searchSql(EnEnt_Plan_Following eEnEnt_Customer_Enterprise,String startTime,String endTime)
{
String sql = "";
int i=0;
if (eEnEnt_Customer_Enterprise.getChFollowResult() != null &&
! (eEnEnt_Customer_Enterprise.getChFollowResult() + "A").equals("A"))
{
sql = sql + "Ent_Plan_Following.chFollowResult like '%" + eEnEnt_Customer_Enterprise.getChFollowResult().trim()+"%'";
i++;
}
//String drt=eEnEnt_Record_Contract.getDtRecordTime();
if (eEnEnt_Customer_Enterprise.getChCommitName() != null &&
! (eEnEnt_Customer_Enterprise.getChCommitName() + "A").equals("A"))
{
if(i==0){
sql = sql + " Ent_Plan_Following.chCommitName like '%" + eEnEnt_Customer_Enterprise.getChCommitName().trim() + "%'";
i++;
}else{
sql = sql + " and Ent_Plan_Following.chCommitName like '%" + eEnEnt_Customer_Enterprise.getChCommitName().trim() + "%'";
}
}
if (eEnEnt_Customer_Enterprise.getChCommitCode() != null &&
! (eEnEnt_Customer_Enterprise.getChCommitCode() + "A").equals("A"))
{
if(i==0){
sql = sql + " Ent_Plan_Following.chCommitCode like '%" + eEnEnt_Customer_Enterprise.getChCommitCode().trim() + "%'";
i++;
}else{
sql = sql + " and Ent_Plan_Following.chCommitCode like '%" + eEnEnt_Customer_Enterprise.getChCommitCode().trim() + "%'";
}
}
if (eEnEnt_Customer_Enterprise.getChStationCode() != null &&
! (eEnEnt_Customer_Enterprise.getChStationCode() + "A").equals("A"))
{
if(i==0){
sql = sql + " Ent_Plan_Following.chStationCode like '%" + eEnEnt_Customer_Enterprise.getChStationCode().trim() + "%'";
i++;
}else{
sql = sql + " and Ent_Plan_Following.chStationCode like '%" + eEnEnt_Customer_Enterprise.getChStationCode().trim() + "%'";
}
}
if (eEnEnt_Customer_Enterprise.getChStation() != null &&
! (eEnEnt_Customer_Enterprise.getChStation() + "A").equals("A"))
{
if(i==0){
sql = sql + " Ent_Plan_Following.chStation like '%" + eEnEnt_Customer_Enterprise.getChStation().trim() + "%'";
i++;
}else{
sql = sql + " and Ent_Plan_Following.chStation like '%" + eEnEnt_Customer_Enterprise.getChStation().trim() + "%'";
}
}
if (startTime != null && ! (startTime + "A").equals("A"))
{
if(i==0){ //TO_DATE('01-01-2000','dd-mm-yyyy');
sql = sql + " Ent_Plan_Following.dtTrackingDate >= TO_DATE('" + startTime.trim() + "','yyyy-MM-dd')";
i++;
}else{
sql = sql + " and Ent_Plan_Following.dtTrackingDate >= TO_DATE('" + startTime.trim() + "','yyyy-MM-dd')";
}
}
if (endTime != null &&
! (endTime + "A").equals("A"))
{
if(i==0){
sql = sql + " Ent_Plan_Following.dtTrackingDate <= TO_DATE('" + endTime.trim() + "','yyyy-MM-dd')";
i++;
}else{
sql = sql + " and Ent_Plan_Following.dtTrackingDate <= TO_DATE('" + endTime.trim() + "','yyyy-MM-dd')";
}
}
return sql;
}
public static String setDefaultSort()
{
String sql = "";
sql = " order by Ent_Plan_Following.id";
return sql ;
}
public static EnEnt_Plan_Following[] SetEnCustomert(DbAccess db, String sql)
throws Exception
{
DataSet ds = db.executeQuery(sql);
EnEnt_Plan_Following[] eEnt_Customer_Enterprise = (EnEnt_Plan_Following[]) DAOBase.resumeFromDataSet(ds, EnEnt_Plan_Following.class.getName());
return eEnt_Customer_Enterprise;
}
public static EnEnt_Plan_Following [] searcheEnContract2(DbAccess db,
EnEnt_Plan_Following SearchEnContract,String startTime,String endTime,String chStationCode,String idstr)
throws Exception
{
String eEnEnt_Customer_Enterprise="";
if ((SearchEnContract.getChFollowResult() != null && SearchEnContract.getChFollowResult().length() != 0)
||(SearchEnContract.getChStationCode() != null && SearchEnContract.getChStationCode().length() != 0)
||(SearchEnContract.getChStation() != null && SearchEnContract.getChStation().length() != 0)
||(startTime != null && startTime.length()!=0)
||(endTime != null && endTime.length()!=0)
||(SearchEnContract.getChCommitName() != null && SearchEnContract.getChCommitName().toString().length() != 0) )
{
//eEnEnt_Customer_Enterprise = "(select * from Ent_Customer_Enterprise where chIsAudited like '1' and "+ GDPE.customer.enterprise.DAOCustomer.searchSql(SearchEnContract,startTime,endTime)+") Ent_Customer_Enterprise ";
eEnEnt_Customer_Enterprise ="(select * from (select * from Ent_Plan_Following where chStationCode ='"+chStationCode+"' or chCommitCode ='"+idstr+"') Ent_Plan_Following where "+ DAOCustomer.searchSql(SearchEnContract,startTime,endTime)+") Ent_Plan_Following ";
//System.out.println("0000000000000000000"+SearchEnContract.getChEnterpriseName());
}else{
eEnEnt_Customer_Enterprise="Ent_Plan_Following";
}
//System.out.println(Auditor);
String sql="";
//String sql = "select * from Ent_Record_Contract where chContractNo='"+SearchEnContract.getChContractNo()+"'";
sql = sql + " select Ent_Plan_Following.*";
sql = sql + " from "+eEnEnt_Customer_Enterprise;
sql = sql + setDefaultSort();
//System.out.println("sq-------------------------"+sql);
EnEnt_Plan_Following [] aEnEnt_Customer_Enterprise = null;
aEnEnt_Customer_Enterprise =DAOCustomer.SetEnCustomert(db, sql);
return (aEnEnt_Customer_Enterprise);
}
public static EnEnt_Plan_Following [] searcheEnContract3(DbAccess db,
EnEnt_Plan_Following SearchEnContract,String startTime,String endTime,String chStationCode,String idstr)
throws Exception
{
String eEnEnt_Customer_Enterprise="";
if ((SearchEnContract.getChFollowResult() != null && SearchEnContract.getChFollowResult().length() != 0)
||(SearchEnContract.getChStationCode() != null && SearchEnContract.getChStationCode().length() != 0)
||(SearchEnContract.getChStation() != null && SearchEnContract.getChStation().length() != 0)
||(startTime != null && startTime.length()!=0)
||(endTime != null && endTime.length()!=0)
||(SearchEnContract.getChCommitName() != null && SearchEnContract.getChCommitName().toString().length() != 0) )
{
//eEnEnt_Customer_Enterprise = "(select * from Ent_Customer_Enterprise where chIsAudited like '1' and "+ GDPE.customer.enterprise.DAOCustomer.searchSql(SearchEnContract,startTime,endTime)+") Ent_Customer_Enterprise ";
eEnEnt_Customer_Enterprise ="(select * from (select * from Ent_Plan_Following where chStationCode ='"+chStationCode+"' or chCommitCode ='"+idstr+"') Ent_Plan_Following where "+ DAOCustomer.searchSql(SearchEnContract,startTime,endTime)+") Ent_Plan_Following ";
//System.out.println("0000000000000000000"+SearchEnContract.getChEnterpriseName());
}else{
eEnEnt_Customer_Enterprise="Ent_Plan_Following";
}
//System.out.println(Auditor);
String sql="";
//String sql = "select * from Ent_Record_Contract where chContractNo='"+SearchEnContract.getChContractNo()+"'";
sql = sql + " select Ent_Plan_Following.*";
sql = sql + " from "+eEnEnt_Customer_Enterprise;
sql = sql + setDefaultSort();
//System.out.println("sq-------------------------"+sql);
EnEnt_Plan_Following [] aEnEnt_Customer_Enterprise = null;
aEnEnt_Customer_Enterprise =DAOCustomer.SetEnCustomert(db, sql);
return (aEnEnt_Customer_Enterprise);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -