Example #1
0
        /// <summary>
        /// 供应商列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public BasePageList<CarSupplierModel> GetSupplierCarPageList(CarSupplierQueryModel query)
        {
            const string spName = "sp_common_pager";
            const string tableName = @"car_supplier";
            const string fields = "innerid, suppliername, address, introduction, contacts, contactsphone, remark, extend, isenabled, createrid, createdtime, modifierid, modifiedtime";
            var orderField = string.IsNullOrWhiteSpace(query.Order) ? "createdtime desc" : query.Order;

            #region 查询条件
            var sqlWhere = new StringBuilder("1=1"); //在售和已售车辆
            if (!string.IsNullOrWhiteSpace(query.Suppliername))
            {
                sqlWhere.Append($" and suppliername like '%{query.Suppliername}%'");
            }

            #endregion

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