<?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>
|