WeCustomerMessageOriginalMapper.xml
2.32 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
<?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.linkwechat.wecom.mapper.WeCustomerMessageOriginalMapper">
<select id="selectCustomerMessagePushs" resultType="com.linkwechat.wecom.domain.vo.CustomerMessagePushVo">
SELECT
wcmo.push_type,
wcmo.message_type,
wcmo.push_range,
wcm.create_by sender,
wcmo.create_time sendTime,
wcm.message_id,
wcm.content,
wcm.chat_type,
wcm.setting_time,
wcm.expect_send,
wcm.actual_send,
wcm.timed_task,
wcm.msgid
FROM
we_customer_messageOriginal wcmo
LEFT JOIN we_customer_message wcm ON wcmo.message_original_Id = wcm.original_id
<where>
<if test="content!=null and content!=''">
AND wcm.content LIKE CONCAT('%',#{content},'%')
</if>
<if test="pushType!=null and pushType!=''">
AND wcmo.push_type=#{pushType}
</if>
<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
AND date_format(wcmo.create_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')
</if>
<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
AND date_format(wcmo.create_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
</if>
<if test="sender!=null and sender!=''">
AND wcm.create_by=#{sender}
</if>
</where>
</select>
<select id="findCustomerMessagePushDetail"
resultType="com.linkwechat.wecom.domain.vo.CustomerMessagePushVo">
SELECT
wcmo.push_type,
wcmo.message_type,
wcmo.push_range,
wcm.create_by sender,
wcmo.create_time sendTime,
wcm.message_id,
wcm.content,
wcm.msgid,
wcm.chat_type,
wcm.setting_time,
wcm.expect_send,
wcm.actual_send,
wcm.timed_task
FROM
we_customer_messageOriginal wcmo
LEFT JOIN we_customer_message wcm ON wcmo.message_original_Id = wcm.original_id
<where>
wcm.message_id=#{messageId}
</where>
</select>
</mapper>