Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
iBiz商业中心
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz商业套件
iBiz商业中心
提交
65d39887
提交
65d39887
编写于
10月 26, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xignzi006 发布系统代码
上级
7762566b
变更
10
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
720 行增加
和
0 行删除
+720
-0
Ir_attachmentServiceImpl.java
...l/core/odoo_ir/service/impl/Ir_attachmentServiceImpl.java
+3
-0
Message_attachment_rel.java
...central/core/odoo_mail/domain/Message_attachment_rel.java
+123
-0
Message_attachment_relSearchContext.java
...odoo_mail/filter/Message_attachment_relSearchContext.java
+57
-0
Message_attachment_relMapper.java
...l/core/odoo_mail/mapper/Message_attachment_relMapper.java
+69
-0
IMessage_attachment_relService.java
...ore/odoo_mail/service/IMessage_attachment_relService.java
+62
-0
Mail_messageServiceImpl.java
.../core/odoo_mail/service/impl/Mail_messageServiceImpl.java
+3
-0
Message_attachment_relServiceImpl.java
..._mail/service/impl/Message_attachment_relServiceImpl.java
+255
-0
h2_table.xml
...esscentral-core/src/main/resources/liquibase/h2_table.xml
+4
-0
Message_attachment_relMapper.xml
...l/message_attachment_rel/Message_attachment_relMapper.xml
+59
-0
iBizBusinessCentral.json
...core/src/main/resources/sysmodel/iBizBusinessCentral.json
+85
-0
未找到文件。
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_ir/service/impl/Ir_attachmentServiceImpl.java
浏览文件 @
65d39887
...
...
@@ -50,6 +50,9 @@ import org.springframework.util.StringUtils;
@Service
(
"Ir_attachmentServiceImpl"
)
public
class
Ir_attachmentServiceImpl
extends
EBSServiceImpl
<
Ir_attachmentMapper
,
Ir_attachment
>
implements
IIr_attachmentService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMessage_attachment_relService
messageAttachmentRelService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_base
.
service
.
IRes_companyService
resCompanyService
;
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/domain/Message_attachment_rel.java
0 → 100644
浏览文件 @
65d39887
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
domain
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.math.BigInteger
;
import
java.util.HashMap
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.DigestUtils
;
import
cn.ibizlab.businesscentral.util.domain.EntityBase
;
import
cn.ibizlab.businesscentral.util.annotation.DEField
;
import
cn.ibizlab.businesscentral.util.enums.DEPredefinedFieldType
;
import
cn.ibizlab.businesscentral.util.enums.DEFieldDefaultValueType
;
import
cn.ibizlab.businesscentral.util.helper.DataObject
;
import
java.io.Serializable
;
import
lombok.*
;
import
org.springframework.data.annotation.Transient
;
import
cn.ibizlab.businesscentral.util.annotation.Audit
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
com.baomidou.mybatisplus.annotation.*
;
import
cn.ibizlab.businesscentral.util.domain.EntityMP
;
import
com.baomidou.mybatisplus.core.toolkit.IdWorker
;
/**
* 实体[消息附件]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties
(
value
=
"handler"
)
@TableName
(
value
=
"MESSAGE_ATTACHMENT_REL"
,
resultMap
=
"Message_attachment_relResultMap"
)
public
class
Message_attachment_rel
extends
EntityMP
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* id
*/
@DEField
(
isKeyField
=
true
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@JSONField
(
name
=
"id"
)
@JsonProperty
(
"id"
)
private
Long
id
;
/**
* ID
*/
@DEField
(
name
=
"message_id"
)
@TableField
(
value
=
"message_id"
)
@JSONField
(
name
=
"message_id"
)
@JsonProperty
(
"message_id"
)
private
Long
messageId
;
/**
* ID
*/
@DEField
(
name
=
"attachment_id"
)
@TableField
(
value
=
"attachment_id"
)
@JSONField
(
name
=
"attachment_id"
)
@JsonProperty
(
"attachment_id"
)
private
Long
attachmentId
;
/**
*
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_ir
.
domain
.
Ir_attachment
odooAttachment
;
/**
*
*/
@JsonIgnore
@JSONField
(
serialize
=
false
)
@TableField
(
exist
=
false
)
private
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
domain
.
Mail_message
orooMessage
;
/**
* 设置 [ID]
*/
public
void
setMessageId
(
Long
messageId
){
this
.
messageId
=
messageId
;
this
.
modify
(
"message_id"
,
messageId
);
}
/**
* 设置 [ID]
*/
public
void
setAttachmentId
(
Long
attachmentId
){
this
.
attachmentId
=
attachmentId
;
this
.
modify
(
"attachment_id"
,
attachmentId
);
}
@Override
public
Serializable
getDefaultKey
(
boolean
gen
)
{
return
IdWorker
.
getId
();
}
/**
* 复制当前对象数据到目标对象(粘贴重置)
* @param targetEntity 目标数据对象
* @param bIncEmpty 是否包括空值
* @param <T>
* @return
*/
@Override
public
<
T
>
T
copyTo
(
T
targetEntity
,
boolean
bIncEmpty
)
{
this
.
reset
(
"id"
);
return
super
.
copyTo
(
targetEntity
,
bIncEmpty
);
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/filter/Message_attachment_relSearchContext.java
0 → 100644
浏览文件 @
65d39887
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
filter
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
lombok.*
;
import
lombok.extern.slf4j.Slf4j
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
cn.ibizlab.businesscentral.util.filter.QueryWrapperContext
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.ibizlab.businesscentral.core.odoo_mail.domain.Message_attachment_rel
;
/**
* 关系型数据实体[Message_attachment_rel] 查询条件对象
*/
@Slf4j
@Data
public
class
Message_attachment_relSearchContext
extends
QueryWrapperContext
<
Message_attachment_rel
>
{
private
Long
n_message_id_eq
;
//[ID]
public
void
setN_message_id_eq
(
Long
n_message_id_eq
)
{
this
.
n_message_id_eq
=
n_message_id_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_message_id_eq
)){
this
.
getSearchCond
().
eq
(
"message_id"
,
n_message_id_eq
);
}
}
private
Long
n_attachment_id_eq
;
//[ID]
public
void
setN_attachment_id_eq
(
Long
n_attachment_id_eq
)
{
this
.
n_attachment_id_eq
=
n_attachment_id_eq
;
if
(!
ObjectUtils
.
isEmpty
(
this
.
n_attachment_id_eq
)){
this
.
getSearchCond
().
eq
(
"attachment_id"
,
n_attachment_id_eq
);
}
}
/**
* 启用快速搜索
*/
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
if
(!
StringUtils
.
isEmpty
(
query
)){
}
}
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/mapper/Message_attachment_relMapper.java
0 → 100644
浏览文件 @
65d39887
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.*
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
java.util.HashMap
;
import
org.apache.ibatis.annotations.Select
;
import
cn.ibizlab.businesscentral.core.odoo_mail.domain.Message_attachment_rel
;
import
cn.ibizlab.businesscentral.core.odoo_mail.filter.Message_attachment_relSearchContext
;
import
org.springframework.cache.annotation.CacheEvict
;
import
org.springframework.cache.annotation.Cacheable
;
import
java.io.Serializable
;
import
com.baomidou.mybatisplus.core.toolkit.Constants
;
import
com.alibaba.fastjson.JSONObject
;
public
interface
Message_attachment_relMapper
extends
BaseMapper
<
Message_attachment_rel
>{
Page
<
Message_attachment_rel
>
searchDefault
(
IPage
page
,
@Param
(
"srf"
)
Message_attachment_relSearchContext
context
,
@Param
(
"ew"
)
Wrapper
<
Message_attachment_rel
>
wrapper
)
;
@Override
Message_attachment_rel
selectById
(
Serializable
id
);
@Override
int
insert
(
Message_attachment_rel
entity
);
@Override
int
updateById
(
@Param
(
Constants
.
ENTITY
)
Message_attachment_rel
entity
);
@Override
int
update
(
@Param
(
Constants
.
ENTITY
)
Message_attachment_rel
entity
,
@Param
(
"ew"
)
Wrapper
<
Message_attachment_rel
>
updateWrapper
);
@Override
int
deleteById
(
Serializable
id
);
/**
* 自定义查询SQL
* @param sql
* @return
*/
@Select
(
"${sql}"
)
List
<
JSONObject
>
selectBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义更新SQL
* @param sql
* @return
*/
@Update
(
"${sql}"
)
boolean
updateBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义插入SQL
* @param sql
* @return
*/
@Insert
(
"${sql}"
)
boolean
insertBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
/**
* 自定义删除SQL
* @param sql
* @return
*/
@Delete
(
"${sql}"
)
boolean
deleteBySQL
(
@Param
(
"sql"
)
String
sql
,
@Param
(
"et"
)
Map
param
);
List
<
Message_attachment_rel
>
selectByAttachmentId
(
@Param
(
"id"
)
Serializable
id
)
;
List
<
Message_attachment_rel
>
selectByMessageId
(
@Param
(
"id"
)
Serializable
id
)
;
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/service/IMessage_attachment_relService.java
0 → 100644
浏览文件 @
65d39887
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.HashMap
;
import
java.util.Collection
;
import
java.math.BigInteger
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.scheduling.annotation.Async
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.cache.annotation.CacheEvict
;
import
cn.ibizlab.businesscentral.core.odoo_mail.domain.Message_attachment_rel
;
import
cn.ibizlab.businesscentral.core.odoo_mail.filter.Message_attachment_relSearchContext
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* 实体[Message_attachment_rel] 服务对象接口
*/
public
interface
IMessage_attachment_relService
extends
IService
<
Message_attachment_rel
>{
boolean
create
(
Message_attachment_rel
et
)
;
void
createBatch
(
List
<
Message_attachment_rel
>
list
)
;
boolean
update
(
Message_attachment_rel
et
)
;
void
updateBatch
(
List
<
Message_attachment_rel
>
list
)
;
boolean
remove
(
Long
key
)
;
void
removeBatch
(
Collection
<
Long
>
idList
)
;
Message_attachment_rel
get
(
Long
key
)
;
Message_attachment_rel
getDraft
(
Message_attachment_rel
et
)
;
boolean
checkKey
(
Message_attachment_rel
et
)
;
boolean
save
(
Message_attachment_rel
et
)
;
void
saveBatch
(
List
<
Message_attachment_rel
>
list
)
;
Page
<
Message_attachment_rel
>
searchDefault
(
Message_attachment_relSearchContext
context
)
;
List
<
Message_attachment_rel
>
selectByAttachmentId
(
Long
id
)
;
void
removeByAttachmentId
(
Long
id
)
;
List
<
Message_attachment_rel
>
selectByMessageId
(
Long
id
)
;
void
removeByMessageId
(
Long
id
)
;
/**
*自定义查询SQL
* @param sql select * from table where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return select * from table where id = '1'
*/
List
<
JSONObject
>
select
(
String
sql
,
Map
param
);
/**
*自定义SQL
* @param sql update table set name ='test' where id =#{et.param}
* @param param 参数列表 param.put("param","1");
* @return update table set name ='test' where id = '1'
*/
boolean
execute
(
String
sql
,
Map
param
);
}
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/service/impl/Mail_messageServiceImpl.java
浏览文件 @
65d39887
...
...
@@ -72,6 +72,9 @@ public class Mail_messageServiceImpl extends EBSServiceImpl<Mail_messageMapper,
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_tracking_valueService
mailTrackingValueService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMessage_attachment_relService
messageAttachmentRelService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_rating
.
service
.
IRating_ratingService
ratingRatingService
;
@Autowired
@Lazy
...
...
businesscentral-core/src/main/java/cn/ibizlab/businesscentral/core/odoo_mail/service/impl/Message_attachment_relServiceImpl.java
0 → 100644
浏览文件 @
65d39887
package
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
impl
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Map
;
import
java.util.HashSet
;
import
java.util.HashMap
;
import
java.util.Collection
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.math.BigInteger
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cglib.beans.BeanCopier
;
import
org.springframework.stereotype.Service
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
cn.ibizlab.businesscentral.util.errors.BadRequestAlertException
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.context.annotation.Lazy
;
import
cn.ibizlab.businesscentral.core.odoo_mail.domain.Message_attachment_rel
;
import
cn.ibizlab.businesscentral.core.odoo_mail.filter.Message_attachment_relSearchContext
;
import
cn.ibizlab.businesscentral.core.odoo_mail.service.IMessage_attachment_relService
;
import
cn.ibizlab.businesscentral.util.helper.CachedBeanCopier
;
import
cn.ibizlab.businesscentral.util.helper.DEFieldCacheMap
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
cn.ibizlab.businesscentral.core.util.helper.EBSServiceImpl
;
import
cn.ibizlab.businesscentral.core.odoo_mail.mapper.Message_attachment_relMapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.Wrapper
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.util.StringUtils
;
/**
* 实体[消息附件] 服务对象接口实现
*/
@Slf4j
@Service
(
"Message_attachment_relServiceImpl"
)
public
class
Message_attachment_relServiceImpl
extends
EBSServiceImpl
<
Message_attachment_relMapper
,
Message_attachment_rel
>
implements
IMessage_attachment_relService
{
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_ir
.
service
.
IIr_attachmentService
irAttachmentService
;
@Autowired
@Lazy
protected
cn
.
ibizlab
.
businesscentral
.
core
.
odoo_mail
.
service
.
IMail_messageService
mailMessageService
;
protected
int
batchSize
=
500
;
public
String
getIrModel
(){
return
"message.attachment.rel"
;
}
private
boolean
messageinfo
=
false
;
public
void
setMessageInfo
(
boolean
messageinfo
){
this
.
messageinfo
=
messageinfo
;
}
@Override
@Transactional
public
boolean
create
(
Message_attachment_rel
et
)
{
boolean
mail_create_nosubscribe
=
et
.
get
(
"mail_create_nosubscribe"
)
!=
null
;
boolean
mail_create_nolog
=
et
.
get
(
"mail_create_nolog"
)
!=
null
;
boolean
mail_notrack
=
et
.
get
(
"mail_notrack"
)
!=
null
;
if
(!
this
.
retBool
(
this
.
baseMapper
.
insert
(
et
)))
return
false
;
if
(
messageinfo
&&
!
mail_create_nosubscribe
&&
false
)
{
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
SpringContextHolder
.
getBean
(
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
.
Mail_followersExService
.
class
).
add_default_followers
(
this
,
et
);
}
if
(
messageinfo
&&
!
mail_create_nolog
&&
false
)
{
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
SpringContextHolder
.
getBean
(
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
.
Mail_tracking_valueExService
.
class
).
add_default_create_message
(
this
,
et
);
}
if
(
messageinfo
&&
!
mail_notrack
&&
false
)
{
}
return
true
;
}
@Override
@Transactional
public
void
createBatch
(
List
<
Message_attachment_rel
>
list
)
{
this
.
saveBatch
(
list
,
batchSize
);
}
@Override
@Transactional
public
boolean
update
(
Message_attachment_rel
et
)
{
Message_attachment_rel
old
=
new
Message_attachment_rel
()
;
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
old
);
boolean
mail_notrack
=
et
.
get
(
"mail_notrack"
)
!=
null
;
if
(!
update
(
et
,(
Wrapper
)
et
.
getUpdateWrapper
(
true
).
eq
(
"id"
,
et
.
getId
())))
return
false
;
CachedBeanCopier
.
copy
(
get
(
et
.
getId
()),
et
);
if
(
messageinfo
&&
!
mail_notrack
&&
false
)
{
cn
.
ibizlab
.
businesscentral
.
util
.
security
.
SpringContextHolder
.
getBean
(
cn
.
ibizlab
.
businesscentral
.
core
.
extensions
.
service
.
Mail_tracking_valueExService
.
class
).
message_track
(
this
,
old
,
et
);
}
return
true
;
}
@Override
@Transactional
public
void
updateBatch
(
List
<
Message_attachment_rel
>
list
)
{
updateBatchById
(
list
,
batchSize
);
}
@Override
@Transactional
public
boolean
remove
(
Long
key
)
{
boolean
result
=
removeById
(
key
);
return
result
;
}
@Override
@Transactional
public
void
removeBatch
(
Collection
<
Long
>
idList
)
{
removeByIds
(
idList
);
}
@Override
@Transactional
public
Message_attachment_rel
get
(
Long
key
)
{
Message_attachment_rel
et
=
getById
(
key
);
if
(
et
==
null
){
et
=
new
Message_attachment_rel
();
}
else
{
}
return
et
;
}
@Override
public
Message_attachment_rel
getDraft
(
Message_attachment_rel
et
)
{
return
et
;
}
@Override
public
boolean
checkKey
(
Message_attachment_rel
et
)
{
return
(!
ObjectUtils
.
isEmpty
(
et
.
getId
()))&&(!
Objects
.
isNull
(
this
.
getById
(
et
.
getId
())));
}
@Override
@Transactional
public
boolean
save
(
Message_attachment_rel
et
)
{
if
(!
saveOrUpdate
(
et
))
return
false
;
return
true
;
}
@Override
@Transactional
public
boolean
saveOrUpdate
(
Message_attachment_rel
et
)
{
if
(
null
==
et
)
{
return
false
;
}
else
{
return
checkKey
(
et
)
?
this
.
update
(
et
)
:
this
.
create
(
et
);
}
}
@Override
@Transactional
public
boolean
saveBatch
(
Collection
<
Message_attachment_rel
>
list
)
{
saveOrUpdateBatch
(
list
,
batchSize
);
return
true
;
}
@Override
@Transactional
public
void
saveBatch
(
List
<
Message_attachment_rel
>
list
)
{
saveOrUpdateBatch
(
list
,
batchSize
);
}
@Override
public
List
<
Message_attachment_rel
>
selectByAttachmentId
(
Long
id
)
{
return
baseMapper
.
selectByAttachmentId
(
id
);
}
@Override
public
void
removeByAttachmentId
(
Long
id
)
{
this
.
remove
(
new
QueryWrapper
<
Message_attachment_rel
>().
eq
(
"attachment_id"
,
id
));
}
@Override
public
List
<
Message_attachment_rel
>
selectByMessageId
(
Long
id
)
{
return
baseMapper
.
selectByMessageId
(
id
);
}
@Override
public
void
removeByMessageId
(
Long
id
)
{
this
.
remove
(
new
QueryWrapper
<
Message_attachment_rel
>().
eq
(
"message_id"
,
id
));
}
/**
* 查询集合 数据集
*/
@Override
public
Page
<
Message_attachment_rel
>
searchDefault
(
Message_attachment_relSearchContext
context
)
{
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
Message_attachment_rel
>
pages
=
baseMapper
.
searchDefault
(
context
.
getPages
(),
context
,
context
.
getSelectCond
());
return
new
PageImpl
<
Message_attachment_rel
>(
pages
.
getRecords
(),
context
.
getPageable
(),
pages
.
getTotal
());
}
@Override
public
List
<
JSONObject
>
select
(
String
sql
,
Map
param
){
return
this
.
baseMapper
.
selectBySQL
(
sql
,
param
);
}
@Override
@Transactional
public
boolean
execute
(
String
sql
,
Map
param
){
if
(
sql
==
null
||
sql
.
isEmpty
())
{
return
false
;
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"insert"
))
{
return
this
.
baseMapper
.
insertBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"update"
))
{
return
this
.
baseMapper
.
updateBySQL
(
sql
,
param
);
}
if
(
sql
.
toLowerCase
().
trim
().
startsWith
(
"delete"
))
{
return
this
.
baseMapper
.
deleteBySQL
(
sql
,
param
);
}
log
.
warn
(
"暂未支持的SQL语法"
);
return
true
;
}
}
businesscentral-core/src/main/resources/liquibase/h2_table.xml
浏览文件 @
65d39887
...
...
@@ -681,6 +681,9 @@
<!--输出实体[MAINTENANCE_TEAM]数据结构 -->
<!--输出实体[MESSAGE_ATTACHMENT_REL]数据结构 -->
<!--输出实体[MRO_CONVERT_ORDER]数据结构 -->
...
...
@@ -1461,6 +1464,7 @@
<!--输出实体[MAINTENANCE_REQUEST]外键关系 -->
<!--输出实体[MAINTENANCE_STAGE]外键关系 -->
<!--输出实体[MAINTENANCE_TEAM]外键关系 -->
<!--输出实体[MESSAGE_ATTACHMENT_REL]外键关系 -->
<!--输出实体[MRO_CONVERT_ORDER]外键关系 -->
<!--输出实体[MRO_ORDER]外键关系 -->
<!--输出实体[MRO_ORDER_PARTS_LINE]外键关系 -->
...
...
businesscentral-core/src/main/resources/mapper/odoo_mail/message_attachment_rel/Message_attachment_relMapper.xml
0 → 100644
浏览文件 @
65d39887
<?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=
"cn.ibizlab.businesscentral.core.odoo_mail.mapper.Message_attachment_relMapper"
>
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select
id=
"selectById"
resultMap=
"Message_attachment_relResultMap"
databaseId=
"postgresql"
>
<![CDATA[select t1.* from (SELECT t1.ATTACHMENT_ID, t1.ID, t1.MESSAGE_ID FROM MESSAGE_ATTACHMENT_REL t1 ) t1 where id=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap
id=
"Message_attachment_relResultMap"
type=
"cn.ibizlab.businesscentral.core.odoo_mail.domain.Message_attachment_rel"
autoMapping=
"true"
>
<id
property=
"id"
column=
"id"
/>
<!--主键字段映射-->
<result
property=
"messageId"
column=
"message_id"
/>
<result
property=
"attachmentId"
column=
"attachment_id"
/>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association
property=
"odooAttachment"
javaType=
"cn.ibizlab.businesscentral.core.odoo_ir.domain.Ir_attachment"
column=
"attachment_id"
select=
"cn.ibizlab.businesscentral.core.odoo_ir.mapper.Ir_attachmentMapper.selectById"
fetchType=
"lazy"
></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association
property=
"orooMessage"
javaType=
"cn.ibizlab.businesscentral.core.odoo_mail.domain.Mail_message"
column=
"message_id"
select=
"cn.ibizlab.businesscentral.core.odoo_mail.mapper.Mail_messageMapper.selectById"
fetchType=
"lazy"
></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_MESSAGE_ATTACHMENT_REL_IR_ATTACHMENT_ATTACHMENT_ID] -->
<select
id=
"selectByAttachmentId"
resultMap=
"Message_attachment_relResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where attachment_id=#{id}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_MESSAGE_ATTACHMENT_REL_MAIL_MESSAGE_MESSAGE_ID] -->
<select
id=
"selectByMessageId"
resultMap=
"Message_attachment_relResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
) t1
where message_id=#{id}
</select>
<!--数据集合[Default]-->
<select
id=
"searchDefault"
parameterType=
"cn.ibizlab.businesscentral.core.odoo_mail.filter.Message_attachment_relSearchContext"
resultMap=
"Message_attachment_relResultMap"
>
select t1.* from (
<include
refid=
"Default"
/>
)t1
<where><if
test=
"ew!=null and ew.sqlSegment!=null and !ew.emptyOfWhere"
>
${ew.sqlSegment}
</if></where>
<if
test=
"ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere"
>
${ew.sqlSegment}
</if>
</select>
<!--数据查询[Default]-->
<sql
id=
"Default"
databaseId=
"postgresql"
>
<![CDATA[ SELECT t1.ATTACHMENT_ID, t1.ID, t1.MESSAGE_ID FROM MESSAGE_ATTACHMENT_REL t1
]]>
</sql>
<!--数据查询[View]-->
<sql
id=
"View"
databaseId=
"postgresql"
>
<![CDATA[ SELECT t1.ATTACHMENT_ID, t1.ID, t1.MESSAGE_ID FROM MESSAGE_ATTACHMENT_REL t1
]]>
</sql>
</mapper>
businesscentral-core/src/main/resources/sysmodel/iBizBusinessCentral.json
浏览文件 @
65d39887
...
...
@@ -71579,6 +71579,12 @@
}
],
"subEntitys":[
{"name":"DER1N_MESSAGE_ATTACHMENT_REL_IR_ATTACHMENT_ATTACHMENT_ID",
"relation_type":"DER1N",
"code_name":"Odoo_attachment",
"entity_name":"MESSAGE_ATTACHMENT_REL",
"ref_entity_name":"IR_ATTACHMENT"
}
],
"parentEntitys":[
{"name":"DER1N_IR_ATTACHMENT_RES_COMPANY_COMPANY_ID",
...
...
@@ -85010,6 +85016,12 @@
"entity_name":"MAIL_TRACKING_VALUE",
"ref_entity_name":"MAIL_MESSAGE"
},
{"name":"DER1N_MESSAGE_ATTACHMENT_REL_MAIL_MESSAGE_MESSAGE_ID",
"relation_type":"DER1N",
"code_name":"Oroo_message",
"entity_name":"MESSAGE_ATTACHMENT_REL",
"ref_entity_name":"MAIL_MESSAGE"
},
{"name":"DER1N_RATING_RATING__MAIL_MESSAGE__MESSAGE_ID",
"relation_type":"DER1N",
"code_name":"Odoo_message",
...
...
@@ -91415,6 +91427,79 @@
"ref_entity_name":"RES_USERS"
}
]
}
,
{
"entity_name":"MESSAGE_ATTACHMENT_REL",
"logic_name":"消息附件",
"code_name":"Message_attachment_rel",
"table_name":"MESSAGE_ATTACHMENT_REL",
"system_id":"iBizBusinessCentral",
"system_name":"iBiz商业中心",
"fields":[
{
"fieldname":"ID" ,
"codename":"Id",
"field_logic_name":"id",
"entity_name":"Message_attachment_rel",
"field_type":"ACID",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":1,
"major_field":0
},
{
"fieldname":"MESSAGE_ID" ,
"codename":"Message_id",
"field_logic_name":"ID",
"entity_name":"Message_attachment_rel",
"ref_de":"MAIL_MESSAGE",
"ref_field_name":"ID",
"relation_name":"DER1N_MESSAGE_ATTACHMENT_REL_MAIL_MESSAGE_MESSAGE_ID",
"relation_codename":"Oroo_message",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"key_field":0,
"major_field":0
},
{
"fieldname":"ATTACHMENT_ID" ,
"codename":"Attachment_id",
"field_logic_name":"ID",
"entity_name":"Message_attachment_rel",
"ref_de":"IR_ATTACHMENT",
"ref_field_name":"ID",
"relation_name":"DER1N_MESSAGE_ATTACHMENT_REL_IR_ATTACHMENT_ATTACHMENT_ID",
"relation_codename":"Odoo_attachment",
"field_type":"PICKUP",
"nullable":1,
"physical_field":1,
"data_type":"BIGINT",
"data_length":20,
"key_field":0,
"major_field":0
}
],
"subEntitys":[
],
"parentEntitys":[
{"name":"DER1N_MESSAGE_ATTACHMENT_REL_IR_ATTACHMENT_ATTACHMENT_ID",
"relation_type":"DER1N",
"code_name":"Odoo_attachment",
"entity_name":"MESSAGE_ATTACHMENT_REL",
"ref_entity_name":"IR_ATTACHMENT"
},
{"name":"DER1N_MESSAGE_ATTACHMENT_REL_MAIL_MESSAGE_MESSAGE_ID",
"relation_type":"DER1N",
"code_name":"Oroo_message",
"entity_name":"MESSAGE_ATTACHMENT_REL",
"ref_entity_name":"MAIL_MESSAGE"
}
]
}
,
{
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录