Browse Source

Merge branch 'saas' of http://git.dayaedu.com/yonge/mec into saas

yonge 2 years ago
parent
commit
405db0fd83

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/HumanCostDao.java

@@ -0,0 +1,20 @@
+package com.ym.mec.biz.dal.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ym.mec.biz.dal.entity.HumanCost;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 人力资源成本(HumanCost)表数据库访问层
+ *
+ * @author zx
+ * @since 2023-04-17 15:31:30
+ */
+public interface HumanCostDao extends BaseMapper<HumanCost> {
+
+   int insertBatch(@Param("entities") List<HumanCost> entities);
+   
+}
+

+ 120 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/HumanCost.java

@@ -0,0 +1,120 @@
+package com.ym.mec.biz.dal.entity;
+
+
+import java.math.BigDecimal;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+
+import java.io.Serializable;
+
+/**
+ * 人力资源成本(HumanCost)表实体类
+ *
+ * @author zx
+ * @since 2023-04-17 15:31:31
+ */
+@ApiModel(value = "human_cost-人力资源成本")
+public class HumanCost implements Serializable {
+  @TableField("id_")
+     @ApiModelProperty(value = "${column.comment}")
+    private Integer id;
+    
+  @TableField("organ_id_")
+     @ApiModelProperty(value = "分部")
+    private Integer organId;
+    
+  @TableField("organ_name_")
+     @ApiModelProperty(value = "分部")
+    private String organName;
+    
+  @TableField("fixed_cost_")
+     @ApiModelProperty(value = "固定成本")
+    private BigDecimal fixedCost;
+    
+  @TableField("change_cost_")
+     @ApiModelProperty(value = "变动成本")
+    private BigDecimal changeCost;
+    
+  @TableField("month_")
+     @ApiModelProperty(value = "月份")
+    private String month;
+    
+  @TableField("create_time_")
+     @ApiModelProperty(value = "${column.comment}")
+    private Date createTime;
+    
+  @TableField("update_time_")
+     @ApiModelProperty(value = "${column.comment}")
+    private Date updateTime;
+    
+    
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getOrganId() {
+        return organId;
+    }
+
+    public void setOrganId(Integer organId) {
+        this.organId = organId;
+    }
+
+    public String getOrganName() {
+        return organName;
+    }
+
+    public void setOrganName(String organName) {
+        this.organName = organName;
+    }
+
+    public BigDecimal getFixedCost() {
+        return fixedCost;
+    }
+
+    public void setFixedCost(BigDecimal fixedCost) {
+        this.fixedCost = fixedCost;
+    }
+
+    public BigDecimal getChangeCost() {
+        return changeCost;
+    }
+
+    public void setChangeCost(BigDecimal changeCost) {
+        this.changeCost = changeCost;
+    }
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+}
+

+ 17 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/HumanCostService.java

@@ -0,0 +1,17 @@
+package com.ym.mec.biz.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ym.mec.biz.dal.dao.HumanCostDao;
+import com.ym.mec.biz.dal.entity.HumanCost;
+
+/**
+ * 人力资源成本(HumanCost)表服务接口
+ *
+ * @author zx
+ * @since 2023-04-17 15:31:32
+ */
+public interface HumanCostService extends IService<HumanCost> {
+
+    HumanCostDao getDao();
+}
+

+ 29 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/HumanCostServiceImpl.java

@@ -0,0 +1,29 @@
+package com.ym.mec.biz.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ym.mec.biz.dal.dao.HumanCostDao;
+import com.ym.mec.biz.dal.entity.HumanCost;
+import com.ym.mec.biz.service.HumanCostService;
+import org.springframework.stereotype.Service;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * 人力资源成本(HumanCost)表服务实现类
+ *
+ * @author zx
+ * @since 2023-04-17 15:31:32
+ */
+@Service("humanCostService")
+public class HumanCostServiceImpl extends ServiceImpl<HumanCostDao, HumanCost> implements HumanCostService {
+
+    private final static Logger log = LoggerFactory.getLogger(HumanCostServiceImpl.class);
+
+    @Override
+    public HumanCostDao getDao(){
+            return this.baseMapper;
+    }
+
+}
+

+ 28 - 0
mec-biz/src/main/resources/config/mybatis/HumanCostMapper.xml

@@ -0,0 +1,28 @@
+<?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.ym.mec.biz.dal.dao.HumanCostDao">
+  <resultMap id="BaseResultMap" type="com.ym.mec.biz.dal.entity.HumanCost">
+                         <result column="id_" jdbcType="INTEGER" property="id"/>
+                                  <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
+                                  <result column="organ_name_" jdbcType="VARCHAR" property="organName"/>
+                                  <result column="fixed_cost_" jdbcType="VARCHAR" property="fixedCost"/>
+                                  <result column="change_cost_" jdbcType="VARCHAR" property="changeCost"/>
+                                  <result column="month_" jdbcType="VARCHAR" property="month"/>
+                                  <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
+                                  <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
+                </resultMap>
+  
+  <sql id="Base_Column_List">    
+                                            id_, organ_id_, organ_name_, fixed_cost_, change_cost_, month_, create_time_, update_time_
+  </sql>
+  
+   <insert id="insertBatch" keyColumn="" keyProperty="" useGeneratedKeys="true"
+            parameterType="com.ym.mec.biz.dal.entity.HumanCost">
+       insert into human_cost(id_, organ_id_, organ_name_, fixed_cost_, change_cost_, month_, create_time_, update_time_)
+       values
+       <foreach collection="entities" item="entity" separator=",">
+       (#{entity.id}, #{entity.organId}, #{entity.organName}, #{entity.fixedCost}, #{entity.changeCost}, #{entity.month}, #{entity.createTime}, #{entity.updateTime})
+       </foreach>
+   </insert>
+
+</mapper>

+ 29 - 0
mec-web/src/main/java/com/ym/mec/web/controller/HumanCostController.java

@@ -0,0 +1,29 @@
+package com.ym.mec.web.controller;
+
+
+import com.ym.mec.biz.service.HumanCostService;
+import com.ym.mec.common.controller.BaseController;
+import io.swagger.annotations.Api;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+
+/**
+ * 人力资源成本(HumanCost)表控制层
+ *
+ * @author zx
+ * @since 2023-04-17 15:31:26
+ */
+@Api(tags = "人力资源成本")
+@RestController
+@RequestMapping("/humanCost")
+public class HumanCostController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private HumanCostService humanCostService;
+
+}
+