src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/OverallEvaluationRep.kt
@@ -5,6 +5,7 @@
import cn.flightfeather.supervision.domain.ds2.entity.OverallEvaluation
import cn.flightfeather.supervision.domain.ds2.mapper.OverallEvaluationMapper
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
import java.time.LocalDate
import java.time.ZoneId
import java.util.*
@@ -13,6 +14,17 @@
class OverallEvaluationRep(private val overallEvaluationMapper: OverallEvaluationMapper){
    /**
     * 获取最新记录
     */
    fun selectLatest(userId: String?): OverallEvaluation? {
        val res = overallEvaluationMapper.selectByExample(Example(OverallEvaluation::class.java).apply {
            createCriteria().andEqualTo("biGuid", userId)
            orderBy("oeUpdateTime").desc()
        })
        return if (res.isNotEmpty()) res[0] else null
    }
    /**
     * 插入一条环信码记录
     * @param userId
     * @param score