package cn.flightfeather.thirdapp.repository.dao
|
|
import cn.flightfeather.thirdapp.bean.entity.Evaluationrule
|
import cn.flightfeather.thirdapp.bean.entity.Evaluationsubrule
|
import cn.flightfeather.thirdapp.common.database.DbFactory
|
import com.ping.greendao.gen.EvaluationruleDao
|
import com.ping.greendao.gen.EvaluationsubruleDao
|
import io.reactivex.Observable
|
|
/**
|
* @author riku
|
* Date: 2019/7/29
|
* 评分相关数据库操作
|
*/
|
class EvaluationDao {
|
|
fun getEvaluationRule(provinceCode: String, cityCode: String,
|
districtCode: String, sceneTypeId: Byte): Observable<List<Evaluationrule>> {
|
return DbFactory.getGreenDaoObservable().map {
|
it.evaluationruleDao.queryBuilder().where(
|
EvaluationruleDao.Properties.Provincecode.eq(provinceCode),
|
EvaluationruleDao.Properties.Citycode.eq(cityCode),
|
EvaluationruleDao.Properties.Districtcode.eq(districtCode),
|
EvaluationruleDao.Properties.Scensetypeid.eq(sceneTypeId)
|
).list()
|
}
|
}
|
|
fun getEvaluationSubRule(evaluationruleGuid: String): Observable<List<Evaluationsubrule>> {
|
return DbFactory.getGreenDaoObservable().map {
|
it.evaluationsubruleDao.queryBuilder().where(
|
EvaluationsubruleDao.Properties.Erguid.eq(evaluationruleGuid)
|
).orderAsc(EvaluationsubruleDao.Properties.Displayid).list()
|
}
|
}
|
}
|