CCN.Modules.Car.DataAccess.CarDataAccess.GetTipOffPageList C# (CSharp) Method

GetTipOffPageList() public method

获取
public GetTipOffPageList ( CarTipQueryModel query ) : BasePageList
query CCN.Modules.Car.BusinessEntity.CarTipQueryModel
return BasePageList
        public BasePageList<CarTipOffModel> GetTipOffPageList(CarTipQueryModel query)
        {
            const string spName = "sp_common_pager";
            const string tableName = @"car_tipoff as a";
            const string fields = "innerid, carid, tipoffname, tipoffphone, content, status, handlecontent, ip, remark, createdtime,handledtime";
            var orderField = string.IsNullOrWhiteSpace(query.Order) ? "a.createdtime desc" : query.Order;

            #region 查询条件

            var sqlWhere = new StringBuilder("1=1");

            if (!string.IsNullOrWhiteSpace(query.Carid))
            {
                sqlWhere.Append($" and a.carid='{query.Carid}'");
            }

            if (query.Status != null)
            {
                sqlWhere.Append($" and a.status={query.Status}");
            }

            if (query.StartCreatedtime != null)
            {
                sqlWhere.Append($" and a.createdtime>='{query.StartCreatedtime}'");
            }

            if (query.EndCreatedtime != null)
            {
                sqlWhere.Append($" and a.createdtime<='{query.EndCreatedtime}'");
            }

            #endregion

            var model = new PagingModel(spName, tableName, fields, orderField, sqlWhere.ToString(), query.PageSize, query.PageIndex);
            var list = Helper.ExecutePaging<CarTipOffModel>(model, query.Echo);
            return list;
        }
CarDataAccess