Browse Source

fix联锁查询

LLL 8 months ago
parent
commit
60e002fdfb

+ 38 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/controller/InterlockDetailController.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.detail.controller;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
+import java.util.Timer;
 import java.util.stream.Collectors;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
@@ -14,6 +15,7 @@ import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
 import org.jeecg.modules.detail.entity.InterlockDetail;
+import org.jeecg.modules.detail.mapper.InterlockDetailMapper;
 import org.jeecg.modules.detail.service.IInterlockDetailService;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -52,6 +54,9 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 public class InterlockDetailController extends JeecgController<InterlockDetail, IInterlockDetailService> {
 	@Autowired
 	private IInterlockDetailService interlockDetailService;
+	 @Autowired
+	 @SuppressWarnings("all")
+	 private InterlockDetailMapper interlockDetailMapper;
 
 	/**联锁总表-分页列表查询(各种逻辑状态)*/
 	 @ApiOperation(value="联锁总表-分页列表查询(各种逻辑状态)", notes="联锁总表-分页列表查询(各种逻辑状态)")
@@ -60,9 +65,35 @@ public class InterlockDetailController extends JeecgController<InterlockDetail,
 															@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
 															@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
 															HttpServletRequest req) {
+	 	 long startTime = System.currentTimeMillis();
+	 	 Page<InterlockSummaryVO> page = new Page<InterlockSummaryVO>(pageNo, pageSize);
+	 	 IPage<InterlockSummaryVO> pageList = interlockDetailService.getPage(page, vo);
+		 long endTime = System.currentTimeMillis();
+		 long duration = endTime - startTime;
+		 String log = "联锁逻辑状态-分页列表查询程序运行时间(毫秒):" + duration;
+		 System.out.println(log);
+		 interlockDetailMapper.insertIntoTimeTestLog("联锁逻辑状态",duration);
+	 	 return Result.OK(pageList);
+
+	 }
+
+	 /**原联锁状态分页查询*/
+	 @ApiOperation(value="原联锁状态分页查询", notes="原联锁状态分页查询")
+	 @GetMapping(value = "/list111")
+	 public Result<IPage<InterlockSummaryVO>> list111(InterlockSummaryVO vo,
+													@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+													@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+													HttpServletRequest req) {
+		 long startTime = System.currentTimeMillis();
 		 Page<InterlockSummaryVO> page = new Page<InterlockSummaryVO>(pageNo, pageSize);
-		 IPage<InterlockSummaryVO> pageList = interlockDetailService.getPage(page, vo);
+		 IPage<InterlockSummaryVO> pageList = interlockDetailService.getPageBefore(page, vo);
+		 long endTime = System.currentTimeMillis();
+		 long duration = endTime - startTime;
+		 String log = "原联锁逻辑状态-分页列表查询程序运行时间(毫秒):" + duration;
+		 System.out.println(log);
+		 interlockDetailMapper.insertIntoTimeTestLog("原联锁逻辑状态",duration);
 		 return Result.OK(pageList);
+
 	 }
 
 
@@ -76,8 +107,14 @@ public class InterlockDetailController extends JeecgController<InterlockDetail,
 												 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
 												 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
 												 HttpServletRequest req) {
+		 long startTime = System.currentTimeMillis();
 		 Page<InterlockDetailQueryVO> page = new Page<InterlockDetailQueryVO>(pageNo, pageSize);
 		 IPage<InterlockDetailQueryVO> pageList = interlockDetailService.getPage2(page, dto);
+		 long endTime = System.currentTimeMillis();
+		 long duration = endTime - startTime;
+		 String log = "联锁详细信息程序运行时间(毫秒):" + duration;
+		 System.out.println(log);
+		 interlockDetailMapper.insertIntoTimeTestLog("联锁详细信息",duration);
 		 return Result.OK(pageList);
 	 }
 

+ 8 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/mapper/InterlockDetailMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
@@ -26,6 +27,9 @@ public interface InterlockDetailMapper extends BaseMapper<InterlockDetail> {
     /**联锁总表-分页列表查询(各种逻辑状态)*/
     IPage<InterlockSummaryVO> getPage(Page<InterlockSummaryVO> page, @Param("interlockSummaryVO") InterlockSummaryVO interlockSummaryVO);
 
+    /**原联锁状态分页查询*/
+    IPage<InterlockSummaryVO> getPageBefore(Page<InterlockSummaryVO> page, @Param("interlockSummaryVO") InterlockSummaryVO interlockSummaryVO);
+
     /**
     *   author: dzc
     *   version: 1.0
@@ -33,4 +37,8 @@ public interface InterlockDetailMapper extends BaseMapper<InterlockDetail> {
     *   date: 2024/5/30
     */
     List<InterlockDetail> selectListBySummaryId(@Param("summaryId") String summaryId);
+
+    @Insert("INSERT INTO time_test_log (type, cost_time) VALUES (#{type}, #{cost_time})")
+    void insertIntoTimeTestLog(@Param("type") String type, @Param("cost_time") Long costTime);
+
 }

+ 18 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/mapper/xml/InterlockDetailMapper.xml

@@ -41,6 +41,24 @@
         order by s.create_time desc
     </select>
 
+    <select id="getPageBefore" parameterType="org.jeecg.modules.summary.vo.InterlockSummaryVO" resultType="org.jeecg.modules.summary.vo.InterlockSummaryVO">
+        select d.id, d.summaryid, d.interlockname, d.interlock_condition, d.interlock_condition_tag, d.instrument_status, d.control_system_status,
+        s.interlock_status, s.loop_health_level, d.bypass, s.interlock_apparatus_id, s.interlock_system_id
+        from interlock_detail d left join interlock_summary s on d.summaryid = s.id
+        <where>
+            <if test="interlockSummaryVO.interlockApparatusId != null and interlockSummaryVO.interlockApparatusId != ''"> and s.interlock_apparatus_id like concat('%', #{interlockSummaryVO.interlockApparatusId}, '%')</if>
+            <if test="interlockSummaryVO.interlockSystemId != null and interlockSummaryVO.interlockSystemId != ''"> and s.interlock_system_id like concat('%', #{interlockSummaryVO.interlockSystemId}, '%')</if>
+            <if test="interlockSummaryVO.interlockname != null and interlockSummaryVO.interlockname != ''"> and d.interlockname like concat('%', #{interlockSummaryVO.interlockname}, '%')</if>
+            <if test="interlockSummaryVO.interlockCondition != null and interlockSummaryVO.interlockCondition != ''"> and d.interlock_condition = #{interlockSummaryVO.interlockCondition}</if>
+            <if test="interlockSummaryVO.interlockConditionTag != null and interlockSummaryVO.interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%',#{interlockSummaryVO.interlockConditionTag},'%')</if>
+            <if test="interlockSummaryVO.instrumentStatus != null and interlockSummaryVO.instrumentStatus != ''"> and d.instrument_status = #{interlockSummaryVO.instrumentStatus}</if>
+            <if test="interlockSummaryVO.controlSystemStatus != null and interlockSummaryVO.controlSystemStatus != ''"> and d.control_system_status = #{interlockSummaryVO.controlSystemStatus}</if>
+            <if test="interlockSummaryVO.interlockStatus != null and interlockSummaryVO.interlockStatus != ''"> and s.interlock_status = #{interlockSummaryVO.interlockStatus}</if>
+            <if test="interlockSummaryVO.loopHealthLevel != null and interlockSummaryVO.loopHealthLevel != ''"> and s.loop_health_level = #{interlockSummaryVO.loopHealthLevel}</if>
+        </where>
+        order by s.create_time desc
+    </select>
+
     <select id="selectListBySummaryId" resultType="org.jeecg.modules.detail.entity.InterlockDetail">
         select * from interlock_detail where summaryid = #{summaryId}
     </select>

+ 3 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/service/IInterlockDetailService.java

@@ -25,6 +25,9 @@ public interface IInterlockDetailService extends IService<InterlockDetail> {
     /**联锁总表-分页列表查询(各种逻辑状态)*/
     public IPage<InterlockSummaryVO> getPage(Page<InterlockSummaryVO> page, InterlockSummaryVO empInfo);
 
+    /**原联锁状态分页查询*/
+    public IPage<InterlockSummaryVO> getPageBefore(Page<InterlockSummaryVO> page, InterlockSummaryVO interlockSummaryVO);
+
     /**
     *   author: dzc
     *   version: 1.0

+ 6 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/service/impl/InterlockDetailServiceImpl.java

@@ -43,10 +43,15 @@ public class InterlockDetailServiceImpl extends ServiceImpl<InterlockDetailMappe
 
     /**联锁总表-分页列表查询(各种逻辑状态)*/
     public IPage<InterlockSummaryVO> getPage(Page<InterlockSummaryVO> page, InterlockSummaryVO interlockSummaryVO) {
-//        IPage<InterlockSummaryVO> voiPage = interlockDetailMapper.getPage(page, interlockSummaryVO);
         return interlockDetailMapper.getPage(page, interlockSummaryVO);
     }
 
+    /**原联锁状态分页查询*/
+    public IPage<InterlockSummaryVO> getPageBefore(Page<InterlockSummaryVO> page, InterlockSummaryVO interlockSummaryVO) {
+        IPage<InterlockSummaryVO> voiPage = interlockDetailMapper.getPage(page, interlockSummaryVO);
+        return zhSummaryVOIPage(voiPage);
+    }
+
     /**
     *   author: dzc
     *   version: 1.0