public async Task <List <OrderMoneyReceiptEntity> > GetList(OrderMoneyReceiptListParam param, OperatorInfo opuser) { var expression = ListFilter(param); var list = await this.BaseRepository().FindList(expression); return(list.ToList()); }
public async Task <ActionResult> GetPageListJson(OrderMoneyReceiptListParam param, Pagination pagination) { OperatorInfo opuser = await Operator.Instance.Current(); TData <List <OrderMoneyReceiptEntity> > obj = await orderMoneyReceiptBLL.GetPageList(param, pagination, opuser); return(Json(obj)); }
private Expression <Func <OrderMoneyReceiptEntity, bool> > ListFilter(OrderMoneyReceiptListParam param) { var expression = LinqExtensions.True <OrderMoneyReceiptEntity>(); if (param != null) { } return(expression); }
public async Task <TData <List <OrderMoneyReceiptEntity> > > GetList(OrderMoneyReceiptListParam param, OperatorInfo opuser) { TData <List <OrderMoneyReceiptEntity> > obj = new TData <List <OrderMoneyReceiptEntity> >(); obj.Data = await orderMoneyReceiptService.GetList(param, opuser); obj.Total = obj.Data.Count; obj.Tag = 1; return(obj); }
/// <summary> /// 创建查询sql /// </summary> /// <param name="param">查询条件数据</param> /// <returns></returns> private StringBuilder CreateListSql(OrderMoneyReceiptListParam param, OperatorInfo opuser) { StringBuilder sql = new StringBuilder(); sql.AppendFormat(" SELECT a.*"); sql.AppendFormat(" ,b.RealName AS SaleManTxt"); sql.AppendFormat(" ,c.Title AS CompanyTxt"); sql.AppendFormat(" ,c.CompanyImg"); sql.AppendFormat(" ,c.NumberPre"); sql.AppendFormat(" from ("); sql.AppendFormat(" SELECT * FROM order_money_receipt "); sql.AppendFormat(" where 1=1 "); if (param != null) { if (!opuser.IsAdminOrDev) { sql.AppendFormat(" AND SaleManId = {0}", opuser.UserIdStr); } if (!string.IsNullOrEmpty(param.Title)) { sql.AppendFormat(" AND Title LIKE '%{0}%'", param.Title); } if (!string.IsNullOrEmpty(param.PayManName)) { sql.AppendFormat(" AND Title LIKE '%{0}%'", param.PayManName); } if (!string.IsNullOrEmpty(param.PayManName)) { sql.AppendFormat(" AND BaseCreateTime >'{0} 00:00:00'", param.StartTime); } if (!string.IsNullOrEmpty(param.EndTime)) { sql.AppendFormat(" AND BaseCreateTime <'{0} 23:59:59'", param.EndTime); } } sql.AppendFormat(" ) a "); sql.AppendFormat(" JOIN "); sql.AppendFormat(" ( "); sql.AppendFormat(" SELECT Id,RealName from sysuser "); sql.AppendFormat(" WHERE 1=1 "); sql.AppendFormat(" ) b"); sql.AppendFormat(" on a.SaleManId = b.Id "); sql.AppendFormat(" JOIN "); sql.AppendFormat(" ( "); sql.AppendFormat(" SELECT Id,CompanyImg,NumberPre,Title from sys_receipt_config "); sql.AppendFormat(" WHERE 1=1 "); sql.AppendFormat(" ) c"); sql.AppendFormat(" on a.CompanyId = c.Id "); return(sql); }
public async Task <TData <List <OrderMoneyReceiptEntity> > > GetPageList(OrderMoneyReceiptListParam param, Pagination pagination, OperatorInfo opuser) { TData <List <OrderMoneyReceiptEntity> > obj = new TData <List <OrderMoneyReceiptEntity> >(); obj.Data = await orderMoneyReceiptService.GetPageList(param, pagination, opuser); obj.Total = pagination.TotalCount; obj.PageTotal = pagination.TotalPage; obj.Tag = 1; return(obj); }
public async Task <List <OrderMoneyReceiptEntity> > GetPageList(OrderMoneyReceiptListParam param, Pagination pagination, OperatorInfo opuser) { /* * var expression = ListFilter(param); * var list= await this.BaseRepository().FindList(expression, pagination); * return list.ToList(); */ StringBuilder sql = CreateListSql(param, opuser); var data = await this.BaseRepository().FindList <OrderMoneyReceiptEntity>(sql.ToString(), pagination); return(data.list.ToList <OrderMoneyReceiptEntity>()); }