OperationLogMapper.xml
3.04 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?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="cn.com.glsx.dj.system.mapper.OperationLogMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.system.model.OperationLog" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="user_id" property="userId" jdbcType="INTEGER" />
<result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
<result column="account" property="account" jdbcType="VARCHAR" />
<result column="path" property="path" jdbcType="VARCHAR"/>
<result column="model" property="model" jdbcType="VARCHAR" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="content" property="content" jdbcType="VARCHAR" />
<result column="ip_address" property="ipAddress" jdbcType="VARCHAR"/>
<result column="ip_nation" property="ipNation" jdbcType="VARCHAR"/>
<result column="ip_province" property="ipProvince" jdbcType="VARCHAR"/>
<result column="ip_city" property="ipCity" jdbcType="VARCHAR"/>
<result column="ip_isp" property="ipIsp" jdbcType="VARCHAR"/>
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, user_id, merchant_id, account, path, model, remark, content, ip_address, ip_nation, ip_province, ip_city, ip_isp,
created_date, created_by, updated_date, updated_by, deleted_flag
</sql>
<select id="search" resultMap="BaseResultMap" parameterType="cn.com.glsx.dj.system.model.OperationLog">
select
<include refid="Base_Column_List"/>
from dj_operation_log
<where>
<if test="userId != null">
user_id = #{userId}
</if>
<if test="merchantId != null">
and merchant_id = #{merchantId}
</if>
<if test="merchantIds != null">
and merchant_id in
<foreach collection="merchantIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="account != null">
and account = #{account}
</if>
<if test="ipAddress != null">
and ip_address = #{ipAddress}
</if>
<if test="ipNation != null">
and ip_nation = #{ipNation}
</if>
<if test="ipProvince != null">
and ip_province = #{ipProvince}
</if>
<if test="ipCity != null">
and ip_city = #{ipCity}
</if>
<if test="ipIsp != null">
and ip_isp = #{ipIsp}
</if>
<if test="createdDate != null">
<![CDATA[
and created_date >= #{createdDate}
]]>
</if>
<if test="updatedDate != null">
<![CDATA[
and created_date <= #{updatedDate}
]]>
</if>
</where>
order by id desc
</select>
</mapper>