start_num = 5 end_num=10(数据库值) start end(条件) 四种情况:
//1、start = 6 end = 8
#{
start} >= start_num and #{
end} <= end_num
//2、start = 4 end = 7
#{
start} <= start_num and (#{
end} between start_num and end_num)
//3、start = 7 end = 9
(#{
start} between start_num and end_num) and #{
end} <= end_num
//4、start = 3 end = 12
#{
start} <= start_num and #{
end} >= end_num
组合起来
(
(#{
start} >= start_num and #{
end} <= end_num)
or (#{
start} <= start_num and (#{
end} between start_num and end_num))
or ((#{
start} between start_num and end_num) and #{
end} <= end_num)
or (#{
start} <= start_num and #{
end} >= valid_date)
)
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/222764.html原文链接:https://javaforall.cn