feiyu02
2022-11-15 23bd719cebe5feeff4e48fde925b0b39755eea93
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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()
        })
    }
}