package cn.flightfeather.supervision.lightshare.service.impl
|
|
import cn.flightfeather.supervision.domain.ds1.entity.Itemevaluation
|
import cn.flightfeather.supervision.domain.ds1.mapper.ItemevaluationMapper
|
import cn.flightfeather.supervision.lightshare.service.ItemevaluationService
|
import cn.flightfeather.supervision.lightshare.vo.ItemevaluationVo
|
import org.springframework.beans.BeanUtils
|
import org.springframework.stereotype.Service
|
import org.springframework.transaction.annotation.Transactional
|
|
@Service
|
class ItemevaluationServiceImpl(val itemevaluationMapper: ItemevaluationMapper) : ItemevaluationService {
|
|
//批量修改单项评估
|
@Transactional
|
override fun updatelist(itemevaluationlist: List<Itemevaluation>): Int {
|
//循环修改
|
itemevaluationlist.forEach {
|
itemevaluationMapper.updateByPrimaryKeySelective(it)
|
}
|
return itemevaluationlist.size
|
}
|
|
//批量保存单项评估
|
@Transactional
|
override fun savelist(itemevaluationlist: List<Itemevaluation>): Int {
|
//循环新增
|
itemevaluationlist.forEach {
|
itemevaluationMapper.insert(it)
|
}
|
return itemevaluationlist.size
|
}
|
|
//根据子任务ID获取单项评估列表
|
override fun findBySubTaskID(subTaskID: String): List<ItemevaluationVo> {
|
val itemvaluationVoList = mutableListOf<ItemevaluationVo>()
|
val itemvaluation = Itemevaluation()
|
itemvaluation.stguid = subTaskID
|
val itemvaluationList = itemevaluationMapper.select(itemvaluation)
|
itemvaluationList.forEach {
|
val itemvaluationVo = ItemevaluationVo()
|
BeanUtils.copyProperties(it, itemvaluationVo)
|
itemvaluationVoList.add(itemvaluationVo)
|
}
|
return itemvaluationVoList
|
}
|
|
override fun findOne(id: String): Itemevaluation = itemevaluationMapper.selectByPrimaryKey(id)
|
|
override fun findAll(): MutableList<Itemevaluation> = itemevaluationMapper.selectAll()
|
|
override fun save(itemevaluation: Itemevaluation): Int = itemevaluationMapper.insert(itemevaluation)
|
|
override fun update(itemevaluation: Itemevaluation): Int = itemevaluationMapper.updateByPrimaryKeySelective(itemevaluation)
|
|
override fun delete(id: String): Int = itemevaluationMapper.deleteByPrimaryKey(id)
|
}
|