OperationLogMapper.xml
2.29 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
38
39
40
41
42
43
44
45
46
47
48
49
50
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="com.yoho.order.dal.OperationLogMapper">
<resultMap id="BaseResultMap" type="com.yoho.order.model.OperationLog">
<result column="id" property="id" jdbcType="INTEGER" />
<result column="uid" property="uId" jdbcType="INTEGER" />
<result column="uname" property="uName" jdbcType="VARCHAR" />
<result column="method_name" property="methodName" jdbcType="VARCHAR" />
<result column="method_param" property="methodParam" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="INTEGER" />
<result column="ip" property="ip" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List">
id, uid, method_name, method_param, create_time, uname, ip
</sql>
<select id="page" parameterType="com.yoho.order.model.OperationLogReq" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from operation_log
where 1 = 1
<if test="operationName != null and operationName != ''">
and uname like concat('%', #{operationName,jdbcType=VARCHAR}, '%')
</if>
order by id desc
limit #{start,jdbcType=INTEGER},#{size,jdbcType=INTEGER}
</select>
<select id="detail" parameterType="int" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/>
from operation_log
where id = #{id,jdbcType=INTEGER}
limit 1
</select>
<select id="count" parameterType="com.yoho.order.model.OperationLogReq" resultType="int">
select count(1)
from operation_log
where 1 = 1
<if test="operationName != null and operationName != ''">
and uname like concat(#{operationName,jdbcType=VARCHAR}, '%')
</if>
</select>
<insert id="save" parameterType="com.yoho.order.model.OperationLog">
insert into
operation_log(`uid`,`method_name`,`method_param`,`create_time`,`uname`,`ip`)
values(#{uId,jdbcType=INTEGER},#{methodName,jdbcType=VARCHAR},#{methodParam,jdbcType=VARCHAR},
#{createTime,jdbcType=INTEGER},#{uName,jdbcType=VARCHAR},#{ip,jdbcType=VARCHAR})
</insert>
</mapper>