package cn.cerc.mis.api;

import cn.cerc.core.Record;
import cn.cerc.core.Utils;
import cn.cerc.db.mysql.BuildQuery;
import cn.cerc.db.mysql.SqlQuery;
import cn.cerc.mis.core.CustomService;
import cn.cerc.mis.core.DataValidateException;

public class ApiBookOption extends CustomService {

    /**
     * 根据帐套代码、参数代码获取参数值
     */
    public boolean getValue() throws DataValidateException {
        Record headIn = getDataIn().getHead();

        DataValidateException.stopRun("帐套代码不允许为空", !headIn.hasValue("CorpNo_"));
        String corpNo = Utils.safeString(headIn.getString("CorpNo_"));

        DataValidateException.stopRun("参数代码不允许为空", !headIn.hasValue("Code_"));
        String code = Utils.safeString(headIn.getString("Code_"));

        BuildQuery f = new BuildQuery(this);
        f.add("select Value_ from %s ", systemTable.getBookOptions());
        f.byField("CorpNo_", corpNo);
        f.byField("Code_", code);
        SqlQuery cdsTmp = f.open();

        getDataOut().appendDataSet(cdsTmp);
        return true;
    }

}

@@ -78,44 +78,8 @@
 ls;%0A
-import cn.cerc.db.mysql.BuildQuery;%0A
 impo
@@ -708,32 +708,33 @@
     
-Build
+Sql
 Query 
-f
+cdsTmp
  = new 
-Build
+Sql
 Quer
@@ -750,17 +750,22 @@
         
-f
+cdsTmp
 .add(%22se
@@ -783,17 +783,16 @@
  from %25s
- 
 %22, syste
@@ -829,26 +829,38 @@
     
-f.byField(%22
+cdsTmp.add(%22where 
 CorpNo_
+='%25s'
 %22, c
@@ -879,24 +879,34 @@
     
-f.byField(%22Code_
+cdsTmp.add(%22and Code_='%25s'
 %22, c
@@ -923,27 +923,14 @@
     
-SqlQuery 
 cdsTmp
- = f
 .ope

Update ApiBookOption.java