读书人

关于ibatis的lt;isNotEmptygt;解决办法

发布时间: 2012-08-19 21:09:48 作者: rapoo

关于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 <……

读书人网 >Java Web开发

热点推荐