Commit 259016d2 by ruyun.zhang@suvalue.com

Merge branch 'feature/医院其他绩效性能优化' into develop

parents 8d45a787 f6121928
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions;
using Performance.EntityModels; using Performance.EntityModels;
namespace Performance.Repository namespace Performance.Repository
...@@ -15,10 +16,23 @@ namespace Performance.Repository ...@@ -15,10 +16,23 @@ namespace Performance.Repository
/// </summary> /// </summary>
public partial class PerforPerapramountRepository : PerforRepository<per_apr_amount> 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 = GetEntities(predicate);
var amounts = this.context.Set<per_apr_amount>().Where(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 var res = from outer in amounts
join inner in employees join inner in employees
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Linq.Expressions;
using Performance.EntityModels; using Performance.EntityModels;
namespace Performance.Repository namespace Performance.Repository
...@@ -15,10 +16,23 @@ namespace Performance.Repository ...@@ -15,10 +16,23 @@ namespace Performance.Repository
/// </summary> /// </summary>
public partial class PerforPerapramounthideRepository : PerforRepository<per_apr_amount_hide> 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 = GetEntities(predicate);
var amounts = this.context.Set<per_apr_amount_hide>().Where(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 var res = from outer in amounts
join inner in employees 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