zoukankan      html  css  js  c++  java
  • 时间段检索时间段

    if (!string.IsNullOrEmpty(starttime) && !string.IsNullOrEmpty(endtime))
                    {
                        Where.Append(" and ((t.StartTime <= @StartTime and t.EndTime >= @StartTime) or (t.StartTime <= @EndTime and t.EndTime >= @EndTime) or (t.StartTime >= @StartTime and t.EndTime <= @EndTime))");
                        ParaList.Add(new SqlParameter("@StartTime", starttime));
                        ParaList.Add(new SqlParameter("@EndTime", endtime));
                    }
                    else if (!string.IsNullOrEmpty(starttime))
                    {
                        Where.Append(" and t.StartTime <= @StartTime and t.EndTime >= @StartTime");
                        ParaList.Add(new SqlParameter("@StartTime", starttime));
                    }
                    else if (!string.IsNullOrEmpty(endtime))
                    {
                        Where.Append(" and t.StartTime <= @EndTime and t.EndTime >= @EndTime");
                        ParaList.Add(new SqlParameter("@EndTime", endtime));
                    }
    View Code
  • 相关阅读:
    Linux查看当前系统的发行版信息
    用 CentOS 7 打造合适的科研环境
    消息队列的使用场景
    RabbitMQ几种Exchange 模式
    JMS规范概览
    消息队列的学习
    springMVC参数传递实例
    java8时间处理实例
    windows电脑常用必备软件
    http后台json解析实例
  • 原文地址:https://www.cnblogs.com/zecVip/p/4708347.html
Copyright © 2011-2022 走看看