| | |
| | | .eqIfPresent(DeviceDO::getModel, reqVO.getModel()) |
| | | .betweenIfPresent(DeviceDO::getPurchaseDate, reqVO.getPurchaseDate()) |
| | | .betweenIfPresent(DeviceDO::getCreateTime, reqVO.getCreateTime()) |
| | | .orderByAsc(DeviceDO::getStateDate)); |
| | | .orderByAsc(DeviceDO::getDevId)); |
| | | } |
| | | |
| | | @Select("select * from lihu.device where dev_id=#{devId}") |
| | |
| | | }) |
| | | DeviceDO getDeviceByDevId(@Param("devId") String devId); |
| | | |
| | | @Update("update lihu.device set state=#{state}, state_date=#{stateDate} where dev_id=#{devId}") |
| | | Integer updateDevState(@Param("devId") String devId, @Param("state") Integer state, @Param("stateDate") LocalDate stateDate); |
| | | @Update("update lihu.device set state=#{state}, state_date=#{stateDate}, comment=#{comment} where dev_id=#{devId}") |
| | | Integer updateDevState(@Param("devId") String devId, @Param("state") Integer state, @Param("stateDate") LocalDate stateDate, @Param("comment") String comment); |
| | | |
| | | @Select("<script>" + |
| | | "select category, state, count(1) as dev_count from lihu.device " + |
| | |
| | | validateDeviceExists(updateReqVO.getId()); |
| | | // 更新 |
| | | DeviceDO updateObj = BeanUtils.toBean(updateReqVO, DeviceDO.class); |
| | | return deviceMapper.updateDevState(updateObj.getDevId(), updateObj.getState(), updateObj.getStateDate()); |
| | | return deviceMapper.updateDevState(updateObj.getDevId(), updateObj.getState(), updateObj.getStateDate(), updateObj.getComment()); |
| | | } |
| | | |
| | | @Override |