Преглед изворни кода

新增创哥另外一个 表相关的操作接口

王苗苗 пре 23 часа
родитељ
комит
2a89ca09b5

+ 106 - 0
slibra-admin/src/main/java/com/slibra/web/controller/business/ValidateCoefController.java

@@ -0,0 +1,106 @@
+package com.slibra.web.controller.business;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.slibra.common.annotation.Log;
+import com.slibra.common.core.controller.BaseController;
+import com.slibra.common.core.domain.AjaxResult;
+import com.slibra.common.enums.BusinessType;
+import com.slibra.business.domain.ValidateCoef;
+import com.slibra.business.service.IValidateCoefService;
+import com.slibra.common.utils.poi.ExcelUtil;
+import com.slibra.common.core.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ * 
+ * @author slibra
+ * @date 2025-05-09
+ */
+@RestController
+@RequestMapping("/business/validateCoef")
+public class ValidateCoefController extends BaseController
+{
+    @Autowired
+    private IValidateCoefService validateCoefService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:coef:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(ValidateCoef validateCoef)
+    {
+        startPage();
+        List<ValidateCoef> list = validateCoefService.selectValidateCoefList(validateCoef);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出【请填写功能名称】列表
+     */
+    @PreAuthorize("@ss.hasPermi('business:coef:export')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ValidateCoef validateCoef)
+    {
+        List<ValidateCoef> list = validateCoefService.selectValidateCoefList(validateCoef);
+        ExcelUtil<ValidateCoef> util = new ExcelUtil<ValidateCoef>(ValidateCoef.class);
+        util.exportExcel(response, list, "【请填写功能名称】数据");
+    }
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('business:coef:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(validateCoefService.selectValidateCoefById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('business:coef:add')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ValidateCoef validateCoef)
+    {
+        validateCoef.setCreateBy(getUsername());
+        return toAjax(validateCoefService.insertValidateCoef(validateCoef));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('business:coef:edit')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ValidateCoef validateCoef)
+    {
+        validateCoef.setUpdateBy(getUsername());
+        return toAjax(validateCoefService.updateValidateCoef(validateCoef));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @PreAuthorize("@ss.hasPermi('business:coef:remove')")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(validateCoefService.deleteValidateCoefByIds(ids));
+    }
+}

+ 1 - 1
slibra-system/src/main/java/com/slibra/business/domain/AutoFeedback.java

@@ -47,7 +47,7 @@ public class AutoFeedback
 
     /** 反馈默认基础控制系数 */
     @Excel(name = "反馈默认基础控制系数")
-    private Long controlCoef;
+    private BigDecimal controlCoef;
 
     /** 当前所属大区间 */
     @Excel(name = "当前所属大区间")

+ 91 - 0
slibra-system/src/main/java/com/slibra/business/domain/ValidateCoef.java

@@ -0,0 +1,91 @@
+package com.slibra.business.domain;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.slibra.common.annotation.Excel;
+import com.slibra.common.core.domain.BaseEntity;
+
+import java.math.BigDecimal;
+
+/**
+ * 【请填写功能名称】对象 validate_coef
+ * 
+ * @author slibra
+ * @date 2025-05-09
+ */
+@Builder
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
+public class ValidateCoef
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 有效系数发生日期 */
+    @Excel(name = "有效系数发生日期")
+    private String validateDate;
+
+    /** 有效系数发生时间 */
+    @Excel(name = "有效系数发生时间")
+    private String validateTime;
+
+    /** 投放池字 */
+    @Excel(name = "投放池字")
+    private Long source;
+
+    /** 有效控制系数 */
+    @Excel(name = "有效控制系数")
+    private BigDecimal coef;
+
+    /** 有效档位 */
+    @Excel(name = "有效档位")
+    private Long subcate;
+
+    /** 第一组好氧池硝酸盐 */
+    @Excel(name = "第一组好氧池硝酸盐")
+    private BigDecimal hycXsy1;
+
+    /** 第二组好氧池硝酸盐 */
+    @Excel(name = "第二组好氧池硝酸盐")
+    private BigDecimal hycXsy2;
+
+    /** 第三组好氧池硝酸盐 */
+    @Excel(name = "第三组好氧池硝酸盐")
+    private BigDecimal hycXsy3;
+
+    /** 计算碳源投加总量 */
+    @Excel(name = "计算碳源投加总量")
+    private BigDecimal carbonCalculate;
+
+    /** 实际碳源投加总量 */
+    @Excel(name = "实际碳源投加总量")
+    private BigDecimal carbonReal;
+
+    /** 碳氮比 */
+    @Excel(name = "碳氮比")
+    private BigDecimal CN;
+
+    /** 进水流量 */
+    @Excel(name = "进水流量")
+    private BigDecimal waterInflow;
+
+    /** mlss */
+    @Excel(name = "mlss")
+    private BigDecimal MLSS;
+
+    /** mlvss */
+    @Excel(name = "mlvss")
+    private BigDecimal MLVSS;
+
+    /** others */
+    @Excel(name = "others")
+    private String ext;
+
+}

+ 61 - 0
slibra-system/src/main/java/com/slibra/business/mapper/ValidateCoefMapper.java

@@ -0,0 +1,61 @@
+package com.slibra.business.mapper;
+
+import java.util.List;
+import com.slibra.business.domain.ValidateCoef;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ * 
+ * @author slibra
+ * @date 2025-05-09
+ */
+public interface ValidateCoefMapper 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public ValidateCoef selectValidateCoefById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<ValidateCoef> selectValidateCoefList(ValidateCoef validateCoef);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertValidateCoef(ValidateCoef validateCoef);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateValidateCoef(ValidateCoef validateCoef);
+
+    /**
+     * 删除【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteValidateCoefById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteValidateCoefByIds(Long[] ids);
+}

+ 61 - 0
slibra-system/src/main/java/com/slibra/business/service/IValidateCoefService.java

@@ -0,0 +1,61 @@
+package com.slibra.business.service;
+
+import java.util.List;
+import com.slibra.business.domain.ValidateCoef;
+
+/**
+ * 【请填写功能名称】Service接口
+ * 
+ * @author slibra
+ * @date 2025-05-09
+ */
+public interface IValidateCoefService 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public ValidateCoef selectValidateCoefById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<ValidateCoef> selectValidateCoefList(ValidateCoef validateCoef);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertValidateCoef(ValidateCoef validateCoef);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateValidateCoef(ValidateCoef validateCoef);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteValidateCoefByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteValidateCoefById(Long id);
+}

+ 93 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/ValidateCoefServiceImpl.java

@@ -0,0 +1,93 @@
+package com.slibra.business.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.slibra.business.mapper.ValidateCoefMapper;
+import com.slibra.business.domain.ValidateCoef;
+import com.slibra.business.service.IValidateCoefService;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ * 
+ * @author slibra
+ * @date 2025-05-09
+ */
+@Service
+public class ValidateCoefServiceImpl implements IValidateCoefService 
+{
+    @Autowired
+    private ValidateCoefMapper validateCoefMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public ValidateCoef selectValidateCoefById(Long id)
+    {
+        return validateCoefMapper.selectValidateCoefById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<ValidateCoef> selectValidateCoefList(ValidateCoef validateCoef)
+    {
+        return validateCoefMapper.selectValidateCoefList(validateCoef);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertValidateCoef(ValidateCoef validateCoef)
+    {
+        return validateCoefMapper.insertValidateCoef(validateCoef);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param validateCoef 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateValidateCoef(ValidateCoef validateCoef)
+    {
+        return validateCoefMapper.updateValidateCoef(validateCoef);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteValidateCoefByIds(Long[] ids)
+    {
+        return validateCoefMapper.deleteValidateCoefByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteValidateCoefById(Long id)
+    {
+        return validateCoefMapper.deleteValidateCoefById(id);
+    }
+}

+ 131 - 0
slibra-system/src/main/resources/mapper/business/ValidateCoefMapper.xml

@@ -0,0 +1,131 @@
+<?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.slibra.business.mapper.ValidateCoefMapper">
+    
+    <resultMap type="ValidateCoef" id="ValidateCoefResult">
+        <result property="id"    column="id"    />
+        <result property="validateDate"    column="validate_date"    />
+        <result property="validateTime"    column="validate_time"    />
+        <result property="source"    column="source"    />
+        <result property="coef"    column="coef"    />
+        <result property="subcate"    column="subcate"    />
+        <result property="hycXsy1"    column="hyc_xsy1"    />
+        <result property="hycXsy2"    column="hyc_xsy2"    />
+        <result property="hycXsy3"    column="hyc_xsy3"    />
+        <result property="carbonCalculate"    column="carbon_calculate"    />
+        <result property="carbonReal"    column="carbon_real"    />
+        <result property="CN"    column="CN"    />
+        <result property="waterInflow"    column="water_inflow"    />
+        <result property="MLSS"    column="MLSS"    />
+        <result property="MLVSS"    column="MLVSS"    />
+        <result property="ext"    column="ext"    />
+    </resultMap>
+
+    <sql id="selectValidateCoefVo">
+        select id, validate_date, validate_time, source, coef, subcate, hyc_xsy1, hyc_xsy2, hyc_xsy3, carbon_calculate, carbon_real, CN, water_inflow, MLSS, MLVSS, ext from validate_coef
+    </sql>
+
+    <select id="selectValidateCoefList" parameterType="ValidateCoef" resultMap="ValidateCoefResult">
+        <include refid="selectValidateCoefVo"/>
+        <where>
+            1 = 1
+            <if test="validateDate != null  and validateDate != ''"> and validate_date = #{validateDate}</if>
+            <if test="validateTime != null  and validateTime != ''"> and validate_time = #{validateTime}</if>
+            <if test="source != null "> and source = #{source}</if>
+            <if test="coef != null "> and coef = #{coef}</if>
+            <if test="subcate != null "> and subcate = #{subcate}</if>
+            <if test="hycXsy1 != null "> and hyc_xsy1 = #{hycXsy1}</if>
+            <if test="hycXsy2 != null "> and hyc_xsy2 = #{hycXsy2}</if>
+            <if test="hycXsy3 != null "> and hyc_xsy3 = #{hycXsy3}</if>
+            <if test="carbonCalculate != null "> and carbon_calculate = #{carbonCalculate}</if>
+            <if test="carbonReal != null "> and carbon_real = #{carbonReal}</if>
+            <if test="CN != null "> and CN = #{CN}</if>
+            <if test="waterInflow != null "> and water_inflow = #{waterInflow}</if>
+            <if test="MLSS != null "> and MLSS = #{MLSS}</if>
+            <if test="MLVSS != null "> and MLVSS = #{MLVSS}</if>
+            <if test="ext != null  and ext != ''"> and ext = #{ext}</if>
+        </where>
+        and del_flag = 0 order by id desc
+    </select>
+    
+    <select id="selectValidateCoefById" parameterType="Long" resultMap="ValidateCoefResult">
+        <include refid="selectValidateCoefVo"/>
+        where id = #{id} and del_flag = 0
+    </select>
+        
+    <insert id="insertValidateCoef" parameterType="ValidateCoef" useGeneratedKeys="true" keyProperty="id">
+        insert into validate_coef
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="validateDate != null">validate_date,</if>
+            <if test="validateTime != null">validate_time,</if>
+            <if test="source != null">source,</if>
+            <if test="coef != null">coef,</if>
+            <if test="subcate != null">subcate,</if>
+            <if test="hycXsy1 != null">hyc_xsy1,</if>
+            <if test="hycXsy2 != null">hyc_xsy2,</if>
+            <if test="hycXsy3 != null">hyc_xsy3,</if>
+            <if test="carbonCalculate != null">carbon_calculate,</if>
+            <if test="carbonReal != null">carbon_real,</if>
+            <if test="CN != null">CN,</if>
+            <if test="waterInflow != null">water_inflow,</if>
+            <if test="MLSS != null">MLSS,</if>
+            <if test="MLVSS != null">MLVSS,</if>
+            <if test="ext != null">ext,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="validateDate != null">#{validateDate},</if>
+            <if test="validateTime != null">#{validateTime},</if>
+            <if test="source != null">#{source},</if>
+            <if test="coef != null">#{coef},</if>
+            <if test="subcate != null">#{subcate},</if>
+            <if test="hycXsy1 != null">#{hycXsy1},</if>
+            <if test="hycXsy2 != null">#{hycXsy2},</if>
+            <if test="hycXsy3 != null">#{hycXsy3},</if>
+            <if test="carbonCalculate != null">#{carbonCalculate},</if>
+            <if test="carbonReal != null">#{carbonReal},</if>
+            <if test="CN != null">#{CN},</if>
+            <if test="waterInflow != null">#{waterInflow},</if>
+            <if test="MLSS != null">#{MLSS},</if>
+            <if test="MLVSS != null">#{MLVSS},</if>
+            <if test="ext != null">#{ext},</if>
+         </trim>
+    </insert>
+
+    <update id="updateValidateCoef" parameterType="ValidateCoef">
+        update validate_coef
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="validateDate != null">validate_date = #{validateDate},</if>
+            <if test="validateTime != null">validate_time = #{validateTime},</if>
+            <if test="source != null">source = #{source},</if>
+            <if test="coef != null">coef = #{coef},</if>
+            <if test="subcate != null">subcate = #{subcate},</if>
+            <if test="hycXsy1 != null">hyc_xsy1 = #{hycXsy1},</if>
+            <if test="hycXsy2 != null">hyc_xsy2 = #{hycXsy2},</if>
+            <if test="hycXsy3 != null">hyc_xsy3 = #{hycXsy3},</if>
+            <if test="carbonCalculate != null">carbon_calculate = #{carbonCalculate},</if>
+            <if test="carbonReal != null">carbon_real = #{carbonReal},</if>
+            <if test="CN != null">CN = #{CN},</if>
+            <if test="waterInflow != null">water_inflow = #{waterInflow},</if>
+            <if test="MLSS != null">MLSS = #{MLSS},</if>
+            <if test="MLVSS != null">MLVSS = #{MLVSS},</if>
+            <if test="ext != null">ext = #{ext},</if>
+        </trim>
+        ,revision = revision + 1
+        where id = #{id}
+    </update>
+
+    
+
+    <delete id="deleteValidateCoefById" parameterType="Long">
+        update validate_coef set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
+    </delete>
+
+    <delete id="deleteValidateCoefByIds" parameterType="String">
+        update validate_coef set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>