|
@@ -765,7 +765,9 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
|
dto.FieldName = dto.FieldName.ToLower();
|
|
|
var query = _orderSnapshotRepository.Queryable(includeDeleted: true)
|
|
|
.LeftJoin<Order>((snapshot, order) => order.Id == snapshot.Id)
|
|
|
- .Where((snapshot, order) => snapshot.CreationTime >= dto.StartTime && snapshot.CreationTime <= dto.EndTime && order.ActualHandleOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == dto.OrgCode);
|
|
|
+ .Where((snapshot, order) => snapshot.CreationTime >= dto.StartTime && snapshot.CreationTime <= dto.EndTime)
|
|
|
+ .WhereIF(dto.OrgCode.NotNullOrEmpty(), (snapshot, order) =>
|
|
|
+ order.ActualHandleOrgCode.Substring(SqlFunc.MappingColumn<int>("0"), SqlFunc.MappingColumn<int>("6")) == dto.OrgCode);
|
|
|
|
|
|
query = dto.FieldName switch
|
|
|
{
|
|
@@ -776,9 +778,13 @@ public class BiSnapshotApplication : IBiSnapshotApplication, IScopeDependency
|
|
|
"not" => query.Where(snapshot => snapshot.CompliantType == ECompliantType.Not),
|
|
|
_ => throw new UserFriendlyException($"入参: {dto.FieldName} 异常")
|
|
|
};
|
|
|
- return query.Select((snapshot, order) => new CompliantStatisticsDetailsOutDto
|
|
|
+ var b = query.Select((snapshot, order) => new CompliantStatisticsDetailsOutDto
|
|
|
{
|
|
|
}, true);
|
|
|
+#if DEBUG
|
|
|
+ var sql = b.ToSqlString();
|
|
|
+#endif
|
|
|
+ return b;
|
|
|
}
|
|
|
|
|
|
[ExportExcel("随手拍重办统计")]
|