개정판 b2ff5ff4
document 조회
- date 조건추가
- ID2 시작일, ID2 종료일, AVEVA 변환일, AVEVA 검토일 -> or 조건
Change-Id: I1918d4fe1f07aa1f303b0728ee0299c764c69f17
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs | ||
---|---|---|
58 | 58 |
} |
59 | 59 |
|
60 | 60 |
|
61 |
public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectGroupID, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem) |
|
61 |
public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectGroupID, List<string> dateTypes, DateTime? frDate, DateTime? toDate, string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult, string isGateWay, string isRegSystem)
|
|
62 | 62 |
{ |
63 | 63 |
var map = new CustomPropertyTypeMap(typeof(AttFileInfo), (type, columnName) |
64 | 64 |
=> type.GetProperties().FirstOrDefault(prop => GetDescriptionFromAttribute(prop) == columnName.ToLower())); |
... | ... | |
71 | 71 |
StringBuilder sbWhere = new StringBuilder(); |
72 | 72 |
StringBuilder sbTotalWhere = new StringBuilder(); |
73 | 73 |
var parameters = new Dictionary<string, object>(); |
74 |
if (dateTypes.Count > 0 && (frDate != null || toDate != null)) |
|
75 |
{ |
|
76 |
List<string> subWheres = new List<string>(); |
|
77 |
foreach (string dateType in dateTypes) |
|
78 |
{ |
|
79 |
StringBuilder sbSubWhere = new StringBuilder(); |
|
80 |
if (frDate != null) |
|
81 |
{ |
|
82 |
sbSubWhere.Insert(0, $@"convert(datetime, '{Convert.ToDateTime(frDate).AddDays(-1):yyyy-MM-dd 23:59:59.997}') < doc.{dateType}"); |
|
83 |
} |
|
84 |
if (toDate != null) |
|
85 |
{ |
|
86 |
if (frDate != null) |
|
87 |
sbSubWhere.Append($@" and "); |
|
88 |
sbSubWhere.Append($@"doc.{dateType} < convert(datetime, '{Convert.ToDateTime(toDate).AddDays(1):yyyy-MM-dd 00:00:00.000}')"); |
|
89 |
} |
|
90 |
|
|
91 |
if (sbSubWhere.Length > 0) |
|
92 |
{ |
|
93 |
subWheres.Add("(" + sbSubWhere.ToString() + ")"); |
|
94 |
} |
|
95 |
} |
|
96 |
|
|
97 |
if (subWheres.Count > 0) |
|
98 |
{ |
|
99 |
sbWhere.Append(" and (" + string.Join(" or ", subWheres) + ") "); |
|
100 |
} |
|
101 |
} |
|
74 | 102 |
if (string.IsNullOrEmpty(projectCode)) |
75 | 103 |
{ |
76 | 104 |
sbWhere.Append(" and isnull(doc.RefProjectCode,'') in (select Code from dbo.Projects where ParentID=@RefGroupID union all select '') "); |
내보내기 Unified diff