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
  • 相关阅读:
    Discuz安装(centos+宝塔)
    宝塔面板安装
    Java中设置classpath、path、JAVA_HOME的作用
    【JDK和Open JDK】平常使用的JDK和Open JDK有什么区别
    提取Chrome插件为crx文件
    Python 01
    Java 01
    HTML5学习之FileReader接口
    formidable上传图片
    Mac系统下brew安装指定版本的nodejs小笔记
  • 原文地址:https://www.cnblogs.com/zecVip/p/4708347.html
Copyright © 2011-2022 走看看