62 lines
1.6 KiB
XML
62 lines
1.6 KiB
XML
|
|
<?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="com.nis.web.dao.SysLogDao" >
|
||
|
|
|
||
|
|
<select id="findList" resultType="sysLog">
|
||
|
|
SELECT
|
||
|
|
a.*
|
||
|
|
FROM sys_log a
|
||
|
|
WHERE a.create_date BETWEEN #{beginDate} AND #{endDate}
|
||
|
|
<if test="title != null and title != ''">
|
||
|
|
AND a.title LIKE
|
||
|
|
<if test="dbName == 'oracle'">'%'||#{title}||'%'</if>
|
||
|
|
<if test="dbName == 'mssql'">'%'+#{title}+'%'</if>
|
||
|
|
<if test="dbName == 'mysql'">CONCAT('%', #{title}, '%')</if>
|
||
|
|
</if>
|
||
|
|
<if test="createBy != null and createBy != ''">
|
||
|
|
AND a.create_by = #{createBy}
|
||
|
|
</if>
|
||
|
|
<if test="requestUri != null and requestUri != ''">
|
||
|
|
AND a.request_uri LIKE
|
||
|
|
<if test="dbName == 'oracle'">'%'||#{requestUri}||'%'</if>
|
||
|
|
<if test="dbName == 'mssql'">'%'+#{requestUri}+'%'</if>
|
||
|
|
<if test="dbName == 'mysql'">CONCAT('%', #{requestUri}, '%')</if>
|
||
|
|
</if>
|
||
|
|
<if test="exception != null and exception != ''">
|
||
|
|
AND a.state = 0
|
||
|
|
</if>
|
||
|
|
ORDER BY a.create_date DESC
|
||
|
|
</select>
|
||
|
|
|
||
|
|
|
||
|
|
<insert id="insert" parameterType="sysLog" useGeneratedKeys="true" keyProperty="id" >
|
||
|
|
INSERT INTO sys_log(
|
||
|
|
type,
|
||
|
|
title,
|
||
|
|
create_by,
|
||
|
|
create_date,
|
||
|
|
remote_addr,
|
||
|
|
user_agent,
|
||
|
|
request_uri,
|
||
|
|
method,
|
||
|
|
state,
|
||
|
|
consumer_time,
|
||
|
|
params,
|
||
|
|
exception
|
||
|
|
) VALUES (
|
||
|
|
#{type},
|
||
|
|
#{title},
|
||
|
|
#{createBy},
|
||
|
|
#{createDate},
|
||
|
|
#{remoteAddr},
|
||
|
|
#{userAgent},
|
||
|
|
#{requestUri},
|
||
|
|
#{method},
|
||
|
|
#{state},
|
||
|
|
#{consumerTime},
|
||
|
|
#{params},
|
||
|
|
#{exception}
|
||
|
|
)
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
</mapper>
|