using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace FrameworkDAL.Query.EntityRelation { public class EntityRelationQB { public const string GET_ENTITYRELATION = @"SELECT ER.ENTITYRELATIONID AS EntityRelationId, ER.RELATEDENTITYID AS EntityRelationRelatedEntityId, RE.ENTITYCODE AS EntityRelationRelatedEntityCode, RE.ENTITYNAME AS EntityRelationRelatedEntityName, ER.PARTICULARS AS EntityRelationParticulars, ER.RELATIONTYPE AS EntityRelationType, ER.RELATIONNAME AS EntityRelationName, ER.DBFIELDID AS EntityRelationDbOjectFieldId, DF.DBFIELDNAME AS EntityRelationDbOjectFieldName, ER.ENTITYID AS EntityRelationEntityRelationEntityId, E.ENTITYCODE AS EntityRelationEntityRelationEntityCode, E.ENTITYNAME AS EntityRelationEntityRelationEntityName FROM MENTITYRELATION ER LEFT JOIN MENTITY E ON E.ENTITYID = ER.ENTITYID LEFT JOIN MENTITY RE ON RE.ENTITYID = ER.RELATEDENTITYID LEFT JOIN MDBOBJECTFIELD DF ON DF.DBFIELDID = ER.DBFIELDID;"; public const string SAVE_ENTITYRELATION = @"INSERT INTO MENTITYRELATION ( ENTITYID, RELATEDENTITYID, PARTICULARS, RELATIONTYPE, RELATIONNAME, DBFIELDID ) VALUES ( @EntityRelationEntityRelationEntityId, @EntityRelationRelatedEntityId, @EntityRelationParticulars, @EntityRelationType, @EntityRelationName, @EntityRelationDbOjectFieldId );"; public const string UPDATE_ENTITYRELATION = @"UPDATE MENTITYRELATION SET ENTITYID = @EntityRelationEntityRelationEntityId, RELATEDENTITYID = @EntityRelationRelatedEntityId, PARTICULARS = @EntityRelationParticulars, RELATIONTYPE = @EntityRelationType, RELATIONNAME = @EntityRelationName, DBFIELDID = @EntityRelationDbOjectFieldId WHERE ENTITYRELATIONID = @EntityRelationId;"; public const string DELETE_ENTITYRELATION = @"DELETE FROM MENTITYRELATION WHERE ENTITYRELATIONID = @entityrelationid;"; } }