hytos / ID2.Manager / ID2.Manager.Dapper / Repository / DocumentRepository.cs @ 5898479a
이력 | 보기 | 이력해설 | 다운로드 (1.46 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.Linq; |
4 |
using System.Text; |
5 |
using System.Threading.Tasks; |
6 |
|
7 |
using ID2.Manager.Data.Models; |
8 |
|
9 |
namespace ID2.Manager.Dapper.Repository |
10 |
{ |
11 |
public class DocumentRepository : BaseRepository |
12 |
{ |
13 |
public DocumentRepository(string connectionStr) : base(connectionStr) { } |
14 |
|
15 |
public IEnumerable<Documents> GetAllDocuments() |
16 |
{ |
17 |
string query = $@" |
18 |
select doc.Seq |
19 |
,doc.DocumentNo |
20 |
,rev.ProcNo |
21 |
,rev.RevNo |
22 |
,rev.PhysicalPath |
23 |
,rev.VirtualPath |
24 |
,doc.JobLevel |
25 |
,doc.Typical |
26 |
,doc.PersonInCharge |
27 |
,rev.Created |
28 |
,toreview.IsDiscussion |
29 |
,toreview.Remarks ToRemarks |
30 |
,toreview.Capture ToCapture |
31 |
,toreview.MarkupLink ToMarkupLink |
32 |
,isnull(toreview.ModifiedUser,toreview.CreatedUser) ToUserID |
33 |
,frreview.ReviewStatus |
34 |
,frreview.Remarks FrRemarks |
35 |
,frreview.Capture FrCapture |
36 |
,frreview.MarkupLink FrMarkupLink |
37 |
,isnull(frreview.ModifiedUser,frreview.CreatedUser) FromUserID |
38 |
from dbo.Documents doc |
39 |
inner join dbo.DocRevisions rev on doc.Seq=rev.RefDocSeq |
40 |
left outer join dbo.ToReview toreview on rev.ProcNo=toreview.RefProcNo |
41 |
left outer join dbo.FromReview frreview on rev.ProcNo=frreview.RefProcNo |
42 |
where doc.IsDeleted=0 and rev.IsLatest=1 |
43 |
order by doc.DocumentNo, rev.ProcNo desc"; |
44 |
|
45 |
return Query<Documents>(query); |
46 |
} |
47 |
} |
48 |
} |