WechatReplyConfigMapper.xml
4.16 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?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.wechat.mapper.WechatReplyConfigMapper" >
<resultMap id="BaseResultMap" type="cn.com.glsx.dj.wechat.model.WechatReplyConfig" >
<!--
WARNING - @mbg.generated
-->
<id column="id" property="id" jdbcType="INTEGER" />
<result column="wechat_appid" property="wechatAppid" jdbcType="VARCHAR" />
<result column="msg_type" property="msgType" jdbcType="VARCHAR" />
<result column="content" property="content" jdbcType="VARCHAR" />
<result column="event" property="event" jdbcType="VARCHAR" />
<result column="event_key" property="eventKey" jdbcType="VARCHAR" />
<result column="reply_msg_type" property="replyMsgType" jdbcType="VARCHAR" />
<result column="reply_content" property="replyContent" jdbcType="VARCHAR" />
<result column="reply_media_id" property="replyMediaId" jdbcType="VARCHAR" />
<result column="reply_title" property="replyTitle" jdbcType="VARCHAR" />
<result column="reply_description" property="replyDescription" jdbcType="VARCHAR" />
<result column="reply_pic_url" property="replyPicUrl" jdbcType="VARCHAR" />
<result column="reply_url" property="replyUrl" jdbcType="VARCHAR" />
<result column="order_no" property="orderNo" jdbcType="INTEGER" />
<result column="remark" property="remark"/>
<result column="created_by" property="createdBy" jdbcType="VARCHAR" />
<result column="created_date" property="createdDate" jdbcType="TIMESTAMP" />
<result column="updated_by" property="updatedBy" jdbcType="VARCHAR" />
<result column="updated_date" property="updatedDate" jdbcType="TIMESTAMP" />
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
</resultMap>
<resultMap type="cn.com.glsx.dj.wechat.dto.WechatReplyConfigDTO" id="DTOResultMap" extends="BaseResultMap">
</resultMap>
<sql id="Base_Column_List" >
<!--
WARNING - @mbg.generated
-->
id, wechat_appid, msg_type, content, event, event_key, reply_msg_type, reply_content,
reply_media_id, reply_title, reply_description, reply_pic_url, reply_url, order_no, remark,
created_by, created_date, updated_by, updated_date, deleted_flag
</sql>
<select id="list" parameterType="cn.com.glsx.dj.wechat.dto.WechatReplyConfigDTO" resultMap="DTOResultMap">
select <include refid="Base_Column_List" /> from dj_wechat_reply_config
<where>
deleted_flag = 'N'
<if test="id != null">
and id = #{id}
</if>
<if test="wechatAppid != null and wechatAppid !=''">
and wechat_appid = #{wechatAppid}
</if>
<if test="msgType != null and msgType !=''">
and msg_type = #{msgType}
</if>
<if test="content != null and content !=''">
and content like CONCAT('%',#{content},'%')
</if>
<if test="event != null and event !=''">
and event = #{event}
</if>
<if test="replyMsgType != null and replyMsgType !=''">
and reply_msg_type = #{replyMsgType}
</if>
</where>
order by order_no desc
</select>
<select id="listMatch" parameterType="cn.com.glsx.dj.wechat.model.WechatReplyConfig" resultMap="BaseResultMap">
select <include refid="Base_Column_List" /> from dj_wechat_reply_config
<where>
deleted_flag = 'N'
and wechat_appid = #{wechatAppid}
<choose>
<when test="msgType != null and msgType !=''">
and msg_type = #{msgType}
</when>
<otherwise>
and msg_type is null
</otherwise>
</choose>
<choose>
<when test="content != null and content !=''">
and content = #{content}
</when>
<otherwise>
and content is null
</otherwise>
</choose>
<choose>
<when test="event != null and event !=''">
and event = #{event}
</when>
<otherwise>
and event is null
</otherwise>
</choose>
<choose>
<when test="eventKey != null and eventKey !=''">
and event_key = #{eventKey}
</when>
<otherwise>
and event_key is null
</otherwise>
</choose>
</where>
order by order_no desc
</select>
</mapper>