Explorar o código

feat(info): 添加部门员工统计和企业基本信息相关实体、Mapper、Service

- 新增 EDepartmentEmployeeStats 和 EEnterpriseBasicInfo 两个实体类
- 新增对应的 Mapper接口和 XML 文件
- 新增对应的 Service 接口和实现类
- 提供基本的分页查询和列表查询功能
林仔 hai 10 meses
pai
achega
0dd410b6ab

+ 105 - 0
src/main/java/com/zksy/info/domain/EDepartmentEmployeeStats.java

@@ -0,0 +1,105 @@
+package com.zksy.info.domain;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ * 部门员工统计表
+ * @TableName e_department_employee_stats
+ */
+@TableName(value ="e_department_employee_stats")
+@Data
+public class EDepartmentEmployeeStats implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_UUID)
+    @ApiModelProperty("主键")
+    @ExcelIgnore
+    private String id;
+
+    /**
+     * 部门名称
+     */
+    @ApiModelProperty("部门名称")
+    @ExcelProperty(value = "部门名称", index = 0)
+    private String departmentName;
+
+    /**
+     * 内籍员工数量
+     */
+    @ApiModelProperty("内籍员工数量")
+    @ExcelProperty(value = "内籍员工数量", index = 1)
+    private Integer domesticEmployees;
+
+    /**
+     * 外籍员工数量
+     */
+    @ApiModelProperty("外籍员工数量")
+    @ExcelProperty(value = "外籍员工数量", index = 2)
+    private Integer foreignEmployees;
+
+    /**
+     * 男工比例
+     */
+    @ApiModelProperty("男工比例")
+    @ExcelProperty(value = "男工比例", index = 3)
+    private String maleRatio;
+
+    /**
+     * 女工比例
+     */
+    @ApiModelProperty("女工比例")
+    @ExcelProperty(value = "女工比例", index = 4)
+    private String femaleRatio;
+
+    /**
+     * 学历分布
+     */
+    @ApiModelProperty("学历分布")
+    @ExcelProperty(value = "学历分布", index = 5)
+    private String educationDistribution;
+
+    /**
+     * 年龄分布
+     */
+    @ApiModelProperty("年龄分布")
+    @ExcelProperty(value = "年龄分布", index = 6)
+    private Object ageDistribution;
+
+    /**
+     * 员工总数
+     */
+    @ApiModelProperty("员工总数")
+    @ExcelProperty(value = "员工总数", index = 7)
+    private Integer totalEmployees;
+
+    /**
+     * 创建时间
+     */
+    @ApiModelProperty("创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelIgnore
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    @ApiModelProperty("更新时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ExcelIgnore
+    private LocalDateTime updateTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 143 - 0
src/main/java/com/zksy/info/domain/EEnterpriseBasicInfo.java

@@ -0,0 +1,143 @@
+package com.zksy.info.domain;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * 企业信息表
+ * @TableName e_enterprise_basic_info
+ */
+@TableName(value ="e_enterprise_basic_info")
+@Data
+public class EEnterpriseBasicInfo implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.ASSIGN_UUID)
+    @ApiModelProperty("主键")
+    @ExcelIgnore
+    private String id;
+
+    /**
+     * 企业名称
+     */
+    @ApiModelProperty("企业名称")
+    @ExcelProperty(value = "企业名称", index = 0)
+    private String enterpriseName;
+
+    /**
+     * 统一社会信用代码
+     */
+    @ApiModelProperty("统一社会信用代码")
+    @ExcelProperty(value = "统一社会信用代码", index = 1)
+    private String unifiedSocialCreditCode;
+
+    /**
+     * 注册日期
+     */
+    @ApiModelProperty("注册日期")
+    @ExcelProperty(value = "注册日期", index = 2)
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private LocalDate registrationDate;
+
+    /**
+     * 产值(万元)
+     */
+    @ApiModelProperty("产值(万元)")
+    @ExcelProperty(value = "产值(万元)", index = 3)
+    private BigDecimal outputValue;
+
+    /**
+     * 产值同比(百分比)
+     */
+    @ApiModelProperty("产值同比(百分比)")
+    @ExcelProperty(value = "产值同比(百分比)", index = 4)
+    private String outputValueYoy;
+
+    /**
+     * 税收(万元)
+     */
+    @ApiModelProperty("税收(万元)")
+    @ExcelProperty(value = "税收(万元)", index = 5)
+    private BigDecimal taxRevenue;
+
+    /**
+     * 税收同比(百分比)
+     */
+    @ApiModelProperty("税收同比(百分比)")
+    @ExcelProperty(value = "税收同比(百分比)", index = 6)
+    private String taxRevenueYoy;
+
+    /**
+     * 营收(万元)
+     */
+    @ApiModelProperty("营收(万元)")
+    @ExcelProperty(value = "营收(万元)", index = 7)
+    private BigDecimal revenue;
+
+    /**
+     * 营收同比(百分比)
+     */
+    @ApiModelProperty("营收同比(百分比)")
+    @ExcelProperty(value = "营收同比(百分比)", index = 8)
+    private String revenueYoy;
+
+    /**
+     * 是否规上企业(否,是)
+     */
+    @ApiModelProperty("是否规上企业(否,是)")
+    @ExcelProperty(value = "是否规上企业(否,是)", index = 9)
+    private String isAboveDesignatedSize;
+
+    /**
+     * 是否高新技术企业(否,是)
+     */
+    @ApiModelProperty("是否高新技术企业(否,是)")
+    @ExcelProperty(value = "是否高新技术企业(否,是)", index = 10)
+    private String isHighTech;
+
+    /**
+     * 企业负责人
+     */
+    @ApiModelProperty("企业负责人")
+    @ExcelProperty(value = "企业负责人", index = 11)
+    private String enterpriseLeader;
+
+    /**
+     * 联系方式
+     */
+    @ApiModelProperty("联系方式")
+    @ExcelProperty(value = "联系方式", index = 12)
+    private String contactInformation;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty("创建时间")
+    @ExcelIgnore
+    private LocalDateTime createTime;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty("更新时间")
+    @ExcelIgnore
+    private LocalDateTime updateTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 18 - 0
src/main/java/com/zksy/info/mapper/EDepartmentEmployeeStatsMapper.java

@@ -0,0 +1,18 @@
+package com.zksy.info.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.info.domain.EDepartmentEmployeeStats;
+
+/**
+* @author Administrator
+* @description 针对表【e_department_employee_stats(部门员工统计表)】的数据库操作Mapper
+* @createDate 2025-07-15 13:51:48
+* @Entity com.zksy.info.domain.EDepartmentEmployeeStats
+*/
+public interface EDepartmentEmployeeStatsMapper extends BaseMapper<EDepartmentEmployeeStats> {
+
+}
+
+
+
+

+ 18 - 0
src/main/java/com/zksy/info/mapper/EEnterpriseBasicInfoMapper.java

@@ -0,0 +1,18 @@
+package com.zksy.info.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zksy.info.domain.EEnterpriseBasicInfo;
+
+/**
+* @author Administrator
+* @description 针对表【e_enterprise_basic_info(企业信息表)】的数据库操作Mapper
+* @createDate 2025-07-15 13:51:48
+* @Entity com.zksy.info.domain.EEnterpriseBasicInfo
+*/
+public interface EEnterpriseBasicInfoMapper extends BaseMapper<EEnterpriseBasicInfo> {
+
+}
+
+
+
+

+ 18 - 0
src/main/java/com/zksy/info/service/EDepartmentEmployeeStatsService.java

@@ -0,0 +1,18 @@
+package com.zksy.info.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.info.domain.EDepartmentEmployeeStats;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【e_department_employee_stats(部门员工统计表)】的数据库操作Service
+* @createDate 2025-07-15 13:51:48
+*/
+public interface EDepartmentEmployeeStatsService extends IService<EDepartmentEmployeeStats> {
+    Page<EDepartmentEmployeeStats> findByPage(long pageNum, long pageSize, String departmentName);
+    List<EDepartmentEmployeeStats> getEDepartmentEmployeeStatsList(String departmentName);
+
+}

+ 18 - 0
src/main/java/com/zksy/info/service/EEnterpriseBasicInfoService.java

@@ -0,0 +1,18 @@
+package com.zksy.info.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.zksy.info.domain.EEnterpriseBasicInfo;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【e_enterprise_basic_info(企业信息表)】的数据库操作Service
+* @createDate 2025-07-15 13:51:48
+*/
+public interface EEnterpriseBasicInfoService extends IService<EEnterpriseBasicInfo> {
+    Page<EEnterpriseBasicInfo> findByPage(long pageNum, long pageSize, String enterpriseName, String unifiedSocialCreditCode, String isAboveDesignatedSize, String isHighTech);
+    List<EEnterpriseBasicInfo> getEEnterpriseBasicInfoList(String enterpriseName, String unifiedSocialCreditCode, String isAboveDesignatedSize, String isHighTech);
+
+}

+ 42 - 0
src/main/java/com/zksy/info/service/impl/EDepartmentEmployeeStatsServiceImpl.java

@@ -0,0 +1,42 @@
+package com.zksy.info.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.info.domain.EDepartmentEmployeeStats;
+import com.zksy.info.mapper.EDepartmentEmployeeStatsMapper;
+import com.zksy.info.service.EDepartmentEmployeeStatsService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【e_department_employee_stats(部门员工统计表)】的数据库操作Service实现
+* @createDate 2025-07-15 13:51:48
+*/
+@Service
+public class EDepartmentEmployeeStatsServiceImpl extends ServiceImpl<EDepartmentEmployeeStatsMapper, EDepartmentEmployeeStats>
+    implements EDepartmentEmployeeStatsService{
+
+    @Override
+    public Page<EDepartmentEmployeeStats> findByPage(long pageNum, long pageSize, String departmentName) {
+        Page<EDepartmentEmployeeStats> page = new Page<>(pageNum,pageSize);
+        LambdaQueryWrapper<EDepartmentEmployeeStats> queryWrapper = new LambdaQueryWrapper();
+        queryWrapper.like(departmentName != null,EDepartmentEmployeeStats::getDepartmentName,departmentName);
+        Page<EDepartmentEmployeeStats> page1 = this.page(page, queryWrapper);
+        return page1;
+    }
+
+    @Override
+    public List<EDepartmentEmployeeStats> getEDepartmentEmployeeStatsList(String departmentName) {
+        LambdaQueryWrapper<EDepartmentEmployeeStats> queryWrapper = new LambdaQueryWrapper();
+        queryWrapper.like(departmentName != null,EDepartmentEmployeeStats::getDepartmentName,departmentName);
+        List<EDepartmentEmployeeStats> list = this.list(queryWrapper);
+        return list;
+    }
+}
+
+
+
+

+ 48 - 0
src/main/java/com/zksy/info/service/impl/EEnterpriseBasicInfoServiceImpl.java

@@ -0,0 +1,48 @@
+package com.zksy.info.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zksy.info.domain.EEnterpriseBasicInfo;
+import com.zksy.info.mapper.EEnterpriseBasicInfoMapper;
+import com.zksy.info.service.EEnterpriseBasicInfoService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+* @author Administrator
+* @description 针对表【e_enterprise_basic_info(企业信息表)】的数据库操作Service实现
+* @createDate 2025-07-15 13:51:48
+*/
+@Service
+public class EEnterpriseBasicInfoServiceImpl extends ServiceImpl<EEnterpriseBasicInfoMapper, EEnterpriseBasicInfo>
+    implements EEnterpriseBasicInfoService{
+
+    @Override
+    public Page<EEnterpriseBasicInfo> findByPage(long pageNum, long pageSize, String enterpriseName, String unifiedSocialCreditCode, String isAboveDesignatedSize, String isHighTech) {
+        Page<EEnterpriseBasicInfo> page = new Page<>(pageNum,pageSize);
+        LambdaQueryWrapper<EEnterpriseBasicInfo> queryWrapper = new LambdaQueryWrapper();
+        queryWrapper.like(enterpriseName != null,EEnterpriseBasicInfo::getEnterpriseName,enterpriseName);
+        queryWrapper.like(unifiedSocialCreditCode != null,EEnterpriseBasicInfo::getUnifiedSocialCreditCode,unifiedSocialCreditCode);
+        queryWrapper.like(isAboveDesignatedSize != null,EEnterpriseBasicInfo::getIsAboveDesignatedSize,isAboveDesignatedSize);
+        queryWrapper.like(isHighTech != null,EEnterpriseBasicInfo::getIsHighTech,isHighTech);
+        Page<EEnterpriseBasicInfo> page1 = this.page(page, queryWrapper);
+        return page1;
+    }
+
+    @Override
+    public List<EEnterpriseBasicInfo> getEEnterpriseBasicInfoList(String enterpriseName, String unifiedSocialCreditCode, String isAboveDesignatedSize, String isHighTech) {
+        LambdaQueryWrapper<EEnterpriseBasicInfo> queryWrapper = new LambdaQueryWrapper();
+        queryWrapper.like(enterpriseName != null,EEnterpriseBasicInfo::getEnterpriseName,enterpriseName);
+        queryWrapper.like(unifiedSocialCreditCode != null,EEnterpriseBasicInfo::getUnifiedSocialCreditCode,unifiedSocialCreditCode);
+        queryWrapper.like(isAboveDesignatedSize != null,EEnterpriseBasicInfo::getIsAboveDesignatedSize,isAboveDesignatedSize);
+        queryWrapper.like(isHighTech != null,EEnterpriseBasicInfo::getIsHighTech,isHighTech);
+        List<EEnterpriseBasicInfo> list = this.list(queryWrapper);
+        return list;
+    }
+}
+
+
+
+

+ 27 - 0
src/main/resources/mapper/info/EDepartmentEmployeeStatsMapper.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zksy.info.mapper.EDepartmentEmployeeStatsMapper">
+
+    <resultMap id="BaseResultMap" type="com.zksy.info.domain.EDepartmentEmployeeStats">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="departmentName" column="department_name" jdbcType="VARCHAR"/>
+            <result property="domesticEmployees" column="domestic_employees" jdbcType="INTEGER"/>
+            <result property="foreignEmployees" column="foreign_employees" jdbcType="INTEGER"/>
+            <result property="maleRatio" column="male_ratio" jdbcType="VARCHAR"/>
+            <result property="femaleRatio" column="female_ratio" jdbcType="VARCHAR"/>
+            <result property="educationDistribution" column="education_distribution" jdbcType="VARCHAR"/>
+            <result property="ageDistribution" column="age_distribution" jdbcType="OTHER"/>
+            <result property="totalEmployees" column="total_employees" jdbcType="INTEGER"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,department_name,domestic_employees,
+        foreign_employees,male_ratio,female_ratio,
+        education_distribution,age_distribution,total_employees,
+        create_time,update_time
+    </sql>
+</mapper>

+ 34 - 0
src/main/resources/mapper/info/EEnterpriseBasicInfoMapper.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zksy.info.mapper.EEnterpriseBasicInfoMapper">
+
+    <resultMap id="BaseResultMap" type="com.zksy.info.domain.EEnterpriseBasicInfo">
+            <id property="id" column="id" jdbcType="VARCHAR"/>
+            <result property="enterpriseName" column="enterprise_name" jdbcType="VARCHAR"/>
+            <result property="unifiedSocialCreditCode" column="unified_social_credit_code" jdbcType="VARCHAR"/>
+            <result property="registrationDate" column="registration_date" jdbcType="DATE"/>
+            <result property="outputValue" column="output_value" jdbcType="DECIMAL"/>
+            <result property="outputValueYoy" column="output_value_yoy" jdbcType="VARCHAR"/>
+            <result property="taxRevenue" column="tax_revenue" jdbcType="DECIMAL"/>
+            <result property="taxRevenueYoy" column="tax_revenue_yoy" jdbcType="VARCHAR"/>
+            <result property="revenue" column="revenue" jdbcType="DECIMAL"/>
+            <result property="revenueYoy" column="revenue_yoy" jdbcType="VARCHAR"/>
+            <result property="isAboveDesignatedSize" column="is_above_designated_size" jdbcType="VARCHAR"/>
+            <result property="isHighTech" column="is_high_tech" jdbcType="VARCHAR"/>
+            <result property="enterpriseLeader" column="enterprise_leader" jdbcType="VARCHAR"/>
+            <result property="contactInformation" column="contact_information" jdbcType="VARCHAR"/>
+            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,enterprise_name,unified_social_credit_code,
+        registration_date,output_value,output_value_yoy,
+        tax_revenue,tax_revenue_yoy,revenue,
+        revenue_yoy,is_above_designated_size,is_high_tech,
+        enterprise_leader,contact_information,create_time,
+        update_time
+    </sql>
+</mapper>

BIN=BIN
src/main/resources/templates/~$2.docx