Просмотр исходного кода

feat(business): 支持按充电设备接口编码过滤充电订单查询

- ChargeOrderInfoQuery中新增connectorId字段,支持接口编码过滤
- 修改ChargeOrderInfoMapper.xml,添加connectorId非空时的SQL查询条件
- 在相关查询语句中加入connectorId条件,增强查询灵活性与过滤能力
SheepHy 14 часов назад
Родитель
Сommit
c77125654f

+ 3 - 0
src/main/java/com/zsElectric/boot/business/model/query/ChargeOrderInfoQuery.java

@@ -44,6 +44,9 @@ public class ChargeOrderInfoQuery extends BasePageQuery {
     @Schema(description = "停止原因")
     @Schema(description = "停止原因")
     private Integer stopReason;
     private Integer stopReason;
 
 
+    @Schema(description = "充电设备接口编码")
+    private String connectorId;
+
     @Schema(description = "开始时间")
     @Schema(description = "开始时间")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")

+ 6 - 0
src/main/resources/mapper/business/ChargeOrderInfoMapper.xml

@@ -93,6 +93,9 @@
             <if test="queryParams.thirdStationId != null">
             <if test="queryParams.thirdStationId != null">
                 AND coi.third_party_station_id = #{queryParams.thirdStationId}
                 AND coi.third_party_station_id = #{queryParams.thirdStationId}
             </if>
             </if>
+            <if test="queryParams.connectorId != null and queryParams.connectorId != ''">
+                AND coi.connector_id = #{queryParams.connectorId}
+            </if>
         </where>
         </where>
         ORDER BY coi.create_time DESC
         ORDER BY coi.create_time DESC
     </select>
     </select>
@@ -323,6 +326,9 @@
             <if test="queryParams.thirdStationId != null">
             <if test="queryParams.thirdStationId != null">
                 AND a.third_party_station_id = #{queryParams.thirdStationId}
                 AND a.third_party_station_id = #{queryParams.thirdStationId}
             </if>
             </if>
+            <if test="queryParams.connectorId != null and queryParams.connectorId != ''">
+                AND a.connector_id = #{queryParams.connectorId}
+            </if>
         </where>
         </where>
         ORDER BY a.create_time DESC
         ORDER BY a.create_time DESC
     </select>
     </select>