|
|
@ -5,12 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.iflytop.gd.app.model.vo.OresCraftsListVO; |
|
|
|
import com.iflytop.gd.common.base.BasePageQuery; |
|
|
|
import com.iflytop.gd.app.mapper.CraftsMapper; |
|
|
|
import com.iflytop.gd.app.mapper.OresMapper; |
|
|
|
import com.iflytop.gd.app.model.entity.Crafts; |
|
|
|
import com.iflytop.gd.app.model.entity.Ores; |
|
|
|
import com.iflytop.gd.app.model.vo.OresCraftsListVO; |
|
|
|
import com.iflytop.gd.common.base.BasePageQuery; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -28,7 +28,7 @@ public class OresService extends ServiceImpl<OresMapper, Ores> { |
|
|
|
|
|
|
|
private final CraftsMapper craftsMapper; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public IPage<OresCraftsListVO> getPage(BasePageQuery pageQuery) { |
|
|
|
// 构建分页对象 |
|
|
|
Page<Ores> oresPage = new Page<>(pageQuery.getPageNum(), pageQuery.getPageSize()); |
|
|
@ -77,22 +77,22 @@ public class OresService extends ServiceImpl<OresMapper, Ores> { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Ores findByName(String name) { |
|
|
|
return this.getOne(new LambdaQueryWrapper<Ores>().eq(Ores::getName, name)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean addOres(Ores ores) { |
|
|
|
return this.save(ores); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean updateOres(Ores ores) { |
|
|
|
return this.updateById(ores); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean deleteOres(String idsStr) { |
|
|
|
List<Long> ids = Arrays.stream(idsStr.split(",")) |
|
|
|
.map(Long::parseLong) |
|
|
|