<where>
<trim prefixOverrides="and">
<if test="id!=null">
and c.id=#{id}
</if>
<if test="oid!=null and oid!=0">
and b.id=#{oid}
</if>
<if test="startDate!=null">
<if test="endDate!=null">
and a.pay_time BETWEEN #{startDate} AND #{endDate}
</if>
</if>
</trim>
</where>
service层如果参数为null,mybatis执行sql语句的时候就不会去拼接你指定的if标签中的sql语句
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....