From c775c6953d9759e70f08acbfa8f6d7490aaae3d1 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期四, 26 九月 2024 21:13:53 +0800
Subject: [PATCH] 1

---
 ycl-common/src/main/resources/mapper/user/UmsAdminLoginLogMapper.xml |   41 ++++++++++++++++++++++++++++++++++-------
 1 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/ycl-common/src/main/resources/mapper/user/UmsAdminLoginLogMapper.xml b/ycl-common/src/main/resources/mapper/user/UmsAdminLoginLogMapper.xml
index 48e945f..1f5a1fd 100644
--- a/ycl-common/src/main/resources/mapper/user/UmsAdminLoginLogMapper.xml
+++ b/ycl-common/src/main/resources/mapper/user/UmsAdminLoginLogMapper.xml
@@ -4,12 +4,39 @@
 
     <!-- 閫氱敤鏌ヨ鏄犲皠缁撴灉 -->
     <resultMap id="BaseResultMap" type="com.ycl.entity.user.UmsAdminLoginLog">
-        <id column="id" property="id" />
-        <result column="admin_id" property="adminId" />
-        <result column="create_time" property="createTime" />
-        <result column="ip" property="ip" />
-        <result column="address" property="address" />
-        <result column="user_agent" property="userAgent" />
+        <id column="id" property="id"/>
+        <result column="admin_id" property="adminId"/>
+        <result column="create_time" property="createTime"/>
+        <result column="ip" property="ip"/>
+        <result column="address" property="address"/>
+        <result column="user_agent" property="userAgent"/>
     </resultMap>
-
+    <select id="selectByCondition" parameterType="com.ycl.dto.log.LogQueryParams"
+            resultType="com.ycl.entity.user.vo.UmsAdminLogVO">
+        SELECT t1.*,t2.username as adminId FROM ums_admin_login_log t1
+        left join ums_admin t2 on t1.admin_id=t2.id
+        <where>
+            <if test="logQueryParams.content!='' and logQueryParams.content!=null">
+                contain LIKE CONCAT('%',#{logQueryParams.content},'%')
+            </if>
+            <if test="logQueryParams.operationType!='' and logQueryParams.operationType!=null">
+                and operation_type=#{logQueryParams.operationType}
+            </if>
+            <if test="logQueryParams.portEquipment!='' and logQueryParams.portEquipment!=null">
+                and user_agent=#{logQueryParams.portEquipment}
+            </if>
+            <if test="logQueryParams.id != null">
+                and admin_id=#{logQueryParams.id}
+            </if>
+            <if test="logQueryParams.startTime != '' and logQueryParams.endTime !='' and logQueryParams.startTime !=null and logQueryParams.endTime!=null ">
+                and create_time BETWEEN #{logQueryParams.startTime} AND #{logQueryParams.endTime}
+            </if>
+        </where>
+        <if test="logQueryParams.sort != null and logQueryParams.sort == 1">
+            ORDER BY create_time desc
+        </if>
+        <if test="logQueryParams.sort != null and logQueryParams.sort == 0">
+            ORDER BY create_time asc
+        </if>
+    </select>
 </mapper>

--
Gitblit v1.8.0