DracMessageCustomerCollectionMapper.xml
3.39 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="cn.com.glsx.entmicro.mapper.DracMessageCustomerCollectionMapper">
<resultMap id="BaseResultMap" type="cn.com.glsx.entmicro.entity.message.DracMessageCustomerCollection">
<!--
WARNING - @mbg.generated
-->
<id column="id" jdbcType="INTEGER" property="id"/>
<result column="im_id" jdbcType="INTEGER" property="imId"/>
<result column="phone" jdbcType="VARCHAR" property="phone"/>
<result column="customer_name" jdbcType="VARCHAR" property="customerName"/>
<result column="message_sign" jdbcType="VARCHAR" property="messageSign"/>
<result column="short_url" jdbcType="VARCHAR" property="shortUrl"/>
<result column="send_time" jdbcType="TIMESTAMP" property="sendTime"/>
<result column="del_flag" jdbcType="INTEGER" property="delFlag"/>
<result column="created_by" jdbcType="INTEGER" property="createdBy"/>
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
<result column="updated_by" jdbcType="INTEGER" property="updatedBy"/>
<result column="updated_time" jdbcType="TIMESTAMP" property="updatedTime"/>
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
-->
id, im_id, phone, customer_name, message_sign, short_url, send_time, del_flag, created_by,
created_time, updated_by, updated_time
</sql>
<update id="updateStatusByImId">
update drac_message_customer_collection
set del_flag=1,
send_time=now()
where im_id=#{imId}
</update>
<select id="findByUuid"
resultType="cn.com.glsx.entmicro.model.response.message.DracMesCusrCollectionResponse">
select t1.phone as phone,t1.customer_name as customerName,t1.message_sign as messageSign,t1.short_url as shortUrl,
t1.send_time as sendTime,t2.message_context as messageContext,t1.im_id as imId
from drac_message_customer_collection t1
left join drac_message_info t2 on t1.im_id=t2.id
where 1=1
<if test="condition.imUid != null and condition.imUid != ''">
and t2.im_Uid = #{condition.imUid}
</if>
<if test="condition.id != null">
and t2.id = #{condition.id}
</if>
</select>
<select id="findAllCustomerByPage"
resultType="cn.com.glsx.entmicro.model.response.message.DracMesCusrCollectionResponse">
select t1.phone as phone,t1.customer_name as customerName,t1.message_sign as messageSign,t1.short_url as shortUrl,
t1.send_time as sendTime,t2.message_context as messageContext,t1.im_id as imId,t1.del_flag as delFlag,t1.merchant_Name as merchantName
from drac_message_customer_collection t1
left join drac_message_info t2 on t1.im_id=t2.id
where t1.im_id=#{condition.imId}
<if test="condition.delFlag != null">
and t1.del_flag=#{condition.delFlag}
</if>
<if test="condition.phone != null and condition.phone != ''">
and t1.phone like concat('%',#{condition.phone},'%')
</if>
<if test="condition.merchantName != null and condition.merchantName != ''">
and t1.merchant_Name like concat('%',#{condition.merchantName},'%')
</if>
</select>
</mapper>