Преглед изворни кода

优化邮件发送记录编辑功能

wangqiong пре 2 година
родитељ
комит
f94be91bb3

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/sendrecord/impl/SendMailRecordServiceImpl.java Прегледај датотеку

@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
14 14
 import org.springframework.stereotype.Service;
15 15
 
16 16
 import java.io.File;
17
+import java.util.Date;
17 18
 import java.util.List;
18 19
 
19 20
 @Service
@@ -46,6 +47,7 @@ public class SendMailRecordServiceImpl implements ISendMailRecordService {
46 47
                 msSendMailHistoryRecord.setParentId(old.getId());
47 48
                 msSendMailHistoryRecord.setId(null);
48 49
                 msSendMailHistoryRecordMapper.insertSelective(msSendMailHistoryRecord);
50
+                sendMailRecord.setUpdateTime(new Date());
49 51
                 sendMailRecordMapper.updateSendMailRecord(sendMailRecord);
50 52
                 return AjaxResult.success("编辑成功");
51 53
             } else {

+ 5
- 4
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/sendrecord/SendMailRecordMapper.xml Прегледај датотеку

@@ -62,10 +62,11 @@
62 62
     </insert>
63 63
     <update id="updateSendMailRecord">
64 64
         update ms_send_mail_record
65
-        set mail_content= #{mailContent},
66
-            update_time=#{updateTime},
67
-            send_time=#{sendTime},
68
-            send_status=#{sendStatus}
65
+        set
66
+        <if test="mailContent != null ">mail_content= #{mailContent}</if>
67
+        <if test="updateTime != null ">,update_time=#{updateTime}</if>
68
+        <if test="sendTime != null ">,send_time=#{sendTime}</if>
69
+        <if test="sendStatus != null ">,send_status=#{sendStatus}</if>
69 70
         where id = #{id}
70 71
     </update>
71 72
     <select id="querySendMailRecordById" resultMap="SendMailRecordResult">