From 71f83a057f01cc56db8fbeed18d64214e386d813 Mon Sep 17 00:00:00 2001
From: liuxm <liuxm@fescotech.com>
Date: 星期二, 23 四月 2024 18:48:42 +0800
Subject: [PATCH] 日志管理相关

---
 pms-parent/pms-global/src/main/resources/mapper/BaLogMapper.xml |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/pms-parent/pms-global/src/main/resources/mapper/BaLogMapper.xml b/pms-parent/pms-global/src/main/resources/mapper/BaLogMapper.xml
index 48010d6..c7cd531 100644
--- a/pms-parent/pms-global/src/main/resources/mapper/BaLogMapper.xml
+++ b/pms-parent/pms-global/src/main/resources/mapper/BaLogMapper.xml
@@ -68,8 +68,7 @@
       <property name="alias" value="r"/>
     </include>
     from ba_log r
-    where
-    <trim prefix="and" suffixOverrides="and">
+    <trim prefix="where " suffixOverrides="and">
       <if test="userId != null and userId != ''">
         user_id = #{userId,jdbcType=BIGINT} and
       </if>
@@ -83,11 +82,30 @@
         res_ip =#{resIp,jdbcType=VARCHAR} and
       </if>
     </trim>
-    order by id DESC
+    order by id desc
     <trim prefix="limit " >
       <if test="start != null and count != null">
         #{start}, #{count}
       </if>
     </trim>
   </select>
+
+  <select id="selectSomeCount" resultType="java.lang.Long">
+    select count(1)
+    from ba_log r
+    <trim prefix="where " suffixOverrides="and">
+      <if test="userId != null and userId != ''">
+        user_id = #{userId,jdbcType=BIGINT} and
+      </if>
+      <if test="content != null  and content != '' ">
+        content like concat('%', #{content}, '%') and
+      </if>
+      <if test="createDt != null and createDt != '' ">
+        create_dt = #{createDt,jdbcType=TIMESTAMP} and
+      </if>
+      <if test="resIp != null and resIp != '' ">
+        res_ip =#{resIp,jdbcType=VARCHAR} and
+      </if>
+    </trim>
+  </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0