当前位置: 代码迷 >> Java Web开发 >> 关于ibatis的<isNotEmpty>解决办法
  详细解决方案

关于ibatis的<isNotEmpty>解决办法

热度:6501   发布时间:2013-02-25 21:17:06.0
关于ibatis的<isNotEmpty>
<select id="queryInspectList" resultClass="inspectinfo">
select insp.* FROM inspectinfo1 insp  
  <dynamic prepend=" where ">
<isNotEmpty prepend=" and " property="reflectivity">reflectivity = 80 </isNotEmpty>
</dynamic>  
 </select>

我这样写有问题吗?怎么查询出来的结果没有执行where啊

<select id="queryInspectList" resultClass="inspectinfo">
  select insp.* FROM inspectinfo1 insp where reflectivity = 80
   
 </select>  

这样写就没有问题
是不是<isNotEmpty>我用的不对啊,请高手指点

------解决方案--------------------------------------------------------
<select id="query" resultMap="hotelinfo.Hotelpromotionrelease">
select * from hpm_hotelpromotionrelease2
<dynamic prepend="where">
<isNotEmpty prepend="and" property="id">
id = #id#
</isNotEmpty>

------解决方案--------------------------------------------------------
探讨
<select id="queryInspectList" resultClass="inspectinfo">
select insp.* FROM inspectinfo1 insp
<dynamic prepend=" where ">
<isNotEmpty prepend=" and " property="reflectivity">reflectivity = 80 <……
  相关解决方案