package cn.flightfeather.supervision.lightshare.service.Impl
|
|
import cn.flightfeather.supervision.domain.entity.Problem
|
import cn.flightfeather.supervision.domain.mapper.BaseInfoMapper
|
import cn.flightfeather.supervision.domain.mapper.ProblemMapper
|
import cn.flightfeather.supervision.lightshare.service.ProblemService
|
import org.springframework.stereotype.Service
|
import tk.mybatis.mapper.entity.Example
|
import java.util.*
|
|
@Service
|
class ProblemServiceImpl(
|
val problemMapper: ProblemMapper,
|
val baseInfoMapper: BaseInfoMapper
|
): ProblemService {
|
|
override fun getProblemsByPeriod(userId: String, year: Int, month: Int): List<Problem> {
|
val baseInfo = baseInfoMapper.selectByPrimaryKey(userId)
|
|
val startTime = Calendar.getInstance().apply {
|
set(year, month-1, 1, 0, 0, 0)
|
}.time
|
val endTime = Calendar.getInstance().apply {
|
set(year, month-1, 30, 0, 0, 0)
|
}.time
|
|
return problemMapper.selectByExample(Example(Problem::class.java).apply {
|
createCriteria().andEqualTo("prSceneId", baseInfo.biGuid)
|
.andBetween("prInspectionPeriod", startTime, endTime)
|
})
|
}
|
|
override fun saveProblem(info: Problem): Int {
|
// TODO: 2023/3/20 not yet implemented
|
return 0
|
}
|
|
override fun updateProblem(info: Problem): Int {
|
// TODO: 2023/3/20 not yet implemented
|
return 0
|
}
|
}
|