This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
k18-ntcs-web-ntc/src/main/java/com/nis/web/dao/SysLogDao.xml

62 lines
1.6 KiB
XML
Raw Normal View History

2017-12-29 16:18:40 +08:00
<?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>