select b.loc,b.findtime,b.status,b.b_uid,b.desc,b.uname
from bugdesc b,user u
<where>
u.id=b.b_uid
<if test="#{id}!=null">id=#{id}</if>
<if test="#{b_uid}!=null">b_uid=#{b_uid}</if>
<if test="#{author}!=null">author=#{author}</if>
<if test="#{begin}!=null">b.findtime >= #{begin}</if>
<!-- <if test="#{end}!=null">b.findtime <= #{end}</if> -->
</where>这样写么
还有最后一个条件的小于号,在xml文件里怎么输入
from bugdesc b,user u
<where>
u.id=b.b_uid
<if test="#{id}!=null">id=#{id}</if>
<if test="#{b_uid}!=null">b_uid=#{b_uid}</if>
<if test="#{author}!=null">author=#{author}</if>
<if test="#{begin}!=null">b.findtime >= #{begin}</if>
<!-- <if test="#{end}!=null">b.findtime <= #{end}</if> -->
</where>这样写么
还有最后一个条件的小于号,在xml文件里怎么输入
解决方案 »
- 大侠们 为什么我的jsp中的form表单无法提交到Servlet啊?求
- 请帮帮忙写一个正则表达式。。。。谢谢了,完了分就送上。。
- JSTL中如何字符串相加
- 请教一个FCKeditor的问题,很棘手~
- 如何在Tomcat意外终止时保存一些信息?
- 我写了个jsp文件,copy到tomcat的安装目录的wepapps下,使用浏览器访问时报错了,是怎么回事?
- 求解答为什么Dao中总是获得不到SESSION
- jsp+javebean模式和jsp+servlet模式哪个运行起来速度快?
- 急急!!!!!!!!!!
- 复选框打勾出现文本框,文本框有多个参数
- 如何通过客户端电脑的用户名实现登陆?
- 有人配过solaris10上apache + 2个tomcat的负载均衡吗
sql语句
]]>
from bugdesc b,user u
<dynamic prepend=" where ">
<isNotNull property="id" prepend=" and ">
<isNotEmpty property="id">
id=#id#
</isNotEmpty>
</isNotNull>
<isNotNull property="end" prepend=" and ">
<isNotEmpty property="end">
<![CDATA[
b.findtime <= #end#
]]>
</isNotEmpty>
</isNotNull>
</dynamic>