Jelajahi Sumber

手动处理报警数据的时候 按照时间升序处理报警

王苗苗 4 hari lalu
induk
melakukan
af83e393ab

+ 2 - 2
slibra-admin/src/main/java/com/slibra/web/controller/business/HandleDataController.java

@@ -2256,7 +2256,7 @@ public class HandleDataController extends BaseController
             throw new RuntimeException("未查询到配置信息");
         TXinyiNormConfig normConfig = tXinyiNormConfigs.get(0);
         //查询最近N天的数据,遍历,处理报警信息
-        List<TXinyiIndustry> tXinyiIndustries = this.xinyiIndustryMapper.selectTXinyiIndustryList(TXinyiIndustry.builder().timeBegin(dateBegin).timeEnd(dateEnd).build());
+        List<TXinyiIndustry> tXinyiIndustries = this.xinyiIndustryMapper.selectTXinyiIndustryListNew(TXinyiIndustry.builder().timeBegin(dateBegin).timeEnd(dateEnd).build());
         if(!CollectionUtils.isEmpty(tXinyiIndustries)){
             for (TXinyiIndustry tXinyiIndustry : tXinyiIndustries) {
 //                asyncTask.handleSZWarningNew(tXinyiIndustry, normConfig);
@@ -3365,7 +3365,7 @@ public class HandleDataController extends BaseController
     @PostMapping("/robotWarningNewByDate")
     public String robotWarningNewByDate(String dateBegin, String dateEnd){
         log.info("进入了 手动处理化验室报警-新的逻辑 并且需要传入起止时间 操作");
-        List<TXinyiRobot> tXinyiRobots = this.xinyiRobotMapper.selectTXinyiRobotList(TXinyiRobot.builder().timeBegin(dateBegin).timeEnd(dateEnd).build());
+        List<TXinyiRobot> tXinyiRobots = this.xinyiRobotMapper.selectTXinyiRobotListNew(TXinyiRobot.builder().timeBegin(dateBegin).timeEnd(dateEnd).build());
         if(!CollectionUtils.isEmpty(tXinyiRobots)){
             for (TXinyiRobot tXinyiRobot : tXinyiRobots) {
                 asyncTask.handleRobotWarningNew(tXinyiRobot);

+ 2 - 0
slibra-system/src/main/java/com/slibra/business/mapper/TXinyiIndustryMapper.java

@@ -121,4 +121,6 @@ public interface TXinyiIndustryMapper
     BigDecimal getAvgJSNh3ByDate(@Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd);
 
     List<MedicineChart> smartAddCharListNew(@Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd);
+
+    List<TXinyiIndustry> selectTXinyiIndustryListNew(TXinyiIndustry build);
 }

+ 1 - 0
slibra-system/src/main/java/com/slibra/business/mapper/TXinyiRobotMapper.java

@@ -99,4 +99,5 @@ public interface TXinyiRobotMapper
 
     BigDecimal getAvgQyNh32ByDate(@Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd);
 
+    List<TXinyiRobot> selectTXinyiRobotListNew(TXinyiRobot build);
 }

+ 68 - 0
slibra-system/src/main/resources/mapper/business/TXinyiIndustryMapper.xml

@@ -842,4 +842,72 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND #{dateEnd}
         ORDER BY a.id ASC
     </select>
+
+
+
+    <select id="selectTXinyiIndustryListNew" parameterType="TXinyiIndustry" resultMap="TXinyiIndustryResult">
+        <include refid="selectTXinyiIndustryVo"/>
+        <where>
+            <if test="testDate != null  and testDate != ''"> and TEST_DATE = #{testDate}</if>
+            <if test="testHour != null  and testHour != ''"> and TEST_HOUR = #{testHour}</if>
+            <if test="testTime != null  and testTime != ''"> and TEST_TIME = #{testTime}</if>
+            <if test="jsCod != null "> and JS_COD = #{jsCod}</if>
+            <if test="jsPh != null "> and JS_PH = #{jsPh}</if>
+            <if test="jsSs != null "> and JS_SS = #{jsSs}</if>
+            <if test="jsTp != null "> and JS_TP = #{jsTp}</if>
+            <if test="jsTn != null "> and JS_TN = #{jsTn}</if>
+            <if test="jsNh3 != null "> and JS_NH3 = #{jsNh3}</if>
+            <if test="jsSwPh != null "> and JS_SW_PH = #{jsSwPh}</if>
+            <if test="jsBfyw != null "> and JS_BFYW = #{jsBfyw}</if>
+            <if test="csSlqc != null "> and CS_SLQC = #{csSlqc}</if>
+            <if test="csCod != null "> and CS_COD = #{csCod}</if>
+            <if test="csPh != null "> and CS_PH = #{csPh}</if>
+            <if test="csSs != null "> and CS_SS = #{csSs}</if>
+            <if test="csTn != null "> and CS_TN = #{csTn}</if>
+            <if test="csTp != null "> and CS_TP = #{csTp}</if>
+            <if test="csNh3 != null "> and CS_NH3 = #{csNh3}</if>
+            <if test="oneHyzdDo != null "> and ONE_HYZD_DO = #{oneHyzdDo}</if>
+            <if test="oneHymdDo != null "> and ONE_HYMD_DO = #{oneHymdDo}</if>
+            <if test="twoHyzdDo != null "> and TWO_HYZD_DO = #{twoHyzdDo}</if>
+            <if test="twoHymdDo != null "> and TWO_HYMD_DO = #{twoHymdDo}</if>
+            <if test="oneMlss != null "> and ONE_MLSS = #{oneMlss}</if>
+            <if test="twoMlss != null "> and TWO_MLSS = #{twoMlss}</if>
+            <if test="jsTds != null "> and JS_TDS = #{jsTds}</if>
+            <if test="jsSlq != null "> and JS_SLQ = #{jsSlq}</if>
+            <if test="nHlbOneGp != null "> and N_HLB_ONE_GP = #{nHlbOneGp}</if>
+            <if test="nHlbTwoGp != null "> and N_HLB_TWO_GP = #{nHlbTwoGp}</if>
+            <if test="nHlbThreeGp != null "> and N_HLB_THREE_GP = #{nHlbThreeGp}</if>
+            <if test="nHlbFourGp != null "> and N_HLB_FOUR_GP = #{nHlbFourGp}</if>
+            <if test="nhlBFiveGp != null "> and NHL_B_FIVE_GP = #{nhlBFiveGp}</if>
+            <if test="nHlbSixGp != null "> and N_HLB_SIX_GP = #{nHlbSixGp}</if>
+            <if test="wHlbOneGp != null "> and W_HLB_ONE_GP = #{wHlbOneGp}</if>
+            <if test="wHlbTwoGp != null "> and W_HLB_TWO_GP = #{wHlbTwoGp}</if>
+            <if test="wHlbThreeGp != null "> and W_HLB_THREE_GP = #{wHlbThreeGp}</if>
+            <if test="wHlbFourGp != null "> and W_HLB_FOUR_GP = #{wHlbFourGp}</if>
+            <if test="wHlbFiveGp != null "> and W_HLB_FIVE_GP = #{wHlbFiveGp}</if>
+            <if test="fjOne != null "> and FJ_ONE = #{fjOne}</if>
+            <if test="fjTwo != null "> and FJ_TWO = #{fjTwo}</if>
+            <if test="fjThree != null "> and FJ_THREE = #{fjThree}</if>
+            <if test="fjFour != null "> and FJ_FOUR = #{fjFour}</if>
+            <if test="fjFive != null "> and FJ_FIVE = #{fjFive}</if>
+            <if test="fjSix != null "> and FJ_SIX = #{fjSix}</if>
+            <if test="kqllOne != null "> and KQLL_ONE = #{kqllOne}</if>
+            <if test="kqllTwo != null "> and KQLL_TWO = #{kqllTwo}</if>
+            <if test="kqllThree != null "> and KQLL_THREE = #{kqllThree}</if>
+            <if test="kqllFour != null "> and KQLL_FOUR = #{kqllFour}</if>
+            <if test="kqllFive != null "> and KQLL_FIVE = #{kqllFive}</if>
+            <if test="kqllSix != null "> and KQLL_SIX = #{kqllSix}</if>
+            <if test="SJTYJLY != null "> and SJTYJLY = #{SJTYJLY}</if>
+            <if test="CLJYSSLL != null "> and CLJYSSLL = #{CLJYSSLL}</if>
+            <if test="hycRjyAll != null  and hycRjyAll != ''"> and HYC_RJY_ALL = #{hycRjyAll}</if>
+            <if test="hycRjyZdAll != null  and hycRjyZdAll != ''"> and HYC_RJY_ZD_ALL = #{hycRjyZdAll}</if>
+            <if test="hycWnndAll != null  and hycWnndAll != ''"> and HYC_WNND_ALL = #{hycWnndAll}</if>
+            <if test="CLP04YCZ != null "> and CL_P04_YCZ = #{CLP04YCZ}</if>
+            <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
+            <!-- 下面是新增的SQL检索条件 -->
+            <if test="timeBegin != null  and timeBegin != ''"> and TEST_DATE &gt;= #{timeBegin}</if>
+            <if test="timeEnd != null  and timeEnd != ''"> and TEST_DATE &lt;= #{timeEnd}</if>
+        </where>
+        order by id asc
+    </select>
 </mapper>

+ 46 - 0
slibra-system/src/main/resources/mapper/business/TXinyiRobotMapper.xml

@@ -415,4 +415,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             TEST_HOUR BETWEEN #{dateBegin}
                 AND  #{dateEnd}
     </select>
+
+
+    <select id="selectTXinyiRobotListNew" parameterType="TXinyiRobot" resultMap="TXinyiRobotResult">
+        <include refid="selectTXinyiRobotVo"/>
+        <where>
+            1 = 1
+            <if test="vDate != null  and vDate != ''"> and V_DATE = #{vDate}</if>
+            <if test="vTime != null  and vTime != ''"> and V_TIME = #{vTime}</if>
+            <if test="vDateTime != null  and vDateTime != ''"> and V_DATE_TIME = #{vDateTime}</if>
+            <if test="testDate != null  and testDate != ''"> and TEST_DATE = #{testDate}</if>
+            <if test="testHour != null  and testHour != ''"> and TEST_HOUR = #{testHour}</if>
+            <if test="testTime != null  and testTime != ''"> and TEST_TIME = #{testTime}</if>
+            <if test="codYb != null "> and COD_YB = #{codYb}</if>
+            <if test="codJqr != null "> and COD_JQR = #{codJqr}</if>
+            <if test="codYz != null "> and COD_YZ = #{codYz}</if>
+            <if test="tpHl1Jqr != null "> and TP_HL1_JQR = #{tpHl1Jqr}</if>
+            <if test="tpHl2Jqr != null "> and TP_HL2_JQR = #{tpHl2Jqr}</if>
+            <if test="tpRccJqr != null "> and TP_RCC_JQR = #{tpRccJqr}</if>
+            <if test="tp1Yz != null "> and TP_1_YZ = #{tp1Yz}</if>
+            <if test="tp2Yz != null "> and TP_2_YZ = #{tp2Yz}</if>
+            <if test="tpRccYz != null "> and TP_RCC_YZ = #{tpRccYz}</if>
+            <if test="nh31Jqr != null "> and NH3_1_JQR = #{nh31Jqr}</if>
+            <if test="nh32Jqr != null "> and NH3_2_JQR = #{nh32Jqr}</if>
+            <if test="nh31Yz != null "> and NH3_1_YZ = #{nh31Yz}</if>
+            <if test="no3Hlc1Yz != null "> and NO3_HLC1_YZ = #{no3Hlc1Yz}</if>
+            <if test="nh32Yz != null "> and NH3_2_YZ = #{nh32Yz}</if>
+            <if test="no3Hlc2Yz != null "> and NO3_HLC2_YZ = #{no3Hlc2Yz}</if>
+            <if test="no3Hlj1Jqr != null "> and NO3_HLJ1_JQR = #{no3Hlj1Jqr}</if>
+            <if test="no3Hlj2Jqr != null "> and NO3_HLJ2_JQR = #{no3Hlj2Jqr}</if>
+            <if test="TYLL != null "> and TYLL = #{TYLL}</if>
+            <if test="no3Qyc1Jqr != null "> and NO3_QYC_1_JQR = #{no3Qyc1Jqr}</if>
+            <if test="no3Qyc2Jqr != null "> and NO3_QYC_2_JQR = #{no3Qyc2Jqr}</if>
+            <if test="no3Qyc1Yz != null "> and NO3_QYC_1_YZ = #{no3Qyc1Yz}</if>
+            <if test="no3Qyc2Yz != null "> and NO3_QYC_2_YZ = #{no3Qyc2Yz}</if>
+            <if test="JSLL != null "> and JSLL = #{JSLL}</if>
+            <if test="createdTime != null "> and CREATED_TIME = #{createdTime}</if>
+            <if test="hycxsyAll != null  and hycxsyAll != ''"> and HYCXSY_ALL = #{hycxsyAll}</if>
+            <if test="qyanAll != null  and qyanAll != ''"> and QYAN_ALL = #{qyanAll}</if>
+            <if test="qyckxsyAll != null  and qyckxsyAll != ''"> and QYCKXSY_ALL = #{qyckxsyAll}</if>
+            <if test="hyzlsyAll != null  and hyzlsyAll != ''"> and HYZLSY_ALL = #{hyzlsyAll}</if>
+            <!-- 下面是新增的SQL检索条件 -->
+            <if test="timeBegin != null  and timeBegin != ''"> and TEST_DATE &gt;= #{timeBegin}</if>
+            <if test="timeEnd != null  and timeEnd != ''"> and TEST_DATE &lt;= #{timeEnd}</if>
+        </where>
+        order by id asc
+    </select>
 </mapper>