|
|
@ -4,66 +4,63 @@ |
|
|
<!-- rqrq - 系统错误日志Mapper XML --> |
|
|
<!-- rqrq - 系统错误日志Mapper XML --> |
|
|
<mapper namespace="com.gaotao.modules.api.dao.SysErrorLogMapper"> |
|
|
<mapper namespace="com.gaotao.modules.api.dao.SysErrorLogMapper"> |
|
|
|
|
|
|
|
|
<!-- 通用查询条件 - rqrq --> |
|
|
|
|
|
<sql id="queryCondition"> |
|
|
|
|
|
|
|
|
<!-- rqrq - 分页查询错误日志列表 --> |
|
|
|
|
|
<select id="queryList" resultType="SysErrorLogData"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
id, |
|
|
|
|
|
site, |
|
|
|
|
|
module_name AS moduleName, |
|
|
|
|
|
function_name AS functionName, |
|
|
|
|
|
business_key AS businessKey, |
|
|
|
|
|
is_interface AS isInterface, |
|
|
|
|
|
interface_type AS interfaceType, |
|
|
|
|
|
interface_name AS interfaceName, |
|
|
|
|
|
request_data AS requestData, |
|
|
|
|
|
method_name AS methodName, |
|
|
|
|
|
error_message AS errorMessage, |
|
|
|
|
|
error_detail AS errorDetail, |
|
|
|
|
|
username, |
|
|
|
|
|
created_time AS createdTime |
|
|
|
|
|
FROM sys_error_log WITH (NOLOCK) |
|
|
<where> |
|
|
<where> |
|
|
<if test="data.site != null and data.site != ''"> |
|
|
|
|
|
AND site = #{data.site} |
|
|
|
|
|
|
|
|
<if test="params.site != null and params.site != ''"> |
|
|
|
|
|
AND site = #{params.site} |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.moduleName != null and data.moduleName != ''"> |
|
|
|
|
|
AND module_name = #{data.moduleName} |
|
|
|
|
|
|
|
|
<if test="params.moduleName != null and params.moduleName != ''"> |
|
|
|
|
|
AND module_name = #{params.moduleName} |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.functionName != null and data.functionName != ''"> |
|
|
|
|
|
AND function_name = #{data.functionName} |
|
|
|
|
|
|
|
|
<if test="params.functionName != null and params.functionName != ''"> |
|
|
|
|
|
AND function_name = #{params.functionName} |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.businessKey != null and data.businessKey != ''"> |
|
|
|
|
|
AND business_key LIKE '%' + #{data.businessKey} + '%' |
|
|
|
|
|
|
|
|
<if test="params.businessKey != null and params.businessKey != ''"> |
|
|
|
|
|
AND business_key LIKE '%' + #{params.businessKey} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.isInterface != null and data.isInterface != ''"> |
|
|
|
|
|
AND is_interface = #{data.isInterface} |
|
|
|
|
|
|
|
|
<if test="params.isInterface != null and params.isInterface != ''"> |
|
|
|
|
|
AND is_interface = #{params.isInterface} |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.interfaceType != null and data.interfaceType != ''"> |
|
|
|
|
|
AND interface_type = #{data.interfaceType} |
|
|
|
|
|
|
|
|
<if test="params.interfaceType != null and params.interfaceType != ''"> |
|
|
|
|
|
AND interface_type = #{params.interfaceType} |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.interfaceName != null and data.interfaceName != ''"> |
|
|
|
|
|
AND interface_name LIKE '%' + #{data.interfaceName} + '%' |
|
|
|
|
|
|
|
|
<if test="params.interfaceName != null and params.interfaceName != ''"> |
|
|
|
|
|
AND interface_name LIKE '%' + #{params.interfaceName} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.username != null and data.username != ''"> |
|
|
|
|
|
AND username LIKE '%' + #{data.username} + '%' |
|
|
|
|
|
|
|
|
<if test="params.username != null and params.username != ''"> |
|
|
|
|
|
AND username LIKE '%' + #{params.username} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.searchErrorMessage != null and data.searchErrorMessage != ''"> |
|
|
|
|
|
AND error_message LIKE '%' + #{data.searchErrorMessage} + '%' |
|
|
|
|
|
|
|
|
<if test="params.searchErrorMessage != null and params.searchErrorMessage != ''"> |
|
|
|
|
|
AND error_message LIKE '%' + #{params.searchErrorMessage} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.searchErrorDetail != null and data.searchErrorDetail != ''"> |
|
|
|
|
|
AND error_detail LIKE '%' + #{data.searchErrorDetail} + '%' |
|
|
|
|
|
|
|
|
<if test="params.searchErrorDetail != null and params.searchErrorDetail != ''"> |
|
|
|
|
|
AND error_detail LIKE '%' + #{params.searchErrorDetail} + '%' |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.startTime != null and data.startTime != ''"> |
|
|
|
|
|
AND created_time >= #{data.startTime} |
|
|
|
|
|
|
|
|
<if test="params.startTime != null and params.startTime != ''"> |
|
|
|
|
|
AND created_time >= #{params.startTime} |
|
|
</if> |
|
|
</if> |
|
|
<if test="data.endTime != null and data.endTime != ''"> |
|
|
|
|
|
AND created_time <= #{data.endTime} |
|
|
|
|
|
|
|
|
<if test="params.endTime != null and params.endTime != ''"> |
|
|
|
|
|
AND created_time <= #{params.endTime} |
|
|
</if> |
|
|
</if> |
|
|
</where> |
|
|
</where> |
|
|
</sql> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 分页查询错误日志 - rqrq --> |
|
|
|
|
|
<select id="queryList" resultType="SysErrorLog"> |
|
|
|
|
|
SELECT |
|
|
|
|
|
id, site, module_name, function_name, business_key, |
|
|
|
|
|
is_interface, interface_type, interface_name, request_data, |
|
|
|
|
|
method_name, error_message, error_detail, |
|
|
|
|
|
username, created_time |
|
|
|
|
|
FROM sys_error_log |
|
|
|
|
|
<include refid="queryCondition"/> |
|
|
|
|
|
ORDER BY created_time DESC |
|
|
ORDER BY created_time DESC |
|
|
OFFSET #{data.offset} ROWS FETCH NEXT #{data.limit} ROWS ONLY |
|
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 查询总数 - rqrq --> |
|
|
|
|
|
<select id="queryTotal" resultType="int"> |
|
|
|
|
|
SELECT COUNT(1) |
|
|
|
|
|
FROM sys_error_log |
|
|
|
|
|
<include refid="queryCondition"/> |
|
|
|
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
</mapper> |
|
|
</mapper> |