Skip to content

参数组件-日期范围组件

点击观看本节视频

目前没有直接支持日期范围的组件,如果想实现日期范围查询,可以通过两个日期组件来实现,如下图所示: 输入图片说明输入图片说明

日期范围sql语句查询示例(mysql)

select
*
from
sys_menu
<where>
    <if test="startDate!=null and startDate!=''">
       and create_time > STR_TO_DATE(#{startDate}, '%Y-%m-%d') 
     </if>
     <if test="endDate!=null and endDate!=''">
       and STR_TO_DATE(#{endDate}, '%Y-%m-%d') > create_time
     </if>
</where>