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;
}