<select id="selectSubstituteIntoApplicationList" parameterType="SubstituteIntoApplication"
resultMap="SubstituteIntoApplicationResult">
<include refid="selectSubstituteIntoApplicationVo"/>
<where>
<if test="account != null and account != ''">and account like concat('%', #{account}, '%')</if>
/*判断这两个取值字段不为空的前提下,再查询区间值
<if test="closeupshoptime != null and setupshoptime != null">
/jdbcType 是为了给取值变量添加临时sql 字段 类型 并 赋值 判断
查询订单字段createtime 大等于 startTime 并 小等于 endTime区间的内容*/
and createtime >= #{startTime ,jdbcType=TIMESTAMP}
and createtime <= #{endTime,jdbcType=TIMESTAMP}
</if>
</where>
</select>
spring boot 查询两个时间区间内容(只有一个创建时间字段的前提下)
最新推荐文章于 2024-12-31 00:44:18 发布
本文介绍了如何在Spring Boot项目中,仅通过一个创建时间字段,实现查询指定时间段内的数据。通过对日期的处理和SQL查询条件的设定,实现了高效的时间区间过滤功能。
1270

被折叠的 条评论
为什么被折叠?



