| | |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | public class InterphoneHostService extends BaseServiceImpl <InterphoneHostMapper, InterphoneHost>{ |
| | | public class InterphoneHostService extends BaseServiceImpl<InterphoneHostMapper, InterphoneHost> { |
| | | |
| | | private final InterphoneHostMapper interphoneHostMapper; |
| | | |
| | | |
| | | /** |
| | | * 添加主机 |
| | | * |
| | | */ |
| | | public boolean addHost(InterphoneHostParam interphoneHostParam) { |
| | | InterphoneHost interphoneHost = new InterphoneHost(); |
| | | BeanUtils.copyProperties(interphoneHostParam, interphoneHost); |
| | | return save(interphoneHost); |
| | | return save(interphoneHost); |
| | | } |
| | | |
| | | /** |
| | | * 修改主机 |
| | | */ |
| | | public boolean updateHost(Integer id,InterphoneHostParam interphoneHostParam) { |
| | | public boolean updateHost(Integer id, InterphoneHostParam interphoneHostParam) { |
| | | InterphoneHost byId = getById(id); |
| | | if(byId == null){ |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | | InterphoneHost interphoneHost = new InterphoneHost(); |
| | |
| | | |
| | | /** |
| | | * 删除主机 |
| | | * |
| | | * @param id |
| | | * @return |
| | | * |
| | | */ |
| | | */ |
| | | public boolean deleteHost(Integer id) { |
| | | InterphoneHost byId = getById(id); |
| | | if(byId == null){ |
| | | if (byId == null) { |
| | | return false; |
| | | } |
| | | return removeById(id); |
| | |
| | | |
| | | /** |
| | | * 查询主机 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public InterphoneHost getHost(Integer id) { |
| | | InterphoneHost byId = getById(id); |
| | | if(byId == null){ |
| | | if (byId == null) { |
| | | return null; |
| | | } |
| | | return byId; |