|
|
@@ -1,32 +1,37 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.doc.sms.mapper.SmsRecordMapper">
|
|
|
|
|
|
<resultMap type="SmsRecord" id="SmsRecordResult">
|
|
|
- <result property="recordId" column="RECORD_ID" />
|
|
|
- <result property="sendPhone" column="SEND_PHONE" />
|
|
|
- <result property="sendContent" column="SEND_CONTENT" />
|
|
|
- <result property="templateId" column="TEMPLATE_ID" />
|
|
|
- <result property="snedSuccess" column="SNED_SUCCESS" />
|
|
|
- <result property="sendResult" column="SEND_RESULT" />
|
|
|
+ <result property="recordId" column="RECORD_ID"/>
|
|
|
+ <result property="sendPhone" column="SEND_PHONE"/>
|
|
|
+ <result property="sendContent" column="SEND_CONTENT"/>
|
|
|
+ <result property="templateId" column="TEMPLATE_ID"/>
|
|
|
+ <result property="snedSuccess" column="SNED_SUCCESS"/>
|
|
|
+ <result property="sendResult" column="SEND_RESULT"/>
|
|
|
+ <result property="sendTime" column="SEND_TIME"/>
|
|
|
+ <result property="smsType" column="SMS_TYPE"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectSmsRecordVo">
|
|
|
- select RECORD_ID, SEND_PHONE, SEND_CONTENT, TEMPLATE_ID, SNED_SUCCESS, SEND_RESULT from sms_record
|
|
|
+ select RECORD_ID, SEND_PHONE, SEND_CONTENT, TEMPLATE_ID, SNED_SUCCESS, SEND_RESULT, SEND_TIME,SMS_TYPE
|
|
|
+ from sms_record
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectSmsRecordList" parameterType="SmsRecord" resultMap="SmsRecordResult">
|
|
|
<include refid="selectSmsRecordVo"/>
|
|
|
<where>
|
|
|
- <if test="recordId != null "> and RECORD_ID = #{recordId}</if>
|
|
|
- <if test="sendPhone != null and sendPhone != ''"> and SEND_PHONE = #{sendPhone}</if>
|
|
|
- <if test="sendContent != null and sendContent != ''"> and SEND_CONTENT = #{sendContent}</if>
|
|
|
- <if test="templateId != null and templateId != ''"> and TEMPLATE_ID = #{templateId}</if>
|
|
|
- <if test="snedSuccess != null and snedSuccess != ''"> and SNED_SUCCESS = #{snedSuccess}</if>
|
|
|
- <if test="sendResult != null and sendResult != ''"> and SEND_RESULT = #{sendResult}</if>
|
|
|
+ <if test="recordId != null ">and RECORD_ID = #{recordId}</if>
|
|
|
+ <if test="sendPhone != null and sendPhone != ''">and SEND_PHONE = #{sendPhone}</if>
|
|
|
+ <if test="sendContent != null and sendContent != ''">and SEND_CONTENT = #{sendContent}</if>
|
|
|
+ <if test="templateId != null and templateId != ''">and TEMPLATE_ID = #{templateId}</if>
|
|
|
+ <if test="snedSuccess != null and snedSuccess != ''">and SNED_SUCCESS = #{snedSuccess}</if>
|
|
|
+ <if test="sendResult != null and sendResult != ''">and SEND_RESULT = #{sendResult}</if>
|
|
|
+ <if test="smsType != null and smsType != ''">and SMS_TYPE = #{smsType}</if>
|
|
|
</where>
|
|
|
+ order by send_time desc
|
|
|
</select>
|
|
|
|
|
|
<select id="selectSmsRecordByRecordId" parameterType="Long" resultMap="SmsRecordResult">
|
|
|
@@ -43,7 +48,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="templateId != null">TEMPLATE_ID,</if>
|
|
|
<if test="snedSuccess != null">SNED_SUCCESS,</if>
|
|
|
<if test="sendResult != null">SEND_RESULT,</if>
|
|
|
- </trim>
|
|
|
+ <if test="sendTime != null">SEND_TIME,</if>
|
|
|
+ <if test="smsType != null">SMS_TYPE,</if>
|
|
|
+ </trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="recordId != null">#{recordId},</if>
|
|
|
<if test="sendPhone != null">#{sendPhone},</if>
|
|
|
@@ -51,7 +58,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="templateId != null">#{templateId},</if>
|
|
|
<if test="snedSuccess != null">#{snedSuccess},</if>
|
|
|
<if test="sendResult != null">#{sendResult},</if>
|
|
|
- </trim>
|
|
|
+ <if test="sendTime != null">#{sendTime},</if>
|
|
|
+ <if test="smsType != null">#{smsType},</if>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="updateSmsRecord" parameterType="SmsRecord">
|
|
|
@@ -67,7 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteSmsRecordByRecordId" parameterType="Long">
|
|
|
- delete from sms_record where RECORD_ID = #{recordId}
|
|
|
+ delete
|
|
|
+ from sms_record
|
|
|
+ where RECORD_ID = #{recordId}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteSmsRecordByRecordIds" parameterType="String">
|