找回密码
 注册成为天翎用户
查看: 1232|回复: 2

queryBySQL为什么要自动加WHERE table_0.DOMAINID ='11e3-8326-70e887f6-904e-5fe0...

[复制链接]
pinpoint 发表于 2015-9-13 22:46:01 | 显示全部楼层 |阅读模式
本帖最后由 johnson 于 2015-9-22 09:00 编辑

09-13 22:33:56  INFO printlnToFile(cn.myapps.core.macro.util.PrintJsUtil:36) - JsUtil:select item_area_name from tlk_business_area_form where item_area_id=(select item_work_area from tlk_person_dept_form where item_employee_name='林波')
09-13 22:33:56  INFO queryDOCBySQL(cn.myapps.core.dynaform.document.dao.AbstractDocStaticTblDAO:2145) - MY SQL:  SELECT * FROM (select item_area_name from tlk_business_area_form where item_area_id=(select item_work_area from tlk_person_dept_form where item_employee_name='林波')) table_0 WHERE table_0.DOMAINID ='11e3-8326-70e887f6-904e-5fe0bcdb8a06'

这是我的一个一个计算脚本里的代码
SQL本身没有问题,但使用queryBySQL后报错,因为table_0.DOMAINID没有这个字段,为什么queryBySQL要自动在外面增加SQL,而且还是增加WHERE table_0.DOMAINID ='11e3-8326-70e887f6-904e-5fe0bcdb8a06'。

应该怎么办?

附计算脚本代码

println("3333333333333333");

var doc = getCurrentDocument();
var process=getDocumentProcess();
var sales = getItemValue("OZOrderSalesPerson");
var sql = "select item_area_name from tlk_business_area_form where item_area_id=(select item_work_area from tlk_person_dept_form where item_employee_name='"+sales+"')";
println(sql);

var query = queryBySQL(sql);
println("aaaaaaaaaaaaaaa");
darcy 发表于 2015-9-15 10:48:20 | 显示全部楼层
我们的函数获取sql(不算直接获取数据源的.)
全部需要 domainid 字段
例子:  select domainid,item_字段 from tlk_表单

我们的视图如果想链接到对应的表单只需要 formid,domainid,id 3个字段

select id,formid,domainid from tlk_表单

我们的执行环境必须能获取到applicationid...(这个一般不会使用,但是遇到错误的时候也可以试着查看是不是该数据丢失.)
回复 1 0

使用道具 举报

lana 发表于 2015-10-8 14:43:03 | 显示全部楼层
你好,如问题已解决,请配合我们的工作,结一下帖子,谢谢
回复

使用道具 举报

本版积分规则

手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-14 05:21

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表