From 2e5763aa24bf3cadb48ec70d49669c997da26994 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期四, 12 十月 2023 11:51:41 +0800
Subject: [PATCH] 大屏设备图片处理

---
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java              |    6 ------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentTypeMapper.java            |    7 -------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentTypeServiceImpl.java |    9 ---------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentTypeMapper.xml         |    9 ---------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java  |   14 +-------------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentTypeService.java         |    6 ------
 lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml          |    3 ++-
 7 files changed, 3 insertions(+), 51 deletions(-)

diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java
index 89474e3..9583205 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/entity/MdcWorkshopEquipment.java
@@ -38,12 +38,6 @@
     private String equipmentId;
 
     /**
-     * 璁惧鍥剧墖
-     */
-    @ApiModelProperty(value = "璁惧鍥剧墖")
-    private String equipmentImage;
-
-    /**
      * 鍧愭爣-宸�
      */
     @ApiModelProperty(value = "鍧愭爣-宸�")
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentTypeMapper.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentTypeMapper.java
index 6613c15..badc78b 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentTypeMapper.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/MdcEquipmentTypeMapper.java
@@ -1,7 +1,6 @@
 package org.jeecg.modules.mdc.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Param;
 import org.jeecg.modules.mdc.entity.MdcEquipmentType;
 
 /**
@@ -12,10 +11,4 @@
 
 public interface MdcEquipmentTypeMapper extends BaseMapper<MdcEquipmentType> {
 
-    /**
-     * 鏍规嵁璁惧绫诲瀷鍚嶇О鏌ヨ璁惧绫诲瀷鍥剧墖
-     * @param equipmentType
-     * @return
-     */
-    String findEquipmentTypeImage(@Param("equipmentType") String equipmentType);
 }
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentTypeMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentTypeMapper.xml
index 2c2b34d..b86d160 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentTypeMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcEquipmentTypeMapper.xml
@@ -2,13 +2,4 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="org.jeecg.modules.mdc.mapper.MdcEquipmentTypeMapper">
 
-    <!--鏍规嵁璁惧绫诲瀷鍚嶇О鏌ヨ璁惧绫诲瀷鍥剧墖-->
-    <select id="findEquipmentTypeImage" resultType="java.lang.String">
-        SELECT
-            equipment_type_pictures
-        FROM
-            mdc_equipment_type
-        WHERE
-            equipment_type_name = #{ equipmentType } AND equipment_type_states = 'Y'
-    </select>
 </mapper>
\ No newline at end of file
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml
index c0e00a6..1a0ecf1 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/mapper/xml/MdcWorkshopInfoMapper.xml
@@ -9,7 +9,7 @@
             a.EquipmentID equipmentId,
             me.equipment_name equipmentName,
             me.equipment_type equipmentType,
-            mew.equipment_image equipmentImage,
+            met.equipment_type_pictures equipmentImage,
             a.Oporation equipmentStatus,
             mew.coordinate_left coordinateLeft,
             mew.coordinate_top coordinateTop,
@@ -20,6 +20,7 @@
             INNER JOIN ( SELECT EquipmentID, MAX ( CollectTime ) 'maxgdtime' FROM EquipmentLog GROUP BY EquipmentID ) b ON a.EquipmentID= b.EquipmentID
             INNER JOIN mdc_workshop_equipment mew ON mew.equipment_id = a.EquipmentID
             INNER JOIN mdc_equipment me ON me.equipment_id = a.EquipmentID
+            INNER JOIN mdc_equipment_type met ON me.equipment_type = met.equipment_type_name
             AND a.CollectTime= b.maxgdtime
             AND mew.workshop_id = #{ workshopId }
     </select>
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentTypeService.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentTypeService.java
index 5ddc621..27bfa94 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentTypeService.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/IMdcEquipmentTypeService.java
@@ -66,10 +66,4 @@
      */
     boolean deleteBatchEquipmentType(String ids);
 
-    /**
-     * 鏍规嵁璁惧绫诲瀷鍚嶇О鏌ヨ璁惧绫诲瀷鍥剧墖
-     * @param equipmentType
-     * @return
-     */
-    String findEquipmentTypeImage(String equipmentType);
 }
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentTypeServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentTypeServiceImpl.java
index 5ede40c..db09dd4 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentTypeServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcEquipmentTypeServiceImpl.java
@@ -70,13 +70,4 @@
         return this.removeByIds(Arrays.asList(ids.split(",")));
     }
 
-    /**
-     * 鏍规嵁璁惧绫诲瀷鍚嶇О鏌ヨ璁惧绫诲瀷鍥剧墖
-     * @param equipmentType
-     * @return
-     */
-    @Override
-    public String findEquipmentTypeImage(String equipmentType) {
-        return this.baseMapper.findEquipmentTypeImage(equipmentType);
-    }
 }
diff --git a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java
index 23cb816..c3b18d37 100644
--- a/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java
+++ b/lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcWorkshopInfoServiceImpl.java
@@ -2,15 +2,12 @@
 
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import org.apache.commons.lang3.StringUtils;
 import org.jeecg.modules.mdc.dto.MdcBigScreenEquipmentDto;
 import org.jeecg.modules.mdc.entity.MdcWorkshopInfo;
 import org.jeecg.modules.mdc.mapper.MdcWorkshopInfoMapper;
-import org.jeecg.modules.mdc.service.IMdcEquipmentTypeService;
 import org.jeecg.modules.mdc.service.IMdcWorkshopInfoService;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.Resource;
 import java.util.List;
 
 /**
@@ -22,9 +19,6 @@
 @Service
 public class MdcWorkshopInfoServiceImpl extends ServiceImpl<MdcWorkshopInfoMapper, MdcWorkshopInfo> implements IMdcWorkshopInfoService {
 
-    @Resource
-    private IMdcEquipmentTypeService mdcEquipmentTypeService;
-
     /**
      * 澶у睆淇℃伅
      * @param workshopId
@@ -32,12 +26,6 @@
      */
     @Override
     public List<MdcBigScreenEquipmentDto> getBigScreenInfo(String workshopId) {
-        List<MdcBigScreenEquipmentDto> list = this.baseMapper.getBigScreenInfo(workshopId);
-        for (MdcBigScreenEquipmentDto mdcBigScreenEquipmentDto : list) {
-            if (StringUtils.isEmpty(mdcBigScreenEquipmentDto.getEquipmentImage())) {
-                mdcBigScreenEquipmentDto.setEquipmentImage(mdcEquipmentTypeService.findEquipmentTypeImage(mdcBigScreenEquipmentDto.getEquipmentType()));
-            }
-        }
-        return list;
+        return this.baseMapper.getBigScreenInfo(workshopId);
     }
 }

--
Gitblit v1.9.3