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

📄 operappealtype.java

📁 电信的网厅的整站代码
💻 JAVA
字号:
package com.doone.fj1w.fjmgr.useroperinfo;
import com.doone.data.DacClient;
import com.doone.data.DataTable;
import com.doone.util.FileLogger;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */

public class Operappealtype{
    /*
     APPEALTYPEID   NUMBER(10)                    故障投诉建议类别序号
     CITYCODE       VARCHAR2(4)                   地市编码
     APPEALTYPENAME VARCHAR2(20)                  业务类别名称
     APPEALMODE     VARCHAR2(9)                   1、故障 2、投诉 3、建议  详见系统参数配置表
     UPAPPEALTYPEID NUMBER(10)            0       上级序号
     */

    private String sappealtypeid=null;
    private String scitycode=null;
    private String sappealtypename=null;
    private String sappealmode=null;
    private String supappealtypeid=null;
    private String FAULTTYPE=null;

    private DacClient _dbClient=null;
    int count=0;//查询数据库中的记录数
    int pagecount =15;//分页是每一页显示的记录个数


    public Operappealtype() {
        try {
          _dbClient = new DacClient();
        }
        catch (Exception ex) {
          FileLogger.getLogger().error(ex);
    }
    }

    public void setappealtypeid(String sappealtypeid)
    {this.sappealtypeid=sappealtypeid;}
    public void setcitycode(String scitycode)
    {this.scitycode =scitycode;}
    public void setappealtypename(String sappealtypename)
    {this.sappealtypename=sappealtypename;}
    public void setappealmode(String sappealmode)
    {this.sappealmode =sappealmode;}
    public void setupappealtypeid(String supappealtypeid)
    {this.supappealtypeid=supappealtypeid;}
    public void setFAULTTYPE(String faulttype) {
		this.FAULTTYPE = faulttype;
	}


    public int insertappealtype(){
        int doExp = 0;
        try {
//            StringBuffer sql=new StringBuffer();
//            sql.append("INSERT INTO Td_AppealType");
//            sql.append("(APPEALTYPEID, CITYCODE,APPEALTYPENAME,APPEALMODE,UPAPPEALTYPEID,STATE,FAULTTYPE)");
//            sql.append("VALUES(");
//            sql.append("SEQ_APPEALTYPEID.nextval, ");
//            sql.append(scitycode);
//            sql.append(",");
//            sql.append(sappealtypename);
//            sql.append(",");
//            sql.append(sappealmode);
//            sql.append(",");
//            sql.append(supappealtypeid);
//            sql.append(",");
//            sql.append("E,");
//            sql.append(FAULTTYPE);
//        
//            sql.append(")");
            //System.out.println("增加====》"+sql); 
        	
        	
        	
        	// XXX 进行sao中字段的有效性检查。
              String Sql_Ins_Showinfo = "INSERT INTO Td_AppealType(APPEALTYPEID, CITYCODE,APPEALTYPENAME,APPEALMODE,UPAPPEALTYPEID,STATE,FAULTTYPE) VALUES(SEQ_APPEALTYPEID.nextval,?,?,?,?,'E',?)";
              Object[] value = new Object[5];
              value[0] = scitycode; //地市编码
              value[1] = sappealtypename; //业务类别名称
              value[2] = sappealmode; //详见系统参数配置表
              value[3] = supappealtypeid; //上级序号
              value[4] = FAULTTYPE; //类别序号
              _dbClient.beginTransaction(10000);
              doExp = _dbClient.executeUpdate(Sql_Ins_Showinfo,1000,value);
              _dbClient.endTransaction(true);

        }catch (Exception ex) {
            FileLogger.getLogger().error(ex);
            try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

    public int deleteappealtype(String tablename,String id){
        int doExp = 0;
        try {
                // XXX 进行sao中字段的有效性检查。
              String Sql_Del_Showinfo = "update Td_AppealType set STATE='D' where APPEALTYPEID=?";
              Object[] value = new Object[1];
              value[0] = sappealtypeid; //序号

              _dbClient.beginTransaction(10000);
              doExp = _dbClient.executeUpdate(Sql_Del_Showinfo,1000,value);
              _dbClient.endTransaction(true);

        }catch (Exception ex) {
            FileLogger.getLogger().error(ex);
            try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

    public int updateappealtype(){
        int doExp = 0;
        try {
                // 只更新业务类别名称
              String Sql_Upd_Showinfo = "update Td_AppealType set APPEALTYPENAME=? where APPEALTYPEID=?";
              Object[] value = new Object[2];
              value[0] = sappealtypename; //
              value[1] = sappealtypeid; //地市编码

              _dbClient.beginTransaction(10000);
              doExp = _dbClient.executeUpdate(Sql_Upd_Showinfo,1000,value);
              _dbClient.endTransaction(true);

        }catch (Exception ex) {
            FileLogger.getLogger().error(ex);
            try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

    public DataTable _queryappealtype(String tablename,String field1,String filed1value,String appealmode){
        DataTable dt = null;
        try {
            String S_SELECT_TICKET =
                    "select a.*,b.CITYNAME from "+tablename+" a,td_city b where a."+field1+"=? and a.citycode=b.citycode and a.UPAPPEALTYPEID='0' and  a.STATE='E' and a.APPEALMODE=? ";
            Object[] obbb = new Object[2];
            obbb[0] = filed1value;
            obbb[1] = appealmode;
           
             _dbClient.beginTransaction(10000);
            dt = _dbClient.executeQuery(S_SELECT_TICKET, obbb);
            _dbClient.endTransaction(true);

        } catch (Exception ex) {
          FileLogger.getLogger().error(ex);
          try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return dt;
    }
    
    
    public DataTable queryappealtype(String citycode,String ywlb,String lx,String pageNo){
        DataTable dt = null;
        try {
        	if(citycode.equals("")){citycode="";}else{citycode=" and a.CITYCODE='"+citycode+"'";}
        	if(ywlb.equals("")){ywlb="";}else{ywlb=" and a.FAULTTYPE='"+ywlb+"'";}
        	if(lx.equals("")){lx="";}else{lx=" and a.APPEALMODE='"+lx+"'";}
        	
        	StringBuffer sql=new StringBuffer();
        	sql.append("select * from(select rownum num,a.*,b.CITYNAME from Td_AppealType a,td_city b ");
        	sql.append(" where a.citycode=b.citycode and a.STATE='E'");
        	sql.append(citycode);
        	sql.append(ywlb);
        	sql.append(lx);
        	sql.append(" order by a.APPEALTYPEID");
        	sql.append(")t");
        	sql.append(" where t.num>");
        	sql.append(pagecount * (Integer.parseInt(pageNo) - 1));
        	sql.append(" and t.num<=");
        	sql.append(pagecount * Integer.parseInt(pageNo));
          // System.out.println("jjjjjjjjjjjj"+sql.toString());
            _dbClient.beginTransaction(10000);
            dt = _dbClient.executeQuery(sql.toString());
            
            _dbClient.endTransaction(true);
        } catch (Exception ex) {
          FileLogger.getLogger().error(ex);
          try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return dt;
    }
    
    public DataTable queryappealtype11(String tablename,String field1,String filed1value){
        DataTable dt = null;
        try {
        	
        	StringBuffer sql=new StringBuffer();
        	sql.append("select a.*,b.CITYNAME from Td_AppealType a,td_city b");
        	sql.append(" where a.APPEALTYPEID=");
        	sql.append( filed1value);
        	sql.append(" and a.citycode=b.citycode and a.STATE='E'");
        	
//            String S_SELECT_TICKET =
//                    "select a.*,b.CITYNAME from "+tablename+" a,td_city b where a."+field1+"=? and a.citycode=b.citycode and a.STATE='E'";
//            Object[] obbb = new Object[1];
//            obbb[0] = filed1value;
           
            // System.out.println("sql22222222==>"+sql);

            _dbClient.beginTransaction(10000);
            dt = _dbClient.executeQuery(sql.toString());
            _dbClient.endTransaction(true);

        } catch (Exception ex) {
          FileLogger.getLogger().error(ex);
          try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return dt;
    }
    
	
	public DataTable query_producd() {

			String 	sql="select distinct PRODUCTNAME,PRODUCTID from td_product t where t.upproductid='0' and t.PRODUCTID in(1,2,3)";
			
			DataTable dt=null;
		
				try {
			
					 dt = _dbClient.executeQuery(sql);
					 _dbClient.beginTransaction(10000);
					   _dbClient.endTransaction(true);
					
					
				} catch (Exception ex) {
					
					return null;}
				
					return dt;
			}

    public DataTable qryappealtypeupid(String field1,String filed1value){
        DataTable dt = null;
        try {
        	
        	StringBuffer sql=new StringBuffer();
        	sql.append("select APPEALTYPEID,APPEALTYPENAME from Td_AppealType");
        	sql.append(" where ");
        	sql.append(field1);
        	sql.append(" =");
        	sql.append(filed1value);
        	sql.append(" and STATE='E'");
        	sql.append(" and UPAPPEALTYPEID='0'");
        	System.out.println(sql.toString());
//            String S_SELECT_TICKET =
//                    "select APPEALTYPEID,APPEALTYPENAME from Td_AppealType where "+field1+"=? and STATE='E'";
//            Object[] obbb = new Object[1];
//            obbb[0] = filed1value;
//            System.out.println("sql===>"+S_SELECT_TICKET);
            

            _dbClient.beginTransaction(10000);
            dt = _dbClient.executeQuery(sql.toString());
            _dbClient.endTransaction(true);

        } catch (Exception ex) {
          FileLogger.getLogger().error(ex);
          try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return dt;
    }

    public String qryexistappealtype(){
        String doExp = "0";
        try {
            String S_SELECT_TICKET =
                    "select count(*) from Td_AppealType where 1=? and CITYCODE=? and APPEALMODE=? and UPAPPEALTYPEID=? and STATE='E'";
            Object[] obbb = new Object[4];
            obbb[0] = "1";
            obbb[1] = scitycode;
            obbb[2] = sappealtypename;
            obbb[3] = supappealtypeid;

            _dbClient.beginTransaction(10000);
            doExp = _dbClient.getStringFromSqlQuery(S_SELECT_TICKET, obbb);
            _dbClient.endTransaction(true);

        } catch (Exception ex) {
          FileLogger.getLogger().error(ex);
          try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
        }
        return doExp;
    }

      //获得页数    
       public int getPageCount(String citycode,String ywlb,String lx){

         DataTable dt=null;
         try{
        	if(citycode.equals("")){citycode="";}else{citycode=" and a.CITYCODE='"+citycode+"'";}
         	if(ywlb.equals("")){ywlb="";}else{ywlb=" and a.FAULTTYPE='"+ywlb+"'";}
         	if(lx.equals("")){lx="";}else{lx=" and a.APPEALMODE='"+lx+"'";}
         	StringBuffer sql=new StringBuffer();
         	sql.append("select count(*) count from Td_AppealType a,td_city b");
         	sql.append(" where a.citycode=b.citycode and a.STATE='E'");
         	sql.append(citycode);
         	sql.append(ywlb);
         	sql.append(lx);
           _dbClient.beginTransaction(10000);
           //System.out.println("得到总页数==〉"+sql.toString()) ;
           dt=_dbClient.executeQuery(sql.toString());
           count=dt.getRow(0).getInt("count");
           if (count % pagecount == 0)
        	   count = count / pagecount;
           else
        	   count = count / pagecount + 1;

           _dbClient.endTransaction(true);
         }
         catch(Exception ex){
           FileLogger.getLogger().error(ex);
             try{_dbClient.endTransaction(false);}
             catch(Exception ex1){}
         }
         return count;
   }


}

⌨️ 快捷键说明

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