<choose>
<when test="strategyBeginTime != null and strategyEndTime==null">
and s.begin_time>= #{strategyBeginTime,jdbcType=TIMESTAMP}
</when>
<when test="strategyEndTime != null and strategyBeginTime == null">
and s.end_time <= #{strategyEndTime,jdbcType=TIMESTAMP}
</when>
<when test="strategyEndTime != null and strategyBeginTime != null">
and ((s.begin_time <=#{strategyBeginTime} and s.end_time >=#{strategyBeginTime}) or (s.begin_time >=#{strategyBeginTime} and s.begin_time<=#{strategyEndTime}))
</when>
</choose>
时间段交集查询
猜你喜欢
转载自www.cnblogs.com/zfzf1/p/9052187.html
今日推荐
周排行