Browse Source

feat(mapper): 新增第三方设备信息分页查询SQL映射

- 创建ThirdPartyEquipmentInfoMapper.xml文件
- 实现selectEquipmentInfoPage方法分页查询设备及关联站点和连接器信息
- 支持根据设备ID、名称,站点ID、名称,设备类型,连接器类型,车位号,国家标准多条件筛选
- 查询结果按更新时间降序排序
- 确保查询仅包含未被删除的设备信息
SheepHy 2 days ago
parent
commit
a70d8f7465
1 changed files with 57 additions and 0 deletions
  1. 57 0
      src/main/resources/mapper/charging/ThirdPartyEquipmentInfoMapper.xml

+ 57 - 0
src/main/resources/mapper/charging/ThirdPartyEquipmentInfoMapper.xml

@@ -0,0 +1,57 @@
+<?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.zsElectric.boot.charging.mapper.ThirdPartyEquipmentInfoMapper">
+
+    <select id="selectEquipmentInfoPage" resultType="com.zsElectric.boot.charging.model.vo.ThirdPartyEquipmentInfoVO">
+        SELECT
+            e.id,
+            e.equipment_id,
+            e.equipment_name,
+            e.station_id,
+            s.station_name,
+            e.equipment_type,
+            e.power,
+            e.update_time,
+            c.connector_id,
+            c.connector_name,
+            c.connector_type,
+            c.voltage_upper_limits,
+            c.voltage_lower_limits,
+            c.current,
+            c.park_no,
+            c.national_standard
+        FROM
+            third_party_equipment_info e
+        LEFT JOIN third_party_station_info s ON e.station_id = s.station_id
+        LEFT JOIN third_party_connector_info c ON e.equipment_id = c.equipment_id
+        <where>
+            e.is_deleted = 0
+            <if test="query.equipmentId != null and query.equipmentId != ''">
+                AND e.equipment_id = #{query.equipmentId}
+            </if>
+            <if test="query.equipmentName != null and query.equipmentName != ''">
+                AND e.equipment_name LIKE CONCAT('%', #{query.equipmentName}, '%')
+            </if>
+            <if test="query.stationId != null and query.stationId != ''">
+                AND e.station_id = #{query.stationId}
+            </if>
+            <if test="query.stationName != null and query.stationName != ''">
+                AND s.station_name LIKE CONCAT('%', #{query.stationName}, '%')
+            </if>
+            <if test="query.equipmentType != null and query.equipmentType != 0">
+                AND e.equipment_type = #{query.equipmentType}
+            </if>
+            <if test="query.connectorType != null and query.connectorType != 0">
+                AND c.connector_type = #{query.connectorType}
+            </if>
+            <if test="query.parkNo != null and query.parkNo != ''">
+                AND c.park_no = #{query.parkNo}
+            </if>
+            <if test="query.nationalStandard != null and query.nationalStandard != 0">
+                AND c.national_standard = #{query.nationalStandard}
+            </if>
+        </where>
+        ORDER BY e.update_time DESC
+    </select>
+
+</mapper>