| | |
| | | package cn.flightfeather.supervision.domain.ds3.repository |
| | | |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteInfo |
| | | import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteInfoMapper |
| | | import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper |
| | |
| | | import cn.flightfeather.supervision.lightshare.vo.DeviceSiteVo |
| | | import org.springframework.stereotype.Repository |
| | | import tk.mybatis.mapper.entity.Example |
| | | import java.util.* |
| | | |
| | | /** |
| | | * 金山扬尘监测点位和系统用户映射关系数据库相关操作 |
| | |
| | | val res = jsDustSiteInfoMapper.selectAll() |
| | | return DeviceSiteVo.fromJSDustSiteInfo(res) |
| | | } |
| | | |
| | | fun searchSiteInfo(keyword: String): List<DeviceSiteVo> { |
| | | val res = jsDustSiteInfoMapper.selectByExample(Example(JSDustSiteInfo::class.java).apply { |
| | | createCriteria().andLike("name", "%$keyword%") |
| | | }) |
| | | return DeviceSiteVo.fromJSDustSiteInfo(res) |
| | | } |
| | | |
| | | /** |
| | | * 根据id查询 |
| | | */ |
| | | fun findByPrimaryKey(id: Int?): JSDustSiteMap? { |
| | | if (id == null) { |
| | | return null |
| | | } |
| | | return jsDustSiteMapMapper.selectByPrimaryKey(id) |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | fun insert(jsDustSiteMap: JSDustSiteMap): Int { |
| | | jsDustSiteMap.createTime = Date() |
| | | return jsDustSiteMapMapper.insert(jsDustSiteMap) |
| | | } |
| | | |
| | | /** |
| | | * 更新 |
| | | */ |
| | | fun update(jsDustSiteMap: JSDustSiteMap): Int { |
| | | jsDustSiteMap.createTime = Date() |
| | | return jsDustSiteMapMapper.updateByPrimaryKeySelective(jsDustSiteMap) |
| | | } |
| | | } |