zhangback
8 天以前 3974fad5d836431e417e99220cc07bb5b0aba331
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?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.ruoyi.tms.mapper.TmsMessageNotifyMapper">
 
    <resultMap type="com.ruoyi.tms.domain.TmsMessageNotify" id="TmsMessageNotifyResult">
        <result property="id"    column="id"    />
        <result property="title"    column="title"    />
        <result property="content"    column="content"    />
        <result property="type"    column="type"    />
        <result property="targetUid"    column="target_uid"    />
        <result property="status"    column="status"    />
        <result property="readStatus"    column="read_status"    />
        <result property="readTime"    column="read_time"    />
        <result property="extraData"    column="extra_data"    />
        <result property="createUid"    column="create_uid"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUid"    column="update_uid"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
 
    <sql id="selectTmsMessageNotifyVo">
        select thisTab.id, thisTab.title, thisTab.content, thisTab.type, thisTab.target_uid, thisTab.status, thisTab.read_status, thisTab.read_time, thisTab.extra_data, thisTab.create_uid, thisTab.create_time, thisTab.update_uid, thisTab.update_time from tms_message_notify AS thisTab
    </sql>
    <sql id="selectTmsMessageNotifyVoCount">
        select count(0) from tms_message_notify as thisTab
    </sql>
 
    <sql id="whereCondition">
        <if test="title != null  and title != ''"> and thisTab.title = #{title}</if>
        <if test="content != null  and content != ''"> and thisTab.content = #{content}</if>
        <if test="type != null "> and thisTab.type = #{type}</if>
        <if test="targetUid != null "> and thisTab.target_uid = #{targetUid}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
        <if test="readStatus != null "> and thisTab.read_status = #{readStatus}</if>
        <if test="readTime != null "> and thisTab.read_time = #{readTime}</if>
        <if test="extraData != null  and extraData != ''"> and thisTab.extra_data = #{extraData}</if>
        <if test="createUid != null "> and thisTab.create_uid = #{createUid}</if>
        <if test="updateUid != null "> and thisTab.update_uid = #{updateUid}</if>
    </sql>
 
    <!--查询-->
    <select id="selectTmsMessageNotifyById" parameterType="Integer" resultMap="TmsMessageNotifyResult">
        <include refid="selectTmsMessageNotifyVo"/>
        where id = #{id}
    </select>
 
    <select id="selectTmsMessageNotifyCount" parameterType="com.ruoyi.tms.domain.TmsMessageNotify" resultType="int">
        <include refid="selectTmsMessageNotifyVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
 
    <select id="selectTmsMessageNotifyList" parameterType="com.ruoyi.tms.domain.TmsMessageNotify" resultMap="TmsMessageNotifyResult">
        <include refid="selectTmsMessageNotifyVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
 
    <!-- 新增 -->
    <insert id="insertTmsMessageNotify" parameterType="com.ruoyi.tms.domain.TmsMessageNotify"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_message_notify
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="title != null and title != ''">title,</if>
            <if test="content != null and content != ''">content,</if>
            <if test="type != null">type,</if>
            <if test="targetUid != null">target_uid,</if>
            <if test="status != null">status,</if>
            <if test="readStatus != null">read_status,</if>
            <if test="readTime != null">read_time,</if>
            <if test="extraData != null">extra_data,</if>
            <if test="createUid != null">create_uid,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateUid != null">update_uid,</if>
            <if test="updateTime != null">update_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="title != null and title != ''">#{title},</if>
            <if test="content != null and content != ''">#{content},</if>
            <if test="type != null">#{type},</if>
            <if test="targetUid != null">#{targetUid},</if>
            <if test="status != null">#{status},</if>
            <if test="readStatus != null">#{readStatus},</if>
            <if test="readTime != null">#{readTime},</if>
            <if test="extraData != null">#{extraData},</if>
            <if test="createUid != null">#{createUid},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateUid != null">#{updateUid},</if>
            <if test="updateTime != null">#{updateTime},</if>
         </trim>
    </insert>
 
    <insert id="insertTmsMessageNotifyBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_message_notify
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,title,content,type,target_uid,status,read_status,read_time,extra_data,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.title},#{item.content},#{item.type},#{item.targetUid},#{item.status},#{item.readStatus},#{item.readTime},#{item.extraData},
            </trim>
        </foreach>
    </insert>
 
    <!-- 修改 -->
    <update id="updateTmsMessageNotify" parameterType="com.ruoyi.tms.domain.TmsMessageNotify">
        update tms_message_notify
        <trim prefix="SET" suffixOverrides=",">
            <if test="title != null and title != ''">title = #{title},</if>
            <if test="content != null and content != ''">content = #{content},</if>
            <if test="type != null">type = #{type},</if>
            <if test="targetUid != null">target_uid = #{targetUid},</if>
            <if test="status != null">status = #{status},</if>
            <if test="readStatus != null">read_status = #{readStatus},</if>
            <if test="readTime != null">read_time = #{readTime},</if>
            <if test="extraData != null">extra_data = #{extraData},</if>
            <if test="createUid != null">create_uid = #{createUid},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateUid != null">update_uid = #{updateUid},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateTmsMessageNotifyBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update tms_message_notify
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.title != null and item.title != ''">title = #{item.title},</if>
                <if test="item.content != null and item.content != ''">content = #{item.content},</if>
                <if test="item.type != null">type = #{item.type},</if>
                <if test="item.targetUid != null">target_uid = #{item.targetUid},</if>
                <if test="item.status != null">status = #{item.status},</if>
                <if test="item.readStatus != null">read_status = #{item.readStatus},</if>
                <if test="item.readTime != null">read_time = #{item.readTime},</if>
                <if test="item.extraData != null">extra_data = #{item.extraData},</if>
                <if test="item.createUid != null">create_uid = #{item.createUid},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateUid != null">update_uid = #{item.updateUid},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
            </trim>
        where id = #{item.id}
        </foreach>
    </update>
 
    <!--删除-->
    <delete id="deleteTmsMessageNotifyById" parameterType="Integer">
        delete from tms_message_notify where id = #{id}
    </delete>
    <delete id="deleteTmsMessageNotifyByIds" parameterType="Integer">
        delete from tms_message_notify where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>