| | |
| | | package cn.flightfeather.supervision.domain.ds2.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds2.entity.DustSiteInfo |
| | | import cn.flightfeather.supervision.domain.ds2.entity.DustSiteMap |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.DustSiteInfoMapper |
| | | import cn.flightfeather.supervision.domain.ds2.mapper.DustSiteMapMapper |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceSiteVo |
| | | import com.github.pagehelper.PageHelper |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.util.* |
| | | |
| | | /** |
| | | * 静安工地扬尘监测点位数据库相关操作 |
| | |
| | | val res = dustSiteInfoMapper.selectAll() |
| | | return DeviceSiteVo.fromJADustSiteInfo(res) |
| | | } |
| | | |
| | | fun searchSiteInfo(keyword: String): List<DeviceSiteVo> { |
| | | val res = dustSiteInfoMapper.selectByExample(Example(DustSiteInfo::class.java).apply { |
| | | createCriteria().andLike("name", "%$keyword%") |
| | | }) |
| | | return DeviceSiteVo.fromJADustSiteInfo(res) |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | */ |
| | | fun findByPrimaryKey(id: Int?): DustSiteMap? { |
| | | if (id == null) { |
| | | return null |
| | | } |
| | | return dustSiteMapMapper.selectByPrimaryKey(id) |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | fun insert(dustSiteMap: DustSiteMap): Int { |
| | | dustSiteMap.createTime = Date() |
| | | return dustSiteMapMapper.insert(dustSiteMap) |
| | | } |
| | | |
| | | /** |
| | | * 更新 |
| | | */ |
| | | fun update(dustSiteMap: DustSiteMap): Int { |
| | | dustSiteMap.createTime = Date() |
| | | return dustSiteMapMapper.updateByPrimaryKeySelective(dustSiteMap) |
| | | } |
| | | } |