Przeglądaj źródła

新增获取全部年度数据接口,并且获取企业的类型

littleblue55 1 miesiąc temu
rodzic
commit
0dd3d0d56e

+ 11 - 1
enteprise-admin/src/main/java/com/enteprise/base_data_year/controller/EnterpriseBaseDataYearController.java

@@ -2,6 +2,8 @@ package com.enteprise.base_data_year.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.enteprise.base_data_year.dto.EnterpriseBaseDataYearDto;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -23,7 +25,7 @@ import com.enteprise.common.core.page.TableDataInfo;
 
 /**
  * base_data_yearController
- * 
+ *
  * @author ruoyi
  * @date 2024-08-30
  */
@@ -45,6 +47,14 @@ public class EnterpriseBaseDataYearController extends BaseController
         List<EnterpriseBaseDataYear> list = enterpriseBaseDataYearService.selectEnterpriseBaseDataYearList(enterpriseBaseDataYear);
         return getDataTable(list);
     }
+    @PreAuthorize("@ss.hasPermi('base_data_year:base_data_year:listAll')")
+    @GetMapping("/list/all")
+    public TableDataInfo listAll()
+    {
+//        startPage();
+        List<EnterpriseBaseDataYearDto> list = enterpriseBaseDataYearService.selectEnterpriseBaseDataYearListWithType();
+        return getDataTable(list);
+    }
 
     /**
      * 导出base_data_year列表

+ 300 - 0
enteprise-admin/src/main/java/com/enteprise/base_data_year/dto/EnterpriseBaseDataYearDto.java

@@ -0,0 +1,300 @@
+package com.enteprise.base_data_year.dto;
+
+import com.enteprise.common.annotation.Excel;
+import com.enteprise.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * base_data_year对象 enterprise_base_data_year
+ *
+ * @author ruoyi
+ * @date 2024-08-30
+ */
+public class EnterpriseBaseDataYearDto extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 企业名称 */
+    @Excel(name = "企业名称")
+    private String enterpriseName;
+
+    /** 坐落地 */
+    @Excel(name = "坐落地")
+    private String location;
+
+    /** 行业代码 */
+    @Excel(name = "行业代码")
+    private String code;
+
+    /** 主营业务活动 */
+    @Excel(name = "主营业务活动")
+    private String mainBusiness;
+
+    /** 用地面积 */
+    @Excel(name = "用地面积")
+    private Long landArea;
+
+    /** 工业总产值 */
+    @Excel(name = "工业总产值")
+    private Long totalIndustrialValue;
+
+    /** 工业增加值 */
+    @Excel(name = "工业增加值")
+    private Long gdp;
+
+    /** 应税收入 */
+    @Excel(name = "应税收入")
+    private Long taxableIncome;
+
+    /** 实缴税金 */
+    @Excel(name = "实缴税金")
+    private Long paidTax;
+
+    /** 主营业务收入 */
+    @Excel(name = "主营业务收入")
+    private Long mainBusinessIncome;
+
+    /** 从业人员数 */
+    @Excel(name = "从业人员数")
+    private Long employeeNumber;
+
+    /** 利润总额 */
+    @Excel(name = "利润总额")
+    private Long profit;
+
+    /** 所有者权益 */
+    @Excel(name = "所有者权益")
+    private Long ownerEquity;
+
+    /** 研发经费 */
+    @Excel(name = "研发经费")
+    private Long funding;
+
+    /** 能源消费量 */
+    @Excel(name = "能源消费量")
+    private Long energyConsume;
+
+    @Excel(name = "电力消费量")
+    private Long powerConsume;
+
+    @Excel(name = "分类编码")
+    private String typeNum;
+
+    /** 年份 */
+    @Excel(name = "年份")
+    private String year;
+
+    /** 月份 */
+    @Excel(name = "月份")
+    private String month;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setEnterpriseName(String enterpriseName)
+    {
+        this.enterpriseName = enterpriseName;
+    }
+
+    public String getTypeNum() {
+        return typeNum;
+    }
+
+    public void setTypeNum(String typeNum) {
+        this.typeNum = typeNum;
+    }
+
+    public String getEnterpriseName()
+    {
+        return enterpriseName;
+    }
+    public void setLocation(String location)
+    {
+        this.location = location;
+    }
+
+    public String getLocation()
+    {
+        return location;
+    }
+    public void setCode(String code)
+    {
+        this.code = code;
+    }
+
+    public String getCode()
+    {
+        return code;
+    }
+    public void setMainBusiness(String mainBusiness)
+    {
+        this.mainBusiness = mainBusiness;
+    }
+
+    public String getMainBusiness()
+    {
+        return mainBusiness;
+    }
+    public void setLandArea(Long landArea)
+    {
+        this.landArea = landArea;
+    }
+
+    public Long getLandArea()
+    {
+        return landArea;
+    }
+    public void setTotalIndustrialValue(Long totalIndustrialValue)
+    {
+        this.totalIndustrialValue = totalIndustrialValue;
+    }
+
+    public Long getTotalIndustrialValue()
+    {
+        return totalIndustrialValue;
+    }
+    public void setGdp(Long gdp)
+    {
+        this.gdp = gdp;
+    }
+
+    public Long getGdp()
+    {
+        return gdp;
+    }
+    public void setTaxableIncome(Long taxableIncome)
+    {
+        this.taxableIncome = taxableIncome;
+    }
+
+    public Long getTaxableIncome()
+    {
+        return taxableIncome;
+    }
+    public void setPaidTax(Long paidTax)
+    {
+        this.paidTax = paidTax;
+    }
+
+    public Long getPaidTax()
+    {
+        return paidTax;
+    }
+    public void setMainBusinessIncome(Long mainBusinessIncome)
+    {
+        this.mainBusinessIncome = mainBusinessIncome;
+    }
+
+    public Long getMainBusinessIncome()
+    {
+        return mainBusinessIncome;
+    }
+    public void setEmployeeNumber(Long employeeNumber)
+    {
+        this.employeeNumber = employeeNumber;
+    }
+
+    public Long getEmployeeNumber()
+    {
+        return employeeNumber;
+    }
+    public void setProfit(Long profit)
+    {
+        this.profit = profit;
+    }
+
+    public Long getProfit()
+    {
+        return profit;
+    }
+    public void setOwnerEquity(Long ownerEquity)
+    {
+        this.ownerEquity = ownerEquity;
+    }
+
+    public Long getOwnerEquity()
+    {
+        return ownerEquity;
+    }
+    public void setFunding(Long funding)
+    {
+        this.funding = funding;
+    }
+
+    public Long getFunding()
+    {
+        return funding;
+    }
+    public void setEnergyConsume(Long energyConsume)
+    {
+        this.energyConsume = energyConsume;
+    }
+
+    public Long getEnergyConsume()
+    {
+        return energyConsume;
+    }
+
+    public void setPowerConsume(Long powerConsume)
+    {
+        this.powerConsume = powerConsume;
+    }
+
+    public Long getPowerConsume()
+    {
+        return powerConsume;
+    }
+    public void setYear(String year)
+    {
+        this.year = year;
+    }
+
+    public String getYear()
+    {
+        return year;
+    }
+    public void setMonth(String month)
+    {
+        this.month = month;
+    }
+
+    public String getMonth()
+    {
+        return month;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("enterpriseName", getEnterpriseName())
+            .append("location", getLocation())
+            .append("code", getCode())
+            .append("mainBusiness", getMainBusiness())
+            .append("landArea", getLandArea())
+            .append("totalIndustrialValue", getTotalIndustrialValue())
+            .append("gdp", getGdp())
+            .append("taxableIncome", getTaxableIncome())
+            .append("paidTax", getPaidTax())
+            .append("mainBusinessIncome", getMainBusinessIncome())
+            .append("employeeNumber", getEmployeeNumber())
+            .append("profit", getProfit())
+            .append("ownerEquity", getOwnerEquity())
+            .append("funding", getFunding())
+            .append("energyConsume", getEnergyConsume())
+                .append("powerConsume", getPowerConsume())
+            .append("year", getYear())
+            .append("month", getMonth())
+            .toString();
+    }
+}

+ 10 - 8
enteprise-admin/src/main/java/com/enteprise/base_data_year/mapper/EnterpriseBaseDataYearMapper.java

@@ -2,20 +2,21 @@ package com.enteprise.base_data_year.mapper;
 
 import java.util.List;
 import com.enteprise.base_data_year.domain.EnterpriseBaseDataYear;
+import com.enteprise.base_data_year.dto.EnterpriseBaseDataYearDto;
 import org.apache.ibatis.annotations.Mapper;
 
 /**
  * base_data_yearMapper接口
- * 
+ *
  * @author ruoyi
  * @date 2024-08-30
  */
 @Mapper
-public interface EnterpriseBaseDataYearMapper 
+public interface EnterpriseBaseDataYearMapper
 {
     /**
      * 查询base_data_year
-     * 
+     *
      * @param id base_data_year主键
      * @return base_data_year
      */
@@ -23,15 +24,16 @@ public interface EnterpriseBaseDataYearMapper
 
     /**
      * 查询base_data_year列表
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return base_data_year集合
      */
     public List<EnterpriseBaseDataYear> selectEnterpriseBaseDataYearList(EnterpriseBaseDataYear enterpriseBaseDataYear);
 
+    public List<EnterpriseBaseDataYearDto> selectEnterpriseBaseDataYearListWithType();
     /**
      * 新增base_data_year
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return 结果
      */
@@ -39,7 +41,7 @@ public interface EnterpriseBaseDataYearMapper
 
     /**
      * 修改base_data_year
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return 结果
      */
@@ -47,7 +49,7 @@ public interface EnterpriseBaseDataYearMapper
 
     /**
      * 删除base_data_year
-     * 
+     *
      * @param id base_data_year主键
      * @return 结果
      */
@@ -55,7 +57,7 @@ public interface EnterpriseBaseDataYearMapper
 
     /**
      * 批量删除base_data_year
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 10 - 8
enteprise-admin/src/main/java/com/enteprise/base_data_year/service/IEnterpriseBaseDataYearService.java

@@ -2,18 +2,19 @@ package com.enteprise.base_data_year.service;
 
 import java.util.List;
 import com.enteprise.base_data_year.domain.EnterpriseBaseDataYear;
+import com.enteprise.base_data_year.dto.EnterpriseBaseDataYearDto;
 
 /**
  * base_data_yearService接口
- * 
+ *
  * @author ruoyi
  * @date 2024-08-30
  */
-public interface IEnterpriseBaseDataYearService 
+public interface IEnterpriseBaseDataYearService
 {
     /**
      * 查询base_data_year
-     * 
+     *
      * @param id base_data_year主键
      * @return base_data_year
      */
@@ -21,15 +22,16 @@ public interface IEnterpriseBaseDataYearService
 
     /**
      * 查询base_data_year列表
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return base_data_year集合
      */
     public List<EnterpriseBaseDataYear> selectEnterpriseBaseDataYearList(EnterpriseBaseDataYear enterpriseBaseDataYear);
 
+    public List<EnterpriseBaseDataYearDto> selectEnterpriseBaseDataYearListWithType();
     /**
      * 新增base_data_year
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return 结果
      */
@@ -37,7 +39,7 @@ public interface IEnterpriseBaseDataYearService
 
     /**
      * 修改base_data_year
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return 结果
      */
@@ -45,7 +47,7 @@ public interface IEnterpriseBaseDataYearService
 
     /**
      * 批量删除base_data_year
-     * 
+     *
      * @param ids 需要删除的base_data_year主键集合
      * @return 结果
      */
@@ -53,7 +55,7 @@ public interface IEnterpriseBaseDataYearService
 
     /**
      * 删除base_data_year信息
-     * 
+     *
      * @param id base_data_year主键
      * @return 结果
      */

+ 15 - 8
enteprise-admin/src/main/java/com/enteprise/base_data_year/service/impl/EnterpriseBaseDataYearServiceImpl.java

@@ -1,6 +1,8 @@
 package com.enteprise.base_data_year.service.impl;
 
 import java.util.List;
+
+import com.enteprise.base_data_year.dto.EnterpriseBaseDataYearDto;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.enteprise.base_data_year.mapper.EnterpriseBaseDataYearMapper;
@@ -9,19 +11,19 @@ import com.enteprise.base_data_year.service.IEnterpriseBaseDataYearService;
 
 /**
  * base_data_yearService业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2024-08-30
  */
 @Service
-public class EnterpriseBaseDataYearServiceImpl implements IEnterpriseBaseDataYearService 
+public class EnterpriseBaseDataYearServiceImpl implements IEnterpriseBaseDataYearService
 {
     @Autowired
     private EnterpriseBaseDataYearMapper enterpriseBaseDataYearMapper;
 
     /**
      * 查询base_data_year
-     * 
+     *
      * @param id base_data_year主键
      * @return base_data_year
      */
@@ -33,7 +35,7 @@ public class EnterpriseBaseDataYearServiceImpl implements IEnterpriseBaseDataYea
 
     /**
      * 查询base_data_year列表
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return base_data_year
      */
@@ -43,9 +45,14 @@ public class EnterpriseBaseDataYearServiceImpl implements IEnterpriseBaseDataYea
         return enterpriseBaseDataYearMapper.selectEnterpriseBaseDataYearList(enterpriseBaseDataYear);
     }
 
+    @Override
+    public List<EnterpriseBaseDataYearDto> selectEnterpriseBaseDataYearListWithType() {
+        return enterpriseBaseDataYearMapper.selectEnterpriseBaseDataYearListWithType();
+    }
+
     /**
      * 新增base_data_year
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return 结果
      */
@@ -57,7 +64,7 @@ public class EnterpriseBaseDataYearServiceImpl implements IEnterpriseBaseDataYea
 
     /**
      * 修改base_data_year
-     * 
+     *
      * @param enterpriseBaseDataYear base_data_year
      * @return 结果
      */
@@ -69,7 +76,7 @@ public class EnterpriseBaseDataYearServiceImpl implements IEnterpriseBaseDataYea
 
     /**
      * 批量删除base_data_year
-     * 
+     *
      * @param ids 需要删除的base_data_year主键
      * @return 结果
      */
@@ -81,7 +88,7 @@ public class EnterpriseBaseDataYearServiceImpl implements IEnterpriseBaseDataYea
 
     /**
      * 删除base_data_year信息
-     * 
+     *
      * @param id base_data_year主键
      * @return 结果
      */

+ 17 - 5
enteprise-admin/src/main/resources/mapper/base_data_year/EnterpriseBaseDataYearMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.enteprise.base_data_year.mapper.EnterpriseBaseDataYearMapper">
-    
+
     <resultMap type="EnterpriseBaseDataYear" id="EnterpriseBaseDataYearResult">
         <result property="id"    column="id"    />
         <result property="enterpriseName"    column="enterprise_name"    />
@@ -32,7 +32,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectEnterpriseBaseDataYearList" parameterType="EnterpriseBaseDataYear" resultMap="EnterpriseBaseDataYearResult">
         <include refid="selectEnterpriseBaseDataYearVo"/>
-        <where>  
+        <where>
             <if test="enterpriseName != null  and enterpriseName != ''"> and enterprise_name = #{enterpriseName}</if>
             <if test="location != null  and location != ''"> and location = #{location}</if>
             <if test="code != null  and code != ''"> and code = #{code}</if>
@@ -53,7 +53,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="month != null  and month != ''"> and month = #{month}</if>
         </where>
     </select>
-    
+
+    <select id="selectEnterpriseBaseDataYearListWithType" parameterType="EnterpriseBaseDataYear" >
+        select a.id, a.enterprise_name enterpriseName, a.location, a.code, a.main_business mainBusiness,
+               a.land_area landArea, a.total_industrial_value totalIndustrialValue, a.gdp,
+               a.taxable_income taxableIncome, a.paid_tax paidTax, a.main_business_income mainBusinessIncome,
+               a.employee_number employeeNumber,
+               a.profit, a.owner_equity ownerEquity, a.funding, energy_consume energyConsume,
+               a.power_consume powerConsume, a.year, a.month, b.type_num typeNum
+        from enterprise_base_data_year a
+        left join enterprise b
+        on a.enterprise_name = b.enterprise_name
+    </select>
+
     <select id="selectEnterpriseBaseDataYearById" parameterType="Long" resultMap="EnterpriseBaseDataYearResult">
         <include refid="selectEnterpriseBaseDataYearVo"/>
         where id = #{id}
@@ -133,9 +145,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteEnterpriseBaseDataYearByIds" parameterType="String">
-        delete from enterprise_base_data_year where id in 
+        delete from enterprise_base_data_year where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-</mapper>
+</mapper>