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

📄 htdlybsdsrwdao.java

📁 以前做的一个j2ee的项目
💻 JAVA
字号:
package gov.gdlt.ssgly.taxcore.taxdao.htdl;

import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.sql.SQLException;

import gov.gdlt.ssgly.taxcore.comm.dao.BaseDataAccessObject;
import gov.gdlt.ssgly.taxcore.comm.exception.TaxBaseSystemException;
import gov.gdlt.ssgly.taxcore.comm.log.LogWritter;
import gov.gdlt.ssgly.taxcore.taxevent.htdl.HTDLybsdsrwVO;
//import gov.gdlt.ssgly.taxcore.taxevent.htdl.HTDLBLHcsVO;
import java.util.ArrayList;

/**
 * <p>Title: 已部署定时任务列表DAO</p>
 *
 * <p>Description: 广东地税税收管理员工作平台</p>
 *
 * <p>Copyright: Copyright (c) 2005 广东省地方税务局,广州市地方税务局</p>
 *
 * <p>Company: 广州地税</p>
 *
 * @author 肖雪莲
 * @version 1.0
 */

public class HTDLybsdsrwDAO extends BaseDataAccessObject {
    private String rw_xh;
    private String rw_mc;
    private String lrry_dm;
    private String blh_mc;
    private String zxpl;
    private int zlsj;
    private int zxyxj;
    private String zb;
    private Timestamp rwbs_sj;
    private Timestamp rwtz_sj;
    private String dq_zt;
    private String csl; //参数列表,用于支持传参调度  by xxl 2005-9-19


    //更新指定任务的当前状态
    /**
     * 更新指定任务的当前状态(使用本DAO的数据作为传入参数)
     * @return int <br>
     *     >=0 被更新的记录数<br>
     *     RET_FAIL 执行失败
     */
    public int updateRwzt(String rw_xh, String dq_zt) throws
            TaxBaseSystemException {
        HashMap para = new HashMap();
        para.put("rw_xh", new String(rw_xh));
        para.put("dq_zt", new String(dq_zt));
        return update("T_HTDL_YBSDSRW.updateDqztByRw", para);
    }


//更新指定任务的上次成功执行时间
    /**
     * @param paramObj:Object 传入的参数对象
     * @return int <br>
     *     >=0 被更新的记录数<br>
     *     RET_FAIL 执行失败
     */
    public int updateSccg_sj(String rw_xh, Timestamp zx_sj) throws
            TaxBaseSystemException {
        HashMap para = new HashMap();
        para.put("zx_sj", zx_sj);
        para.put("rw_xh", rw_xh);
        return update("T_HTDL_YBSDSRW.updateSczxsj", para);
    }

    //插入一条新的定时任务
    /* @return Object
     *     RET_FAIL:Integer 执行失败
     *     非RET_FAIL:Object 保存成功
     */
    //需要修改,catch 中需要修改Exception的类型和编码 mod
    public boolean saveDsrw() throws TaxBaseSystemException {
        boolean result = true;
        try {
            save("T_HTDL_YBSDSRW.insertYbsdsrw");
        } catch (Exception e) {
            result = false;
            LogWritter.sysError("YCHTDL02211:往已部署任务列表中插入新记录时出现异常!" +
                                e.getMessage());
            throw new TaxBaseSystemException("YCHTDL02211"); //YCHTDL01***:插入新的定时任务失败
        }
        return result;
    }

    /*
        //插入一条新的定时任务,同时解析参数列表,并插入到blh参数表中
     public boolean addYbsrw(HTDLybsdsrwVO ybsrwVO) throws SsglyDAOException {
            this.getSqlMapClient();  //用父类方法获取SqlMap对象
            try {
                try {
                   sqlMap.startTransaction();
                   //获取新的任务序号
                   ybsrwVO.setRw_xh((String)sqlMap.queryForObject("T_HTDL_YBSDSRW.getNewRwXh",null));
                   //插入新的任务的记录
                   sqlMap.insert("T_HTDL_YBSDSRW.insertYbsdsrw",ybsrwVO);
                   //插入任务-参数记录
                   String blh_mc = ybsrwVO.getBlh_mc();
                   String rw_xh = ybsrwVO.getRw_xh();
     String csl[] = ybsrwVO.getCsl().split(";");  //key1=value;key2=value;的形式
                   for (int i=0; i<csl.length;i++) {
                       String cs = csl[i];
                       HTDLBLHcsVO blhCsVO = new HTDLBLHcsVO();
                       blhCsVO.setBlh_mc(blh_mc);
                       blhCsVO.setRw_xh(rw_xh);
                       blhCsVO.setCs_mc((cs.split("="))[0]);  //参数名称
                       blhCsVO.setCsz((cs.split("="))[1]);  //参数值
                       sqlMap.insert("T_HTDL_BLHCS.insertBlhCs",blhCsVO);
                   }
                   sqlMap.commitTransaction();
                } finally {
                    sqlMap.endTransaction();
                }
            }catch (SQLException e) {
     LogWritter.sysError("YCHTDL02211:往已部署任务列表中插入新记录时出现数据库操作异常!"+e.getMessage());
                throw new SsglyDAOException("YCHTDL02211:往已部署任务列表中插入新记录时出现数据库操作异常!"+e.getMessage());
            } catch(Exception e) {
                //mod
            }
            return true;
        }

        //更新已部署任务列表中指定任务的参数列表值,同时更新对应的任务-参数对应表中的记录
        public boolean updateYbsrwCsByRwxh(String rwxh, String csl) throws SsglyDAOException {
            this.getSqlMapClient();
            try {
                try {
                    sqlMap.startTransaction();
                    //更新已部署任务列表中指定任务的参数值
                    HashMap para = new HashMap();
                    para.put("csl", new String(csl));
                    para.put("rw_xh", new String(rwxh));
                    sqlMap.update("T_HTDL_YBSDSRW.updateYbsrwCsByRw",para);

                    //更新任务-参数列表中的记录
     String csArray[] = csl.split(";");  //key1=value;key2=value;的形式
                   for (int i=0; i<csArray.length;i++) {
                       String cs = csArray[i];
                       HTDLBLHcsVO blhCsVO = new HTDLBLHcsVO();
                       blhCsVO.setRw_xh(rwxh);
                       blhCsVO.setCs_mc((cs.split("="))[0]);  //参数名称
                       blhCsVO.setCsz((cs.split("="))[1]);  //参数值
                       sqlMap.update("T_HTDL_BLHCS.updateBlhCs",blhCsVO);
                   }
                   sqlMap.commitTransaction();
                } finally {
                    sqlMap.endTransaction();
                }
            }catch (Exception e) {
                //mod
            }
            return true;
        }

        //删除指定任务序号的任务,同时删除任务-参数列表中的记录
     public boolean delYbsrwAndCs(ArrayList rwList) throws SsglyDAOException {
            this.getSqlMapClient();
            try {
                    try {
                        sqlMap.startTransaction();
                        for (int i=0; i<rwList.size();i++) {
                            //删除已部署任务列表中的记录
     sqlMap.delete("T_HTDL_YBSDSRW.delYbsdsrw", rwList.get(i));
                            //删除任务-参数列表中的记录
     sqlMap.delete("T_HTDL_BLHCS.deleteBlhCs", rwList.get(i));
                            sqlMap.commitTransaction();
                        }
                    } finally {
                        sqlMap.endTransaction();
                    }
            } catch (Exception e) {
                //mod
            }
            return true;
        }
     */

//更新指定任务的参数列
    public int updateYbsrwCs(String rwxh, String csl) throws
            TaxBaseSystemException {
        HashMap para = new HashMap();
        para.put("rw_xh", new String(rwxh));
        para.put("csl", new String(csl));
        return update("T_HTDL_YBSDSRW.updateYbsrwCsByRw", para);
    }

//更新指定任务的相关属性
    public int updateYbsrwByXh(HTDLybsdsrwVO ybsrwVO) throws TaxBaseSystemException {
        return update("T_HTDL_YBSDSRW.updateYbsrwByXh", ybsrwVO);
    }
    /**
     * 从已部署任务列表中删除指定任务序号rw_xh的任务
     * @param rw_xh:String 任务序号
     * @return int <br>
     *     >=0 被删除的记录数<br>
     *     RET_FAIL 执行失败
     */
    public int deleteYbsrw(String rw_xh) throws TaxBaseSystemException {
        return delete("T_HTDL_YBSDSRW.delYbsdsrw", rw_xh);
    }

    //从已部署任务列表中删除指定任务序号rwList的任务
    public int deleteYbsrwBatch(String rwList) throws TaxBaseSystemException {
        return delete("T_HTDL_YBSDSRW.delYbsdsrwBatch", rwList);
    }

    //返回已部署任务列表中的记录
    public List selectAllYbsrw(String blh_mc) throws TaxBaseSystemException {
        HashMap para = new HashMap();
        if (blh_mc != null) {
            para.put("blh_mc", new String(blh_mc));
        } else {
            para.put("blh_mc", new String(""));
        }
        return selectAll("T_HTDL_YBSDSRW.selectAllYbsdsrw", para);
    }

//模糊查询已部署任务表中的记录
    public List getYbsrwFuzzy(String rw_mc, String zxpl, String blh_mc,
                              String dq_zt) throws TaxBaseSystemException {
        HashMap para = new HashMap();
        if (rw_mc != null) {
            para.put("rw_mc", new String(rw_mc));
        } else {
            para.put("rw_mc", new String(""));
        }
        if (zxpl != null) {
            para.put("zxpl", new String(zxpl));
        } else {
            para.put("zxpl", new String(""));
        }
        if (blh_mc != null) {
            para.put("blh_mc", new String(blh_mc));
        } else {
            para.put("blh_mc", new String(""));
        }
        if (dq_zt != null) {
            para.put("dq_zt", new String(dq_zt));
        } else {
            para.put("dq_zt", new String(""));
        }
        return selectAll("T_HTDL_YBSDSRW.getYbsrwFuzzy", para);
    }

//模糊查询已部署任务列表中人工调度任务的记录
    public List getManualDdrwFuzzy(String rw_mc, String blh_mc, String dq_zt) {
        HashMap para = new HashMap();
        if (rw_mc != null) {
            para.put("rw_mc", new String(rw_mc));
        } else {
            para.put("rw_mc", new String(""));
        }
        if (blh_mc != null) {
            para.put("blh_mc", new String(blh_mc));
        } else {
            para.put("blh_mc", new String(""));
        }
        if (dq_zt != null) {
            para.put("dq_zt", new String(dq_zt));
        } else {
            para.put("dq_zt", new String(""));
        }
        return selectAll("T_HTDL_YBSDSRW.getManualDdrwFuzzy", para);
    }

    /**批量更新任务的当前状态 0<-->1
     * @param paramObj:Object 传入的参数对象
     * @return int <br>
     *     >=0 被更新的记录数<br>
     *     RET_FAIL 执行失败
     */
    public int updateZtBatch(String rwxh) throws TaxBaseSystemException {
        return update("T_HTDL_YBSDSRW.updateDqztBatch", rwxh);
    }

    public int updateZtBatch2(List rwxh) throws TaxBaseSystemException {
        return update("T_HTDL_YBSDSRW.updateDqztBatch2", rwxh);
    }

    public List getYbsrwByRwxh(String rwxh) throws TaxBaseSystemException {
        return selectAll("T_HTDL_YBSDSRW.getYbsrwByRwxh", rwxh);
    }

    public String getBlh_mc() {
        return blh_mc;
    }

    public String getDq_zt() {
        return dq_zt;
    }

    public String getLrry_dm() {
        return lrry_dm;
    }

    public String getRw_xh() {
        return rw_xh;
    }

    public Timestamp getRwbs_sj() {
        return rwbs_sj;
    }

    public Timestamp getRwtz_sj() {
        return rwtz_sj;
    }

    public String getZb() {
        return zb;
    }

    public int getZlsj() {
        return zlsj;
    }

    public String getZxpl() {
        return zxpl;
    }

    public int getZxyxj() {
        return zxyxj;
    }

    public String getRw_mc() {
        return rw_mc;
    }

    public String getCsl() {
        return csl;
    }

    public void setBlh_mc(String blh_mc) {
        this.blh_mc = blh_mc;
    }

    public void setDq_zt(String dq_zt) {
        this.dq_zt = dq_zt;
    }

    public void setLrry_dm(String lrry_dm) {
        this.lrry_dm = lrry_dm;
    }

    public void setRw_xh(String rw_xh) {
        this.rw_xh = rw_xh;
    }

    public void setRwbs_sj(Timestamp rwbs_sj) {
        this.rwbs_sj = rwbs_sj;
    }

    public void setRwtz_sj(Timestamp rwtz_sj) {
        this.rwtz_sj = rwtz_sj;
    }

    public void setZb(String zb) {
        this.zb = zb;
    }

    public void setZlsj(int zlsj) {
        this.zlsj = zlsj;
    }

    public void setZxpl(String zxpl) {
        this.zxpl = zxpl;
    }

    public void setZxyxj(int zxyxj) {
        this.zxyxj = zxyxj;
    }

    public void setRw_mc(String rw_mc) {
        this.rw_mc = rw_mc;
    }

    public void setCsl(String csl) {
        this.csl = csl;
    }

    public static void main(String args[]) throws Exception {
        HTDLybsdsrwDAO tmpDAO = new HTDLybsdsrwDAO();
//        Timestamp sj = new Timestamp(System.currentTimeMillis());
//        tmpDAO.updateSccg_sj("12",sj);
//        List tmp1 = tmpDAO.getYbsrwFuzzy("A07-01","A07-01","A07-01","A07-01");
//        System.out.println(tmp1.size());
//
//        List tmp = tmpDAO.getManualDdrwFuzzy("A07-01","A07-01","A07-01");
//        System.out.println(tmp.size());

        String str1="wewe";
        String str2="我们我们";
        char[] c1 = str1.toCharArray();
        char[] c2 = str2.toCharArray();
        byte[] b1 = str1.getBytes();
        byte[] b2 = str2.getBytes();
        System.out.println("c1.length:"+c1.length);
        System.out.println("c2.length:"+c2.length);
        System.out.println("b1.length:"+b1.length);
        System.out.println("b2.length:"+b2.length);
        System.out.println("b1."+b1.toString());
        System.out.println("b2."+b2.toString());
    }
}

⌨️ 快捷键说明

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