增加质检结果展示页面
This commit is contained in:
23
app/src/main/java/com/navinfo/omqs/db/dao/OfflineMapDao.kt
Normal file
23
app/src/main/java/com/navinfo/omqs/db/dao/OfflineMapDao.kt
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.navinfo.omqs.db.dao
|
||||
|
||||
import androidx.room.*
|
||||
import com.navinfo.omqs.bean.OfflineMapCityBean
|
||||
|
||||
@Dao
|
||||
interface OfflineMapDao {
|
||||
|
||||
@Insert
|
||||
suspend fun insert(message: OfflineMapCityBean): Long
|
||||
|
||||
@Update(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun update(message: OfflineMapCityBean)
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertOrUpdate(list: List<OfflineMapCityBean>)
|
||||
|
||||
@Query("select * from OfflineMapCity order by id")
|
||||
suspend fun getOfflineMapList(): List<OfflineMapCityBean>
|
||||
|
||||
@Query("select * from OfflineMapCity where status != 0 order by id")
|
||||
suspend fun getOfflineMapListWithOutNone(): List<OfflineMapCityBean>
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.navinfo.omqs.db.dao
|
||||
|
||||
import androidx.room.*
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import com.navinfo.collect.library.data.dao.impl.MapLifeDataBase.getDatabase
|
||||
import com.navinfo.omqs.bean.ScProblemTypeBean
|
||||
|
||||
|
||||
@Dao
|
||||
interface ScProblemTypeDao {
|
||||
// @Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
// suspend fun insert(bean: ScProblemTypeBean): Long
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertList(list: List<ScProblemTypeBean>)
|
||||
|
||||
|
||||
@Query("delete from ScProblemType")
|
||||
suspend fun deleteAll()
|
||||
|
||||
/**
|
||||
* 更新整个数据库表,由于没有
|
||||
*/
|
||||
@Transaction
|
||||
suspend fun insertOrUpdateList(list: List<ScProblemTypeBean>) {
|
||||
//先删除
|
||||
deleteAll()
|
||||
//后插入
|
||||
insertList(list)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取问题分类,并去重
|
||||
*/
|
||||
@Query("select DISTINCT CLASS_TYPE from ScProblemType order by CLASS_TYPE")
|
||||
suspend fun findClassTypeList(): List<String>?
|
||||
|
||||
/**
|
||||
* 获取问题类型,并去重
|
||||
*/
|
||||
@Query("select DISTINCT TYPE from ScProblemType where CLASS_TYPE=:type order by TYPE")
|
||||
suspend fun findProblemTypeList(type: String): List<String>
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Query("select PHENOMENON from ScProblemType where CLASS_TYPE=:classType and TYPE=:type order by PHENOMENON")
|
||||
suspend fun getPhenomenonList(classType: String, type: String): List<String>
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.navinfo.omqs.db.dao
|
||||
|
||||
import androidx.room.*
|
||||
import com.navinfo.omqs.bean.ScRootCauseAnalysisBean
|
||||
|
||||
|
||||
@Dao
|
||||
interface ScRootCauseAnalysisDao {
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
suspend fun insertList(list: List<ScRootCauseAnalysisBean>)
|
||||
|
||||
|
||||
@Query("delete from ScRootCauseAnalysis")
|
||||
suspend fun deleteAll()
|
||||
|
||||
@Transaction
|
||||
suspend fun insertOrUpdateList(list: List<ScRootCauseAnalysisBean>) {
|
||||
//先删除
|
||||
deleteAll()
|
||||
//后插入
|
||||
insertList(list)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user