feat: 日志分页列表和添加操作日志记录

This commit is contained in:
hxr
2024-06-28 08:06:26 +08:00
parent 9b5fd036e5
commit 3ba34ca8ee
17 changed files with 192 additions and 26 deletions

View File

@@ -4,17 +4,27 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.youlai.system.mapper.SysLogMapper">
<resultMap id="BaseResultMap" type="com.youlai.system.model.entity.SysLog">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="createBy" column="create_by" jdbcType="BIGINT"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateBy" column="update_by" jdbcType="BIGINT"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="isDeleted" column="is_deleted" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id,create_by,create_time,
update_by,update_time,is_deleted
</sql>
<!-- 日志分页列表 -->
<select id="listPagedLogs" resultType="com.youlai.system.model.vo.LogPageVO">
SELECT
t1.*,
t2.nickname AS operator
FROM
sys_log t1
LEFT JOIN sys_user t2 ON t1.create_by = t2.id
<where>
t1.is_deleted = 0
<if test="queryParams.keywords != null and queryParams.keywords != ''">
AND (
t1.content LIKE concat('%',#{queryParams.keywords},'%')
OR
t1.ip LIKE concat('%',#{queryParams.keywords},'%')
OR
t2.nickname LIKE concat('%',#{queryParams.keywords},'%')
)
</if>
</where>
ORDER BY
t1.create_time DESC
</select>
</mapper>