Explorar o código

@task: get relation by projectId

bai %!s(int64=2) %!d(string=hai) anos
pai
achega
d0e58f4a0d

+ 4 - 0
demo/src/main/java/com/framework/mvvm/model/db/dao/RelationDao.kt

@@ -17,6 +17,10 @@ interface RelationDao {
     @Query("select * from relation where building_id = :id")
     suspend fun getRelationByBuildingId(id: String): List<RelationEntity>
 
+     @Query("select * from relation where project_id = :projectId")
+    suspend fun getRelationByProjectId(projectId: String): List<RelationEntity>
+
+
     @Query("select * from relation where graph_code = :graphCode and rel_code = :relCode and valid = 1")
     suspend fun getRelationByCode(graphCode: String, relCode: String): List<RelationEntity>
 

+ 1 - 1
demo/src/main/java/com/framework/mvvm/model/repository/AdmRepository.kt

@@ -463,7 +463,7 @@ class AdmRepository(
                 .filter { it.state == 0 || it.state == 1 }
 
             val relations =
-                relationDao.getRelationByBuildingId(buildingId)
+                relationDao.getRelationByProjectId(projectId)
                     .filter { it.state == 0 || it.state == 1 }
 
             val problemArchs =