zoukankan      html  css  js  c++  java
  • 多字段动态查询

    private bool GetCondition(MerchantTravelXSJL tb, string key, string searchCity, string phoneNumber, DateTime? buyStartDate, DateTime? buyEndDate, int? checkStatus)
    {
    bool boolResult = true;

    if (!String.IsNullOrEmpty(key))
    {
    boolResult &= tb.MERCHANTNAME == key;
    }
    if (!String.IsNullOrEmpty(searchCity))
    {
    boolResult &= tb.CITYCODE == searchCity;
    }
    if (!String.IsNullOrEmpty(phoneNumber))
    {
    boolResult &= tb.CELLPHONENUMBER == phoneNumber;

    }
    if (buyStartDate.HasValue)
    {
    boolResult &= (tb.CREATEDTIME >= buyStartDate.Value);
    }
    if (buyEndDate.HasValue)
    {
    boolResult &= tb.CREATEDTIME < buyEndDate.Value;
    }
    if (checkStatus.HasValue)
    {
    boolResult &= tb.STATUS == checkStatus;
    }
    return boolResult;
    }

  • 相关阅读:
    团队作业(9)
    团队作业(8)
    团队作业(7)
    团队作业(6)
    团队作业(5)
    团队作业(4)
    团队作业(3)
    05数据爬去
    02周总结
    04结对开发
  • 原文地址:https://www.cnblogs.com/fyy1003668657/p/6817149.html
Copyright © 2011-2022 走看看