Search in sources :

Example 6 with BuildQuery

use of cn.cerc.jdb.mysql.BuildQuery in project summer-bean by cn-cerc.

the class BookOptions method getBookCreateDate.

// 从系统帐套中取开帐日期
private static TDate getBookCreateDate(IHandle handle) {
    BuildQuery f = new BuildQuery(handle);
    String corpNo = handle.getCorpNo();
    f.byField("CorpNo_", corpNo);
    f.add("select AppDate_ from %s", SystemTable.get(SystemTable.getBookInfo));
    SqlQuery ds = f.open();
    if (ds.size() == 0)
        throw new RuntimeException(String.format("没有找到帐套:%s", corpNo));
    return ds.getDate("AppDate_");
}
Also used : SqlQuery(cn.cerc.jdb.mysql.SqlQuery) BuildQuery(cn.cerc.jdb.mysql.BuildQuery)

Example 7 with BuildQuery

use of cn.cerc.jdb.mysql.BuildQuery in project summer-mis by cn-cerc.

the class FieldUseCheck method checkTable.

private boolean checkTable(String tableCode, String fieldCode, String fieldValue) {
    BuildQuery bq = new BuildQuery(this);
    bq.byField("CorpNo_", handle.getCorpNo());
    bq.byParam(String.format("%s=N'%s'", fieldCode, fieldValue));
    bq.setMaximum(1);
    bq.add("select %s * ");
    bq.add("from %s ", tableCode);
    bq.open();
    return !bq.getDataSet().eof();
}
Also used : BuildQuery(cn.cerc.jdb.mysql.BuildQuery)

Aggregations

BuildQuery (cn.cerc.jdb.mysql.BuildQuery)7 SqlQuery (cn.cerc.jdb.mysql.SqlQuery)3 DataSet (cn.cerc.jdb.core.DataSet)2 Record (cn.cerc.jdb.core.Record)1