change -修改查询记录

dep_yangw
我叫锄头 11 months ago committed by frankiecao
parent 1cee34ecf5
commit 94be9ac375

File diff suppressed because it is too large Load Diff

@ -41,6 +41,7 @@ namespace ProductionSystem_Service
&& m.EquipmentName == equipmentName && m.EquipmentName == equipmentName
&& m.ProductType == productType) && m.ProductType == productType)
.Where(x=>x.ProductBarcode==productCode) .Where(x=>x.ProductBarcode==productCode)
.OrderByDescending(x=>x.CreateTime)
.First(); .First();
} }
} }

@ -50,8 +50,8 @@ namespace ProductionSystem_Service
/// <returns></returns> /// <returns></returns>
public TestResut2Res Query(TestResut2Vm vm) public TestResut2Res Query(TestResut2Vm vm)
{ {
int totalRecord = 0; int totalRecord = 0;
var iq= db.Queryable<T_Result2>(). var iq= db.Queryable<T_Result2>().
WhereIF(!string.IsNullOrEmpty(vm.ProductType), x => x.ProductType == vm.ProductType) WhereIF(!string.IsNullOrEmpty(vm.ProductType), x => x.ProductType == vm.ProductType)
.WhereIF(!string.IsNullOrEmpty(vm.ProductCode),x=>x.ProductBarcode == vm.ProductCode) .WhereIF(!string.IsNullOrEmpty(vm.ProductCode),x=>x.ProductBarcode == vm.ProductCode)
.WhereIF(!string.IsNullOrEmpty(vm.BeginTime),x=>x.CreateTime>=Convert.ToDateTime(vm.BeginTime)) .WhereIF(!string.IsNullOrEmpty(vm.BeginTime),x=>x.CreateTime>=Convert.ToDateTime(vm.BeginTime))
@ -59,10 +59,7 @@ namespace ProductionSystem_Service
.OrderByDescending(x => x.CreateTime) .OrderByDescending(x => x.CreateTime)
.ToPageList(vm.PageIndex,vm.PageSize, ref totalRecord); .ToPageList(vm.PageIndex,vm.PageSize, ref totalRecord);
int totalPage = (totalRecord + vm.PageSize - 1) / vm.PageSize; int totalPage = (totalRecord + vm.PageSize - 1) / vm.PageSize;
TestResut2Res testResut2Res = new TestResut2Res(); TestResut2Res testResut2Res = new TestResut2Res();
testResut2Res.Total= totalPage; testResut2Res.Total= totalPage;
testResut2Res.Data = iq; testResut2Res.Data = iq;

Loading…
Cancel
Save