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

📄 boardroomapplydb.java

📁 oa 源码
💻 JAVA
字号:
package com.redmoon.oa.meeting;import java.sql.*;import java.util.*;import cn.js.fan.base.*;import cn.js.fan.db.*;import cn.js.fan.util.*;public class BoardroomApplyDb extends ObjectDb {    public BoardroomApplyDb() {    }    public BoardroomApplyDb(int flowId) {        this.flowId = flowId;        initDB();        load();    }    public BoardroomApplyDb getBoardroomApplyDb(int flowId) {        return (BoardroomApplyDb) getObjectDb(new Integer(flowId));    }    public ObjectDb getObjectRaw(PrimaryKey pk) {        return new BoardroomApplyDb(pk.getIntValue());    }    public void initDB() {        this.tableName = "form_table_hysqd";        primaryKey = new PrimaryKey("flowId", PrimaryKey.TYPE_INT);        objectCache = new BoardroomApplyCache(this);        this.QUERY_LOAD =                "SELECT flowId,meeting_title,sqren,hycontent,chrenyuan,bzwpyq,hyshi,apply_date,start_date,end_date,chrs,spyjian,result FROM " +                tableName + " WHERE flowId=?";        this.QUERY_LIST = "SELECT flowId FROM " + tableName;        isInitFromConfigDB = false;    }    public boolean create() throws ErrMsgException {        return false;    }    public boolean save() throws ErrMsgException {        return false;    }    public void load() {        Conn conn = new Conn(connname);        PreparedStatement pstmt = null;        ResultSet rs = null;        try {            pstmt = conn.prepareStatement(this.QUERY_LOAD);            pstmt.setInt(1, flowId);            rs = conn.executePreQuery();            if (rs.next()) {                try {                    this.meeting_title = StrUtil.getNullStr(rs.getString(                            "meeting_title"));                    this.sqren = StrUtil.getNullStr(rs.getString("sqren"));                    this.hycontent = StrUtil.getNullStr(rs.getString(                            "hycontent"));                    this.chrenyuan = StrUtil.getNullStr(rs.getString(                            "chrenyuan"));                    this.bzwpyq = StrUtil.getNullStr(rs.getString("bzwpyq"));                    this.hyshi = StrUtil.getNullStr(rs.getString("hyshi"));                    Timestamp ts = rs.getTimestamp("apply_date");                    if (ts == null)                        this.apply_date = null;                    else {                        this.apply_date = ts;                    }                    ts = rs.getTimestamp("start_date");                    if (ts == null)                        this.start_date = null;                    else {                        this.start_date = ts;                    }                    ts = rs.getTimestamp("end_date");                    if (ts == null) {                        this.end_date = null;                    } else {                        this.end_date = ts;                    }                } catch (SQLException e) {                    logger.error("load1:" + e.getMessage());                }                this.chrs = StrUtil.getNullStr(rs.getString("chrs"));                this.spyjian = StrUtil.getNullStr(rs.getString("spyjian"));                this.result = StrUtil.getNullStr(rs.getString("result"));                loaded = true;                primaryKey.setValue(new Integer(flowId));            }        } catch (SQLException e) {            logger.error("load:" + e.getMessage());            e.printStackTrace();        } finally {            if (rs != null) {                try {                    rs.close();                } catch (Exception e) {}                rs = null;            }            if (conn != null) {                conn.close();                conn = null;            }        }    }    public boolean del() throws ErrMsgException {        return false;    }    public ListResult listResult(String listsql, int curPage, int pageSize) throws            ErrMsgException {        int total = 0;        ResultSet rs = null;        Vector result = new Vector();        ListResult lr = new ListResult();        lr.setTotal(total);        lr.setResult(result);        Conn conn = new Conn(connname);        try {                        String countsql = SQLFilter.getCountSql(listsql);            rs = conn.executeQuery(countsql);            if (rs != null && rs.next()) {                total = rs.getInt(1);            }            if (rs != null) {                rs.close();                rs = null;            }            if (total != 0)                conn.setMaxRows(curPage * pageSize);             rs = conn.executeQuery(listsql);            if (rs == null) {                return lr;            } else {                rs.setFetchSize(pageSize);                int absoluteLocation = pageSize * (curPage - 1) + 1;                if (rs.absolute(absoluteLocation) == false) {                    return lr;                }                do {                    BoardroomApplyDb vd = getBoardroomApplyDb(rs.getInt(1));                    result.addElement(vd);                } while (rs.next());            }        } catch (SQLException e) {            logger.error(e.getMessage());            throw new ErrMsgException("数据库出错!");        } finally {            if (rs != null) {                try {                    rs.close();                } catch (Exception e) {}                rs = null;            }            if (conn != null) {                conn.close();                conn = null;            }        }        lr.setResult(result);        lr.setTotal(total);        return lr;    }    public void setSqren(String sqren) {        this.sqren = sqren;    }    public void setFlowId(int flowId) {        this.flowId = flowId;    }    public void setHycontent(String hycontent) {        this.hycontent = hycontent;    }    public void setChrenyuan(String chrenyuan) {        this.chrenyuan = chrenyuan;    }    public void setBzwpyq(String bzwpyq) {        this.bzwpyq = bzwpyq;    }    public void setHyshi(String hyshi) {        this.hyshi = hyshi;    }    public void setApply_date(java.util.Date apply_date) {        this.apply_date = apply_date;    }    public void setStart_date(java.util.Date start_date) {        this.start_date = start_date;    }    public void setEnd_date(java.util.Date end_date) {        this.end_date = end_date;    }    public void setMeetingTitle(String meeting_title) {        this.meeting_title = meeting_title;    }    public void setChrs(String chrs) {        this.chrs = chrs;    }    public void setSpyjian(String spyjian) {        this.spyjian = spyjian;    }    public void setResult(String result) {        this.result = result;    }    public String getSqren() {        return sqren;    }    public int getFlowId() {        return flowId;    }    public String getHycontent() {        return hycontent;    }    public String getChrenyuan() {        return chrenyuan;    }    public String getBzwpyq() {        return bzwpyq;    }    public String getHyshi() {        return hyshi;    }    public java.util.Date getApply_date() {        return apply_date;    }    public java.util.Date getStart_date() {        return start_date;    }    public java.util.Date getEnd_date() {        return end_date;    }    public String getMeetingTitle() {        return meeting_title;    }    public String getChrs() {        return chrs;    }    public String getSpyjian() {        return spyjian;    }    public String getResult() {        return result;    }    private int flowId;    private String hycontent;    private String chrenyuan;    private String bzwpyq;    private String hyshi;    private java.util.Date apply_date;    private java.util.Date start_date;    private java.util.Date end_date;    private String meeting_title;    private String sqren;    private String chrs;    private String spyjian;    private String result;}

⌨️ 快捷键说明

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