医院其他绩效性能优化

parent 8d45a787
......@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Performance.EntityModels;
namespace Performance.Repository
......@@ -15,10 +16,23 @@ namespace Performance.Repository
/// </summary>
public partial class PerforPerapramountRepository : PerforRepository<per_apr_amount>
{
public List<view_per_apr_amount> GetFullAmount(Func<per_apr_amount, bool> predicate)
public List<view_per_apr_amount> GetFullAmount(Expression<Func<per_apr_amount, bool>> predicate)
{
var employees = this.context.Set<per_employee>().AsEnumerable();
var amounts = this.context.Set<per_apr_amount>().Where(predicate);
var amounts = GetEntities(predicate);
if (amounts == null || !amounts.Any())
return new List<view_per_apr_amount>();
var ids = amounts.Select(w => w.AllotId).Distinct().ToList();
var employees = this.context.Set<per_employee>()
.Where(w => w.AllotId.HasValue && ids.Contains(w.AllotId.Value))
.Select(w => new
{
UnitType = w.UnitType,
AccountingUnit = w.AccountingUnit,
AllotId = w.AllotId,
PersonnelNumber = w.PersonnelNumber,
});
var res = from outer in amounts
join inner in employees
......
......@@ -6,6 +6,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Performance.EntityModels;
namespace Performance.Repository
......@@ -15,10 +16,23 @@ namespace Performance.Repository
/// </summary>
public partial class PerforPerapramounthideRepository : PerforRepository<per_apr_amount_hide>
{
public List<view_per_apr_amount> GetFullAmount(Func<per_apr_amount_hide, bool> predicate)
public List<view_per_apr_amount> GetFullAmount(Expression<Func<per_apr_amount_hide, bool>> predicate)
{
var employees = this.context.Set<per_employee>().AsEnumerable();
var amounts = this.context.Set<per_apr_amount_hide>().Where(predicate);
var amounts = GetEntities(predicate);
if (amounts == null || !amounts.Any())
return new List<view_per_apr_amount>();
var ids = amounts.Select(w => w.AllotId).Distinct().ToList();
var employees = this.context.Set<per_employee>()
.Where(w => w.AllotId.HasValue && ids.Contains(w.AllotId.Value))
.Select(w => new
{
UnitType = w.UnitType,
AccountingUnit = w.AccountingUnit,
AllotId = w.AllotId,
PersonnelNumber = w.PersonnelNumber,
});
var res = from outer in amounts
join inner in employees
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment