프로젝트

일반

사용자정보

개정판 b2ff5ff4

IDb2ff5ff4f11055e6e14325486cdb446ee0845369
상위 ac1b02f3
하위 986f7d35

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

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

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