ibatis中 select标签不能用isNotEmpty 用了 select就出错
Thecontentofelementtype"select"mustmatch"(include|trim|where|set|foreach|choose|if|bi...
The content of element type "select" must match "(include|trim|where|set|foreach|choose|if|bind)".
展开
展开全部
你可以这样写:
select rownum sno,cott.* FROM cottonbaginfo cott where 1=1
<dynamic >
<isNotEmpty prepend=" and " property="grower">grower = 111</isNotEmpty>
</dynamic>
因为 <dynamic > 是动态的,当你<isNotEmpty >的条件不满足时就不会走,执行
select rownum sno,cott.* FROM cottonbaginfo cott where 1=1查询全部,当条件满足时就执行 <isNotEmpty >。
select rownum sno,cott.* FROM cottonbaginfo cott where 1=1
<dynamic >
<isNotEmpty prepend=" and " property="grower">grower = 111</isNotEmpty>
</dynamic>
因为 <dynamic > 是动态的,当你<isNotEmpty >的条件不满足时就不会走,执行
select rownum sno,cott.* FROM cottonbaginfo cott where 1=1查询全部,当条件满足时就执行 <isNotEmpty >。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询