Ver código fonte

1.计算调整 2.新增字段区分1池和2池自动、手动 3所有和信义有关的名称全部换成锡林浩特

王苗苗 6 meses atrás
pai
commit
d544b812e0

BIN
.DS_Store


+ 4 - 6
src/main/java/com/xlht/xlhtproject/controller/ScheduledTasks.java

@@ -1,20 +1,18 @@
 package com.xlht.xlhtproject.controller;
 
 import com.xlht.xlhtproject.domain.TTbDu;
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
 import com.xlht.xlhtproject.mapper.TShuju1Mapper;
 import com.xlht.xlhtproject.mapper.TTbDuMapper;
-import com.xlht.xlhtproject.mapper.TXinyiMedicineParamMapper;
+import com.xlht.xlhtproject.mapper.TXlhtMedicineParamMapper;
 import com.xlht.xlhtproject.utils.CalculateUtils;
 import com.xlht.xlhtproject.utils.DateUtils;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.net.telnet.TelnetClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
 import java.math.BigDecimal;
-import java.util.HashMap;
 import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 
@@ -26,7 +24,7 @@ public class ScheduledTasks {
 
 
     @Autowired
-    private TXinyiMedicineParamMapper tXinyiMedicineParamMapper;
+    private TXlhtMedicineParamMapper tXlhtMedicineParamMapper;
 
     @Autowired
     private TShuju1Mapper shuju1Mapper;
@@ -53,7 +51,7 @@ public class ScheduledTasks {
     public void addMedicine() {
         log.info("进入了定时投药的逻辑处理--开始");
         //计算一池和二池的值
-        TXinyiMedicineParam latestRecord = this.tXinyiMedicineParamMapper.getLatestRecord();
+        TXlhtMedicineParam latestRecord = this.tXlhtMedicineParamMapper.getLatestRecord();
         if(Objects.isNull(latestRecord)){
             log.error("锡林浩特定时投药处理:没有配置投药信息,无法投药");
             return;

+ 11 - 16
src/main/java/com/xlht/xlhtproject/controller/TXinyiMedicineParamController.java → src/main/java/com/xlht/xlhtproject/controller/TXlhtMedicineParamController.java

@@ -1,15 +1,12 @@
 package com.xlht.xlhtproject.controller;
 
 
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
 import com.xlht.xlhtproject.respParse.bean.AjaxResult;
-import com.xlht.xlhtproject.service.ITXinyiMedicineParamService;
+import com.xlht.xlhtproject.service.ITXlhtMedicineParamService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-
 /**
  * 智能投药参数设置Controller
  * 
@@ -18,10 +15,10 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/business/medicineParamSetting")
-public class TXinyiMedicineParamController extends BaseController
+public class TXlhtMedicineParamController extends BaseController
 {
     @Autowired
-    private ITXinyiMedicineParamService tXinyiMedicineParamService;
+    private ITXlhtMedicineParamService xlhtMedicineParamService;
 
 //    前端需要的接口
 
@@ -30,10 +27,9 @@ public class TXinyiMedicineParamController extends BaseController
      *
      */
     @PutMapping
-    public AjaxResult edit(@RequestBody TXinyiMedicineParam tXinyiMedicineParam)
+    public AjaxResult edit(@RequestBody TXlhtMedicineParam tXlhtMedicineParam)
     {
-//        tXinyiMedicineParam.setUpdateBy(getUsername());
-        return toAjax(tXinyiMedicineParamService.updateTXinyiMedicineParam(tXinyiMedicineParam));
+        return toAjax(xlhtMedicineParamService.updateTXlhtMedicineParam(tXlhtMedicineParam));
     }
 
 
@@ -44,10 +40,9 @@ public class TXinyiMedicineParamController extends BaseController
 //    @PreAuthorize("@ss.hasPermi('business:param:add')")
 //    @Log(title = "智能投药参数设置", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody TXinyiMedicineParam tXinyiMedicineParam)
+    public AjaxResult add(@RequestBody TXlhtMedicineParam tXlhtMedicineParam)
     {
-//        tXinyiMedicineParam.setCreateBy(getUsername());
-        return toAjax(tXinyiMedicineParamService.insertTXinyiMedicineParam(tXinyiMedicineParam));
+        return toAjax(xlhtMedicineParamService.insertTXlhtMedicineParam(tXlhtMedicineParam));
     }
 
 
@@ -55,9 +50,9 @@ public class TXinyiMedicineParamController extends BaseController
      * 获取智能投药参数设置详细信息的历史记录-统计使用
      */
     @GetMapping(value = "/getList")
-    public AjaxResult getList(TXinyiMedicineParam tXinyiMedicineParam)
+    public AjaxResult getList(TXlhtMedicineParam tXlhtMedicineParam)
     {
-        return success(tXinyiMedicineParamService.selectTXinyiMedicineParamList(tXinyiMedicineParam));
+        return success(xlhtMedicineParamService.selectTXlhtMedicineParamList(tXlhtMedicineParam));
     }
 
 
@@ -67,7 +62,7 @@ public class TXinyiMedicineParamController extends BaseController
     @GetMapping(value = "/getLatestRecord")
     public AjaxResult getLatestRecord()
     {
-        return success(tXinyiMedicineParamService.getLatestRecord());
+        return success(xlhtMedicineParamService.getLatestRecord());
     }
 
 

+ 7 - 9
src/main/java/com/xlht/xlhtproject/controller/TestController.java

@@ -2,23 +2,21 @@ package com.xlht.xlhtproject.controller;
 
 
 import com.alibaba.fastjson2.JSON;
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
-import com.xlht.xlhtproject.mapper.TXinyiMedicineParamMapper;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
+import com.xlht.xlhtproject.mapper.TXlhtMedicineParamMapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.Resource;
-
 @RestController
 @RequestMapping("/test")
 @Slf4j
 public class TestController {
 
     @Autowired
-    private TXinyiMedicineParamMapper xinyiMedicineParamMapper;
+    private TXlhtMedicineParamMapper xlhtMedicineParamMapper;
 
     @GetMapping("/hello")
     public String hello() {
@@ -26,10 +24,10 @@ public class TestController {
     }
 
     @GetMapping("/testMyBatis")
-    public TXinyiMedicineParam testMyBatis() {
-        TXinyiMedicineParam tXinyiMedicineParam = xinyiMedicineParamMapper.selectTXinyiMedicineParamById(1L);
-        System.out.println(JSON.toJSONString(tXinyiMedicineParam));
-        return tXinyiMedicineParam;
+    public TXlhtMedicineParam testMyBatis() {
+        TXlhtMedicineParam tXlhtMedicineParam = xlhtMedicineParamMapper.selectTXlhtMedicineParamById(1L);
+        System.out.println(JSON.toJSONString(tXlhtMedicineParam));
+        return tXlhtMedicineParam;
     }
 
 }

+ 7 - 4
src/main/java/com/xlht/xlhtproject/domain/TXinyiMedicineParam.java → src/main/java/com/xlht/xlhtproject/domain/TXlhtMedicineParam.java

@@ -11,7 +11,7 @@ import java.math.BigDecimal;
 import java.util.Date;
 
 /**
- * 智能投药参数设置对象 t_xinyi_medicine_param
+ * 智能投药参数设置对象
  * 
  * @author slibra
  * @date 2024-09-09
@@ -20,15 +20,18 @@ import java.util.Date;
 @Builder
 @NoArgsConstructor
 @AllArgsConstructor
-public class TXinyiMedicineParam
+public class TXlhtMedicineParam
 {
     private static final Long serialVersionUID = 1L;
 
     /** 主键 */
     private Long id;
 
-    /** 自动方式(0自动 1人工投放) */
-    private Integer type;
+    /** 1池自动方式(0自动 1人工投放) */
+    private Integer typeOne;
+
+    /** 2池自动方式(0自动 1人工投放) */
+    private Integer typeTwo;
 
     /** 进水流量类型1池(0手动 1仪表) */
     private Integer jsLlTypeOne;

+ 0 - 67
src/main/java/com/xlht/xlhtproject/mapper/TXinyiMedicineParamMapper.java

@@ -1,67 +0,0 @@
-package com.xlht.xlhtproject.mapper;
-
-
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-
-/**
- * 智能投药参数设置Mapper接口
- * 
- * @author slibra
- * @date 2024-09-09
- */
-@Mapper
-public interface TXinyiMedicineParamMapper 
-{
-    /**
-     * 查询智能投药参数设置
-     * 
-     * @param id 智能投药参数设置主键
-     * @return 智能投药参数设置
-     */
-    public TXinyiMedicineParam selectTXinyiMedicineParamById(Long id);
-
-    /**
-     * 查询智能投药参数设置列表
-     * 
-     * @param tXinyiMedicineParam 智能投药参数设置
-     * @return 智能投药参数设置集合
-     */
-    public List<TXinyiMedicineParam> selectTXinyiMedicineParamList(TXinyiMedicineParam tXinyiMedicineParam);
-
-    /**
-     * 新增智能投药参数设置
-     * 
-     * @param tXinyiMedicineParam 智能投药参数设置
-     * @return 结果
-     */
-    public int insertTXinyiMedicineParam(TXinyiMedicineParam tXinyiMedicineParam);
-
-    /**
-     * 修改智能投药参数设置
-     * 
-     * @param tXinyiMedicineParam 智能投药参数设置
-     * @return 结果
-     */
-    public int updateTXinyiMedicineParam(TXinyiMedicineParam tXinyiMedicineParam);
-
-    /**
-     * 删除智能投药参数设置
-     * 
-     * @param id 智能投药参数设置主键
-     * @return 结果
-     */
-    public int deleteTXinyiMedicineParamById(Long id);
-
-    /**
-     * 批量删除智能投药参数设置
-     * 
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int deleteTXinyiMedicineParamByIds(Long[] ids);
-
-    TXinyiMedicineParam getLatestRecord();
-}

+ 66 - 0
src/main/java/com/xlht/xlhtproject/mapper/TXlhtMedicineParamMapper.java

@@ -0,0 +1,66 @@
+package com.xlht.xlhtproject.mapper;
+
+
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
+
+import java.util.List;
+
+/**
+ * 锡林浩特智能投药参数配置Mapper接口
+ *
+ * @author slibra
+ * @date 2024-09-24
+ */
+public interface TXlhtMedicineParamMapper
+{
+    /**
+     * 查询锡林浩特智能投药参数配置
+     *
+     * @param id 锡林浩特智能投药参数配置主键
+     * @return 锡林浩特智能投药参数配置
+     */
+    public TXlhtMedicineParam selectTXlhtMedicineParamById(Long id);
+
+    /**
+     * 查询锡林浩特智能投药参数配置列表
+     *
+     * @param tXlhtMedicineParam 锡林浩特智能投药参数配置
+     * @return 锡林浩特智能投药参数配置集合
+     */
+    public List<TXlhtMedicineParam> selectTXlhtMedicineParamList(TXlhtMedicineParam tXlhtMedicineParam);
+
+    /**
+     * 新增锡林浩特智能投药参数配置
+     *
+     * @param tXlhtMedicineParam 锡林浩特智能投药参数配置
+     * @return 结果
+     */
+    public int insertTXlhtMedicineParam(TXlhtMedicineParam tXlhtMedicineParam);
+
+    /**
+     * 修改锡林浩特智能投药参数配置
+     *
+     * @param tXlhtMedicineParam 锡林浩特智能投药参数配置
+     * @return 结果
+     */
+    public int updateTXlhtMedicineParam(TXlhtMedicineParam tXlhtMedicineParam);
+
+    /**
+     * 删除锡林浩特智能投药参数配置
+     *
+     * @param id 锡林浩特智能投药参数配置主键
+     * @return 结果
+     */
+    public int deleteTXlhtMedicineParamById(Long id);
+
+    /**
+     * 批量删除锡林浩特智能投药参数配置
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTXlhtMedicineParamByIds(Long[] ids);
+
+
+    TXlhtMedicineParam getLatestRecord();
+}

+ 12 - 13
src/main/java/com/xlht/xlhtproject/service/ITXinyiMedicineParamService.java → src/main/java/com/xlht/xlhtproject/service/ITXlhtMedicineParamService.java

@@ -1,7 +1,7 @@
 package com.xlht.xlhtproject.service;
 
 
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
 
 import java.util.List;
 
@@ -11,7 +11,7 @@ import java.util.List;
  * @author slibra
  * @date 2024-09-09
  */
-public interface ITXinyiMedicineParamService 
+public interface ITXlhtMedicineParamService
 {
     /**
      * 查询智能投药参数设置
@@ -19,31 +19,30 @@ public interface ITXinyiMedicineParamService
      * @param id 智能投药参数设置主键
      * @return 智能投药参数设置
      */
-    public TXinyiMedicineParam selectTXinyiMedicineParamById(Long id);
+    public TXlhtMedicineParam selectTXlhtMedicineParamById(Long id);
 
     /**
      * 查询智能投药参数设置列表
-     * 
-     * @param tXinyiMedicineParam 智能投药参数设置
+     * @param tXlhtMedicineParam 智能投药参数设置
      * @return 智能投药参数设置集合
      */
-    public List<TXinyiMedicineParam> selectTXinyiMedicineParamList(TXinyiMedicineParam tXinyiMedicineParam);
+    public List<TXlhtMedicineParam> selectTXlhtMedicineParamList(TXlhtMedicineParam tXlhtMedicineParam);
 
     /**
      * 新增智能投药参数设置
      * 
-     * @param tXinyiMedicineParam 智能投药参数设置
+     * @param tXlhtMedicineParam 智能投药参数设置
      * @return 结果
      */
-    public int insertTXinyiMedicineParam(TXinyiMedicineParam tXinyiMedicineParam);
+    public int insertTXlhtMedicineParam(TXlhtMedicineParam tXlhtMedicineParam);
 
     /**
      * 修改智能投药参数设置
      * 
-     * @param tXinyiMedicineParam 智能投药参数设置
+     * @param tXlhtMedicineParam 智能投药参数设置
      * @return 结果
      */
-    public int updateTXinyiMedicineParam(TXinyiMedicineParam tXinyiMedicineParam);
+    public int updateTXlhtMedicineParam(TXlhtMedicineParam tXlhtMedicineParam);
 
     /**
      * 批量删除智能投药参数设置
@@ -51,7 +50,7 @@ public interface ITXinyiMedicineParamService
      * @param ids 需要删除的智能投药参数设置主键集合
      * @return 结果
      */
-    public int deleteTXinyiMedicineParamByIds(Long[] ids);
+    public int deleteTXlhtMedicineParamByIds(Long[] ids);
 
     /**
      * 删除智能投药参数设置信息
@@ -59,7 +58,7 @@ public interface ITXinyiMedicineParamService
      * @param id 智能投药参数设置主键
      * @return 结果
      */
-    public int deleteTXinyiMedicineParamById(Long id);
+    public int deleteTXlhtMedicineParamById(Long id);
 
-    TXinyiMedicineParam getLatestRecord();
+    TXlhtMedicineParam getLatestRecord();
 }

+ 25 - 26
src/main/java/com/xlht/xlhtproject/service/impl/TXinyiMedicineParamServiceImpl.java → src/main/java/com/xlht/xlhtproject/service/impl/TXlhtMedicineParamServiceImpl.java

@@ -3,15 +3,14 @@ package com.xlht.xlhtproject.service.impl;
 
 import com.xlht.xlhtproject.domain.SmartAdd;
 import com.xlht.xlhtproject.domain.TTbDu;
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
 import com.xlht.xlhtproject.mapper.TShuju1Mapper;
 import com.xlht.xlhtproject.mapper.TTbDuMapper;
-import com.xlht.xlhtproject.mapper.TXinyiMedicineParamMapper;
-import com.xlht.xlhtproject.service.ITXinyiMedicineParamService;
+import com.xlht.xlhtproject.mapper.TXlhtMedicineParamMapper;
+import com.xlht.xlhtproject.service.ITXlhtMedicineParamService;
 import com.xlht.xlhtproject.utils.CalculateUtils;
 import com.xlht.xlhtproject.utils.DateUtils;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.annotations.Mapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -30,10 +29,10 @@ import static com.xlht.xlhtproject.enums.MyConstants.LONG_1;
  */
 @Slf4j
 @Service
-public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamService
+public class TXlhtMedicineParamServiceImpl implements ITXlhtMedicineParamService
 {
     @Autowired
-    private TXinyiMedicineParamMapper tXinyiMedicineParamMapper;
+    private TXlhtMedicineParamMapper tXlhtMedicineParamMapper;
 
     @Autowired
     private TShuju1Mapper shuju1Mapper;
@@ -52,47 +51,47 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
      * @return 智能投药参数设置
      */
     @Override
-    public TXinyiMedicineParam selectTXinyiMedicineParamById(Long id)
+    public TXlhtMedicineParam selectTXlhtMedicineParamById(Long id)
     {
-        return tXinyiMedicineParamMapper.selectTXinyiMedicineParamById(id);
+        return tXlhtMedicineParamMapper.selectTXlhtMedicineParamById(id);
     }
 
     /**
      * 查询智能投药参数设置列表
      * 
-     * @param tXinyiMedicineParam 智能投药参数设置
+     * @param tXlhtMedicineParam 智能投药参数设置
      * @return 智能投药参数设置
      */
     @Override
-    public List<TXinyiMedicineParam> selectTXinyiMedicineParamList(TXinyiMedicineParam tXinyiMedicineParam)
+    public List<TXlhtMedicineParam> selectTXlhtMedicineParamList(TXlhtMedicineParam tXlhtMedicineParam)
     {
-        return tXinyiMedicineParamMapper.selectTXinyiMedicineParamList(tXinyiMedicineParam);
+        return tXlhtMedicineParamMapper.selectTXlhtMedicineParamList(tXlhtMedicineParam);
     }
 
     /**
      * 新增智能投药参数设置
      * 
-     * @param tXinyiMedicineParam 智能投药参数设置
+     * @param tXlhtMedicineParam 智能投药参数设置
      * @return 结果
      */
     @Override
-    public int insertTXinyiMedicineParam(TXinyiMedicineParam tXinyiMedicineParam)
+    public int insertTXlhtMedicineParam(TXlhtMedicineParam tXlhtMedicineParam)
     {
-        tXinyiMedicineParam.setCreateTime(DateUtils.getNowDate());
-        return tXinyiMedicineParamMapper.insertTXinyiMedicineParam(tXinyiMedicineParam);
+        tXlhtMedicineParam.setCreateTime(DateUtils.getNowDate());
+        return tXlhtMedicineParamMapper.insertTXlhtMedicineParam(tXlhtMedicineParam);
     }
 
     /**
      * 修改智能投药参数设置
      * 
-     * @param tXinyiMedicineParam 智能投药参数设置
+     * @param tXlhtMedicineParam 智能投药参数设置
      * @return 结果
      */
     @Override
-    public int updateTXinyiMedicineParam(TXinyiMedicineParam tXinyiMedicineParam)
+    public int updateTXlhtMedicineParam(TXlhtMedicineParam tXlhtMedicineParam)
     {
-        tXinyiMedicineParam.setUpdateTime(DateUtils.getNowDate());
-        return tXinyiMedicineParamMapper.updateTXinyiMedicineParam(tXinyiMedicineParam);
+        tXlhtMedicineParam.setUpdateTime(DateUtils.getNowDate());
+        return tXlhtMedicineParamMapper.updateTXlhtMedicineParam(tXlhtMedicineParam);
     }
 
     /**
@@ -102,9 +101,9 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
      * @return 结果
      */
     @Override
-    public int deleteTXinyiMedicineParamByIds(Long[] ids)
+    public int deleteTXlhtMedicineParamByIds(Long[] ids)
     {
-        return tXinyiMedicineParamMapper.deleteTXinyiMedicineParamByIds(ids);
+        return tXlhtMedicineParamMapper.deleteTXlhtMedicineParamByIds(ids);
     }
 
     /**
@@ -114,21 +113,21 @@ public class TXinyiMedicineParamServiceImpl implements ITXinyiMedicineParamServi
      * @return 结果
      */
     @Override
-    public int deleteTXinyiMedicineParamById(Long id)
+    public int deleteTXlhtMedicineParamById(Long id)
     {
-        return tXinyiMedicineParamMapper.deleteTXinyiMedicineParamById(id);
+        return tXlhtMedicineParamMapper.deleteTXlhtMedicineParamById(id);
     }
 
     @Override
-    public TXinyiMedicineParam getLatestRecord() {
-        TXinyiMedicineParam latestRecord = this.tXinyiMedicineParamMapper.getLatestRecord();
+    public TXlhtMedicineParam getLatestRecord() {
+        TXlhtMedicineParam latestRecord = this.tXlhtMedicineParamMapper.getLatestRecord();
         if(!Objects.isNull(latestRecord)){
             this.addExtra(latestRecord);
         }
         return latestRecord;
     }
 
-    private void addExtra(TXinyiMedicineParam latestRecord) {
+    private void addExtra(TXlhtMedicineParam latestRecord) {
         //2024年09月20日13:42:18  有可能用户选择的是仪表或者化验,需要获取实时数据
         //获取最新的实时数据
         SmartAdd smartAdd = this.shuju1Mapper.getNewestData();

+ 34 - 13
src/main/java/com/xlht/xlhtproject/utils/CalculateUtils.java

@@ -1,8 +1,10 @@
 package com.xlht.xlhtproject.utils;
 
 import com.xlht.xlhtproject.domain.SmartAdd;
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
 import com.xlht.xlhtproject.mapper.TShuju1Mapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
@@ -15,10 +17,11 @@ import static com.xlht.xlhtproject.enums.MyConstants.*;
 @Component
 public class CalculateUtils {
 
+    private static final Logger log = LoggerFactory.getLogger(CalculateUtils.class);
     @Autowired
     private TShuju1Mapper shuju1Mapper;
 
-    public BigDecimal calculateMedicineByLastRecord(TXinyiMedicineParam param, int type) {
+    public BigDecimal calculateMedicineByLastRecord(TXlhtMedicineParam param, int whichCZ) {
         if (Objects.isNull(param)) {
             return null;
         }
@@ -80,23 +83,47 @@ public class CalculateUtils {
         BigDecimal sxpsTwo = param.getSxpsTwo();
 
         //计算
-        if(!Objects.isNull(type)) {
-            if(3 == type){
+        /*if(!Objects.isNull(whichCZ)) {
+            if(3 == whichCZ){
                 return medicineAmountOne;
             }
             //2024年09月19日11:30:06 锡林浩特,碳源投放是1池和2池分开投放的
             //计算1号池的值
             //计算二号池的值
             //判断,返回值
-            if(0 == type)//锡林浩特没有这个逻辑,连个池子是分开的
+            if(0 == whichCZ)//锡林浩特没有这个逻辑,连个池子是分开的
                 return null;
-            else if(1 == type) {
+            else if(1 == whichCZ) {
                 return getResultByDiff(hycXsyTypeOne, hycXsyOne, htfksdOne, qycAdTypeOne, qycAdOne, qycYxyTypeOne, qycYxyOne, xzxsOne, jzxsOne, jsLlTypeOne, jsLlOne, slfpxsOne, kzxsOne, jsCodTypeOne, jsCodOne, zhxsOne, tydlOne, "one", yymdOne, sxpsOne);
-            }else if(2 == type)
+            }else if(2 == whichCZ)
                 return getResultByDiff(hycXsyTypeTwo, hycXsyTwo, htfksdTwo, qycAdTypeTwo, qycAdTwo, qycYxyTypeTwo, qycYxyTwo, xzxsTwo, jzxsTwo, jsLlTypeTwo, jsLlTwo, slfpxsTwo, kzxsTwo, jsCodTypeTwo, jsCodTwo, zhxsTwo, tydlTwo, "two", yymdTwo, sxpsTwo);
             else {
                 return null;//错误的配置
             }
+        }*/
+        //2024年09月24日14:35:32 先判断是哪个池子 再判断是否是手动
+        Integer typeOne = param.getTypeOne();
+        if(Objects.isNull(typeOne)) {
+            typeOne = 0;
+        }
+        Integer typeTwo = param.getTypeTwo();
+        if(Objects.isNull(typeTwo)) {
+            typeTwo = 0;
+        }
+        if(1 == whichCZ) {
+            if(typeOne == 1){//人工
+                return param.getMedicineAmountOne();
+            }else {//自动
+                return getResultByDiff(hycXsyTypeOne, hycXsyOne, htfksdOne, qycAdTypeOne, qycAdOne, qycYxyTypeOne, qycYxyOne, xzxsOne, jzxsOne, jsLlTypeOne, jsLlOne, slfpxsOne, kzxsOne, jsCodTypeOne, jsCodOne, zhxsOne, tydlOne, "one", yymdOne, sxpsOne);
+            }
+        }else if(2 == whichCZ) {
+            if(typeTwo == 1){//人工
+                return param.getMedicineAmountTwo();
+            }else {//自动
+                return getResultByDiff(hycXsyTypeTwo, hycXsyTwo, htfksdTwo, qycAdTypeTwo, qycAdTwo, qycYxyTypeTwo, qycYxyTwo, xzxsTwo, jzxsTwo, jsLlTypeTwo, jsLlTwo, slfpxsTwo, kzxsTwo, jsCodTypeTwo, jsCodTwo, zhxsTwo, tydlTwo, "two", yymdTwo, sxpsTwo);
+            }
+        }else {
+            log.error("不支持的类型××××××");
         }
         return null;
     }
@@ -200,10 +227,4 @@ public class CalculateUtils {
     }
 
 
-    /*public static void main(String[] args) {
-        TXinyiMedicineParam tXinyiMedicineParam = new TXinyiMedicineParam();
-        tXinyiMedicineParam.setYymd(BigDecimal_2);
-        tXinyiMedicineParam.setTydl(BigDecimal_2);
-        System.out.println(calculateMedicineByLastRecord(tXinyiMedicineParam, 1));
-    }*/
 }

+ 32 - 20
src/main/resources/mapper/TXinyiMedicineParamMapper.xml

@@ -1,12 +1,13 @@
 <?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.xlht.xlhtproject.mapper.TXinyiMedicineParamMapper">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.xlht.xlhtproject.mapper.TXlhtMedicineParamMapper">
 
-    <resultMap type="TXinyiMedicineParam" id="TXinyiMedicineParamResult">
+    <resultMap type="TXlhtMedicineParam" id="TXlhtMedicineParamResult">
         <result property="id"    column="id"    />
-        <result property="type"    column="type"    />
+        <result property="typeOne"    column="type_one"    />
+        <result property="typeTwo"    column="type_two"    />
         <result property="jsLlTypeOne"    column="js_ll_type_one"    />
         <result property="jsLlOne"    column="js_ll_one"    />
         <result property="jsLlTypeTwo"    column="js_ll_type_two"    />
@@ -64,19 +65,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="remark"    column="remark"    />
     </resultMap>
 
-    <sql id="selectTXinyiMedicineParamVo">
-        select id, type, js_ll_type_one, js_ll_one, js_ll_type_two, js_ll_two, js_cod_type_one, js_cod_one, js_cod_type_two, js_cod_two, hyc_xsy_type_one, hyc_xsy_one, hyc_xsy_type_two, hyc_xsy_two, qyc_yxy_type_one, qyc_yxy_one, qyc_yxy_type_two, qyc_yxy_two, qyc_ad_type_one, qyc_ad_one, qyc_ad_type_two, qyc_ad_two, js_tn_type_one, js_tn_one, js_tn_type_two, js_tn_two, htfksd_one, htfksd_two, jzxs_one, jzxs_two, xzxs_one, xzxs_two, kzxs_one, kzxs_two, slfpxs_one, slfpxs_two, tydl_one, tydl_two, zhxs_one, zhxs_two, sxps_one, sxps_two, yymd_one, yymd_two, zxqdll_one, zxqdll_two, medicine_amount_one, medicine_amount_two, tdb_one, tdb_two, revision, del_flag, create_by, create_time, update_by, update_time, remark from t_xlht_medicine_param
+    <sql id="selectTXlhtMedicineParamVo">
+        select id, type_one, type_two, js_ll_type_one, js_ll_one, js_ll_type_two, js_ll_two, js_cod_type_one, js_cod_one, js_cod_type_two, js_cod_two, hyc_xsy_type_one, hyc_xsy_one, hyc_xsy_type_two, hyc_xsy_two, qyc_yxy_type_one, qyc_yxy_one, qyc_yxy_type_two, qyc_yxy_two, qyc_ad_type_one, qyc_ad_one, qyc_ad_type_two, qyc_ad_two, js_tn_type_one, js_tn_one, js_tn_type_two, js_tn_two, htfksd_one, htfksd_two, jzxs_one, jzxs_two, xzxs_one, xzxs_two, kzxs_one, kzxs_two, slfpxs_one, slfpxs_two, tydl_one, tydl_two, zhxs_one, zhxs_two, sxps_one, sxps_two, yymd_one, yymd_two, zxqdll_one, zxqdll_two, medicine_amount_one, medicine_amount_two, tdb_one, tdb_two, revision, del_flag, create_by, create_time, update_by, update_time, remark from t_xlht_medicine_param
     </sql>
 
-    <select id="selectTXinyiMedicineParamById" parameterType="Long" resultMap="TXinyiMedicineParamResult">
-        <include refid="selectTXinyiMedicineParamVo"/>
+    <select id="selectTXlhtMedicineParamById" parameterType="Long" resultMap="TXlhtMedicineParamResult">
+        <include refid="selectTXlhtMedicineParamVo"/>
         where id = #{id} and del_flag = 0
     </select>
 
-    <insert id="insertTXinyiMedicineParam" parameterType="TXinyiMedicineParam" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertTXlhtMedicineParam" parameterType="TXlhtMedicineParam" useGeneratedKeys="true" keyProperty="id">
         insert into t_xlht_medicine_param
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="type != null">type,</if>
+            <if test="typeOne != null">type_one,</if>
+            <if test="typeTwo != null">type_two,</if>
             <if test="jsLlTypeOne != null">js_ll_type_one,</if>
             <if test="jsLlOne != null">js_ll_one,</if>
             <if test="jsLlTypeTwo != null">js_ll_type_two,</if>
@@ -134,7 +136,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remark != null">remark,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="type != null">#{type},</if>
+            <if test="typeOne != null">#{typeOne},</if>
+            <if test="typeTwo != null">#{typeTwo},</if>
             <if test="jsLlTypeOne != null">#{jsLlTypeOne},</if>
             <if test="jsLlOne != null">#{jsLlOne},</if>
             <if test="jsLlTypeTwo != null">#{jsLlTypeTwo},</if>
@@ -193,10 +196,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </trim>
     </insert>
 
-    <update id="updateTXinyiMedicineParam" parameterType="TXinyiMedicineParam">
+    <update id="updateTXlhtMedicineParam" parameterType="TXlhtMedicineParam">
         update t_xlht_medicine_param
         <trim prefix="SET" suffixOverrides=",">
-            <if test="type != null">type = #{type},</if>
+            <if test="typeOne != null">type_one = #{typeOne},</if>
+            <if test="typeTwo != null">type_two = #{typeTwo},</if>
             <if test="jsLlTypeOne != null">js_ll_type_one = #{jsLlTypeOne},</if>
             <if test="jsLlOne != null">js_ll_one = #{jsLlOne},</if>
             <if test="jsLlTypeTwo != null">js_ll_type_two = #{jsLlTypeTwo},</if>
@@ -259,19 +263,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
 
-    <delete id="deleteTXinyiMedicineParamById" parameterType="Long">
+    <delete id="deleteTXlhtMedicineParamById" parameterType="Long">
         update t_xlht_medicine_param set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
     </delete>
 
-    <delete id="deleteTXinyiMedicineParamByIds" parameterType="String">
+    <delete id="deleteTXlhtMedicineParamByIds" parameterType="String">
         update t_xlht_medicine_param 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>
 
+
     <!-- 下面是新增的SQL,不要覆盖 -->
-    <select id="getLatestRecord" resultMap="TXinyiMedicineParamResult">
+    <select id="getLatestRecord" resultMap="TXlhtMedicineParamResult">
         SELECT TOP
             1 *
         FROM
@@ -280,11 +285,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
 
-    <select id="selectTXinyiMedicineParamList" parameterType="TXinyiMedicineParam" resultMap="TXinyiMedicineParamResult">
-        <include refid="selectTXinyiMedicineParamVo"/>
+    <select id="selectTXlhtMedicineParamList" parameterType="TXlhtMedicineParam" resultMap="TXlhtMedicineParamResult">
+        <include refid="selectTXlhtMedicineParamVo"/>
         <where>
             1 = 1
-            <if test="type != null "> and type = #{type}</if>
+            <if test="typeOne != null "> and type_one = #{typeOne}</if>
+            <if test="typeTwo != null "> and type_two = #{typeTwo}</if>
             <if test="jsLlTypeOne != null "> and js_ll_type_one = #{jsLlTypeOne}</if>
             <if test="jsLlOne != null "> and js_ll_one = #{jsLlOne}</if>
             <if test="jsLlTypeTwo != null "> and js_ll_type_two = #{jsLlTypeTwo}</if>
@@ -334,6 +340,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="tdbOne != null "> and tdb_one = #{tdbOne}</if>
             <if test="tdbTwo != null "> and tdb_two = #{tdbTwo}</if>
             <if test="revision != null "> and revision = #{revision}</if>
+            <!-- 下面是新增的SQL检索条件  SqlServer写法-->
+            <if test="timeBegin != null  and timeBegin != ''"> and SUBSTRING (CONVERT ( VARCHAR, create_time, 120 ), 1, 10 ) &gt;= #{timeBegin}</if>
+            <if test="timeEnd != null  and timeEnd != ''"> and SUBSTRING (CONVERT ( VARCHAR, create_time, 120 ), 1, 10 ) &lt;= #{timeEnd}</if>
+            <!-- 下面是新增的SQL检索条件  MySQL写法-->
+            <!--<if test="timeBegin != null  and timeBegin != ''"> and DATE_FORMAT(create_time, '%Y-%m-%d') &gt;= #{timeBegin}</if>
+            <if test="timeEnd != null  and timeEnd != ''"> DATE_FORMAT(create_time, '%Y-%m-%d') &lt;= #{timeEnd}</if>-->
         </where>
         and del_flag = 0 order by id desc
     </select>

+ 6 - 9
src/test/java/com/xlht/xlhtproject/XlhtProjectApplicationTests.java

@@ -1,10 +1,9 @@
 package com.xlht.xlhtproject;
 
 import com.alibaba.fastjson2.JSON;
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
-import com.xlht.xlhtproject.mapper.TXinyiMedicineParamMapper;
-import com.xlht.xlhtproject.service.ITXinyiMedicineParamService;
-import org.apache.tomcat.Jar;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
+import com.xlht.xlhtproject.mapper.TXlhtMedicineParamMapper;
+import com.xlht.xlhtproject.service.ITXlhtMedicineParamService;
 import org.junit.jupiter.api.Test;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
@@ -16,17 +15,15 @@ class XlhtProjectApplicationTests {
     void contextLoads() {
     }
 
-    @Autowired
-    private ITXinyiMedicineParamService itXinyiMedicineParamService;
 
     @Autowired
-    private TXinyiMedicineParamMapper xinyiMedicineParamMapper;
+    private TXlhtMedicineParamMapper xlhtMedicineParamMapper;
 
 
     @Test
     public void testMyBatis(){
-        TXinyiMedicineParam tXinyiMedicineParam = xinyiMedicineParamMapper.selectTXinyiMedicineParamById(1L);
-        System.out.println(JSON.toJSONString(tXinyiMedicineParam));
+        TXlhtMedicineParam tXlhtMedicineParam = xlhtMedicineParamMapper.selectTXlhtMedicineParamById(1L);
+        System.out.println(JSON.toJSONString(tXlhtMedicineParam));
     }
 
 }

+ 6 - 8
src/test/java/com/xlht/xlhtproject/test/Test.java

@@ -2,9 +2,9 @@ package com.xlht.xlhtproject.test;
 
 
 import com.alibaba.fastjson2.JSON;
-import com.xlht.xlhtproject.domain.TXinyiMedicineParam;
-import com.xlht.xlhtproject.mapper.TXinyiMedicineParamMapper;
-import com.xlht.xlhtproject.service.ITXinyiMedicineParamService;
+import com.xlht.xlhtproject.domain.TXlhtMedicineParam;
+import com.xlht.xlhtproject.mapper.TXlhtMedicineParamMapper;
+import com.xlht.xlhtproject.service.ITXlhtMedicineParamService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 
@@ -12,16 +12,14 @@ import org.springframework.boot.test.context.SpringBootTest;
 public class Test {
 
 
-    @Autowired
-    private ITXinyiMedicineParamService itXinyiMedicineParamService;
 
     @Autowired
-    private TXinyiMedicineParamMapper xinyiMedicineParamMapper;
+    private TXlhtMedicineParamMapper xlhtMedicineParamMapper;
 
 
     @org.junit.jupiter.api.Test
     public void testMyBatis(){
-        TXinyiMedicineParam tXinyiMedicineParam = xinyiMedicineParamMapper.selectTXinyiMedicineParamById(1L);
-        System.out.println(JSON.toJSONString(tXinyiMedicineParam));
+        TXlhtMedicineParam tXlhtMedicineParam = xlhtMedicineParamMapper.selectTXlhtMedicineParamById(1L);
+        System.out.println(JSON.toJSONString(tXlhtMedicineParam));
     }
 }