MerchantLogMapper.xml
3.11 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
<?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.merchants.mapper.MerchantLogMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.merchants.entity.MerchantLog">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="module" jdbcType="VARCHAR" property="module"/>
<result column="processed" jdbcType="VARCHAR" property="processed"/>
<result column="action" jdbcType="VARCHAR" property="action"/>
<result column="operator" jdbcType="VARCHAR" property="operator"/>
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
<result column="ip" jdbcType="VARCHAR" property="ip"/>
<result column="result" jdbcType="VARCHAR" property="result"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
</resultMap>
<resultMap id="resultMap" type="cn.com.glsx.merchants.model.response.MerchantLogResponse">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="module_type" jdbcType="INTEGER" property="moduleType"/>
<result column="processed" jdbcType="VARCHAR" property="processed"/>
<result column="action_type" jdbcType="INTEGER" property="actionType"/>
<result column="operator" jdbcType="VARCHAR" property="operator"/>
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
<result column="ip" jdbcType="VARCHAR" property="ip"/>
<result column="result" jdbcType="VARCHAR" property="result"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
<result column="product_name" jdbcType="TIMESTAMP" property="productName"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, `module`, processed, `action`, `operator`, ip, `result`, created_time
</sql>
<select id="findMerchantLog" resultMap="resultMap"
parameterType="cn.com.glsx.merchants.model.request.MerchantLogRequest">
select * from platform_merchant_log where 1=1
<if test="log.bussinessId != null">
and bussiness_id = #{log.bussinessId,jdbcType=INTEGER}
</if>
<if test="log.moduleName != null">
and model_type = #{log.moduleType,jdbcType=INTEGER}
</if>
order by created_time desc
</select>
<select id="findMerchantAndStaffLog" resultMap="resultMap">
SELECT * FROM platform_merchant_log
WHERE model_type = 1 AND bussiness_id =#{bo.merchantId}
<if test="bo.staffIdList != null and bo.staffIdList.size >0">
UNION
SELECT * FROM platform_merchant_log
WHERE model_type = 2
AND bussiness_id in
<foreach collection="bo.staffIdList" open="(" close=")" separator="," index="index" item="id">
#{id}
</foreach>
</if>
ORDER BY created_time desc
</select>
</mapper>