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

📄 daocustomer.java.svn-base

📁 公司CRM部分原代码,采用的是java技术.
💻 SVN-BASE
📖 第 1 页 / 共 2 页
字号:
package GDPE.customer.latent;

import levin.base.*;
import levin.util.DbAccess;
import levin.util.DataSet;
import GDPE.customer.enterprise.*;
 

/**
 * 合同管理 数据库访问类
 * <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_Customer_Enterprise [] searcheEnContract(DbAccess db,
    		EnEnt_Customer_Enterprise SearchEnContract,String startTime,String endTime)
      throws Exception
  {
    String eEnEnt_Customer_Enterprise="";

    if ((SearchEnContract.getChEnterpriseLinkman() != null && SearchEnContract.getChEnterpriseLinkman().length() != 0)
      ||(SearchEnContract.getChEnterpriseFullName() != null && SearchEnContract.getChEnterpriseFullName().length() != 0)
      ||(SearchEnContract.getChSeatCode() != null && SearchEnContract.getChSeatCode().length() != 0)
      ||(SearchEnContract.getChStationCode() != null && SearchEnContract.getChStationCode().length() != 0)
      ||(SearchEnContract.getChStation() != null && SearchEnContract.getChStation().length() != 0)
      
      ||(SearchEnContract.getChEnterpriseProvinceCode() != null && SearchEnContract.getChEnterpriseProvinceCode().length() != 0)
      ||(SearchEnContract.getChEnterpriseCityName() != null && SearchEnContract.getChEnterpriseCityName().length() != 0)
      ||(SearchEnContract.getChArea() != null && SearchEnContract.getChArea().length() != 0)
      
      ||(SearchEnContract.getChEnterpriseFax() != null && SearchEnContract.getChEnterpriseFax().length() != 0)
      ||(SearchEnContract.getChEnterprisePhone() != null && SearchEnContract.getChEnterprisePhone().length() != 0)
      ||(SearchEnContract.getLinkmanTel() != null && SearchEnContract.getLinkmanTel().length() != 0)
      
      ||(SearchEnContract.getChEnterpriseCategory() != null && SearchEnContract.getChEnterpriseCategory().length() != 0)
      ||(SearchEnContract.getChProduct() != null && SearchEnContract.getChProduct().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 '0' and "+ GDPE.customer.enterprise.DAOCustomer.searchSql(SearchEnContract,startTime,endTime)+") Ent_Customer_Enterprise ";
        //System.out.println("0000000000000000000"+SearchEnContract.getChEnterpriseName());
    }else{
    	
    	eEnEnt_Customer_Enterprise="Ent_Customer_Enterprise";
    }

    //System.out.println(Auditor);
    String  sql="";
   //String sql = "select * from Ent_Record_Contract where chContractNo='"+SearchEnContract.getChContractNo()+"'";
    sql = sql + " select Ent_Customer_Enterprise.*";
    sql = sql + " from "+eEnEnt_Customer_Enterprise;
    sql = sql + setDefaultSort();
    //System.out.println("sq-------------------------"+sql);
    EnEnt_Customer_Enterprise [] aEnEnt_Customer_Enterprise = null;
    aEnEnt_Customer_Enterprise =DAOCustomer.SetEnCustomert(db, sql);
    return (aEnEnt_Customer_Enterprise);
 }

  public static String searchSql(EnEnt_Customer_Enterprise eEnEnt_Customer_Enterprise,String startTime,String endTime)
    {
      String sql = "";
      int i=0;
      if (eEnEnt_Customer_Enterprise.getChEnterpriseLinkman() != null &&
          ! (eEnEnt_Customer_Enterprise.getChEnterpriseLinkman() + "A").equals("A"))
      {
        sql = sql + "Ent_Customer_Enterprise.chEnterpriseLinkman like '%" + eEnEnt_Customer_Enterprise.getChEnterpriseLinkman().trim()+"%'";
        i++;
      }
      if (eEnEnt_Customer_Enterprise.getChEnterpriseFullName() != null &&
          ! (eEnEnt_Customer_Enterprise.getChEnterpriseFullName() + "A").equals("A"))
      {
           if(i==0){
           sql = sql + " Ent_Customer_Enterprise.chEnterpriseFullName like '%" + eEnEnt_Customer_Enterprise.getChEnterpriseFullName().trim() + "%'";
           i++;
           }else{
           sql = sql + " and Ent_Customer_Enterprise.chEnterpriseFullName like '%" + eEnEnt_Customer_Enterprise.getChEnterpriseFullName().trim() + "%'";
           }
      }
      if (eEnEnt_Customer_Enterprise.getChSeatCode() != null &&
          ! (eEnEnt_Customer_Enterprise.getChSeatCode()  + "A").equals("A"))
      {
           if(i==0){
           sql = sql + " Ent_Customer_Enterprise.chSeatCode like '%" + eEnEnt_Customer_Enterprise.getChSeatCode().trim() + "%'";
           i++;
           }else{
           sql = sql + " and Ent_Customer_Enterprise.chSeatCode like '%" + eEnEnt_Customer_Enterprise.getChSeatCode().trim() + "%'";
           }
      }
      //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_Customer_Enterprise.chCommitName like '%" + eEnEnt_Customer_Enterprise.getChCommitName().trim() + "%'";
               i++;
               }else{
               sql = sql + " and Ent_Customer_Enterprise.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_Customer_Enterprise.chCommitCode like '%" + eEnEnt_Customer_Enterprise.getChCommitCode().trim() + "%'";
               i++;
               }else{
               sql = sql + " and Ent_Customer_Enterprise.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_Customer_Enterprise.chStationCode like '%" + eEnEnt_Customer_Enterprise.getChStationCode().trim() + "%'";
               i++;
               }else{
               sql = sql + " and Ent_Customer_Enterprise.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_Customer_Enterprise.chStation like '%" + eEnEnt_Customer_Enterprise.getChStation().trim() + "%'";
               i++;
               }else{
               sql = sql + " and Ent_Customer_Enterprise.chStation like '%" + eEnEnt_Customer_Enterprise.getChStation().trim() + "%'";
               }
          }
      
      if (eEnEnt_Customer_Enterprise.getChEnterpriseProvinceCode() != null &&
              ! (eEnEnt_Customer_Enterprise.getChEnterpriseProvinceCode()  + "A").equals("A"))
          {
               if(i==0){
               sql = sql + " Ent_Customer_Enterprise.chEnterpriseProvinceCode like '%" + eEnEnt_Customer_Enterprise.getChEnterpriseProvinceCode().trim() + "%'";
               i++;
               }else{
               sql = sql + " and Ent_Customer_Enterprise.chEnterpriseProvinceCode like '%" + eEnEnt_Customer_Enterprise.getChEnterpriseProvinceCode().trim() + "%'";
               }
          }
      if (eEnEnt_Customer_Enterprise.getChEnterpriseCityName() != null &&
              ! (eEnEnt_Customer_Enterprise.getChEnterpriseCityName()  + "A").equals("A"))
          {
               if(i==0){
               sql = sql + " Ent_Customer_Enterprise.chEnterpriseCityName like '%" + eEnEnt_Customer_Enterprise.getChEnterpriseCityName().trim() + "%'";
               i++;
               }else{
               sql = sql + " and Ent_Customer_Enterprise.chEnterpriseCityName like '%" + eEnEnt_Customer_Enterprise.getChEnterpriseCityName().trim() + "%'";
               }
          }
      
      if (eEnEnt_Customer_Enterprise.getChArea() != null &&
              ! (eEnEnt_Customer_Enterprise.getChArea()  + "A").equals("A"))
          {
               if(i==0){
               sql = sql + " Ent_Customer_Enterprise.chArea like '%" + eEnEnt_Customer_Enterprise.getChArea().trim() + "%'";
               i++;
               }else{
               sql = sql + " and Ent_Customer_Enterprise.chArea like '%" + eEnEnt_Customer_Enterprise.getChArea().trim() + "%'";
               }
          }
          
      if (eEnEnt_Customer_Enterprise.getChEnterpriseFax() != null &&

⌨️ 快捷键说明

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