From 0100359605ba05638c1f683d68a2948cc273b0d2 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期一, 08 十二月 2025 11:21:29 +0800
Subject: [PATCH] yys 修改设备模块
---
src/main/java/com/ruoyi/device/mapper/DeviceMaintenanceMapper.java | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/src/main/java/com/ruoyi/device/mapper/DeviceMaintenanceMapper.java b/src/main/java/com/ruoyi/device/mapper/DeviceMaintenanceMapper.java
index 5fde866..4225bf0 100644
--- a/src/main/java/com/ruoyi/device/mapper/DeviceMaintenanceMapper.java
+++ b/src/main/java/com/ruoyi/device/mapper/DeviceMaintenanceMapper.java
@@ -1,13 +1,19 @@
package com.ruoyi.device.mapper;
+import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.device.dto.DeviceMaintenanceDto;
import com.ruoyi.device.dto.DeviceRepairDto;
+import com.ruoyi.device.dto.RepairAmountGroupDTO;
import com.ruoyi.device.pojo.DeviceMaintenance;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
@Mapper
public interface DeviceMaintenanceMapper extends BaseMapper<DeviceMaintenance> {
@@ -15,4 +21,34 @@
IPage<DeviceMaintenanceDto> queryPage(Page page, DeviceMaintenanceDto deviceMaintenanceDto);
DeviceMaintenanceDto detailById(Long id);
+
+ @InterceptorIgnore(tenantLine = "true")
+ List<DeviceMaintenance> list1(Long id);
+
+ /**
+ * 鎸夆�滄寚瀹氬勾浠界殑骞存湀+璁惧鍙拌处id鈥濆垎缁勶紝姹傚拰鎶ヤ慨閲戦
+ * @param year 鍓嶇浼犲叆鐨勫勾浠斤紙濡�"2025"锛�
+ */
+ @Select("SELECT " +
+ " DATE_FORMAT(maintenance_actually_time, '%m') AS repairYearMonth, " +
+ " device_ledger_id AS deviceLedgerId, " +
+ " SUM(maintenance_price) AS totalRepairPrice " +
+ "FROM device_maintenance " +
+ "WHERE DATE_FORMAT(maintenance_actually_time, '%Y') = #{year} " + // 鍙煡璇㈡寚瀹氬勾浠界殑鏁版嵁
+ "GROUP BY device_ledger_id,DATE_FORMAT(maintenance_actually_time, '%Y-%m') " +
+ "ORDER BY repairYearMonth ASC") // 鎸夋湀浠芥帓搴忥紝鏂逛究鍓嶇灞曠ず
+ List<RepairAmountGroupDTO> groupByMonthAndDeviceLedger(@Param("year") String year);
+
+ /**
+ * 鎸夆�滆澶囧彴璐d鈥濆垎缁勶紝姹傚拰鎶ヤ慨閲戦
+ * @param year 鍓嶇浼犲叆鐨勫勾浠斤紙濡�"2025"锛�
+ */
+ @Select("SELECT " +
+ " device_ledger_id AS deviceLedgerId, " +
+ " SUM(maintenance_price) AS totalRepairPrice " +
+ "FROM device_maintenance " +
+ "WHERE DATE_FORMAT(maintenance_actually_time, '%Y') = #{year} " + // 鍙煡璇㈡寚瀹氬勾浠界殑鏁版嵁
+ "GROUP BY device_ledger_id ") // 鎸夋湀浠芥帓搴忥紝鏂逛究鍓嶇灞曠ず
+ List<RepairAmountGroupDTO> groupByDeviceLedger(@Param("year") String year);
+
}
--
Gitblit v1.9.3