liusheng
2025-02-17 32d595cb8c9b608f089c800815bf44210e25117c
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?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.smartor.mapper.SmsRecordsMapper">
 
    <resultMap type="SmsRecords" id="SmsRecordsResult">
        <result property="recordid"    column="recordid"    />
        <result property="userid"    column="userid"    />
        <result property="username"    column="username"    />
        <result property="phone"    column="phone"    />
        <result property="msgno"    column="msgno"    />
        <result property="msg"    column="msg"    />
        <result property="inserttime"    column="inserttime"    />
        <result property="sendtime"    column="sendtime"    />
        <result property="sendfailedcount"    column="sendfailedcount"    />
        <result property="resulttime"    column="resulttime"    />
        <result property="resultmsg"    column="resultmsg"    />
        <result property="sendstate"    column="sendstate"    />
        <result property="inserttype"    column="inserttype"    />
        <result property="insertsystem"    column="insertsystem"    />
        <result property="insertmodule"    column="insertmodule"    />
        <result property="moduleid"    column="moduleid"    />
        <result property="msgidentify"    column="msgidentify"    />
        <result property="accountid"    column="accountid"    />
        <result property="orgid"    column="orgid"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="isupload"    column="isupload"    />
        <result property="uploadTime"    column="upload_time"    />
        <result property="guid"    column="guid"    />
    </resultMap>
 
    <sql id="selectSmsRecordsVo">
        select recordid, userid, guid, username, phone, msgno, msg, inserttime, sendtime, sendfailedcount, resulttime, resultmsg, sendstate, inserttype, insertsystem, insertmodule, moduleid, msgidentify, accountid, orgid, del_flag, update_by, update_time, create_by, create_time, isupload, upload_time from sms_records
    </sql>
 
    <select id="selectSmsRecordsList" parameterType="SmsRecords" resultMap="SmsRecordsResult">
        <include refid="selectSmsRecordsVo"/>
        <where>
            <if test="userid != null  and userid != ''"> and userid = #{userid}</if>
            <if test="username != null  and username != ''"> and username like concat('%', #{username}, '%')</if>
            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
            <if test="msgno != null  and msgno != ''"> and msgno = #{msgno}</if>
            <if test="msg != null  and msg != ''"> and msg = #{msg}</if>
            <if test="inserttime != null "> and inserttime = #{inserttime}</if>
            <if test="sendtime != null "> and sendtime = #{sendtime}</if>
            <if test="sendfailedcount != null "> and sendfailedcount = #{sendfailedcount}</if>
            <if test="resulttime != null "> and resulttime = #{resulttime}</if>
            <if test="resultmsg != null  and resultmsg != ''"> and resultmsg = #{resultmsg}</if>
            <if test="sendstate != null "> and sendstate = #{sendstate}</if>
            <if test="inserttype != null "> and inserttype = #{inserttype}</if>
            <if test="insertsystem != null "> and insertsystem = #{insertsystem}</if>
            <if test="insertmodule != null  and insertmodule != ''"> and insertmodule = #{insertmodule}</if>
            <if test="moduleid != null  and moduleid != ''"> and moduleid = #{moduleid}</if>
            <if test="msgidentify != null  and msgidentify != ''"> and msgidentify = #{msgidentify}</if>
            <if test="accountid != null "> and accountid = #{accountid}</if>
            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
            <if test="isupload != null "> and isupload = #{isupload}</if>
            <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
        </where>
    </select>
 
    <select id="selectSmsRecordsByRecordid" parameterType="Long" resultMap="SmsRecordsResult">
        <include refid="selectSmsRecordsVo"/>
        where recordid = #{recordid}
    </select>
 
    <insert id="insertSmsRecords" parameterType="SmsRecords">
        insert into sms_records
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="recordid != null">recordid,</if>
            <if test="userid != null">userid,</if>
            <if test="username != null">username,</if>
            <if test="phone != null">phone,</if>
            <if test="msgno != null">msgno,</if>
            <if test="msg != null">msg,</if>
            <if test="inserttime != null">inserttime,</if>
            <if test="sendtime != null">sendtime,</if>
            <if test="sendfailedcount != null">sendfailedcount,</if>
            <if test="resulttime != null">resulttime,</if>
            <if test="resultmsg != null">resultmsg,</if>
            <if test="sendstate != null">sendstate,</if>
            <if test="inserttype != null">inserttype,</if>
            <if test="insertsystem != null">insertsystem,</if>
            <if test="insertmodule != null">insertmodule,</if>
            <if test="moduleid != null">moduleid,</if>
            <if test="msgidentify != null">msgidentify,</if>
            <if test="accountid != null">accountid,</if>
            <if test="orgid != null">orgid,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="isupload != null">isupload,</if>
            <if test="uploadTime != null">upload_time,</if>
            <if test="guid != null">guid,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="recordid != null">#{recordid},</if>
            <if test="userid != null">#{userid},</if>
            <if test="username != null">#{username},</if>
            <if test="phone != null">#{phone},</if>
            <if test="msgno != null">#{msgno},</if>
            <if test="msg != null">#{msg},</if>
            <if test="inserttime != null">#{inserttime},</if>
            <if test="sendtime != null">#{sendtime},</if>
            <if test="sendfailedcount != null">#{sendfailedcount},</if>
            <if test="resulttime != null">#{resulttime},</if>
            <if test="resultmsg != null">#{resultmsg},</if>
            <if test="sendstate != null">#{sendstate},</if>
            <if test="inserttype != null">#{inserttype},</if>
            <if test="insertsystem != null">#{insertsystem},</if>
            <if test="insertmodule != null">#{insertmodule},</if>
            <if test="moduleid != null">#{moduleid},</if>
            <if test="msgidentify != null">#{msgidentify},</if>
            <if test="accountid != null">#{accountid},</if>
            <if test="orgid != null">#{orgid},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="isupload != null">#{isupload},</if>
            <if test="uploadTime != null">#{uploadTime},</if>
            <if test="guid != null">#{guid},</if>
         </trim>
    </insert>
 
    <update id="updateSmsRecords" parameterType="SmsRecords">
        update sms_records
        <trim prefix="SET" suffixOverrides=",">
            <if test="userid != null">userid = #{userid},</if>
            <if test="username != null">username = #{username},</if>
            <if test="phone != null">phone = #{phone},</if>
            <if test="msgno != null">msgno = #{msgno},</if>
            <if test="msg != null">msg = #{msg},</if>
            <if test="inserttime != null">inserttime = #{inserttime},</if>
            <if test="sendtime != null">sendtime = #{sendtime},</if>
            <if test="sendfailedcount != null">sendfailedcount = #{sendfailedcount},</if>
            <if test="resulttime != null">resulttime = #{resulttime},</if>
            <if test="resultmsg != null">resultmsg = #{resultmsg},</if>
            <if test="sendstate != null">sendstate = #{sendstate},</if>
            <if test="inserttype != null">inserttype = #{inserttype},</if>
            <if test="insertsystem != null">insertsystem = #{insertsystem},</if>
            <if test="insertmodule != null">insertmodule = #{insertmodule},</if>
            <if test="moduleid != null">moduleid = #{moduleid},</if>
            <if test="msgidentify != null">msgidentify = #{msgidentify},</if>
            <if test="accountid != null">accountid = #{accountid},</if>
            <if test="orgid != null">orgid = #{orgid},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="isupload != null">isupload = #{isupload},</if>
            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
            <if test="guid != null">guid = #{guid},</if>
        </trim>
        where recordid = #{recordid}
    </update>
 
    <delete id="deleteSmsRecordsByRecordid" parameterType="Long">
        delete from sms_records where recordid = #{recordid}
    </delete>
 
    <delete id="deleteSmsRecordsByRecordids" parameterType="String">
        delete from sms_records where recordid in
        <foreach item="recordid" collection="array" open="(" separator="," close=")">
            #{recordid}
        </foreach>
    </delete>
</mapper>