chsm-server/chsm-common/src/main/java/com/sunyard/chsm/mapper/CryptoServiceApiMapper.java
2024-12-06 16:39:30 +08:00

32 lines
872 B
Java

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.CryptoServiceApi;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.util.CollectionUtils;
import java.util.Collections;
import java.util.List;
/**
* @author liulu
* @since 2024/10/15
*/
@Mapper
public interface CryptoServiceApiMapper extends BaseMapper<CryptoServiceApi> {
default List<CryptoServiceApi> selectByServiceIds(List<Long> serviceIds) {
if (CollectionUtils.isEmpty(serviceIds)) {
return Collections.emptyList();
}
return selectList(
new LambdaQueryWrapper<CryptoServiceApi>()
.in(CryptoServiceApi::getCryptoServiceId, serviceIds)
);
}
}