Simon 1 year ago
parent
commit
73879541b7

+ 8 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TDeviceListMapper.java

@@ -20,6 +20,14 @@ public interface TDeviceListMapper {
      */
     public TDeviceList selectTDeviceListById(Integer id);
 
+    /**
+     * 查询列表
+     *
+     * @param device_id_code 设备id
+     * @return 设备列集合
+     */
+    public List<TDeviceList> selectTDeviceByDeviceIdCode(String device_id_code);
+
     /**
      * 查询设备列集合
      *

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDeviceListServiceImpl.java

@@ -143,7 +143,7 @@ public class TDeviceListServiceImpl implements ITDeviceListService {
             }
         }
         //根据设备表示ID查询数据库中的设备信息
-        List<RateDto> rateDtoList = tDeviceListMapper.selectTDeviceByDeviceId(tDeviceList.getDeviceId());
+        List<TDeviceList> rateDtoList = tDeviceListMapper.selectTDeviceByDeviceIdCode(tDeviceList.getDeviceId());
         if (rateDtoList != null && !rateDtoList.isEmpty()) {
             //如果表中有该设备则提示
             StringBuilder stringBuilder = new StringBuilder();

+ 5 - 0
ruoyi-system/src/main/resources/mapper/system/TDeviceListMapper.xml

@@ -187,6 +187,11 @@
         where userid = #{userid}
     </select>
 
+    <select id="selectTDeviceByDeviceIdCode" parameterType="string" resultMap="TDeviceListResult">
+        <include refid="selectTDeviceListVo"/>
+        where device_id = #{device_id}
+    </select>
+
 
     <insert id="insertTDeviceList" parameterType="TDeviceList" useGeneratedKeys="true" keyProperty="id">
         insert into t_device_list