package cn.flightfeather.supervision.lightshare.service.Impl
|
|
import cn.flightfeather.supervision.domain.entity.Complaint
|
import cn.flightfeather.supervision.domain.entity.Punishment
|
import cn.flightfeather.supervision.domain.mapper.ComplaintMapper
|
import cn.flightfeather.supervision.domain.mapper.PunishmentMapper
|
import cn.flightfeather.supervision.lightshare.service.ComplaintService
|
import org.springframework.stereotype.Service
|
import tk.mybatis.mapper.entity.Example
|
|
@Service
|
class ComplaintServiceImpl(
|
val complaintMapper: ComplaintMapper,
|
val punishmentMapper: PunishmentMapper
|
): ComplaintService{
|
|
override fun getComplaints(userId: String): List<Complaint> {
|
return complaintMapper.selectByExample(Example(Complaint::class.java).apply {
|
createCriteria().andEqualTo("cpSceneid", userId)
|
orderBy("cpTime").desc()
|
})
|
}
|
|
override fun getPunishment(userId: String): List<Punishment> {
|
return punishmentMapper.selectByExample(Example(Punishment::class.java).apply {
|
createCriteria().andEqualTo("pmSceneId", userId)
|
orderBy("pmTime").desc()
|
})
|
}
|
}
|