send-message-log-mapper.xml
1.72 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
<?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.cjs.cms.dao.pub.SendMessageLogDao">
<sql id="send_message">
id, phone_number, message, send_result, create_at,send_status
</sql>
<sql id="searchCondition">
where 1 = 1
<if test="phoneNumber != null and phoneNumber != ''">
and phone_number like CONCAT('%',#{phoneNumber},'%')
</if>
<if test="message!=null and message!=''">
and message like CONCAT('%',#{message},'%')
</if>
<if test="sendResult!=null and sendResult!=''">
and send_result=#{sendResult}
</if>
</sql>
<insert id="insertMegLog">
insert into
send_message_log(phone_number, message, send_result, create_at)
values(#{phoneNumber}, #{message}, #{sendResult}, now())
</insert>
<select id="getSendMessageList" parameterType="java.util.Map"
resultType="java.util.Map">
select
<include refid="send_message" />
from send_message_log
<include refid="searchCondition" />
order by create_at desc
<include refid="common.pageLimit" />
</select>
<select id="getSendMessageCount" parameterType="java.util.Map"
resultType="int">
select count(*) from send_message_log
<include refid="searchCondition" />
</select>
<update id="update" parameterType="java.util.Map">
update send_message_log set send_status=#{sendStatus} , send_at
=#{sendAt} where send_result=#{send_result}
</update>
<select id="queryByStatus" parameterType="java.util.Map"
resultType="java.util.Map">
select
<include refid="send_message" />
from send_message_log
where 1=1
<if test="sendResult!=null and sendResult!=''">
and send_result=#{sendResult}
</if>
</select>
</mapper>