服务管理
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.sunyard.chsm.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sunyard.chsm.model.entity.CryptoServiceDeviceGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/11/1
|
||||
*/
|
||||
@Mapper
|
||||
public interface CryptoServiceDeviceGroupMapper extends BaseMapper<CryptoServiceDeviceGroup> {
|
||||
|
||||
|
||||
default CryptoServiceDeviceGroup selectByServiceId(Long id) {
|
||||
Assert.notNull(id, "id不能为空");
|
||||
List<CryptoServiceDeviceGroup> list = selectList(new LambdaQueryWrapper<CryptoServiceDeviceGroup>().eq(CryptoServiceDeviceGroup::getServiceId, id));
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return null;
|
||||
}
|
||||
return list.iterator().next();
|
||||
}
|
||||
|
||||
default List<CryptoServiceDeviceGroup> selectByServiceIds(List<Long> ids) {
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return selectList(new LambdaQueryWrapper<CryptoServiceDeviceGroup>().
|
||||
in(CryptoServiceDeviceGroup::getServiceId, ids));
|
||||
}
|
||||
|
||||
default void deleteByServiceId(Long id) {
|
||||
Assert.notNull(id, "id不能为空");
|
||||
delete(new LambdaQueryWrapper<CryptoServiceDeviceGroup>().eq(CryptoServiceDeviceGroup::getServiceId, id));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.sunyard.chsm.model.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author liulu
|
||||
* @since 2024/11/1
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_crypto_service_device_group")
|
||||
public class CryptoServiceDeviceGroup {
|
||||
|
||||
private Long id;
|
||||
private Long serviceId;
|
||||
private Long deviceGroupId;
|
||||
private String deviceGroupName;
|
||||
|
||||
private String remark;
|
||||
private LocalDateTime createTime;
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user