|
@@ -0,0 +1,63 @@
|
|
|
+package com.ruoyi.web.service.impl;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
|
+import com.ruoyi.web.entity.IndustryData;
|
|
|
+import com.ruoyi.web.mapper.IndustryDataMapper;
|
|
|
+import com.ruoyi.web.service.IIndustryDataService;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import static com.ruoyi.common.core.domain.AjaxResult.success;
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 产业数据收集 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author author
|
|
|
+ * @since 2025-07-23
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class IndustryDataServiceImpl extends ServiceImpl<IndustryDataMapper, IndustryData> implements IIndustryDataService {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IndustryDataMapper industryDataMapper;
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult add(IndustryData industryData) {
|
|
|
+ industryDataMapper.insert(industryData);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult edit(IndustryData industryData) {
|
|
|
+ industryDataMapper.updateById(industryData);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult delete(String ids) {
|
|
|
+ String[] split = ids.split(",");
|
|
|
+ for (String s : split) {
|
|
|
+ industryDataMapper.deleteById(s);
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AjaxResult page(Integer pageNum, Integer pageSize, Integer industryCategory) {
|
|
|
+ QueryWrapper<IndustryData> queryWrapper = new QueryWrapper<>();
|
|
|
+ Page<IndustryData> page = new Page<>(pageNum, pageSize);
|
|
|
+ if (null == industryCategory) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq( "industry_category", industryCategory);
|
|
|
+ }
|
|
|
+
|
|
|
+ return success(industryDataMapper.selectPage(page, queryWrapper));
|
|
|
+ }
|
|
|
+}
|