프로젝트

일반

사용자정보

개정판 7066b8a9

ID7066b8a9848b962cf44d50c0c3eafadbe94c09f0
상위 d30305e5
하위 7db33dd9

유성호이(가) 일년 이상 전에 추가함

issue #0000
document 조회 시 Total dwg 갯수 조회(output)

Change-Id: I839ee65e9ced3f97a67cb7e91aa15ddb199fccc3

차이점 보기:

ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs
14 14
    {
15 15
        public DocumentRepository(string connectionStr) : base(connectionStr) { }
16 16

  
17
        public IEnumerable<Documents> GetAllDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
17
        public IEnumerable<Documents> GetAllDocuments()
18 18
        {
19
            string query = $@"
20
select   doc.*,
21

  
22
  (
23
    select markus.*
24
	from [markus_SEC].[dbo].[ViewMarkupData] markus where doc.DocumentNo = markus.DOCUMENT_ID
25
	FOR JSON PATH
26
  ) as MarkupText
27
from     dbo.Documents doc
28
where    doc.IsDeleted=0
29
order by doc.Seq;";
30

  
31
            return Query<Documents>(query);
32
        }
33

  
34
        public (IEnumerable<Documents> dwgs, int totalCnt) GetDocuments(string projectCode, string personIncharge, string jobLevel, string documentNo, string isToIsDiscussion, string isFrReviewStatus, string isID2Work, string id2Status, string avevaStatus, string prodIsResult, string clientIsResult)
35
        {
36
            var dynamicParameters = new DynamicParameters();
37
            dynamicParameters.Add("Total", dbType: System.Data.DbType.Int32, direction: System.Data.ParameterDirection.Output);
38

  
19 39
            StringBuilder sbWhere = new StringBuilder();
20 40
            var parameters = new Dictionary<string, object>();
21 41
            if (!string.IsNullOrEmpty(projectCode))
......
89 109
  ) as MarkupText
90 110
from     dbo.Documents doc
91 111
where    doc.IsDeleted=0 {sbWhere}
92
order by doc.Seq;";
112
order by doc.Seq
113

  
114
select @Total=count(*) from dbo.Documents
115
select @Total;";
93 116

  
94 117
            if (parameters.Count > 0)
95 118
            {
96
                var dynamicParameters = new DynamicParameters(parameters);
97
                return Query<Documents>(query, dynamicParameters);
119
                dynamicParameters.AddDynamicParams(parameters);
98 120
            }
99 121

  
100
            return Query<Documents>(query);
122
            var ret = Query<Documents>(query, dynamicParameters);
123

  
124
            int totalCount = dynamicParameters.Get<int>("Total");
125

  
126
            return (ret, totalCount);
101 127
        }
102 128

  
103 129
        public bool SetDocumentData(List<Documents> docList, List<Documents> delDocList)

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)