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
package cn.flightfeather.supervision.lightshare.service.Impl
 
import cn.flightfeather.supervision.domain.entity.Evaluationsubrule
import cn.flightfeather.supervision.domain.mapper.EvaluationsubruleMapper
import cn.flightfeather.supervision.lightshare.service.EvaluationsubruleService
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
 
@Service
class EvaluationsubruleServiceImpl (val evaluationsubruleMapper: EvaluationsubruleMapper):EvaluationsubruleService {
 
    override fun findOne(id: String): Evaluationsubrule = evaluationsubruleMapper.selectByPrimaryKey(id)
 
    override fun findAll(): MutableList<Evaluationsubrule> = evaluationsubruleMapper.selectAll()
 
    override fun save(evaluationsubrule: Evaluationsubrule): Int = evaluationsubruleMapper.insert(evaluationsubrule)
 
    override fun update(evaluationsubrule: Evaluationsubrule): Int = evaluationsubruleMapper.updateByPrimaryKey(evaluationsubrule)
 
    override fun delete(id: String): Int = evaluationsubruleMapper.deleteByPrimaryKey(id)
 
    override fun findByRuleId(erguid: String): List<Evaluationsubrule> {
        val example = Example(Evaluationsubrule::class.java)
        val criteria = example.createCriteria()
        criteria.andEqualTo("erguid", erguid)
        return evaluationsubruleMapper.selectByExample(example)
    }
}