From add5c816a5281cf6b1df4a0988e8b3a0c2b59bee Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期三, 25 六月 2025 17:37:03 +0800
Subject: [PATCH] 电源表和电池信息表加入新的字段,添加,编辑需要修改

---
 src/main/resources/mapper/BattInfMapper.xml |   33 +++++++++++++++++++++++++++++++--
 1 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/BattInfMapper.xml b/src/main/resources/mapper/BattInfMapper.xml
index d799e9a..a0ada3d 100644
--- a/src/main/resources/mapper/BattInfMapper.xml
+++ b/src/main/resources/mapper/BattInfMapper.xml
@@ -278,7 +278,7 @@
                 and tb_batt_inf.inuse_time>=#{stic.inuseStartTime}
             </if>
             <if test="stic.inuseEndTime!=null">
-                and tb_batt_inf.inuse_time&lt;=#{stic.inuseEndTimee}
+                and tb_batt_inf.inuse_time&lt;=#{stic.inuseEndTime}
             </if>
             <if test="stic.uid>100">
                 and tb_batt_inf.station_id in(
@@ -315,7 +315,7 @@
             and tb_batt_inf.inuse_time>=#{stic.inuseStartTime}
         </if>
         <if test="stic.inuseEndTime!=null">
-            and tb_batt_inf.inuse_time&lt;=#{stic.inuseEndTimee}
+            and tb_batt_inf.inuse_time&lt;=#{stic.inuseEndTime}
         </if>
         <if test="stic.uid>100">
             and tb_batt_inf.station_id in(
@@ -501,4 +501,33 @@
         </where>
         order by battgroup_num asc
     </select>
+    <select id="getScoreByHehavior" resultType="com.whyc.pojo.db_station.BattInf">
+        select distinct tb_batt_inf.*,(TIMESTAMPDIFF(YEAR, tb_batt_inf.inuse_time,CURDATE())+1) as batt_year,#{stic.inuseYear} as inuse_year
+        from db_station.tb_batt_inf
+        <where>
+            <if test="stic.product!=null">
+                and tb_batt_inf.product=#{stic.product}
+            </if>
+            <if test="stic.moncapstd!=null">
+                and tb_batt_inf.moncapstd=#{stic.moncapstd}
+            </if>
+            <if test="stic.monvolstd!=null">
+                and tb_batt_inf.monvolstd=#{stic.monvolstd}
+            </if>
+            <if test="stic.inuseStartTime!=null">
+                and tb_batt_inf.inuse_time>=#{stic.inuseStartTime}
+            </if>
+            <if test="stic.inuseEndTime!=null">
+                and tb_batt_inf.inuse_time&lt;=#{stic.inuseEndTime}
+            </if>
+            <if test="stic.uid>100">
+                and tb_batt_inf.station_id in(
+                select distinct station_id from db_user.tb_baojigroup_power,db_user.tb_baojigroup_usr
+                where   tb_baojigroup_power.baoji_group_id=tb_baojigroup_usr.baoji_group_id
+                and tb_baojigroup_usr.uid=#{stic.uid}
+                )
+            </if>
+            order by tb_batt_inf.dev_id asc,battgroup_id asc
+        </where>
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1