WeMsgTlpScopeMapper.xml
3.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?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.WeMsgTlpScopeMapper">
<resultMap type="WeMsgTlpScope" id="WeMsgTlpScopeResult">
<result property="id" column="id" />
<result property="msgTlpId" column="msg_tlp_id" />
<result property="useUserId" column="use_user_id" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectWeMsgTlpScopeVo">
select id, msg_tlp_id, use_user_id, del_flag from we_msg_tlp_scope
</sql>
<select id="selectWeMsgTlpScopeList" parameterType="WeMsgTlpScope" resultMap="WeMsgTlpScopeResult">
<include refid="selectWeMsgTlpScopeVo"/>
<where>
<if test="msgTlpId != null "> and msg_tlp_id = #{msgTlpId}</if>
<if test="useUserId != null "> and use_user_id = #{useUserId}</if>
</where>
</select>
<select id="selectWeMsgTlpScopeById" parameterType="Long" resultMap="WeMsgTlpScopeResult">
<include refid="selectWeMsgTlpScopeVo"/>
where id = #{id}
</select>
<insert id="insertWeMsgTlpScope" parameterType="WeMsgTlpScope">
insert into we_msg_tlp_scope
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="msgTlpId != null">msg_tlp_id,</if>
<if test="useUserId != null">use_user_id,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="msgTlpId != null">#{msgTlpId},</if>
<if test="useUserId != null">#{useUserId},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateWeMsgTlpScope" parameterType="WeMsgTlpScope">
update we_msg_tlp_scope
<trim prefix="SET" suffixOverrides=",">
<if test="msgTlpId != null">msg_tlp_id = #{msgTlpId},</if>
<if test="useUserId != null">use_user_id = #{useUserId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeMsgTlpScopeById" parameterType="Long">
delete from we_msg_tlp_scope where id = #{id}
</delete>
<delete id="deleteWeMsgTlpScopeByIds" parameterType="String">
delete from we_msg_tlp_scope where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchInsetWeMsgTlpScope">
insert into we_msg_tlp_scope (id,msg_tlp_id,use_user_id,del_flag)
values
<foreach collection="weMsgTlpScopes" item="scop" index="index" separator=",">
(#{scop.id},#{scop.msgTlpId},#{scop.useUserId},#{scop.delFlag})
</foreach>
</insert>
<update id="batchRemoveWeMsgTlpScopesByMsgTlpIds">
update we_msg_tlp_scope set
del_flag = 2
where msgTlpId in
<foreach collection="msgTlpIds" item="msgTlpId" index="index"
separator="," open="(" close=")">
#{msgTlpId.msgTlpId}
</foreach>
</update>
</mapper>