Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibznotify
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibznotify
提交
38a2e62b
提交
38a2e62b
编写于
9月 04, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibiz4j 发布系统代码
上级
eb7c7a36
变更
2
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
14 行增加
和
5 行删除
+14
-5
MsgBodyMapper.xml
...rc/main/resources/mapper/notify/msgbody/MsgBodyMapper.xml
+3
-3
VersionCheckAspect.java
.../main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
+11
-2
未找到文件。
ibznotify-core/src/main/resources/mapper/notify/msgbody/MsgBodyMapper.xml
浏览文件 @
38a2e62b
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select
id=
"selectById"
resultMap=
"MsgBodyResultMap"
databaseId=
"mysql"
>
<select
id=
"selectById"
resultMap=
"MsgBodyResultMap"
databaseId=
"mysql"
>
<![CDATA[select t1.* from (SELECT t1.`CONTENT`, t1.`ERRORINFO`, t1.`ISERROR`, t1.`ISSEND`, t1.`MSGID`, t1.`MSGLINK`, t1.`MSGNAME`, t1.`MSGTYPE`, t1.`SUBJECT`, t1.`TEMPLATEID`, t1.`TEMPLPARAMS`, t1.`TOUSERS`, t1.`USERDATA`
, t1.`USERDATA2`
FROM `IBZMSGBODY` t1 ) t1 where msgid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`CONTENT`, t1.`ERRORINFO`, t1.`ISERROR`, t1.`ISSEND`, t1.`MSGID`, t1.`MSGLINK`, t1.`MSGNAME`, t1.`MSGTYPE`, t1.`SUBJECT`, t1.`TEMPLATEID`, t1.`TEMPLPARAMS`, t1.`TOUSERS`, t1.`USERDATA` FROM `IBZMSGBODY` t1 ) t1 where msgid=#{id}]]>
</select>
</select>
<select
id=
"selectById"
resultMap=
"MsgBodyResultMap"
databaseId=
"oracle"
>
<select
id=
"selectById"
resultMap=
"MsgBodyResultMap"
databaseId=
"oracle"
>
<![CDATA[select t1.* from (SELECT t1.CONTENT, t1.ERRORINFO, t1.ISERROR, t1.ISSEND, t1.MSGID, t1.MSGLINK, t1.MSGNAME, t1.MSGTYPE, t1.SUBJECT, t1.TEMPLATEID, t1.TEMPLPARAMS, t1.TOUSERS, t1.USERDATA FROM IBZMSGBODY t1 ) t1 where msgid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.CONTENT, t1.ERRORINFO, t1.ISERROR, t1.ISSEND, t1.MSGID, t1.MSGLINK, t1.MSGNAME, t1.MSGTYPE, t1.SUBJECT, t1.TEMPLATEID, t1.TEMPLPARAMS, t1.TOUSERS, t1.USERDATA FROM IBZMSGBODY t1 ) t1 where msgid=#{id}]]>
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
<!--数据查询[Default]-->
<!--数据查询[Default]-->
<sql
id=
"Default"
databaseId=
"mysql"
>
<sql
id=
"Default"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CONTENT`, t1.`ISERROR`, t1.`ISSEND`, t1.`MSGID`, t1.`MSGLINK`, t1.`MSGNAME`, t1.`MSGTYPE`, t1.`SUBJECT`, t1.`TEMPLATEID`, t1.`TOUSERS`, t1.`USERDATA`
, t1.`USERDATA2`
FROM `IBZMSGBODY` t1
<![CDATA[ SELECT t1.`CONTENT`, t1.`ISERROR`, t1.`ISSEND`, t1.`MSGID`, t1.`MSGLINK`, t1.`MSGNAME`, t1.`MSGTYPE`, t1.`SUBJECT`, t1.`TEMPLATEID`, t1.`TOUSERS`, t1.`USERDATA` FROM `IBZMSGBODY` t1
]]>
]]>
</sql>
</sql>
<!--数据查询[Default]-->
<!--数据查询[Default]-->
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
</sql>
</sql>
<!--数据查询[View]-->
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"mysql"
>
<sql
id=
"View"
databaseId=
"mysql"
>
<![CDATA[ SELECT t1.`CONTENT`, t1.`ERRORINFO`, t1.`ISERROR`, t1.`ISSEND`, t1.`MSGID`, t1.`MSGLINK`, t1.`MSGNAME`, t1.`MSGTYPE`, t1.`SUBJECT`, t1.`TEMPLATEID`, t1.`TEMPLPARAMS`, t1.`TOUSERS`, t1.`USERDATA`
, t1.`USERDATA2`
FROM `IBZMSGBODY` t1
<![CDATA[ SELECT t1.`CONTENT`, t1.`ERRORINFO`, t1.`ISERROR`, t1.`ISSEND`, t1.`MSGID`, t1.`MSGLINK`, t1.`MSGNAME`, t1.`MSGTYPE`, t1.`SUBJECT`, t1.`TEMPLATEID`, t1.`TEMPLPARAMS`, t1.`TOUSERS`, t1.`USERDATA` FROM `IBZMSGBODY` t1
]]>
]]>
</sql>
</sql>
<!--数据查询[View]-->
<!--数据查询[View]-->
...
...
ibznotify-util/src/main/java/cn/ibizlab/util/aspect/VersionCheckAspect.java
浏览文件 @
38a2e62b
...
@@ -18,6 +18,9 @@ import org.springframework.stereotype.Component;
...
@@ -18,6 +18,9 @@ import org.springframework.stereotype.Component;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Field
;
import
java.sql.Timestamp
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -109,7 +112,8 @@ public class VersionCheckAspect
...
@@ -109,7 +112,8 @@ public class VersionCheckAspect
*/
*/
@SneakyThrows
@SneakyThrows
private
Object
getDBVersion
(
VersionCheck
versionCheck
,
Object
service
,
Object
id
){
private
Object
getDBVersion
(
VersionCheck
versionCheck
,
Object
service
,
Object
id
){
Object
dbVersion
=
null
;
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Timestamp
dbVersion
=
null
;
String
versionField
=
versionCheck
.
versionfield
();
String
versionField
=
versionCheck
.
versionfield
();
if
(!
ObjectUtils
.
isEmpty
(
service
)){
if
(!
ObjectUtils
.
isEmpty
(
service
)){
EvaluationContext
oldContext
=
new
StandardEvaluationContext
();
EvaluationContext
oldContext
=
new
StandardEvaluationContext
();
...
@@ -117,7 +121,12 @@ public class VersionCheckAspect
...
@@ -117,7 +121,12 @@ public class VersionCheckAspect
oldContext
.
setVariable
(
"id"
,
id
);
oldContext
.
setVariable
(
"id"
,
id
);
Expression
oldExp
=
parser
.
parseExpression
(
"#service.get(#id)"
);
Expression
oldExp
=
parser
.
parseExpression
(
"#service.get(#id)"
);
EntityBase
oldEntity
=
oldExp
.
getValue
(
oldContext
,
EntityBase
.
class
);
EntityBase
oldEntity
=
oldExp
.
getValue
(
oldContext
,
EntityBase
.
class
);
return
oldEntity
.
get
(
versionField
);
Object
oldDate
=
oldEntity
.
get
(
versionField
);
if
(
oldDate
!=
null
&&
oldDate
instanceof
Timestamp
){
Timestamp
db_time
=
(
Timestamp
)
oldDate
;
Date
db_date
=
sdf
.
parse
(
sdf
.
format
(
db_time
));
dbVersion
=
new
Timestamp
(
db_date
.
getTime
());
}
}
}
return
dbVersion
;
return
dbVersion
;
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录