LogMapper.xml
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?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.sibu.orderHelper.integral.web.dao.LogDao">
<resultMap type="com.sibu.orderHelper.integral.sys.response.SystemLogResponse" id="listSysLog">
<id column="id" property="id"/>
<result column="operation_username" property="operationUsername" />
<result column="operation_nickname" property="operationNickname" />
<result column="description" property="description" />
<result column="operation_method" property="operationMethod" />
<result column="request_ip" property="requestIp" />
<result column="exception_code" property="exceptionCode" />
<result column="create_date" property="createDate" jdbcType="TIMESTAMP"/>
</resultMap>
<insert id="saveLog" parameterType="com.sibu.orderHelper.integral.model.LogBean">
INSERT INTO system_log (
operation_username,operation_nickname,description,operation_method,log_type,request_ip,exception_code,exception_detail,params,create_date
) VALUES (
#{operationUsername},#{operationNickname},#{description},#{operationMethod},#{logType},#{requestIp},#{exceptionCode}
,#{exceptionDetail},#{params},NOW()
)
</insert>
<!-- 查询日志 -->
<select id="listSysLog" parameterType="com.sibu.orderHelper.integral.sys.request.SystemLogRequest" resultMap="listSysLog">
select id,operation_username,operation_nickname,description,operation_method,request_ip,exception_code,create_date
from system_log
where log_type = ${logType}
order by id desc
limit ${pageNow},${pageSize}
</select>
<select id="countSysLog" resultType="int" parameterType="com.sibu.orderHelper.integral.sys.request.SystemLogRequest">
select count(*) from system_log where log_type = ${logType}
</select>
</mapper>