serv-初始mapper
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.system.TbSysConfig;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 系统配置数据访问层
|
||||
* @filename SysConfigMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysConfigMapper extends BaseMapper<TbSysConfig> {
|
||||
|
||||
/**
|
||||
* @description 查询系统配置列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbSysConfig> 系统配置列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbSysConfig> selectSysConfigs(TbSysConfig filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.system.TbSysDictData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 字典数据数据访问层
|
||||
* @filename SysDictDataMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDictDataMapper extends BaseMapper<TbSysDictData> {
|
||||
|
||||
/**
|
||||
* @description 查询字典数据列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbSysDictData> 字典数据列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbSysDictData> selectSysDictData(TbSysDictData filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.system.TbSysDictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 字典类型数据访问层
|
||||
* @filename SysDictTypeMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysDictTypeMapper extends BaseMapper<TbSysDictType> {
|
||||
|
||||
/**
|
||||
* @description 查询字典类型列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbSysDictType> 字典类型列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbSysDictType> selectSysDictTypes(TbSysDictType filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.system.TbSysFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 文件上传记录数据访问层
|
||||
* @filename SysFileMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysFileMapper extends BaseMapper<TbSysFile> {
|
||||
|
||||
/**
|
||||
* @description 查询文件上传记录列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbSysFile> 文件上传记录列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbSysFile> selectSysFiles(TbSysFile filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.system.TbSysNotification;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 系统通知数据访问层
|
||||
* @filename SysNotificationMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysNotificationMapper extends BaseMapper<TbSysNotification> {
|
||||
|
||||
/**
|
||||
* @description 查询系统通知列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbSysNotification> 系统通知列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbSysNotification> selectSysNotifications(TbSysNotification filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.system.TbSysOperationLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 操作日志数据访问层
|
||||
* @filename SysOperationLogMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysOperationLogMapper extends BaseMapper<TbSysOperationLog> {
|
||||
|
||||
/**
|
||||
* @description 查询操作日志列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbSysOperationLog> 操作日志列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbSysOperationLog> selectSysOperationLogs(TbSysOperationLog filter);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.xyzh.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.xyzh.common.dto.system.TbSysVisitStatistics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 系统访问统计数据访问层
|
||||
* @filename SysVisitStatisticsMapper.java
|
||||
* @author system
|
||||
* @copyright xyzh
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysVisitStatisticsMapper extends BaseMapper<TbSysVisitStatistics> {
|
||||
|
||||
/**
|
||||
* @description 查询系统访问统计列表
|
||||
* @param filter 过滤条件
|
||||
* @return List<TbSysVisitStatistics> 系统访问统计列表
|
||||
* @author system
|
||||
* @since 2025-10-15
|
||||
*/
|
||||
List<TbSysVisitStatistics> selectSysVisitStatistics(TbSysVisitStatistics filter);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.system.mapper.SysConfigMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysConfig">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="config_key" property="configKey" jdbcType="VARCHAR"/>
|
||||
<result column="config_value" property="configValue" jdbcType="LONGVARCHAR"/>
|
||||
<result column="config_type" property="configType" jdbcType="VARCHAR"/>
|
||||
<result column="config_group" property="configGroup" jdbcType="VARCHAR"/>
|
||||
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||
<result column="is_system" property="isSystem" jdbcType="BOOLEAN"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, config_key, config_value, config_type, config_group, description,
|
||||
is_system, creator, updater, create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="configKey != null and configKey != ''">
|
||||
AND config_key = #{configKey}
|
||||
</if>
|
||||
<if test="configGroup != null and configGroup != ''">
|
||||
AND config_group = #{configGroup}
|
||||
</if>
|
||||
<if test="configType != null and configType != ''">
|
||||
AND config_type = #{configType}
|
||||
</if>
|
||||
<if test="isSystem != null">
|
||||
AND is_system = #{isSystem}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectSysConfigs -->
|
||||
<select id="selectSysConfigs" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_sys_config
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY config_group, config_key
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.system.mapper.SysDictDataMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysDictData">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="dict_type" property="dictType" jdbcType="VARCHAR"/>
|
||||
<result column="dict_label" property="dictLabel" jdbcType="VARCHAR"/>
|
||||
<result column="dict_value" property="dictValue" jdbcType="VARCHAR"/>
|
||||
<result column="dict_sort" property="dictSort" jdbcType="INTEGER"/>
|
||||
<result column="css_class" property="cssClass" jdbcType="VARCHAR"/>
|
||||
<result column="list_class" property="listClass" jdbcType="VARCHAR"/>
|
||||
<result column="is_default" property="isDefault" jdbcType="BOOLEAN"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="remark" property="remark" jdbcType="VARCHAR"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, dict_type, dict_label, dict_value, dict_sort, css_class, list_class,
|
||||
is_default, status, remark, creator, updater, create_time, update_time,
|
||||
delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type = #{dictType}
|
||||
</if>
|
||||
<if test="dictLabel != null and dictLabel != ''">
|
||||
AND dict_label LIKE CONCAT('%', #{dictLabel}, '%')
|
||||
</if>
|
||||
<if test="dictValue != null and dictValue != ''">
|
||||
AND dict_value = #{dictValue}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="isDefault != null">
|
||||
AND is_default = #{isDefault}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectSysDictData -->
|
||||
<select id="selectSysDictData" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_sys_dict_data
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY dict_type, dict_sort ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.system.mapper.SysDictTypeMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysDictType">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="dict_type" property="dictType" jdbcType="VARCHAR"/>
|
||||
<result column="dict_name" property="dictName" jdbcType="VARCHAR"/>
|
||||
<result column="description" property="description" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="creator" property="creator" jdbcType="VARCHAR"/>
|
||||
<result column="updater" property="updater" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="delete_time" property="deleteTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="deleted" property="deleted" jdbcType="BOOLEAN"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, dict_type, dict_name, description, status, creator, updater,
|
||||
create_time, update_time, delete_time, deleted
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
deleted = 0
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type = #{dictType}
|
||||
</if>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name LIKE CONCAT('%', #{dictName}, '%')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectSysDictTypes -->
|
||||
<select id="selectSysDictTypes" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_sys_dict_type
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.system.mapper.SysFileMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysFile">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="file_name" property="fileName" jdbcType="VARCHAR"/>
|
||||
<result column="original_name" property="originalName" jdbcType="VARCHAR"/>
|
||||
<result column="file_path" property="filePath" jdbcType="VARCHAR"/>
|
||||
<result column="file_url" property="fileUrl" jdbcType="VARCHAR"/>
|
||||
<result column="file_size" property="fileSize" jdbcType="BIGINT"/>
|
||||
<result column="file_type" property="fileType" jdbcType="VARCHAR"/>
|
||||
<result column="mime_type" property="mimeType" jdbcType="VARCHAR"/>
|
||||
<result column="module" property="module" jdbcType="VARCHAR"/>
|
||||
<result column="business_id" property="businessID" jdbcType="VARCHAR"/>
|
||||
<result column="uploader" property="uploader" jdbcType="VARCHAR"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, file_name, original_name, file_path, file_url, file_size,
|
||||
file_type, mime_type, module, business_id, uploader, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="fileName != null and fileName != ''">
|
||||
AND file_name LIKE CONCAT('%', #{fileName}, '%')
|
||||
</if>
|
||||
<if test="fileType != null and fileType != ''">
|
||||
AND file_type = #{fileType}
|
||||
</if>
|
||||
<if test="module != null and module != ''">
|
||||
AND module = #{module}
|
||||
</if>
|
||||
<if test="businessID != null and businessID != ''">
|
||||
AND business_id = #{businessID}
|
||||
</if>
|
||||
<if test="uploader != null and uploader != ''">
|
||||
AND uploader = #{uploader}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectSysFiles -->
|
||||
<select id="selectSysFiles" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_sys_file
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.system.mapper.SysNotificationMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysNotification">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="type" property="type" jdbcType="INTEGER"/>
|
||||
<result column="title" property="title" jdbcType="VARCHAR"/>
|
||||
<result column="content" property="content" jdbcType="LONGVARCHAR"/>
|
||||
<result column="link_type" property="linkType" jdbcType="INTEGER"/>
|
||||
<result column="link_id" property="linkID" jdbcType="VARCHAR"/>
|
||||
<result column="is_read" property="isRead" jdbcType="BOOLEAN"/>
|
||||
<result column="read_time" property="readTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, type, title, content, link_type, link_id, is_read,
|
||||
read_time, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
AND type = #{type}
|
||||
</if>
|
||||
<if test="title != null and title != ''">
|
||||
AND title LIKE CONCAT('%', #{title}, '%')
|
||||
</if>
|
||||
<if test="isRead != null">
|
||||
AND is_read = #{isRead}
|
||||
</if>
|
||||
<if test="linkType != null">
|
||||
AND link_type = #{linkType}
|
||||
</if>
|
||||
<if test="linkID != null and linkID != ''">
|
||||
AND link_id = #{linkID}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectSysNotifications -->
|
||||
<select id="selectSysNotifications" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_sys_notification
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.system.mapper.SysOperationLogMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysOperationLog">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="user_id" property="userID" jdbcType="VARCHAR"/>
|
||||
<result column="username" property="username" jdbcType="VARCHAR"/>
|
||||
<result column="module" property="module" jdbcType="VARCHAR"/>
|
||||
<result column="operation" property="operation" jdbcType="VARCHAR"/>
|
||||
<result column="method" property="method" jdbcType="VARCHAR"/>
|
||||
<result column="request_url" property="requestUrl" jdbcType="VARCHAR"/>
|
||||
<result column="request_method" property="requestMethod" jdbcType="VARCHAR"/>
|
||||
<result column="request_params" property="requestParams" jdbcType="LONGVARCHAR"/>
|
||||
<result column="response_data" property="responseData" jdbcType="LONGVARCHAR"/>
|
||||
<result column="ip_address" property="ipAddress" jdbcType="VARCHAR"/>
|
||||
<result column="ip_source" property="ipSource" jdbcType="VARCHAR"/>
|
||||
<result column="browser" property="browser" jdbcType="VARCHAR"/>
|
||||
<result column="os" property="os" jdbcType="VARCHAR"/>
|
||||
<result column="status" property="status" jdbcType="INTEGER"/>
|
||||
<result column="error_message" property="errorMessage" jdbcType="LONGVARCHAR"/>
|
||||
<result column="execute_time" property="executeTime" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, user_id, username, module, operation, method, request_url,
|
||||
request_method, request_params, response_data, ip_address, ip_source,
|
||||
browser, os, status, error_message, execute_time, create_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="userID != null and userID != ''">
|
||||
AND user_id = #{userID}
|
||||
</if>
|
||||
<if test="username != null and username != ''">
|
||||
AND username LIKE CONCAT('%', #{username}, '%')
|
||||
</if>
|
||||
<if test="module != null and module != ''">
|
||||
AND module = #{module}
|
||||
</if>
|
||||
<if test="operation != null and operation != ''">
|
||||
AND operation = #{operation}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="ipAddress != null and ipAddress != ''">
|
||||
AND ip_address = #{ipAddress}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectSysOperationLogs -->
|
||||
<select id="selectSysOperationLogs" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_sys_operation_log
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.xyzh.system.mapper.SysVisitStatisticsMapper">
|
||||
|
||||
<!-- 基础结果映射 -->
|
||||
<resultMap id="BaseResultMap" type="org.xyzh.common.dto.system.TbSysVisitStatistics">
|
||||
<id column="id" property="id" jdbcType="VARCHAR"/>
|
||||
<result column="stat_date" property="statDate" jdbcType="DATE"/>
|
||||
<result column="total_visits" property="totalVisits" jdbcType="INTEGER"/>
|
||||
<result column="unique_visitors" property="uniqueVisitors" jdbcType="INTEGER"/>
|
||||
<result column="new_users" property="newUsers" jdbcType="INTEGER"/>
|
||||
<result column="active_users" property="activeUsers" jdbcType="INTEGER"/>
|
||||
<result column="page_views" property="pageViews" jdbcType="INTEGER"/>
|
||||
<result column="avg_visit_duration" property="avgVisitDuration" jdbcType="INTEGER"/>
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
||||
<result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础字段 -->
|
||||
<sql id="Base_Column_List">
|
||||
id, stat_date, total_visits, unique_visitors, new_users, active_users,
|
||||
page_views, avg_visit_duration, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<!-- 通用条件 -->
|
||||
<sql id="Where_Clause">
|
||||
<where>
|
||||
<if test="statDate != null">
|
||||
AND stat_date = #{statDate}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<!-- selectSysVisitStatistics -->
|
||||
<select id="selectSysVisitStatistics" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM tb_sys_visit_statistics
|
||||
<include refid="Where_Clause"/>
|
||||
ORDER BY stat_date DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user