实现数据集中如果开始和结束日期,在2022-08-01之前,且是整月,则正常查询sql,否则查询为null
${if(开始日期<'2022-08-01'&&开始日期=DATEINMONTH(开始日期,1)&&结束日期=DATEINMONTH(结束日期,-1),"and 日期 between 开始日期 and 结束日期","")}
case
when 结束时间<'2022-08-01' and DATEDIFF(开始日期, 结束日期) = 30 then 1=1
else 1=0
end
select * from table where 1=1 ${if(and(开始日期<"2022-08-01",结束日期<"2022-08-01",开始日期=DATEINMONTH(开始日期,1),结束日期=DATEINMONTH(开始日期,-1))," AND xxxxxx.........."," and 1<>1")}