You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
package com.iflytop.gd.app.service;
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.iflytop.gd.app.mapper.SolutionsMapper;
|
|
import com.iflytop.gd.app.model.entity.Solutions;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
import java.util.stream.Collectors;
|
|
|
|
/**
|
|
* 溶液业务实现类
|
|
*/
|
|
@Service
|
|
@RequiredArgsConstructor
|
|
public class SolutionsService extends ServiceImpl<SolutionsMapper, Solutions> {
|
|
|
|
public Solutions findByName(String name) {
|
|
return this.getOne(new LambdaQueryWrapper<Solutions>().eq(Solutions::getName, name));
|
|
}
|
|
|
|
public boolean addSolutions(Solutions solutions) {
|
|
return this.save(solutions);
|
|
}
|
|
|
|
public boolean updateSolutions(Solutions solutions) {
|
|
return this.updateById(solutions);
|
|
}
|
|
|
|
public boolean deleteSolutions(String idsStr) {
|
|
List<Long> ids = Arrays.stream(idsStr.split(","))
|
|
.map(Long::parseLong)
|
|
.collect(Collectors.toList());
|
|
return this.removeByIds(ids);
|
|
}
|
|
}
|