개정판 f37c5383
Fix: 심볼 검색 속도 개선(Component를 데이타베이스에 저장한 프로젝트는 심볼 사용 여부를 데이타베이스에서 조회)
Change-Id: I06c51ee6fd38d4c5b61ac70df308f1153fae5914
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs | ||
---|---|---|
819 | 819 |
/// </summary> |
820 | 820 |
/// <param name="id2Info"></param> |
821 | 821 |
/// <param name="Name"></param> |
822 |
/// <param name="XmlOnly">Component가 Xml에만 저장되어 있는지 여부</param>" |
|
822 | 823 |
/// <returns></returns> |
823 |
public IEnumerable<ID2Symbol> FindID2Symbols(string Name) |
|
824 |
public IEnumerable<ID2Symbol> FindID2Symbols(string Name, bool XmlOnly)
|
|
824 | 825 |
{ |
825 |
string query = $@"select Name, T.[Type], OriginalPoint, ConnectionPoint, Width, Height |
|
826 |
from Symbol A join SymbolType T on A.SymbolType_UID=T.UID where A.Name like @Name"; |
|
826 |
string query; |
|
827 |
if (!XmlOnly) |
|
828 |
{ |
|
829 |
query = $@"select A.Name, T.[Type], A.OriginalPoint, A.ConnectionPoint, A.Width, A.Height |
|
830 |
from Symbol A |
|
831 |
join SymbolType T on A.SymbolType_UID=T.UID |
|
832 |
where A.Name like @Name and EXISTS(select * from Components where Symbol_UID = A.UID)"; |
|
833 |
} |
|
834 |
else |
|
835 |
{ |
|
836 |
query = $@"select Name, T.[Type], OriginalPoint, ConnectionPoint, Width, Height |
|
837 |
from Symbol A |
|
838 |
join Components C on A.Symbol_UID=C.UID |
|
839 |
join SymbolType T on A.SymbolType_UID=T.UID where A.Name like @Name"; |
|
840 |
} |
|
841 |
|
|
827 | 842 |
return Query<ID2Symbol>(query, new { Name = $"%{Name}%" }); |
828 | 843 |
} |
829 | 844 |
|
845 |
/// <summary> |
|
846 |
/// ID2 Configuration을 조회한다. |
|
847 |
/// </summary> |
|
848 |
/// <returns></returns> |
|
849 |
public IEnumerable<ID2Configuration> GetID2Configurations() |
|
850 |
{ |
|
851 |
string query = $@"select [Section], [Key], [Value] from Configuration"; |
|
852 |
return Query<ID2Configuration>(query); |
|
853 |
} |
|
830 | 854 |
|
831 | 855 |
//Transactions |
832 | 856 |
public int GetTranKey(string userId, string projectIDs) |
내보내기 Unified diff