ibatis取数据,有执行,但拿不到结果,怎么办

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ibatis取数据,有执行,但拿不到结果,怎么办相关的知识,希望对你有一定的参考价值。

下面是ibatis的sqlmap,数据库是oracle,当传入参数使a,b表无数据时,能返回空结果集,但当传入参数使a,b有数据时,就卡住无限读取了,经测试,用log4j输出的语句,在plsql中运行正常
with a as
(select a.dept,
a.deptname,
a.cureno,
(b.dosageqty*a.qty*d.ddd_value) consume
from qpbi_charge a,
(select * from qpbi_drugbasic where chemiccode like 'A%') b,
qpbi_drug_ddd d,
qpbi_admission c
where a.itemcode = b.itemcode(+)
and b.chemicname = d.itemname
]]>
<isNotEmpty property="starttime">
<![CDATA[ and a.chargedate >= to_timestamp(#starttime#, 'YYYY-MM-DD') ]]>
</isNotEmpty>
<isNotEmpty property="endtime">
<![CDATA[and a.chargedate < (to_timestamp(#endtime#, 'YYYY-MM-DD')+1) ]]>
</isNotEmpty>
<![CDATA[
and a.cureno = c.cureno
and c.status = 5),
b as
(select a.inhospdate, a.cureno
from qpbi_admission a
where status = 5
]]>
<isNotEmpty property="starttime">
<![CDATA[ and a.dischargedate >= to_timestamp(#starttime#, 'YYYY-MM-DD') ]]>
</isNotEmpty>
<isNotEmpty property="endtime">
<![CDATA[and a.dischargedate < (to_timestamp(#endtime#, 'YYYY-MM-DD')+1) ]]>
</isNotEmpty>
<![CDATA[
)
select rd attr1,deptname attr2,sumconsume attr3,hosptialout attr4,avghos attr5,useInte attr6 from (select rownum rd,c.* from(select
a.deptname,
sum(a.consume) sumconsume,
count(b.cureno) hosptialout,
round((sum(b.inhospdate) / decode(count(b.cureno),0,1,count(b.cureno))),2) avghos,
round(sum(a.consume) / decode(sum(b.inhospdate),0,1,sum(b.inhospdate)),2) useInte
from a, b
where a.cureno = b.cureno
group by a.dept, a.deptname
]]>
<isNotEmpty property="attr1">
order by $attr1$ desc
</isNotEmpty>

<![CDATA[
)c)d where d.rd>=#startrow# and d.rd<#startrow#+5
]]>

参考技术A b as
(select a.inhospdate, a.cureno
from qpbi_admission a
where status = 5
]]>

你的这个地方应该是a.status = 5
你检查一下sql其他看有错误没有。追问

只有一张表的时候可以省略吧,不是这个问题,找下来发现是starttime的问题,但具体不知道怎么做

参考技术B 我虽然没搞过ibatis 但是个人感觉原因可能是他解析的sql有问题,比较sql解析是他们开发人员做的,有些过于复杂的sql是没法解析的 建议你采用存储过程完成复杂的sql执行的任务

在vue开发中会遇到methods方法里有一个函数嵌套另一个函数,最内层函数this取不到data数据,该怎么解决?

一,问题

在vue的methods方法中两个函数互相嵌套,最内层函数this取不到data数据


二,原因

this的指向问题


三,解决方法

(1)给最外层函数this重新赋值给一个变量

 methods: 
    /** 给最外层函数this重新赋值 */
    t3() 
      console.log('函数外',this.msgData);   // codekey
      let _this = this
      let t4 = function() 
      console.log('函数内',_this.msgData);   // codekey
      
      t4()
    
 

(2)使用箭头函数

 methods: 
    /** 箭头函数 */
   t5() 
      console.log('函数外',this.msgData);   // codekey
      let t6 = () => 
        console.log('函数内',this.msgData);  // codekey
      
      t6()
    
  


以上是关于ibatis取数据,有执行,但拿不到结果,怎么办的主要内容,如果未能解决你的问题,请参考以下文章

$.ajax post提交的参数ASP接收不到

开机提示,windows找不到C:/windows/ylmf/桌面运行/numlock exe。怎

ibator使用

SQL2088 安装完成 但失败 找不到数据库引擎启动句柄怎麽回事 求大神 求解释 求解决

等我怎么怎了,就如何如何

Ibator插件安装配置及使用说明