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
  • 相关阅读:
    构建之法阅读笔记03
    构建之法阅读笔记01
    构建之法阅读笔记02
    周总结06
    《大道至简》第一章伪代码
    《大道至简》观后感
    【leetcode】Valid Number
    【leetcode】Maximal Rectangle
    【Unity3D】Invoke,InvokeRepeating ,Coroutine 延迟调用,周期性调用
    【leetcode】Scramble String
  • 原文地址:https://www.cnblogs.com/zecVip/p/4708347.html
Copyright © 2011-2022 走看看