mybatis怎么实现时间段查询
展开全部
<select id="selectOrderListByPage" parameterType="com.xhh.webui.system.entity.Order"
resultType="com.xhh.webui.system.entity.Order">
select * from `order`
<where>
<if test="begindate != null and begindate !=''">
createTime>#{begindate,jdbcType=TIMESTAMP}
</if>
<if test="enddate != null and enddate !=''">
and createTime<#{enddate,jdbcType=TIMESTAMP}
</if>
</where>
<if test="sort != null and order != null">
<![CDATA[ order by ${sort} ${order} ]]>
</if>
LIMIT #{start},#{rows}
</select>
resultType="com.xhh.webui.system.entity.Order">
select * from `order`
<where>
<if test="begindate != null and begindate !=''">
createTime>#{begindate,jdbcType=TIMESTAMP}
</if>
<if test="enddate != null and enddate !=''">
and createTime<#{enddate,jdbcType=TIMESTAMP}
</if>
</where>
<if test="sort != null and order != null">
<![CDATA[ order by ${sort} ${order} ]]>
</if>
LIMIT #{start},#{rows}
</select>
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询