diff --git a/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java b/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java
index a937b8d..0a63e51 100755
--- a/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java
+++ b/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java
@@ -10,6 +10,7 @@ import com.lq.cms.web.AdminBaseController;
import com.lq.code.entity.AjaxResult;
import com.lq.code.util.Constant;
import com.lq.code.util.FileUtil;
+import com.lq.code.util.StringUtil;
import com.lq.entity.SysUser;
import com.lq.entity.WechatMessage;
import org.apache.shiro.authz.annotation.RequiresPermissions;
@@ -24,6 +25,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
+import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
@@ -77,7 +79,10 @@ public class WechatMessageController {
AjaxResult ajaxResult = new AjaxResult();
try {
String filePath = upLoadFile(file);
- vo.setImageUrl(filePath);
+ if(StringUtil.isNotNull(filePath)) {
+ vo.setImageUrl(filePath);
+ }
+ vo.setUpdateTime(new Date());
wechatMessageService.save(vo);
} catch (IllegalAccessException e) {
e.printStackTrace();
@@ -93,7 +98,10 @@ public class WechatMessageController {
public Object update(WechatMessageVo vo,@RequestParam(value = "file",required = false) MultipartFile file){
AjaxResult ajaxResult = new AjaxResult();
String filePath = upLoadFile(file);
- vo.setImageUrl(filePath);
+ if (StringUtil.isNotNull(filePath)) {
+ vo.setImageUrl(filePath);
+ }
+ vo.setUpdateTime(new Date());
wechatMessageService.update(vo);
return ajaxResult;
}
diff --git a/src/main/resources/mybatis/mapping/SysFileDao.xml b/src/main/resources/mybatis/mapping/SysFileDao.xml
index 23939d6..8b8c82a 100644
--- a/src/main/resources/mybatis/mapping/SysFileDao.xml
+++ b/src/main/resources/mybatis/mapping/SysFileDao.xml
@@ -45,8 +45,10 @@
- DELETE
- FROM sys_file
+ UPDATE
+ sys_file
+ SET
+ status = 0
WHERE
id=#{id}
diff --git a/src/main/resources/mybatis/mapping/SysLogDao.xml b/src/main/resources/mybatis/mapping/SysLogDao.xml
index e940a9a..33c47e9 100644
--- a/src/main/resources/mybatis/mapping/SysLogDao.xml
+++ b/src/main/resources/mybatis/mapping/SysLogDao.xml
@@ -49,8 +49,10 @@
- DELETE
- FROM sys_log
+ UPDATE
+ sys_log
+ SET
+ status = 0
WHERE id=#{id}
diff --git a/src/main/resources/mybatis/mapping/SysResourceDao.xml b/src/main/resources/mybatis/mapping/SysResourceDao.xml
index 6b161a7..051cae8 100644
--- a/src/main/resources/mybatis/mapping/SysResourceDao.xml
+++ b/src/main/resources/mybatis/mapping/SysResourceDao.xml
@@ -70,9 +70,12 @@
- UPDATE sys_resource
- SET status = 0
- WHERE id=#{id}
+ UPDATE
+ sys_resource
+ SET
+ status = 0
+ WHERE
+ id=#{id}
diff --git a/src/main/resources/mybatis/mapping/SysRoleDao.xml b/src/main/resources/mybatis/mapping/SysRoleDao.xml
index f531bac..bc02c45 100644
--- a/src/main/resources/mybatis/mapping/SysRoleDao.xml
+++ b/src/main/resources/mybatis/mapping/SysRoleDao.xml
@@ -59,7 +59,12 @@
- UPDATE sys_role SET status = 0 WHERE id=#{id}
+ UPDATE
+ sys_role
+ SET
+ status = 0
+ WHERE
+ id=#{id}