提交 c6217e49 编写于 作者: ibizdev's avatar ibizdev

lab_gzf 部署微服务接口

上级 1c4617bc
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /assetmanagement-app-assetmanagement.jar
EXPOSE 10325
EXPOSE 8080
ADD assetmanagement-app-assetmanagement.jar /assetmanagement-app-assetmanagement.jar
......@@ -3,25 +3,9 @@ services:
assetmanagement-app-assetmanagement:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-app-assetmanagement:latest
ports:
- "10325:10325"
- "8080:8080"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10325
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -13,6 +13,8 @@ import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import cn.ibizlab.assetmanagement.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
......@@ -30,6 +32,9 @@ import java.util.List;
})
public class AssetManagementApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(AssetManagementApplication.class,args);
}
......@@ -37,6 +42,6 @@ public class AssetManagementApplication extends WebMvcConfigurerAdapter{
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.assetmanagement.util.web.SearchContextHandlerMethodArgumentResolver());
argumentResolvers.add(resolver);
}
}
......@@ -7,6 +7,10 @@ logging:
#zuul网关路由设置
zuul:
routes:
eamdocument:
path: /eamdocuments/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamlocationstatemodel:
path: /eamlocationstatemodels/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
......@@ -111,6 +115,10 @@ zuul:
path: /eamwostates/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamdocumenttype:
path: /eamdocumenttypes/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
stripPrefix: false
eamassetstatemodel:
path: /eamassetstatemodels/**
serviceId: ${ibiz.ref.service.ibizassetmanagement-assetapi:ibizassetmanagement-assetapi}
......
......@@ -14,6 +14,8 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.List;
import cn.ibizlab.assetmanagement.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@EnableDiscoveryClient
......@@ -34,6 +36,9 @@ import java.util.List;
@EnableScheduling
public class DevBootApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(DevBootApplication.class,args);
}
......@@ -41,6 +46,6 @@ public class DevBootApplication extends WebMvcConfigurerAdapter{
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.assetmanagement.util.web.SearchContextHandlerMethodArgumentResolver());
argumentResolvers.add(resolver);
}
}
......@@ -152,6 +152,13 @@ public class EAMAsset extends EntityMP implements Serializable {
@JSONField(name = "assetnumber")
@JsonProperty("assetnumber")
private String assetnumber;
/**
* 描述
*/
@TableField(value = "description")
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
*
......@@ -235,6 +242,14 @@ public class EAMAsset extends EntityMP implements Serializable {
this.modify("assetnumber",assetnumber);
}
/**
* 设置 [描述]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
}
......
......@@ -110,6 +110,13 @@ public class EAMAssetType extends EntityMP implements Serializable {
@JSONField(name = "assettypenumber")
@JsonProperty("assettypenumber")
private String assettypenumber;
/**
* 描述
*/
@TableField(value = "description")
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
*
......@@ -145,6 +152,14 @@ public class EAMAssetType extends EntityMP implements Serializable {
this.modify("assettypenumber",assettypenumber);
}
/**
* 设置 [描述]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
}
......
package cn.ibizlab.assetmanagement.core.asset.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.assetmanagement.util.domain.EntityBase;
import cn.ibizlab.assetmanagement.util.annotation.DEField;
import cn.ibizlab.assetmanagement.util.enums.DEPredefinedFieldType;
import cn.ibizlab.assetmanagement.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.assetmanagement.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.assetmanagement.util.domain.EntityMP;
/**
* 实体[文档]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "EAMDOCUMENT",resultMap = "EAMDocumentResultMap")
public class EAMDocument extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 文档名称
*/
@TableField(value = "eamdocumentname")
@JSONField(name = "eamdocumentname")
@JsonProperty("eamdocumentname")
private String eamdocumentname;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 文档标识
*/
@DEField(isKeyField=true)
@TableId(value= "eamdocumentid",type=IdType.ASSIGN_UUID)
@JSONField(name = "eamdocumentid")
@JsonProperty("eamdocumentid")
private String eamdocumentid;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 资产类型标识
*/
@TableField(value = "eamassettypeid")
@JSONField(name = "eamassettypeid")
@JsonProperty("eamassettypeid")
private String eamassettypeid;
/**
* 资产类型
*/
@TableField(exist = false)
@JSONField(name = "eamassettypename")
@JsonProperty("eamassettypename")
private String eamassettypename;
/**
* 文档编号
*/
@TableField(value = "documentnumber")
@JSONField(name = "documentnumber")
@JsonProperty("documentnumber")
private String documentnumber;
/**
* 文档类型标识
*/
@TableField(value = "eamdocumenttypeid")
@JSONField(name = "eamdocumenttypeid")
@JsonProperty("eamdocumenttypeid")
private String eamdocumenttypeid;
/**
* 文档类型
*/
@TableField(exist = false)
@JSONField(name = "eamdocumenttypename")
@JsonProperty("eamdocumenttypename")
private String eamdocumenttypename;
/**
* 内容
*/
@TableField(value = "content")
@JSONField(name = "content")
@JsonProperty("content")
private String content;
/**
* 文件
*/
@TableField(value = "docfile")
@JSONField(name = "docfile")
@JsonProperty("docfile")
private String docfile;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType eamassettype;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType eamdocumenttype;
/**
* 设置 [文档名称]
*/
public void setEamdocumentname(String eamdocumentname){
this.eamdocumentname = eamdocumentname ;
this.modify("eamdocumentname",eamdocumentname);
}
/**
* 设置 [资产类型标识]
*/
public void setEamassettypeid(String eamassettypeid){
this.eamassettypeid = eamassettypeid ;
this.modify("eamassettypeid",eamassettypeid);
}
/**
* 设置 [文档编号]
*/
public void setDocumentnumber(String documentnumber){
this.documentnumber = documentnumber ;
this.modify("documentnumber",documentnumber);
}
/**
* 设置 [文档类型标识]
*/
public void setEamdocumenttypeid(String eamdocumenttypeid){
this.eamdocumenttypeid = eamdocumenttypeid ;
this.modify("eamdocumenttypeid",eamdocumenttypeid);
}
/**
* 设置 [内容]
*/
public void setContent(String content){
this.content = content ;
this.modify("content",content);
}
/**
* 设置 [文件]
*/
public void setDocfile(String docfile){
this.docfile = docfile ;
this.modify("docfile",docfile);
}
}
package cn.ibizlab.assetmanagement.core.asset.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.assetmanagement.util.domain.EntityBase;
import cn.ibizlab.assetmanagement.util.annotation.DEField;
import cn.ibizlab.assetmanagement.util.enums.DEPredefinedFieldType;
import cn.ibizlab.assetmanagement.util.enums.DEFieldDefaultValueType;
import java.io.Serializable;
import lombok.*;
import org.springframework.data.annotation.Transient;
import cn.ibizlab.assetmanagement.util.annotation.Audit;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.baomidou.mybatisplus.annotation.*;
import cn.ibizlab.assetmanagement.util.domain.EntityMP;
/**
* 实体[文档类型]
*/
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(value = "handler")
@TableName(value = "EAMDOCUMENTTYPE",resultMap = "EAMDocumentTypeResultMap")
public class EAMDocumentType extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 文档类型名称
*/
@TableField(value = "eamdocumenttypename")
@JSONField(name = "eamdocumenttypename")
@JsonProperty("eamdocumenttypename")
private String eamdocumenttypename;
/**
* 文档类型标识
*/
@DEField(isKeyField=true)
@TableId(value= "eamdocumenttypeid",type=IdType.ASSIGN_UUID)
@JSONField(name = "eamdocumenttypeid")
@JsonProperty("eamdocumenttypeid")
private String eamdocumenttypeid;
/**
* 建立时间
*/
@DEField(preType = DEPredefinedFieldType.CREATEDATE)
@TableField(value = "createdate" , fill = FieldFill.INSERT)
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 更新人
*/
@DEField(preType = DEPredefinedFieldType.UPDATEMAN)
@TableField(value = "updateman")
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 更新时间
*/
@DEField(preType = DEPredefinedFieldType.UPDATEDATE)
@TableField(value = "updatedate")
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 建立人
*/
@DEField(preType = DEPredefinedFieldType.CREATEMAN)
@TableField(value = "createman" , fill = FieldFill.INSERT)
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 上级文档类型标识
*/
@TableField(value = "peamdocumenttypeid")
@JSONField(name = "peamdocumenttypeid")
@JsonProperty("peamdocumenttypeid")
private String peamdocumenttypeid;
/**
* 上级文档类型
*/
@TableField(exist = false)
@JSONField(name = "peamdocumenttypename")
@JsonProperty("peamdocumenttypename")
private String peamdocumenttypename;
/**
*
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType peamdocumenttype;
/**
* 设置 [文档类型名称]
*/
public void setEamdocumenttypename(String eamdocumenttypename){
this.eamdocumenttypename = eamdocumenttypename ;
this.modify("eamdocumenttypename",eamdocumenttypename);
}
/**
* 设置 [上级文档类型标识]
*/
public void setPeamdocumenttypeid(String peamdocumenttypeid){
this.peamdocumenttypeid = peamdocumenttypeid ;
this.modify("peamdocumenttypeid",peamdocumenttypeid);
}
}
package cn.ibizlab.assetmanagement.core.asset.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.assetmanagement.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocument;
/**
* 关系型数据实体[EAMDocument] 查询条件对象
*/
@Slf4j
@Data
public class EAMDocumentSearchContext extends QueryWrapperContext<EAMDocument> {
private String n_eamdocumentname_like;//[文档名称]
public void setN_eamdocumentname_like(String n_eamdocumentname_like) {
this.n_eamdocumentname_like = n_eamdocumentname_like;
if(!ObjectUtils.isEmpty(this.n_eamdocumentname_like)){
this.getSearchCond().like("eamdocumentname", n_eamdocumentname_like);
}
}
private String n_eamassettypeid_eq;//[资产类型标识]
public void setN_eamassettypeid_eq(String n_eamassettypeid_eq) {
this.n_eamassettypeid_eq = n_eamassettypeid_eq;
if(!ObjectUtils.isEmpty(this.n_eamassettypeid_eq)){
this.getSearchCond().eq("eamassettypeid", n_eamassettypeid_eq);
}
}
private String n_eamassettypename_eq;//[资产类型]
public void setN_eamassettypename_eq(String n_eamassettypename_eq) {
this.n_eamassettypename_eq = n_eamassettypename_eq;
if(!ObjectUtils.isEmpty(this.n_eamassettypename_eq)){
this.getSearchCond().eq("eamassettypename", n_eamassettypename_eq);
}
}
private String n_eamassettypename_like;//[资产类型]
public void setN_eamassettypename_like(String n_eamassettypename_like) {
this.n_eamassettypename_like = n_eamassettypename_like;
if(!ObjectUtils.isEmpty(this.n_eamassettypename_like)){
this.getSearchCond().like("eamassettypename", n_eamassettypename_like);
}
}
private String n_eamdocumenttypeid_eq;//[文档类型标识]
public void setN_eamdocumenttypeid_eq(String n_eamdocumenttypeid_eq) {
this.n_eamdocumenttypeid_eq = n_eamdocumenttypeid_eq;
if(!ObjectUtils.isEmpty(this.n_eamdocumenttypeid_eq)){
this.getSearchCond().eq("eamdocumenttypeid", n_eamdocumenttypeid_eq);
}
}
private String n_eamdocumenttypename_eq;//[文档类型]
public void setN_eamdocumenttypename_eq(String n_eamdocumenttypename_eq) {
this.n_eamdocumenttypename_eq = n_eamdocumenttypename_eq;
if(!ObjectUtils.isEmpty(this.n_eamdocumenttypename_eq)){
this.getSearchCond().eq("eamdocumenttypename", n_eamdocumenttypename_eq);
}
}
private String n_eamdocumenttypename_like;//[文档类型]
public void setN_eamdocumenttypename_like(String n_eamdocumenttypename_like) {
this.n_eamdocumenttypename_like = n_eamdocumenttypename_like;
if(!ObjectUtils.isEmpty(this.n_eamdocumenttypename_like)){
this.getSearchCond().like("eamdocumenttypename", n_eamdocumenttypename_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("eamdocumentname", query)
);
}
}
}
package cn.ibizlab.assetmanagement.core.asset.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.assetmanagement.util.filter.QueryWrapperContext;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType;
/**
* 关系型数据实体[EAMDocumentType] 查询条件对象
*/
@Slf4j
@Data
public class EAMDocumentTypeSearchContext extends QueryWrapperContext<EAMDocumentType> {
private String n_eamdocumenttypename_like;//[文档类型名称]
public void setN_eamdocumenttypename_like(String n_eamdocumenttypename_like) {
this.n_eamdocumenttypename_like = n_eamdocumenttypename_like;
if(!ObjectUtils.isEmpty(this.n_eamdocumenttypename_like)){
this.getSearchCond().like("eamdocumenttypename", n_eamdocumenttypename_like);
}
}
private String n_peamdocumenttypeid_eq;//[上级文档类型标识]
public void setN_peamdocumenttypeid_eq(String n_peamdocumenttypeid_eq) {
this.n_peamdocumenttypeid_eq = n_peamdocumenttypeid_eq;
if(!ObjectUtils.isEmpty(this.n_peamdocumenttypeid_eq)){
this.getSearchCond().eq("peamdocumenttypeid", n_peamdocumenttypeid_eq);
}
}
private String n_peamdocumenttypename_eq;//[上级文档类型]
public void setN_peamdocumenttypename_eq(String n_peamdocumenttypename_eq) {
this.n_peamdocumenttypename_eq = n_peamdocumenttypename_eq;
if(!ObjectUtils.isEmpty(this.n_peamdocumenttypename_eq)){
this.getSearchCond().eq("peamdocumenttypename", n_peamdocumenttypename_eq);
}
}
private String n_peamdocumenttypename_like;//[上级文档类型]
public void setN_peamdocumenttypename_like(String n_peamdocumenttypename_like) {
this.n_peamdocumenttypename_like = n_peamdocumenttypename_like;
if(!ObjectUtils.isEmpty(this.n_peamdocumenttypename_like)){
this.getSearchCond().like("peamdocumenttypename", n_peamdocumenttypename_like);
}
}
/**
* 启用快速搜索
*/
public void setQuery(String query)
{
this.query=query;
if(!StringUtils.isEmpty(query)){
this.getSearchCond().and( wrapper ->
wrapper.like("eamdocumenttypename", query)
);
}
}
}
package cn.ibizlab.assetmanagement.core.asset.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.assetmanagement.core.asset.domain.EAMDocument;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentSearchContext;
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 EAMDocumentMapper extends BaseMapper<EAMDocument>{
Page<EAMDocument> searchDefault(IPage page, @Param("srf") EAMDocumentSearchContext context, @Param("ew") Wrapper<EAMDocument> wrapper) ;
@Override
EAMDocument selectById(Serializable id);
@Override
int insert(EAMDocument entity);
@Override
int updateById(@Param(Constants.ENTITY) EAMDocument entity);
@Override
int update(@Param(Constants.ENTITY) EAMDocument entity, @Param("ew") Wrapper<EAMDocument> 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<EAMDocument> selectByEamassettypeid(@Param("eamassettypeid") Serializable eamassettypeid) ;
List<EAMDocument> selectByEamdocumenttypeid(@Param("eamdocumenttypeid") Serializable eamdocumenttypeid) ;
}
package cn.ibizlab.assetmanagement.core.asset.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.assetmanagement.core.asset.domain.EAMDocumentType;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentTypeSearchContext;
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 EAMDocumentTypeMapper extends BaseMapper<EAMDocumentType>{
Page<EAMDocumentType> searchDefault(IPage page, @Param("srf") EAMDocumentTypeSearchContext context, @Param("ew") Wrapper<EAMDocumentType> wrapper) ;
Page<EAMDocumentType> searchTop(IPage page, @Param("srf") EAMDocumentTypeSearchContext context, @Param("ew") Wrapper<EAMDocumentType> wrapper) ;
@Override
EAMDocumentType selectById(Serializable id);
@Override
int insert(EAMDocumentType entity);
@Override
int updateById(@Param(Constants.ENTITY) EAMDocumentType entity);
@Override
int update(@Param(Constants.ENTITY) EAMDocumentType entity, @Param("ew") Wrapper<EAMDocumentType> 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<EAMDocumentType> selectByPeamdocumenttypeid(@Param("eamdocumenttypeid") Serializable eamdocumenttypeid) ;
}
package cn.ibizlab.assetmanagement.core.asset.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 com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocument;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[EAMDocument] 服务对象接口
*/
public interface IEAMDocumentService extends IService<EAMDocument>{
boolean create(EAMDocument et) ;
void createBatch(List<EAMDocument> list) ;
boolean update(EAMDocument et) ;
void updateBatch(List<EAMDocument> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
EAMDocument get(String key) ;
EAMDocument getDraft(EAMDocument et) ;
boolean checkKey(EAMDocument et) ;
boolean save(EAMDocument et) ;
void saveBatch(List<EAMDocument> list) ;
Page<EAMDocument> searchDefault(EAMDocumentSearchContext context) ;
List<EAMDocument> selectByEamassettypeid(String eamassettypeid) ;
void removeByEamassettypeid(String eamassettypeid) ;
List<EAMDocument> selectByEamdocumenttypeid(String eamdocumenttypeid) ;
void removeByEamdocumenttypeid(String eamdocumenttypeid) ;
/**
*自定义查询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);
List<EAMDocument> getEamdocumentByIds(List<String> ids) ;
List<EAMDocument> getEamdocumentByEntities(List<EAMDocument> entities) ;
}
package cn.ibizlab.assetmanagement.core.asset.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 com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.CacheEvict;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentTypeSearchContext;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 实体[EAMDocumentType] 服务对象接口
*/
public interface IEAMDocumentTypeService extends IService<EAMDocumentType>{
boolean create(EAMDocumentType et) ;
void createBatch(List<EAMDocumentType> list) ;
boolean update(EAMDocumentType et) ;
void updateBatch(List<EAMDocumentType> list) ;
boolean remove(String key) ;
void removeBatch(Collection<String> idList) ;
EAMDocumentType get(String key) ;
EAMDocumentType getDraft(EAMDocumentType et) ;
boolean checkKey(EAMDocumentType et) ;
boolean save(EAMDocumentType et) ;
void saveBatch(List<EAMDocumentType> list) ;
Page<EAMDocumentType> searchDefault(EAMDocumentTypeSearchContext context) ;
Page<EAMDocumentType> searchTop(EAMDocumentTypeSearchContext context) ;
List<EAMDocumentType> selectByPeamdocumenttypeid(String eamdocumenttypeid) ;
void removeByPeamdocumenttypeid(String eamdocumenttypeid) ;
/**
*自定义查询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);
List<EAMDocumentType> getEamdocumenttypeByIds(List<String> ids) ;
List<EAMDocumentType> getEamdocumenttypeByEntities(List<EAMDocumentType> entities) ;
}
......@@ -53,6 +53,9 @@ public class EAMAssetTypeServiceImpl extends ServiceImpl<EAMAssetTypeMapper, EAM
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetService eamassetService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentService eamdocumentService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetStateModelService eamassetstatemodelService;
protected int batchSize = 500;
......
package cn.ibizlab.assetmanagement.core.asset.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.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocument;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentSearchContext;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentService;
import cn.ibizlab.assetmanagement.util.helper.CachedBeanCopier;
import cn.ibizlab.assetmanagement.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.assetmanagement.core.asset.mapper.EAMDocumentMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[文档] 服务对象接口实现
*/
@Slf4j
@Service("EAMDocumentServiceImpl")
public class EAMDocumentServiceImpl extends ServiceImpl<EAMDocumentMapper, EAMDocument> implements IEAMDocumentService {
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMAssetTypeService eamassettypeService;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentTypeService eamdocumenttypeService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMDocument et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamdocumentid()),et);
return true;
}
@Override
public void createBatch(List<EAMDocument> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMDocument et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamdocumentid",et.getEamdocumentid())))
return false;
CachedBeanCopier.copy(get(et.getEamdocumentid()),et);
return true;
}
@Override
public void updateBatch(List<EAMDocument> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public EAMDocument get(String key) {
EAMDocument et = getById(key);
if(et==null){
et=new EAMDocument();
et.setEamdocumentid(key);
}
else{
}
return et;
}
@Override
public EAMDocument getDraft(EAMDocument et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(EAMDocument et) {
return (!ObjectUtils.isEmpty(et.getEamdocumentid()))&&(!Objects.isNull(this.getById(et.getEamdocumentid())));
}
@Override
@Transactional
public boolean save(EAMDocument et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(EAMDocument et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<EAMDocument> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMDocument> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<EAMDocument> selectByEamassettypeid(String eamassettypeid) {
return baseMapper.selectByEamassettypeid(eamassettypeid);
}
@Override
public void removeByEamassettypeid(String eamassettypeid) {
this.remove(new QueryWrapper<EAMDocument>().eq("eamassettypeid",eamassettypeid));
}
@Override
public List<EAMDocument> selectByEamdocumenttypeid(String eamdocumenttypeid) {
return baseMapper.selectByEamdocumenttypeid(eamdocumenttypeid);
}
@Override
public void removeByEamdocumenttypeid(String eamdocumenttypeid) {
this.remove(new QueryWrapper<EAMDocument>().eq("eamdocumenttypeid",eamdocumenttypeid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<EAMDocument> searchDefault(EAMDocumentSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMDocument> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMDocument>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMDocument et){
//实体关系[DER1N_EAMDOCUMENT_EAMASSETTYPE_EAMASSETTYPEID]
if(!ObjectUtils.isEmpty(et.getEamassettypeid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType eamassettype=et.getEamassettype();
if(ObjectUtils.isEmpty(eamassettype)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType majorEntity=eamassettypeService.get(et.getEamassettypeid());
et.setEamassettype(majorEntity);
eamassettype=majorEntity;
}
et.setEamassettypename(eamassettype.getEamassettypename());
}
//实体关系[DER1N_EAMDOCUMENT_EAMDOCUMENTTYPE_EAMDOCUMENTTYPEID]
if(!ObjectUtils.isEmpty(et.getEamdocumenttypeid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType eamdocumenttype=et.getEamdocumenttype();
if(ObjectUtils.isEmpty(eamdocumenttype)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType majorEntity=eamdocumenttypeService.get(et.getEamdocumenttypeid());
et.setEamdocumenttype(majorEntity);
eamdocumenttype=majorEntity;
}
et.setEamdocumenttypename(eamdocumenttype.getEamdocumenttypename());
}
}
@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;
}
@Override
public List<EAMDocument> getEamdocumentByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<EAMDocument> getEamdocumentByEntities(List<EAMDocument> entities) {
List ids =new ArrayList();
for(EAMDocument entity : entities){
Serializable id=entity.getEamdocumentid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
package cn.ibizlab.assetmanagement.core.asset.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.transaction.annotation.Transactional;
import org.springframework.context.annotation.Lazy;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentTypeSearchContext;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentTypeService;
import cn.ibizlab.assetmanagement.util.helper.CachedBeanCopier;
import cn.ibizlab.assetmanagement.util.helper.DEFieldCacheMap;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.ibizlab.assetmanagement.core.asset.mapper.EAMDocumentTypeMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.StringUtils;
/**
* 实体[文档类型] 服务对象接口实现
*/
@Slf4j
@Service("EAMDocumentTypeServiceImpl")
public class EAMDocumentTypeServiceImpl extends ServiceImpl<EAMDocumentTypeMapper, EAMDocumentType> implements IEAMDocumentTypeService {
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentTypeService eamdocumenttypeService = this;
@Autowired
@Lazy
protected cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentService eamdocumentService;
protected int batchSize = 500;
@Override
@Transactional
public boolean create(EAMDocumentType et) {
fillParentData(et);
if(!this.retBool(this.baseMapper.insert(et)))
return false;
CachedBeanCopier.copy(get(et.getEamdocumenttypeid()),et);
return true;
}
@Override
public void createBatch(List<EAMDocumentType> list) {
list.forEach(item->fillParentData(item));
this.saveBatch(list,batchSize);
}
@Override
@Transactional
public boolean update(EAMDocumentType et) {
fillParentData(et);
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("eamdocumenttypeid",et.getEamdocumenttypeid())))
return false;
CachedBeanCopier.copy(get(et.getEamdocumenttypeid()),et);
return true;
}
@Override
public void updateBatch(List<EAMDocumentType> list) {
list.forEach(item->fillParentData(item));
updateBatchById(list,batchSize);
}
@Override
@Transactional
public boolean remove(String key) {
boolean result=removeById(key);
return result ;
}
@Override
public void removeBatch(Collection<String> idList) {
removeByIds(idList);
}
@Override
@Transactional
public EAMDocumentType get(String key) {
EAMDocumentType et = getById(key);
if(et==null){
et=new EAMDocumentType();
et.setEamdocumenttypeid(key);
}
else{
}
return et;
}
@Override
public EAMDocumentType getDraft(EAMDocumentType et) {
fillParentData(et);
return et;
}
@Override
public boolean checkKey(EAMDocumentType et) {
return (!ObjectUtils.isEmpty(et.getEamdocumenttypeid()))&&(!Objects.isNull(this.getById(et.getEamdocumenttypeid())));
}
@Override
@Transactional
public boolean save(EAMDocumentType et) {
if(!saveOrUpdate(et))
return false;
return true;
}
@Override
@Transactional
public boolean saveOrUpdate(EAMDocumentType et) {
if (null == et) {
return false;
} else {
return checkKey(et) ? this.update(et) : this.create(et);
}
}
@Override
public boolean saveBatch(Collection<EAMDocumentType> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
return true;
}
@Override
public void saveBatch(List<EAMDocumentType> list) {
list.forEach(item->fillParentData(item));
saveOrUpdateBatch(list,batchSize);
}
@Override
public List<EAMDocumentType> selectByPeamdocumenttypeid(String eamdocumenttypeid) {
return baseMapper.selectByPeamdocumenttypeid(eamdocumenttypeid);
}
@Override
public void removeByPeamdocumenttypeid(String eamdocumenttypeid) {
this.remove(new QueryWrapper<EAMDocumentType>().eq("peamdocumenttypeid",eamdocumenttypeid));
}
/**
* 查询集合 DEFAULT
*/
@Override
public Page<EAMDocumentType> searchDefault(EAMDocumentTypeSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMDocumentType> pages=baseMapper.searchDefault(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMDocumentType>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 查询集合 顶级文档类型
*/
@Override
public Page<EAMDocumentType> searchTop(EAMDocumentTypeSearchContext context) {
com.baomidou.mybatisplus.extension.plugins.pagination.Page<EAMDocumentType> pages=baseMapper.searchTop(context.getPages(),context,context.getSelectCond());
return new PageImpl<EAMDocumentType>(pages.getRecords(), context.getPageable(), pages.getTotal());
}
/**
* 为当前实体填充父数据(外键值文本、外键值附加数据)
* @param et
*/
private void fillParentData(EAMDocumentType et){
//实体关系[DER1N_EAMDOCUMENTTYPE_EAMDOCUMENTTYPE_PEAMDOCUMENTTYPEID]
if(!ObjectUtils.isEmpty(et.getPeamdocumenttypeid())){
cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType peamdocumenttype=et.getPeamdocumenttype();
if(ObjectUtils.isEmpty(peamdocumenttype)){
cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType majorEntity=eamdocumenttypeService.get(et.getPeamdocumenttypeid());
et.setPeamdocumenttype(majorEntity);
peamdocumenttype=majorEntity;
}
et.setPeamdocumenttypename(peamdocumenttype.getEamdocumenttypename());
}
}
@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;
}
@Override
public List<EAMDocumentType> getEamdocumenttypeByIds(List<String> ids) {
return this.listByIds(ids);
}
@Override
public List<EAMDocumentType> getEamdocumenttypeByEntities(List<EAMDocumentType> entities) {
List ids =new ArrayList();
for(EAMDocumentType entity : entities){
Serializable id=entity.getEamdocumenttypeid();
if(!ObjectUtils.isEmpty(id)){
ids.add(id);
}
}
if(ids.size()>0)
return this.listByIds(ids);
else
return entities;
}
}
......@@ -4,7 +4,7 @@
<!--输出实体[EAMAPPLY]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamapply-57-1">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamapply-58-1">
<createTable tableName="EAMAPPLY">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -128,7 +128,7 @@
<!--输出实体[EAMASSET]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamasset-93-6">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamasset-99-6">
<createTable tableName="ASSET">
<column name="ASSETID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMASSET_ASSETID"/>
......@@ -153,12 +153,14 @@
</column>
<column name="ASSETNUMBER" remarks="" type="VARCHAR(100)">
</column>
<column name="DESCRIPTION" remarks="" type="VARCHAR(2000)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMASSETPARTSGROUP]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetpartsgroup-16-7">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassetpartsgroup-22-7">
<createTable tableName="EAMASSETPARTSGROUP">
<column name="EAMASSETTYPEID" remarks="" type="VARCHAR(100)">
</column>
......@@ -248,7 +250,7 @@
<!--输出实体[EAMASSETTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassettype-22-11">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamassettype-37-11">
<createTable tableName="EAMASSETTYPE">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -267,12 +269,66 @@
</column>
<column name="ASSETTYPENUMBER" remarks="" type="VARCHAR(100)">
</column>
<column name="DESCRIPTION" remarks="" type="VARCHAR(2000)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMDOCUMENT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamdocument-27-12">
<createTable tableName="EAMDOCUMENT">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="EAMDOCUMENTNAME" remarks="" type="VARCHAR(200)">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="EAMDOCUMENTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMDOCUMENT_EAMDOCUMENTID"/>
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="EAMASSETTYPEID" remarks="" type="VARCHAR(100)">
</column>
<column name="DOCUMENTNUMBER" remarks="" type="VARCHAR(100)">
</column>
<column name="EAMDOCUMENTTYPEID" remarks="" type="VARCHAR(100)">
</column>
<column name="CONTENT" remarks="" type="VARCHAR(2000)">
</column>
<column name="DOCFILE" remarks="" type="VARCHAR(2000)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMDOCUMENTTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamdocumenttype-21-13">
<createTable tableName="EAMDOCUMENTTYPE">
<column name="EAMDOCUMENTTYPENAME" remarks="" type="VARCHAR(200)">
</column>
<column name="EAMDOCUMENTTYPEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMDOCUMENTTYPE_EAMDOCUMENT"/>
</column>
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
<column name="PEAMDOCUMENTTYPEID" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[EAMLOCATION]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-93-12">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocation-93-14">
<createTable tableName="EAMLOCATION">
<column name="EAMLOCATIONID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMLOCATION_EAMLOCATIONID"/>
......@@ -302,7 +358,7 @@
<!--输出实体[EAMLOCATIONSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-44-13">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstate-44-15">
<createTable tableName="EAMLOCATIONSTATE">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -326,7 +382,7 @@
<!--输出实体[EAMLOCATIONSTATEMODEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodel-22-14">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodel-22-16">
<createTable tableName="EAMLOCATIONSTATEMODEL">
<column name="CREATEDATE" remarks="" type="DATETIME">
</column>
......@@ -346,7 +402,7 @@
<!--输出实体[EAMLOCATIONSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-29-15">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationstatemodelline-29-17">
<createTable tableName="EAMLOCATIONSTATEMODELLINE">
<column name="UPDATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -370,7 +426,7 @@
<!--输出实体[EAMLOCATIONTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationtype-23-16">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamlocationtype-23-18">
<createTable tableName="EAMLOCATIONTYPE">
<column name="EAMLOCATIONTYPENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -394,7 +450,7 @@
<!--输出实体[EAMMONITORPOINT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eammonitorpoint-10-17">
<changeSet author="a_LAB01_e85d8801c" id="tab-eammonitorpoint-10-19">
<createTable tableName="EAMMONITORPOINT">
<column name="EAMMONITORPOINTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMMONITORPOINT_EAMMONITORP"/>
......@@ -414,7 +470,7 @@
<!--输出实体[EAMPRODUCT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamproduct-14-18">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamproduct-14-20">
<createTable tableName="PRODUCT">
<column name="PRODUCTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPRODUCT_PRODUCTID"/>
......@@ -436,7 +492,7 @@
<!--输出实体[EAMPLAN]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplan-56-19">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplan-57-21">
<createTable tableName="EAMPLAN">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -470,7 +526,7 @@
<!--输出实体[EAMPLANCDT]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplancdt-7-20">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplancdt-7-22">
<createTable tableName="EAMPLANCDT">
<column name="EAMPLANCDTID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPLANCDT_EAMPLANCDTID"/>
......@@ -492,7 +548,7 @@
<!--输出实体[EAMPLANLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanline-22-21">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanline-22-23">
<createTable tableName="EAMPLANLINE">
<column name="EAMPLANLINEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPLANLINE_EAMPLANLINEID"/>
......@@ -524,7 +580,7 @@
<!--输出实体[EAMPLANSCHEDULE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanschedule-7-22">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamplanschedule-7-24">
<createTable tableName="EAMPLANSCHEDULE">
<column name="EAMPLANSCHEDULEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMPLANSCHEDULE_EAMPLANSCHE"/>
......@@ -546,7 +602,7 @@
<!--输出实体[EAMSERVICELEVEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamservicelevel-18-23">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamservicelevel-18-25">
<createTable tableName="EAMSERVICELEVEL">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -568,7 +624,7 @@
<!--输出实体[EAMSPAREPARTSGROUP]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamsparepartsgroup-33-24">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamsparepartsgroup-33-26">
<createTable tableName="EAMSPAREPARTSGROUP">
<column name="EAMSPAREPARTSGROUPID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMSPAREPARTSGROUP_EAMSPARE"/>
......@@ -590,7 +646,7 @@
<!--输出实体[EAMSPAREPARTSPRO]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamsparepartspro-20-25">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamsparepartspro-20-27">
<createTable tableName="EAMSPAREPARTSPRO">
<column name="EAMSPAREPARTSGROUPID" remarks="" type="VARCHAR(100)">
</column>
......@@ -614,7 +670,7 @@
<!--输出实体[EAMWOSTATE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostate-7-26">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostate-7-28">
<createTable tableName="EAMWOSTATE">
<column name="EAMWOSTATENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -634,7 +690,7 @@
<!--输出实体[EAMWOSTATEMODEL]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodel-7-27">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodel-7-29">
<createTable tableName="EAMWOSTATEMODEL">
<column name="CREATEMAN" remarks="" type="VARCHAR(60)">
</column>
......@@ -654,7 +710,7 @@
<!--输出实体[EAMWOSTATEMODELLINE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodelline-7-28">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwostatemodelline-7-30">
<createTable tableName="EAMWOSTATEMODELLINE">
<column name="UPDATEDATE" remarks="" type="DATETIME">
</column>
......@@ -678,7 +734,7 @@
<!--输出实体[EAMWOTYPE]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwotype-17-29">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwotype-17-31">
<createTable tableName="EAMWOTYPE">
<column name="EAMWOTYPENAME" remarks="" type="VARCHAR(200)">
</column>
......@@ -700,7 +756,7 @@
<!--输出实体[EAMWORKORDER]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamworkorder-86-30">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamworkorder-87-32">
<createTable tableName="WORKORDER">
<column name="WORKORDERID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMWORKORDER_WORKORDERID"/>
......@@ -746,7 +802,7 @@
<!--输出实体[EAMWOORIGIN]数据结构 -->
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwoorigin-16-31">
<changeSet author="a_LAB01_e85d8801c" id="tab-eamwoorigin-16-33">
<createTable tableName="EAMWOORIGIN">
<column name="EAMWOORIGINID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_EAMWOORIGIN_EAMWOORIGINID"/>
......@@ -767,147 +823,158 @@
</changeSet>
<!--输出实体[EAMAPPLY]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-57-32">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-58-34">
<addForeignKeyConstraint baseColumnNames="EAMAPPLYTYPEID" baseTableName="EAMAPPLY" constraintName="DER1N_EAMAPPLY_EAMAPPLYTYPE_EA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMAPPLYTYPEID" referencedTableName="EAMAPPLYTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-57-33">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-58-35">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMAPPLY" constraintName="DER1N_EAMAPPLY_EAMASSET_ASSETI" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-57-34">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-58-36">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMAPPLY" constraintName="DER1N_EAMAPPLY_EAMLOCATION_EAM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-57-35">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapply-58-37">
<addForeignKeyConstraint baseColumnNames="EAMSERVICELEVELID" baseTableName="EAMAPPLY" constraintName="DER1N_EAMAPPLY_EAMSERVICELEVEL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMSERVICELEVELID" referencedTableName="EAMSERVICELEVEL" validate="true"/>
</changeSet>
<!--输出实体[EAMAPPLYSTATE]外键关系 -->
<!--输出实体[EAMAPPLYSTATEMODEL]外键关系 -->
<!--输出实体[EAMAPPLYSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplystatemodelline-8-36">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplystatemodelline-8-38">
<addForeignKeyConstraint baseColumnNames="EAMAPPLYSTATEMODELID" baseTableName="EAMAPPLYSTATEMODELLINE" constraintName="DER1N_EAMAPPLYSTATEMODELLINE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMAPPLYSTATEMODELID" referencedTableName="EAMAPPLYSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMAPPLYTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplytype-19-38">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamapplytype-19-40">
<addForeignKeyConstraint baseColumnNames="EAMAPPLYSTATEMODELID" baseTableName="EAMAPPLYTYPE" constraintName="DER1N_EAMAPPLYTYPE_EAMAPPLYSTA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMAPPLYSTATEMODELID" referencedTableName="EAMAPPLYSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMASSET]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-93-39">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-99-41">
<addForeignKeyConstraint baseColumnNames="EAMASSETSTATEID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMASSETSTATE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETSTATEID" referencedTableName="EAMASSETSTATE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-93-40">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-99-42">
<addForeignKeyConstraint baseColumnNames="EAMASSETTYPEID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMASSETTYPE_EA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETTYPEID" referencedTableName="EAMASSETTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-93-41">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-99-43">
<addForeignKeyConstraint baseColumnNames="PASSETID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMASSET_PASSET" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-93-42">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamasset-99-44">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="ASSET" constraintName="DER1N_EAMASSET_EAMLOCATION_EAM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMASSETPARTSGROUP]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetpartsgroup-16-43">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetpartsgroup-22-45">
<addForeignKeyConstraint baseColumnNames="EAMASSETTYPEID" baseTableName="EAMASSETPARTSGROUP" constraintName="DER1N_EAMASSETPARTSGROUP_EAMAS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETTYPEID" referencedTableName="EAMASSETTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetpartsgroup-16-44">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetpartsgroup-22-46">
<addForeignKeyConstraint baseColumnNames="EAMSPAREPARTSGROUPID" baseTableName="EAMASSETPARTSGROUP" constraintName="DER1N_EAMASSETPARTSGROUP_EAMSP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMSPAREPARTSGROUPID" referencedTableName="EAMSPAREPARTSGROUP" validate="true"/>
</changeSet>
<!--输出实体[EAMASSETSTATE]外键关系 -->
<!--输出实体[EAMASSETSTATEMODEL]外键关系 -->
<!--输出实体[EAMASSETSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetstatemodelline-21-45">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassetstatemodelline-21-47">
<addForeignKeyConstraint baseColumnNames="EAMASSETSTATEMODELID" baseTableName="EAMASSETSTATEMODELLINE" constraintName="DER1N_EAMASSETSTATEMODELLINE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETSTATEMODELID" referencedTableName="EAMASSETSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMASSETTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassettype-22-47">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamassettype-37-49">
<addForeignKeyConstraint baseColumnNames="EAMASSETSTATEMODELID" baseTableName="EAMASSETTYPE" constraintName="DER1N_EAMASSETTYPE_EAMASSETSTA" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETSTATEMODELID" referencedTableName="EAMASSETSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMDOCUMENT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamdocument-27-50">
<addForeignKeyConstraint baseColumnNames="EAMASSETTYPEID" baseTableName="EAMDOCUMENT" constraintName="DER1N_EAMDOCUMENT_EAMASSETTYPE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMASSETTYPEID" referencedTableName="EAMASSETTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamdocument-27-51">
<addForeignKeyConstraint baseColumnNames="EAMDOCUMENTTYPEID" baseTableName="EAMDOCUMENT" constraintName="DER1N_EAMDOCUMENT_EAMDOCUMENTT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMDOCUMENTTYPEID" referencedTableName="EAMDOCUMENTTYPE" validate="true"/>
</changeSet>
<!--输出实体[EAMDOCUMENTTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamdocumenttype-21-52">
<addForeignKeyConstraint baseColumnNames="PEAMDOCUMENTTYPEID" baseTableName="EAMDOCUMENTTYPE" constraintName="DER1N_EAMDOCUMENTTYPE_EAMDOCUM" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMDOCUMENTTYPEID" referencedTableName="EAMDOCUMENTTYPE" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATION]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-93-48">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-93-53">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATIONS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEID" referencedTableName="EAMLOCATIONSTATE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-93-49">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-93-54">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONTYPEID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATIONT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONTYPEID" referencedTableName="EAMLOCATIONTYPE" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-93-50">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocation-93-55">
<addForeignKeyConstraint baseColumnNames="PEAMLOCATIONID" baseTableName="EAMLOCATION" constraintName="DER1N_EAMLOCATION_EAMLOCATION_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATIONSTATE]外键关系 -->
<!--输出实体[EAMLOCATIONSTATEMODEL]外键关系 -->
<!--输出实体[EAMLOCATIONSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationstatemodelline-29-51">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationstatemodelline-29-56">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEMODELID" baseTableName="EAMLOCATIONSTATEMODELLINE" constraintName="DER1N_EAMLOCATIONSTATEMODELLIN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEMODELID" referencedTableName="EAMLOCATIONSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMLOCATIONTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationtype-23-53">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamlocationtype-23-58">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONSTATEMODELID" baseTableName="EAMLOCATIONTYPE" constraintName="DER1N_EAMLOCATIONTYPE_EAMLOCAT" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONSTATEMODELID" referencedTableName="EAMLOCATIONSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMMONITORPOINT]外键关系 -->
<!--输出实体[EAMPRODUCT]外键关系 -->
<!--输出实体[EAMPLAN]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-56-54">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-57-59">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMASSET_ASSETID" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-56-55">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-57-60">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMLOCATION_EAML" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-56-56">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplan-57-61">
<addForeignKeyConstraint baseColumnNames="EAMMONITORPOINTID" baseTableName="EAMPLAN" constraintName="DER1N_EAMPLAN_EAMMONITORPOINT_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMMONITORPOINTID" referencedTableName="EAMMONITORPOINT" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANCDT]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplancdt-7-57">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplancdt-7-62">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANCDT" constraintName="DER1N_EAMPLANCDT_EAMPLAN_EAMPL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-58">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-63">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMASSET_ASS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-59">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-64">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMLOCATION_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-60">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-65">
<addForeignKeyConstraint baseColumnNames="EAMMONITORPOINTID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMMONITORPO" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMMONITORPOINTID" referencedTableName="EAMMONITORPOINT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-61">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanline-22-66">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANLINE" constraintName="DER1N_EAMPLANLINE_EAMPLAN_EAMP" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMPLANSCHEDULE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanschedule-7-62">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamplanschedule-7-67">
<addForeignKeyConstraint baseColumnNames="EAMPLANID" baseTableName="EAMPLANSCHEDULE" constraintName="DER1N_EAMPLANSCHEDULE_EAMPLAN_" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMPLANID" referencedTableName="EAMPLAN" validate="true"/>
</changeSet>
<!--输出实体[EAMSERVICELEVEL]外键关系 -->
<!--输出实体[EAMSPAREPARTSGROUP]外键关系 -->
<!--输出实体[EAMSPAREPARTSPRO]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamsparepartspro-20-63">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamsparepartspro-20-68">
<addForeignKeyConstraint baseColumnNames="PRODUCTID" baseTableName="EAMSPAREPARTSPRO" constraintName="DER1N_EAMSPAREPARTSPRO_EAMPROD" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="PRODUCTID" referencedTableName="PRODUCT" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamsparepartspro-20-64">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamsparepartspro-20-69">
<addForeignKeyConstraint baseColumnNames="EAMSPAREPARTSGROUPID" baseTableName="EAMSPAREPARTSPRO" constraintName="DER1N_EAMSPAREPARTSPRO_EAMSPAR" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMSPAREPARTSGROUPID" referencedTableName="EAMSPAREPARTSGROUP" validate="true"/>
</changeSet>
<!--输出实体[EAMWOSTATE]外键关系 -->
<!--输出实体[EAMWOSTATEMODEL]外键关系 -->
<!--输出实体[EAMWOSTATEMODELLINE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwostatemodelline-7-65">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwostatemodelline-7-70">
<addForeignKeyConstraint baseColumnNames="EAMWOSTATEMODELID" baseTableName="EAMWOSTATEMODELLINE" constraintName="DER1N_EAMWOSTATEMODELLINE_EAMW" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOSTATEMODELID" referencedTableName="EAMWOSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMWOTYPE]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwotype-17-67">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamwotype-17-72">
<addForeignKeyConstraint baseColumnNames="EAMWOSTATEMODELID" baseTableName="EAMWOTYPE" constraintName="DER1N_EAMWOTYPE_EAMWOSTATEMODE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOSTATEMODELID" referencedTableName="EAMWOSTATEMODEL" validate="true"/>
</changeSet>
<!--输出实体[EAMWORKORDER]外键关系 -->
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-86-68">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-87-73">
<addForeignKeyConstraint baseColumnNames="ASSETID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMASSET_AS" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="ASSETID" referencedTableName="ASSET" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-86-69">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-87-74">
<addForeignKeyConstraint baseColumnNames="EAMLOCATIONID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMLOCATION" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMLOCATIONID" referencedTableName="EAMLOCATION" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-86-70">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-87-75">
<addForeignKeyConstraint baseColumnNames="EAMSERVICELEVELID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMSERVICEL" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMSERVICELEVELID" referencedTableName="EAMSERVICELEVEL" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-86-71">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-87-76">
<addForeignKeyConstraint baseColumnNames="EAMWOORIGINID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWOORIGIN" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOORIGINID" referencedTableName="EAMWOORIGIN" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-86-72">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-87-77">
<addForeignKeyConstraint baseColumnNames="PWORKORDERID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWORKORDE" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="WORKORDERID" referencedTableName="WORKORDER" validate="true"/>
</changeSet>
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-86-73">
<changeSet author="a_LAB01_e85d8801c" id="fk-eamworkorder-87-78">
<addForeignKeyConstraint baseColumnNames="EAMWOTYPEID" baseTableName="WORKORDER" constraintName="DER1N_EAMWORKORDER_EAMWOTYPE_E" deferrable="false" initiallyDeferred="false" onDelete="RESTRICT" onUpdate="RESTRICT" referencedColumnNames="EAMWOTYPEID" referencedTableName="EAMWOTYPE" validate="true"/>
</changeSet>
<!--输出实体[EAMWOORIGIN]外键关系 -->
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMAssetResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID ) t1 where assetid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID ) t1 where assetid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -76,24 +76,24 @@
<!--数据查询[ChildAsset]-->
<sql id="ChildAsset" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
WHERE ( t1.`PASSETID` = #{srf.datacontext.srfparentkey} )
]]>
</sql>
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
]]>
</sql>
<!--数据查询[LocationAsset]-->
<sql id="LocationAsset" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
WHERE ( t1.`EAMLOCATIONID` = #{srf.datacontext.eamlocationid} )
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
<![CDATA[ SELECT t1.`ASSETID`, t1.`ASSETNAME`, t1.`ASSETNUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEID`, t31.`EAMASSETSTATENAME`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMLOCATIONID`, t21.`EAMLOCATIONNAME`, t1.`PASSETID`, t41.`ASSETNAME` AS `PASSETNAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `ASSET` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMLOCATION t21 ON t1.EAMLOCATIONID = t21.EAMLOCATIONID LEFT JOIN EAMASSETSTATE t31 ON t1.EAMASSETSTATEID = t31.EAMASSETSTATEID LEFT JOIN ASSET t41 ON t1.PASSETID = t41.ASSETID
]]>
</sql>
</mapper>
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMAssetTypeResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID ) t1 where eamassettypeid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID ) t1 where eamassettypeid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -37,12 +37,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID
<![CDATA[ SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID
<![CDATA[ SELECT t1.`ASSETTYPENUMBER`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DESCRIPTION`, t1.`EAMASSETSTATEMODELID`, t11.`EAMASSETSTATEMODELNAME`, t1.`EAMASSETTYPEID`, t1.`EAMASSETTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMASSETTYPE` t1 LEFT JOIN EAMASSETSTATEMODEL t11 ON t1.EAMASSETSTATEMODELID = t11.EAMASSETSTATEMODELID
]]>
</sql>
</mapper>
......
<?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.assetmanagement.core.asset.mapper.EAMDocumentMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMDocumentResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CONTENT`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DOCFILE`, t1.`DOCUMENTNUMBER`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMDOCUMENTID`, t1.`EAMDOCUMENTNAME`, t1.`EAMDOCUMENTTYPEID`, t21.`EAMDOCUMENTTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMDOCUMENT` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMDOCUMENTTYPE t21 ON t1.EAMDOCUMENTTYPEID = t21.EAMDOCUMENTTYPEID ) t1 where eamdocumentid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EAMDocumentResultMap" type="cn.ibizlab.assetmanagement.core.asset.domain.EAMDocument" autoMapping="true">
<id property="eamdocumentid" column="eamdocumentid" /><!--主键字段映射-->
<result property="eamassettypeid" column="eamassettypeid" />
<result property="eamdocumenttypeid" column="eamdocumenttypeid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamassettype" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMAssetType" column="eamassettypeid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMAssetTypeMapper.selectById" fetchType="lazy"></association>
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="eamdocumenttype" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType" column="eamdocumenttypeid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMDocumentTypeMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMDOCUMENT_EAMASSETTYPE_EAMASSETTYPEID] -->
<select id="selectByEamassettypeid" resultMap="EAMDocumentResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamassettypeid=#{eamassettypeid}
</select>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMDOCUMENT_EAMDOCUMENTTYPE_EAMDOCUMENTTYPEID] -->
<select id="selectByEamdocumenttypeid" resultMap="EAMDocumentResultMap">
select t1.* from (
<include refid="Default" />
) t1
where eamdocumenttypeid=#{eamdocumenttypeid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentSearchContext" resultMap="EAMDocumentResultMap">
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="mysql">
<![CDATA[ SELECT t1.`CONTENT`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DOCFILE`, t1.`DOCUMENTNUMBER`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMDOCUMENTID`, t1.`EAMDOCUMENTNAME`, t1.`EAMDOCUMENTTYPEID`, t21.`EAMDOCUMENTTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMDOCUMENT` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMDOCUMENTTYPE t21 ON t1.EAMDOCUMENTTYPEID = t21.EAMDOCUMENTTYPEID
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CONTENT`, t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`DOCFILE`, t1.`DOCUMENTNUMBER`, t1.`EAMASSETTYPEID`, t11.`EAMASSETTYPENAME`, t1.`EAMDOCUMENTID`, t1.`EAMDOCUMENTNAME`, t1.`EAMDOCUMENTTYPEID`, t21.`EAMDOCUMENTTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMDOCUMENT` t1 LEFT JOIN EAMASSETTYPE t11 ON t1.EAMASSETTYPEID = t11.EAMASSETTYPEID LEFT JOIN EAMDOCUMENTTYPE t21 ON t1.EAMDOCUMENTTYPEID = t21.EAMDOCUMENTTYPEID
]]>
</sql>
</mapper>
<?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.assetmanagement.core.asset.mapper.EAMDocumentTypeMapper">
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="EAMDocumentTypeResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMDOCUMENTTYPEID`, t1.`EAMDOCUMENTTYPENAME`, t1.`PEAMDOCUMENTTYPEID`, t11.`EAMDOCUMENTTYPENAME` AS `PEAMDOCUMENTTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMDOCUMENTTYPE` t1 LEFT JOIN EAMDOCUMENTTYPE t11 ON t1.PEAMDOCUMENTTYPEID = t11.EAMDOCUMENTTYPEID ) t1 where eamdocumenttypeid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="EAMDocumentTypeResultMap" type="cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType" autoMapping="true">
<id property="eamdocumenttypeid" column="eamdocumenttypeid" /><!--主键字段映射-->
<result property="peamdocumenttypeid" column="peamdocumenttypeid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="peamdocumenttype" javaType="cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType" column="peamdocumenttypeid" select="cn.ibizlab.assetmanagement.core.asset.mapper.EAMDocumentTypeMapper.selectById" fetchType="lazy"></association>
</resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_EAMDOCUMENTTYPE_EAMDOCUMENTTYPE_PEAMDOCUMENTTYPEID] -->
<select id="selectByPeamdocumenttypeid" resultMap="EAMDocumentTypeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where peamdocumenttypeid=#{eamdocumenttypeid}
</select>
<!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentTypeSearchContext" resultMap="EAMDocumentTypeResultMap">
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>
<!--数据集合[Top]-->
<select id="searchTop" parameterType="cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentTypeSearchContext" resultMap="EAMDocumentTypeResultMap">
select t1.* from (
<include refid="Top" />
)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="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMDOCUMENTTYPEID`, t1.`EAMDOCUMENTTYPENAME`, t1.`PEAMDOCUMENTTYPEID`, t11.`EAMDOCUMENTTYPENAME` AS `PEAMDOCUMENTTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMDOCUMENTTYPE` t1 LEFT JOIN EAMDOCUMENTTYPE t11 ON t1.PEAMDOCUMENTTYPEID = t11.EAMDOCUMENTTYPEID
]]>
</sql>
<!--数据查询[Top]-->
<sql id="Top" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMDOCUMENTTYPEID`, t1.`EAMDOCUMENTTYPENAME`, t1.`PEAMDOCUMENTTYPEID`, t11.`EAMDOCUMENTTYPENAME` AS `PEAMDOCUMENTTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMDOCUMENTTYPE` t1 LEFT JOIN EAMDOCUMENTTYPE t11 ON t1.PEAMDOCUMENTTYPEID = t11.EAMDOCUMENTTYPEID
WHERE ( t1.`PEAMDOCUMENTTYPEID` IS NULL )
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`CREATEDATE`, t1.`CREATEMAN`, t1.`EAMDOCUMENTTYPEID`, t1.`EAMDOCUMENTTYPENAME`, t1.`PEAMDOCUMENTTYPEID`, t11.`EAMDOCUMENTTYPENAME` AS `PEAMDOCUMENTTYPENAME`, t1.`UPDATEDATE`, t1.`UPDATEMAN` FROM `EAMDOCUMENTTYPE` t1 LEFT JOIN EAMDOCUMENTTYPE t11 ON t1.PEAMDOCUMENTTYPEID = t11.EAMDOCUMENTTYPEID
]]>
</sql>
</mapper>
......@@ -4,6 +4,14 @@
],
"entities":[
{
"dename":"EAMDocument",
"delogicname":"文档",
"sysmoudle":{"id":"ASSET","name":"资产管理"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMLocationStateModel",
"delogicname":"功能位置状态模型",
"sysmoudle":{"id":"LOCATION","name":"功能位置"},
......@@ -212,6 +220,14 @@
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMDocumentType",
"delogicname":"文档类型",
"sysmoudle":{"id":"ASSET","name":"资产管理"},
"dedataset":[{"id":"Default" , "name":"DEFAULT"},{"id":"Top" , "name":"顶级文档类型"}],
"deaction":[{"id":"Create" , "name":"Create" , "type":"BUILTIN" },{"id":"Update" , "name":"Update" , "type":"BUILTIN" },{"id":"Remove" , "name":"Remove" , "type":"BUILTIN" },{"id":"Get" , "name":"Get" , "type":"BUILTIN" },{"id":"GetDraft" , "name":"GetDraft" , "type":"BUILTIN" },{"id":"CheckKey" , "name":"CheckKey" , "type":"BUILTIN" },{"id":"Save" , "name":"Save" , "type":"BUILTIN" }],
"datascope":[{"id":"all","name":"全部数据"}, {"id":"createman","name":"创建人"}]
}
, {
"dename":"EAMAssetStateModel",
"delogicname":"资产状态模型",
"sysmoudle":{"id":"ASSET","name":"资产管理"},
......@@ -233,7 +249,7 @@
{
"appid":"AssetManagement",
"appname":"资产管理",
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem15" , "name":"系统设置" , "items":[{ "id":"menuitem16" , "name":"服务等级" },{ "id":"menuitem17" , "name":"维护申请类型" },{ "id":"menuitem19" , "name":"工单类型" }]}]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem1" , "name":"功能位置" , "items":[{ "id":"menuitem6" , "name":"功能位置状态" },{ "id":"menuitem7" , "name":"功能位置状态模型" },{ "id":"menuitem8" , "name":"功能位置类型" },{ "id":"menuitem9" , "name":"功能位置" }]},{ "id":"menuitem2" , "name":"资产管理" , "items":[{ "id":"menuitem10" , "name":"资产状态" },{ "id":"menuitem11" , "name":"资产状态模型" },{ "id":"menuitem12" , "name":"资产类型" },{ "id":"menuitem13" , "name":"资产管理" },{ "id":"menuitem14" , "name":"备件包" }]},{ "id":"menuitem4" , "name":"工单管理" , "items":[{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem18" , "name":"工单" }]},{ "id":"menuitem5" , "name":"维护计划" , "items":[{ "id":"menuitem20" , "name":"维护计划" }]}]}] }]
"appmenu":[{"menuid":"AppIndexView", "menuname":"AppIndexView", "menuitem":[{ "id":"user_menus" , "name":"用户菜单" },{ "id":"top_menus" , "name":"顶部菜单" , "items":[{ "id":"menuitem15" , "name":"系统设置" , "items":[{ "id":"menuitem21" , "name":"文档类型" },{ "id":"menuitem16" , "name":"服务等级" },{ "id":"menuitem17" , "name":"维护申请类型" },{ "id":"menuitem19" , "name":"工单类型" }]}]},{ "id":"left_exp" , "name":"左侧菜单" , "items":[{ "id":"menuitem1" , "name":"功能位置" , "items":[{ "id":"menuitem6" , "name":"功能位置状态" },{ "id":"menuitem7" , "name":"功能位置状态模型" },{ "id":"menuitem8" , "name":"功能位置类型" },{ "id":"menuitem9" , "name":"功能位置" }]},{ "id":"menuitem2" , "name":"资产管理" , "items":[{ "id":"menuitem10" , "name":"资产状态" },{ "id":"menuitem11" , "name":"资产状态模型" },{ "id":"menuitem12" , "name":"资产类型" },{ "id":"menuitem13" , "name":"资产管理" },{ "id":"menuitem22" , "name":"文档" },{ "id":"menuitem14" , "name":"备件包" }]},{ "id":"menuitem4" , "name":"工单管理" , "items":[{ "id":"menuitem3" , "name":"维护申请" },{ "id":"menuitem18" , "name":"工单" }]},{ "id":"menuitem5" , "name":"维护计划" , "items":[{ "id":"menuitem20" , "name":"维护计划" }]}]}] }]
}
]
}
......@@ -12,6 +12,6 @@ CMD echo "The application will start in ${IBIZ_SLEEP}s..." && \
sleep ${IBIZ_SLEEP} && \
java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /assetmanagement-provider-assetapi.jar
EXPOSE 8081
EXPOSE 10315
ADD assetmanagement-provider-assetapi.jar /assetmanagement-provider-assetapi.jar
......@@ -3,9 +3,25 @@ services:
assetmanagement-provider-assetapi:
image: registry.cn-shanghai.aliyuncs.com/ibizsys/assetmanagement-provider-assetapi:latest
ports:
- "8081:8081"
- "10315:10315"
networks:
- agent_network
environment:
- SPRING_CLOUD_NACOS_DISCOVERY_IP=172.16.240.110
- SERVER_PORT=10315
- SPRING_CLOUD_NACOS_DISCOVERY_SERVER-ADDR=172.16.240.110:8848
- SPRING_REDIS_HOST=172.16.240.110
- SPRING_REDIS_PORT=6379
- SPRING_REDIS_DATABASE=0
- SPRING_DATASOURCE_USERNAME=a_LAB01_e85d8801c
- SPRING_DATASOURCE_PASSWORD=b1@@@772
- SPRING_DATASOURCE_URL=jdbc:mysql://172.16.186.185:3306/a_LAB01_e85d8801c?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
- SPRING_DATASOURCE_DRIVER-CLASS-NAME=com.mysql.jdbc.Driver
- SPRING_DATASOURCE_DEFAULTSCHEMA=a_LAB01_e85d8801c
- CAS=https://passport.ibizlab.cn
- NACOS=172.16.240.110:8848
- SEATA_REGISTRY_NACOS_SERVER-ADDR=172.16.240.110:8848
- SEATA_ENABLED=true
deploy:
resources:
limits:
......
......@@ -146,6 +146,14 @@ public class EAMAssetDTO extends DTOBase implements Serializable {
@JsonProperty("assetnumber")
private String assetnumber;
/**
* 属性 [DESCRIPTION]
*
*/
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
* 设置 [ASSETNAME]
......@@ -195,6 +203,14 @@ public class EAMAssetDTO extends DTOBase implements Serializable {
this.modify("assetnumber",assetnumber);
}
/**
* 设置 [DESCRIPTION]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
}
......@@ -98,6 +98,14 @@ public class EAMAssetTypeDTO extends DTOBase implements Serializable {
@JsonProperty("assettypenumber")
private String assettypenumber;
/**
* 属性 [DESCRIPTION]
*
*/
@JSONField(name = "description")
@JsonProperty("description")
private String description;
/**
* 设置 [EAMASSETTYPENAME]
......@@ -123,6 +131,14 @@ public class EAMAssetTypeDTO extends DTOBase implements Serializable {
this.modify("assettypenumber",assettypenumber);
}
/**
* 设置 [DESCRIPTION]
*/
public void setDescription(String description){
this.description = description ;
this.modify("description",description);
}
}
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[EAMDocumentDTO]
*/
@Data
public class EAMDocumentDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [EAMDOCUMENTNAME]
*
*/
@JSONField(name = "eamdocumentname")
@JsonProperty("eamdocumentname")
private String eamdocumentname;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [EAMDOCUMENTID]
*
*/
@JSONField(name = "eamdocumentid")
@JsonProperty("eamdocumentid")
private String eamdocumentid;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [EAMASSETTYPEID]
*
*/
@JSONField(name = "eamassettypeid")
@JsonProperty("eamassettypeid")
private String eamassettypeid;
/**
* 属性 [EAMASSETTYPENAME]
*
*/
@JSONField(name = "eamassettypename")
@JsonProperty("eamassettypename")
private String eamassettypename;
/**
* 属性 [DOCUMENTNUMBER]
*
*/
@JSONField(name = "documentnumber")
@JsonProperty("documentnumber")
private String documentnumber;
/**
* 属性 [EAMDOCUMENTTYPEID]
*
*/
@JSONField(name = "eamdocumenttypeid")
@JsonProperty("eamdocumenttypeid")
private String eamdocumenttypeid;
/**
* 属性 [EAMDOCUMENTTYPENAME]
*
*/
@JSONField(name = "eamdocumenttypename")
@JsonProperty("eamdocumenttypename")
private String eamdocumenttypename;
/**
* 属性 [CONTENT]
*
*/
@JSONField(name = "content")
@JsonProperty("content")
private String content;
/**
* 属性 [DOCFILE]
*
*/
@JSONField(name = "docfile")
@JsonProperty("docfile")
private String docfile;
/**
* 设置 [EAMDOCUMENTNAME]
*/
public void setEamdocumentname(String eamdocumentname){
this.eamdocumentname = eamdocumentname ;
this.modify("eamdocumentname",eamdocumentname);
}
/**
* 设置 [EAMASSETTYPEID]
*/
public void setEamassettypeid(String eamassettypeid){
this.eamassettypeid = eamassettypeid ;
this.modify("eamassettypeid",eamassettypeid);
}
/**
* 设置 [DOCUMENTNUMBER]
*/
public void setDocumentnumber(String documentnumber){
this.documentnumber = documentnumber ;
this.modify("documentnumber",documentnumber);
}
/**
* 设置 [EAMDOCUMENTTYPEID]
*/
public void setEamdocumenttypeid(String eamdocumenttypeid){
this.eamdocumenttypeid = eamdocumenttypeid ;
this.modify("eamdocumenttypeid",eamdocumenttypeid);
}
/**
* 设置 [CONTENT]
*/
public void setContent(String content){
this.content = content ;
this.modify("content",content);
}
/**
* 设置 [DOCFILE]
*/
public void setDocfile(String docfile){
this.docfile = docfile ;
this.modify("docfile",docfile);
}
}
package cn.ibizlab.assetmanagement.assetapi.dto;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.math.BigInteger;
import java.util.Map;
import java.util.HashMap;
import java.io.Serializable;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.fastjson.annotation.JSONField;
import cn.ibizlab.assetmanagement.util.domain.DTOBase;
import cn.ibizlab.assetmanagement.util.domain.DTOClient;
import lombok.Data;
/**
* 服务DTO对象[EAMDocumentTypeDTO]
*/
@Data
public class EAMDocumentTypeDTO extends DTOBase implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 属性 [EAMDOCUMENTTYPENAME]
*
*/
@JSONField(name = "eamdocumenttypename")
@JsonProperty("eamdocumenttypename")
private String eamdocumenttypename;
/**
* 属性 [EAMDOCUMENTTYPEID]
*
*/
@JSONField(name = "eamdocumenttypeid")
@JsonProperty("eamdocumenttypeid")
private String eamdocumenttypeid;
/**
* 属性 [CREATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "createdate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("createdate")
private Timestamp createdate;
/**
* 属性 [UPDATEMAN]
*
*/
@JSONField(name = "updateman")
@JsonProperty("updateman")
private String updateman;
/**
* 属性 [UPDATEDATE]
*
*/
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", locale = "zh" , timezone="GMT+8")
@JSONField(name = "updatedate" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("updatedate")
private Timestamp updatedate;
/**
* 属性 [CREATEMAN]
*
*/
@JSONField(name = "createman")
@JsonProperty("createman")
private String createman;
/**
* 属性 [PEAMDOCUMENTTYPEID]
*
*/
@JSONField(name = "peamdocumenttypeid")
@JsonProperty("peamdocumenttypeid")
private String peamdocumenttypeid;
/**
* 属性 [PEAMDOCUMENTTYPENAME]
*
*/
@JSONField(name = "peamdocumenttypename")
@JsonProperty("peamdocumenttypename")
private String peamdocumenttypename;
/**
* 设置 [EAMDOCUMENTTYPENAME]
*/
public void setEamdocumenttypename(String eamdocumenttypename){
this.eamdocumenttypename = eamdocumenttypename ;
this.modify("eamdocumenttypename",eamdocumenttypename);
}
/**
* 设置 [PEAMDOCUMENTTYPEID]
*/
public void setPeamdocumenttypeid(String peamdocumenttypeid){
this.peamdocumenttypeid = peamdocumenttypeid ;
this.modify("peamdocumenttypeid",peamdocumenttypeid);
}
}
......@@ -15,6 +15,8 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import cn.ibizlab.assetmanagement.util.web.SearchContextHandlerMethodArgumentResolver;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@Slf4j
......@@ -40,6 +42,9 @@ import java.util.List;
@EnableScheduling
public class iBizAssetManagementAssetApiApplication extends WebMvcConfigurerAdapter{
@Autowired
SearchContextHandlerMethodArgumentResolver resolver;
public static void main(String[] args) {
SpringApplication.run(iBizAssetManagementAssetApiApplication.class, args);
}
......@@ -47,6 +52,6 @@ public class iBizAssetManagementAssetApiApplication extends WebMvcConfigurerAdap
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
super.addArgumentResolvers(argumentResolvers);
argumentResolvers.add(new cn.ibizlab.assetmanagement.util.web.SearchContextHandlerMethodArgumentResolver());
argumentResolvers.add(resolver);
}
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocument;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMDocumentDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMDocumentMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMDocumentMapping extends MappingBase<EAMDocumentDTO, EAMDocument> {
}
package cn.ibizlab.assetmanagement.assetapi.mapping;
import org.mapstruct.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType;
import cn.ibizlab.assetmanagement.assetapi.dto.EAMDocumentTypeDTO;
import cn.ibizlab.assetmanagement.util.domain.MappingBase;
import org.mapstruct.factory.Mappers;
@Mapper(componentModel = "spring", uses = {},implementationName="AssetApiEAMDocumentTypeMapping",
nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface EAMDocumentTypeMapping extends MappingBase<EAMDocumentTypeDTO, EAMDocumentType> {
}
......@@ -161,6 +161,139 @@ public class EAMAssetPartsGroupResource {
.body(new PageImpl(eamassetpartsgroupMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdto),'iBizAssetManagement-EAMAssetPartsGroup-Create')")
@ApiOperation(value = "根据资产类型建立资产备件包", tags = {"资产备件包" }, notes = "根据资产类型建立资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups")
@Transactional
public ResponseEntity<EAMAssetPartsGroupDTO> createByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
domain.setEamassettypeid(eamassettype_id);
eamassetpartsgroupService.create(domain);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos),'iBizAssetManagement-EAMAssetPartsGroup-Create')")
@ApiOperation(value = "根据资产类型批量建立资产备件包", tags = {"资产备件包" }, notes = "根据资产类型批量建立资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> createBatchByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
List<EAMAssetPartsGroup> domainlist=eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos);
for(EAMAssetPartsGroup domain:domainlist){
domain.setEamassettypeid(eamassettype_id);
}
eamassetpartsgroupService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamassetpartsgroup" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.get(#eamassetpartsgroup_id),'iBizAssetManagement-EAMAssetPartsGroup-Update')")
@ApiOperation(value = "根据资产类型更新资产备件包", tags = {"资产备件包" }, notes = "根据资产类型更新资产备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/{eamassetpartsgroup_id}")
@Transactional
public ResponseEntity<EAMAssetPartsGroupDTO> updateByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
domain.setEamassettypeid(eamassettype_id);
domain.setEamassetpartsgroupid(eamassetpartsgroup_id);
eamassetpartsgroupService.update(domain);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.getEamassetpartsgroupByEntities(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos)),'iBizAssetManagement-EAMAssetPartsGroup-Update')")
@ApiOperation(value = "根据资产类型批量更新资产备件包", tags = {"资产备件包" }, notes = "根据资产类型批量更新资产备件包")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> updateBatchByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
List<EAMAssetPartsGroup> domainlist=eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos);
for(EAMAssetPartsGroup domain:domainlist){
domain.setEamassettypeid(eamassettype_id);
}
eamassetpartsgroupService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.get(#eamassetpartsgroup_id),'iBizAssetManagement-EAMAssetPartsGroup-Remove')")
@ApiOperation(value = "根据资产类型删除资产备件包", tags = {"资产备件包" }, notes = "根据资产类型删除资产备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/{eamassetpartsgroup_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.remove(eamassetpartsgroup_id));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupService.getEamassetpartsgroupByIds(#ids),'iBizAssetManagement-EAMAssetPartsGroup-Remove')")
@ApiOperation(value = "根据资产类型批量删除资产备件包", tags = {"资产备件包" }, notes = "根据资产类型批量删除资产备件包")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/batch")
public ResponseEntity<Boolean> removeBatchByEAMAssetType(@RequestBody List<String> ids) {
eamassetpartsgroupService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "根据资产类型获取资产备件包", tags = {"资产备件包" }, notes = "根据资产类型获取资产备件包")
@RequestMapping(method = RequestMethod.GET, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/{eamassetpartsgroup_id}")
public ResponseEntity<EAMAssetPartsGroupDTO> getByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @PathVariable("eamassetpartsgroup_id") String eamassetpartsgroup_id) {
EAMAssetPartsGroup domain = eamassetpartsgroupService.get(eamassetpartsgroup_id);
EAMAssetPartsGroupDTO dto = eamassetpartsgroupMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产类型获取资产备件包草稿", tags = {"资产备件包" }, notes = "根据资产类型获取资产备件包草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/getdraft")
public ResponseEntity<EAMAssetPartsGroupDTO> getDraftByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id) {
EAMAssetPartsGroup domain = new EAMAssetPartsGroup();
domain.setEamassettypeid(eamassettype_id);
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupMapping.toDto(eamassetpartsgroupService.getDraft(domain)));
}
@ApiOperation(value = "根据资产类型检查资产备件包", tags = {"资产备件包" }, notes = "根据资产类型检查资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.checkKey(eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto)));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdto),'iBizAssetManagement-EAMAssetPartsGroup-Save')")
@ApiOperation(value = "根据资产类型保存资产备件包", tags = {"资产备件包" }, notes = "根据资产类型保存资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/save")
public ResponseEntity<Boolean> saveByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMAssetPartsGroupDTO eamassetpartsgroupdto) {
EAMAssetPartsGroup domain = eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdto);
domain.setEamassettypeid(eamassettype_id);
return ResponseEntity.status(HttpStatus.OK).body(eamassetpartsgroupService.save(domain));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdtos),'iBizAssetManagement-EAMAssetPartsGroup-Save')")
@ApiOperation(value = "根据资产类型批量保存资产备件包", tags = {"资产备件包" }, notes = "根据资产类型批量保存资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamassetpartsgroups/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody List<EAMAssetPartsGroupDTO> eamassetpartsgroupdtos) {
List<EAMAssetPartsGroup> domainlist=eamassetpartsgroupMapping.toDomain(eamassetpartsgroupdtos);
for(EAMAssetPartsGroup domain:domainlist){
domain.setEamassettypeid(eamassettype_id);
}
eamassetpartsgroupService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMAssetPartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "根据资产类型获取DEFAULT", tags = {"资产备件包" } ,notes = "根据资产类型获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassettypes/{eamassettype_id}/eamassetpartsgroups/fetchdefault")
public ResponseEntity<List<EAMAssetPartsGroupDTO>> fetchEAMAssetPartsGroupDefaultByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id,EAMAssetPartsGroupSearchContext context) {
context.setN_eamassettypeid_eq(eamassettype_id);
Page<EAMAssetPartsGroup> domains = eamassetpartsgroupService.searchDefault(context) ;
List<EAMAssetPartsGroupDTO> list = eamassetpartsgroupMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMAssetPartsGroup-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMAssetPartsGroup-Get')")
@ApiOperation(value = "根据资产类型查询DEFAULT", tags = {"资产备件包" } ,notes = "根据资产类型查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassettypes/{eamassettype_id}/eamassetpartsgroups/searchdefault")
public ResponseEntity<Page<EAMAssetPartsGroupDTO>> searchEAMAssetPartsGroupDefaultByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMAssetPartsGroupSearchContext context) {
context.setN_eamassettypeid_eq(eamassettype_id);
Page<EAMAssetPartsGroup> domains = eamassetpartsgroupService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamassetpartsgroupMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamassetpartsgroupMapping.toDomain(#eamassetpartsgroupdto),'iBizAssetManagement-EAMAssetPartsGroup-Create')")
@ApiOperation(value = "根据备件包建立资产备件包", tags = {"资产备件包" }, notes = "根据备件包建立资产备件包")
@RequestMapping(method = RequestMethod.POST, value = "/eamsparepartsgroups/{eamsparepartsgroup_id}/eamassetpartsgroups")
@Transactional
......
package cn.ibizlab.assetmanagement.assetapi.rest;
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 lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.assetmanagement.assetapi.dto.*;
import cn.ibizlab.assetmanagement.assetapi.mapping.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocument;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentService;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"文档" })
@RestController("AssetApi-eamdocument")
@RequestMapping("")
public class EAMDocumentResource {
@Autowired
public IEAMDocumentService eamdocumentService;
@Autowired
@Lazy
public EAMDocumentMapping eamdocumentMapping;
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdto),'iBizAssetManagement-EAMDocument-Create')")
@ApiOperation(value = "新建文档", tags = {"文档" }, notes = "新建文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocuments")
@Transactional
public ResponseEntity<EAMDocumentDTO> create(@RequestBody EAMDocumentDTO eamdocumentdto) {
EAMDocument domain = eamdocumentMapping.toDomain(eamdocumentdto);
eamdocumentService.create(domain);
EAMDocumentDTO dto = eamdocumentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdtos),'iBizAssetManagement-EAMDocument-Create')")
@ApiOperation(value = "批量新建文档", tags = {"文档" }, notes = "批量新建文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocuments/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMDocumentDTO> eamdocumentdtos) {
eamdocumentService.createBatch(eamdocumentMapping.toDomain(eamdocumentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamdocument" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamdocumentService.get(#eamdocument_id),'iBizAssetManagement-EAMDocument-Update')")
@ApiOperation(value = "更新文档", tags = {"文档" }, notes = "更新文档")
@RequestMapping(method = RequestMethod.PUT, value = "/eamdocuments/{eamdocument_id}")
@Transactional
public ResponseEntity<EAMDocumentDTO> update(@PathVariable("eamdocument_id") String eamdocument_id, @RequestBody EAMDocumentDTO eamdocumentdto) {
EAMDocument domain = eamdocumentMapping.toDomain(eamdocumentdto);
domain .setEamdocumentid(eamdocument_id);
eamdocumentService.update(domain );
EAMDocumentDTO dto = eamdocumentMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamdocumentService.getEamdocumentByEntities(this.eamdocumentMapping.toDomain(#eamdocumentdtos)),'iBizAssetManagement-EAMDocument-Update')")
@ApiOperation(value = "批量更新文档", tags = {"文档" }, notes = "批量更新文档")
@RequestMapping(method = RequestMethod.PUT, value = "/eamdocuments/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMDocumentDTO> eamdocumentdtos) {
eamdocumentService.updateBatch(eamdocumentMapping.toDomain(eamdocumentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamdocumentService.get(#eamdocument_id),'iBizAssetManagement-EAMDocument-Remove')")
@ApiOperation(value = "删除文档", tags = {"文档" }, notes = "删除文档")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamdocuments/{eamdocument_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamdocument_id") String eamdocument_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentService.remove(eamdocument_id));
}
@PreAuthorize("hasPermission(this.eamdocumentService.getEamdocumentByIds(#ids),'iBizAssetManagement-EAMDocument-Remove')")
@ApiOperation(value = "批量删除文档", tags = {"文档" }, notes = "批量删除文档")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamdocuments/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamdocumentService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamdocumentMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMDocument-Get')")
@ApiOperation(value = "获取文档", tags = {"文档" }, notes = "获取文档")
@RequestMapping(method = RequestMethod.GET, value = "/eamdocuments/{eamdocument_id}")
public ResponseEntity<EAMDocumentDTO> get(@PathVariable("eamdocument_id") String eamdocument_id) {
EAMDocument domain = eamdocumentService.get(eamdocument_id);
EAMDocumentDTO dto = eamdocumentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取文档草稿", tags = {"文档" }, notes = "获取文档草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamdocuments/getdraft")
public ResponseEntity<EAMDocumentDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentMapping.toDto(eamdocumentService.getDraft(new EAMDocument())));
}
@ApiOperation(value = "检查文档", tags = {"文档" }, notes = "检查文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocuments/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMDocumentDTO eamdocumentdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentService.checkKey(eamdocumentMapping.toDomain(eamdocumentdto)));
}
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdto),'iBizAssetManagement-EAMDocument-Save')")
@ApiOperation(value = "保存文档", tags = {"文档" }, notes = "保存文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocuments/save")
public ResponseEntity<Boolean> save(@RequestBody EAMDocumentDTO eamdocumentdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentService.save(eamdocumentMapping.toDomain(eamdocumentdto)));
}
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdtos),'iBizAssetManagement-EAMDocument-Save')")
@ApiOperation(value = "批量保存文档", tags = {"文档" }, notes = "批量保存文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocuments/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMDocumentDTO> eamdocumentdtos) {
eamdocumentService.saveBatch(eamdocumentMapping.toDomain(eamdocumentdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocument-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMDocument-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"文档" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamdocuments/fetchdefault")
public ResponseEntity<List<EAMDocumentDTO>> fetchDefault(EAMDocumentSearchContext context) {
Page<EAMDocument> domains = eamdocumentService.searchDefault(context) ;
List<EAMDocumentDTO> list = eamdocumentMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocument-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMDocument-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"文档" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamdocuments/searchdefault")
public ResponseEntity<Page<EAMDocumentDTO>> searchDefault(@RequestBody EAMDocumentSearchContext context) {
Page<EAMDocument> domains = eamdocumentService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamdocumentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdto),'iBizAssetManagement-EAMDocument-Create')")
@ApiOperation(value = "根据资产类型建立文档", tags = {"文档" }, notes = "根据资产类型建立文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamdocuments")
@Transactional
public ResponseEntity<EAMDocumentDTO> createByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMDocumentDTO eamdocumentdto) {
EAMDocument domain = eamdocumentMapping.toDomain(eamdocumentdto);
domain.setEamassettypeid(eamassettype_id);
eamdocumentService.create(domain);
EAMDocumentDTO dto = eamdocumentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdtos),'iBizAssetManagement-EAMDocument-Create')")
@ApiOperation(value = "根据资产类型批量建立文档", tags = {"文档" }, notes = "根据资产类型批量建立文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamdocuments/batch")
public ResponseEntity<Boolean> createBatchByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody List<EAMDocumentDTO> eamdocumentdtos) {
List<EAMDocument> domainlist=eamdocumentMapping.toDomain(eamdocumentdtos);
for(EAMDocument domain:domainlist){
domain.setEamassettypeid(eamassettype_id);
}
eamdocumentService.createBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamdocument" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamdocumentService.get(#eamdocument_id),'iBizAssetManagement-EAMDocument-Update')")
@ApiOperation(value = "根据资产类型更新文档", tags = {"文档" }, notes = "根据资产类型更新文档")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassettypes/{eamassettype_id}/eamdocuments/{eamdocument_id}")
@Transactional
public ResponseEntity<EAMDocumentDTO> updateByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @PathVariable("eamdocument_id") String eamdocument_id, @RequestBody EAMDocumentDTO eamdocumentdto) {
EAMDocument domain = eamdocumentMapping.toDomain(eamdocumentdto);
domain.setEamassettypeid(eamassettype_id);
domain.setEamdocumentid(eamdocument_id);
eamdocumentService.update(domain);
EAMDocumentDTO dto = eamdocumentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamdocumentService.getEamdocumentByEntities(this.eamdocumentMapping.toDomain(#eamdocumentdtos)),'iBizAssetManagement-EAMDocument-Update')")
@ApiOperation(value = "根据资产类型批量更新文档", tags = {"文档" }, notes = "根据资产类型批量更新文档")
@RequestMapping(method = RequestMethod.PUT, value = "/eamassettypes/{eamassettype_id}/eamdocuments/batch")
public ResponseEntity<Boolean> updateBatchByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody List<EAMDocumentDTO> eamdocumentdtos) {
List<EAMDocument> domainlist=eamdocumentMapping.toDomain(eamdocumentdtos);
for(EAMDocument domain:domainlist){
domain.setEamassettypeid(eamassettype_id);
}
eamdocumentService.updateBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamdocumentService.get(#eamdocument_id),'iBizAssetManagement-EAMDocument-Remove')")
@ApiOperation(value = "根据资产类型删除文档", tags = {"文档" }, notes = "根据资产类型删除文档")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassettypes/{eamassettype_id}/eamdocuments/{eamdocument_id}")
@Transactional
public ResponseEntity<Boolean> removeByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @PathVariable("eamdocument_id") String eamdocument_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentService.remove(eamdocument_id));
}
@PreAuthorize("hasPermission(this.eamdocumentService.getEamdocumentByIds(#ids),'iBizAssetManagement-EAMDocument-Remove')")
@ApiOperation(value = "根据资产类型批量删除文档", tags = {"文档" }, notes = "根据资产类型批量删除文档")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamassettypes/{eamassettype_id}/eamdocuments/batch")
public ResponseEntity<Boolean> removeBatchByEAMAssetType(@RequestBody List<String> ids) {
eamdocumentService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamdocumentMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMDocument-Get')")
@ApiOperation(value = "根据资产类型获取文档", tags = {"文档" }, notes = "根据资产类型获取文档")
@RequestMapping(method = RequestMethod.GET, value = "/eamassettypes/{eamassettype_id}/eamdocuments/{eamdocument_id}")
public ResponseEntity<EAMDocumentDTO> getByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @PathVariable("eamdocument_id") String eamdocument_id) {
EAMDocument domain = eamdocumentService.get(eamdocument_id);
EAMDocumentDTO dto = eamdocumentMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "根据资产类型获取文档草稿", tags = {"文档" }, notes = "根据资产类型获取文档草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamassettypes/{eamassettype_id}/eamdocuments/getdraft")
public ResponseEntity<EAMDocumentDTO> getDraftByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id) {
EAMDocument domain = new EAMDocument();
domain.setEamassettypeid(eamassettype_id);
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentMapping.toDto(eamdocumentService.getDraft(domain)));
}
@ApiOperation(value = "根据资产类型检查文档", tags = {"文档" }, notes = "根据资产类型检查文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamdocuments/checkkey")
public ResponseEntity<Boolean> checkKeyByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMDocumentDTO eamdocumentdto) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentService.checkKey(eamdocumentMapping.toDomain(eamdocumentdto)));
}
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdto),'iBizAssetManagement-EAMDocument-Save')")
@ApiOperation(value = "根据资产类型保存文档", tags = {"文档" }, notes = "根据资产类型保存文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamdocuments/save")
public ResponseEntity<Boolean> saveByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMDocumentDTO eamdocumentdto) {
EAMDocument domain = eamdocumentMapping.toDomain(eamdocumentdto);
domain.setEamassettypeid(eamassettype_id);
return ResponseEntity.status(HttpStatus.OK).body(eamdocumentService.save(domain));
}
@PreAuthorize("hasPermission(this.eamdocumentMapping.toDomain(#eamdocumentdtos),'iBizAssetManagement-EAMDocument-Save')")
@ApiOperation(value = "根据资产类型批量保存文档", tags = {"文档" }, notes = "根据资产类型批量保存文档")
@RequestMapping(method = RequestMethod.POST, value = "/eamassettypes/{eamassettype_id}/eamdocuments/savebatch")
public ResponseEntity<Boolean> saveBatchByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody List<EAMDocumentDTO> eamdocumentdtos) {
List<EAMDocument> domainlist=eamdocumentMapping.toDomain(eamdocumentdtos);
for(EAMDocument domain:domainlist){
domain.setEamassettypeid(eamassettype_id);
}
eamdocumentService.saveBatch(domainlist);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocument-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMDocument-Get')")
@ApiOperation(value = "根据资产类型获取DEFAULT", tags = {"文档" } ,notes = "根据资产类型获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamassettypes/{eamassettype_id}/eamdocuments/fetchdefault")
public ResponseEntity<List<EAMDocumentDTO>> fetchEAMDocumentDefaultByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id,EAMDocumentSearchContext context) {
context.setN_eamassettypeid_eq(eamassettype_id);
Page<EAMDocument> domains = eamdocumentService.searchDefault(context) ;
List<EAMDocumentDTO> list = eamdocumentMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocument-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMDocument-Get')")
@ApiOperation(value = "根据资产类型查询DEFAULT", tags = {"文档" } ,notes = "根据资产类型查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamassettypes/{eamassettype_id}/eamdocuments/searchdefault")
public ResponseEntity<Page<EAMDocumentDTO>> searchEAMDocumentDefaultByEAMAssetType(@PathVariable("eamassettype_id") String eamassettype_id, @RequestBody EAMDocumentSearchContext context) {
context.setN_eamassettypeid_eq(eamassettype_id);
Page<EAMDocument> domains = eamdocumentService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamdocumentMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
package cn.ibizlab.assetmanagement.assetapi.rest;
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 lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.ServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.http.HttpStatus;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.util.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.access.prepost.PostAuthorize;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import cn.ibizlab.assetmanagement.assetapi.dto.*;
import cn.ibizlab.assetmanagement.assetapi.mapping.*;
import cn.ibizlab.assetmanagement.core.asset.domain.EAMDocumentType;
import cn.ibizlab.assetmanagement.core.asset.service.IEAMDocumentTypeService;
import cn.ibizlab.assetmanagement.core.asset.filter.EAMDocumentTypeSearchContext;
import cn.ibizlab.assetmanagement.util.annotation.VersionCheck;
@Slf4j
@Api(tags = {"文档类型" })
@RestController("AssetApi-eamdocumenttype")
@RequestMapping("")
public class EAMDocumentTypeResource {
@Autowired
public IEAMDocumentTypeService eamdocumenttypeService;
@Autowired
@Lazy
public EAMDocumentTypeMapping eamdocumenttypeMapping;
@PreAuthorize("hasPermission(this.eamdocumenttypeMapping.toDomain(#eamdocumenttypedto),'iBizAssetManagement-EAMDocumentType-Create')")
@ApiOperation(value = "新建文档类型", tags = {"文档类型" }, notes = "新建文档类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocumenttypes")
@Transactional
public ResponseEntity<EAMDocumentTypeDTO> create(@RequestBody EAMDocumentTypeDTO eamdocumenttypedto) {
EAMDocumentType domain = eamdocumenttypeMapping.toDomain(eamdocumenttypedto);
eamdocumenttypeService.create(domain);
EAMDocumentTypeDTO dto = eamdocumenttypeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamdocumenttypeMapping.toDomain(#eamdocumenttypedtos),'iBizAssetManagement-EAMDocumentType-Create')")
@ApiOperation(value = "批量新建文档类型", tags = {"文档类型" }, notes = "批量新建文档类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocumenttypes/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<EAMDocumentTypeDTO> eamdocumenttypedtos) {
eamdocumenttypeService.createBatch(eamdocumenttypeMapping.toDomain(eamdocumenttypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@VersionCheck(entity = "eamdocumenttype" , versionfield = "updatedate")
@PreAuthorize("hasPermission(this.eamdocumenttypeService.get(#eamdocumenttype_id),'iBizAssetManagement-EAMDocumentType-Update')")
@ApiOperation(value = "更新文档类型", tags = {"文档类型" }, notes = "更新文档类型")
@RequestMapping(method = RequestMethod.PUT, value = "/eamdocumenttypes/{eamdocumenttype_id}")
@Transactional
public ResponseEntity<EAMDocumentTypeDTO> update(@PathVariable("eamdocumenttype_id") String eamdocumenttype_id, @RequestBody EAMDocumentTypeDTO eamdocumenttypedto) {
EAMDocumentType domain = eamdocumenttypeMapping.toDomain(eamdocumenttypedto);
domain .setEamdocumenttypeid(eamdocumenttype_id);
eamdocumenttypeService.update(domain );
EAMDocumentTypeDTO dto = eamdocumenttypeMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasPermission(this.eamdocumenttypeService.getEamdocumenttypeByEntities(this.eamdocumenttypeMapping.toDomain(#eamdocumenttypedtos)),'iBizAssetManagement-EAMDocumentType-Update')")
@ApiOperation(value = "批量更新文档类型", tags = {"文档类型" }, notes = "批量更新文档类型")
@RequestMapping(method = RequestMethod.PUT, value = "/eamdocumenttypes/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<EAMDocumentTypeDTO> eamdocumenttypedtos) {
eamdocumenttypeService.updateBatch(eamdocumenttypeMapping.toDomain(eamdocumenttypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasPermission(this.eamdocumenttypeService.get(#eamdocumenttype_id),'iBizAssetManagement-EAMDocumentType-Remove')")
@ApiOperation(value = "删除文档类型", tags = {"文档类型" }, notes = "删除文档类型")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamdocumenttypes/{eamdocumenttype_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("eamdocumenttype_id") String eamdocumenttype_id) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumenttypeService.remove(eamdocumenttype_id));
}
@PreAuthorize("hasPermission(this.eamdocumenttypeService.getEamdocumenttypeByIds(#ids),'iBizAssetManagement-EAMDocumentType-Remove')")
@ApiOperation(value = "批量删除文档类型", tags = {"文档类型" }, notes = "批量删除文档类型")
@RequestMapping(method = RequestMethod.DELETE, value = "/eamdocumenttypes/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
eamdocumenttypeService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PostAuthorize("hasPermission(this.eamdocumenttypeMapping.toDomain(returnObject.body),'iBizAssetManagement-EAMDocumentType-Get')")
@ApiOperation(value = "获取文档类型", tags = {"文档类型" }, notes = "获取文档类型")
@RequestMapping(method = RequestMethod.GET, value = "/eamdocumenttypes/{eamdocumenttype_id}")
public ResponseEntity<EAMDocumentTypeDTO> get(@PathVariable("eamdocumenttype_id") String eamdocumenttype_id) {
EAMDocumentType domain = eamdocumenttypeService.get(eamdocumenttype_id);
EAMDocumentTypeDTO dto = eamdocumenttypeMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取文档类型草稿", tags = {"文档类型" }, notes = "获取文档类型草稿")
@RequestMapping(method = RequestMethod.GET, value = "/eamdocumenttypes/getdraft")
public ResponseEntity<EAMDocumentTypeDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumenttypeMapping.toDto(eamdocumenttypeService.getDraft(new EAMDocumentType())));
}
@ApiOperation(value = "检查文档类型", tags = {"文档类型" }, notes = "检查文档类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocumenttypes/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody EAMDocumentTypeDTO eamdocumenttypedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumenttypeService.checkKey(eamdocumenttypeMapping.toDomain(eamdocumenttypedto)));
}
@PreAuthorize("hasPermission(this.eamdocumenttypeMapping.toDomain(#eamdocumenttypedto),'iBizAssetManagement-EAMDocumentType-Save')")
@ApiOperation(value = "保存文档类型", tags = {"文档类型" }, notes = "保存文档类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocumenttypes/save")
public ResponseEntity<Boolean> save(@RequestBody EAMDocumentTypeDTO eamdocumenttypedto) {
return ResponseEntity.status(HttpStatus.OK).body(eamdocumenttypeService.save(eamdocumenttypeMapping.toDomain(eamdocumenttypedto)));
}
@PreAuthorize("hasPermission(this.eamdocumenttypeMapping.toDomain(#eamdocumenttypedtos),'iBizAssetManagement-EAMDocumentType-Save')")
@ApiOperation(value = "批量保存文档类型", tags = {"文档类型" }, notes = "批量保存文档类型")
@RequestMapping(method = RequestMethod.POST, value = "/eamdocumenttypes/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<EAMDocumentTypeDTO> eamdocumenttypedtos) {
eamdocumenttypeService.saveBatch(eamdocumenttypeMapping.toDomain(eamdocumenttypedtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocumentType-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMDocumentType-Get')")
@ApiOperation(value = "获取DEFAULT", tags = {"文档类型" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/eamdocumenttypes/fetchdefault")
public ResponseEntity<List<EAMDocumentTypeDTO>> fetchDefault(EAMDocumentTypeSearchContext context) {
Page<EAMDocumentType> domains = eamdocumenttypeService.searchDefault(context) ;
List<EAMDocumentTypeDTO> list = eamdocumenttypeMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocumentType-searchDefault-all') and hasPermission(#context,'iBizAssetManagement-EAMDocumentType-Get')")
@ApiOperation(value = "查询DEFAULT", tags = {"文档类型" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/eamdocumenttypes/searchdefault")
public ResponseEntity<Page<EAMDocumentTypeDTO>> searchDefault(@RequestBody EAMDocumentTypeSearchContext context) {
Page<EAMDocumentType> domains = eamdocumenttypeService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamdocumenttypeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocumentType-searchTop-all') and hasPermission(#context,'iBizAssetManagement-EAMDocumentType-Get')")
@ApiOperation(value = "获取顶级文档类型", tags = {"文档类型" } ,notes = "获取顶级文档类型")
@RequestMapping(method= RequestMethod.GET , value="/eamdocumenttypes/fetchtop")
public ResponseEntity<List<EAMDocumentTypeDTO>> fetchTop(EAMDocumentTypeSearchContext context) {
Page<EAMDocumentType> domains = eamdocumenttypeService.searchTop(context) ;
List<EAMDocumentTypeDTO> list = eamdocumenttypeMapping.toDto(domains.getContent());
return ResponseEntity.status(HttpStatus.OK)
.header("x-page", String.valueOf(context.getPageable().getPageNumber()))
.header("x-per-page", String.valueOf(context.getPageable().getPageSize()))
.header("x-total", String.valueOf(domains.getTotalElements()))
.body(list);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','iBizAssetManagement-EAMDocumentType-searchTop-all') and hasPermission(#context,'iBizAssetManagement-EAMDocumentType-Get')")
@ApiOperation(value = "查询顶级文档类型", tags = {"文档类型" } ,notes = "查询顶级文档类型")
@RequestMapping(method= RequestMethod.POST , value="/eamdocumenttypes/searchtop")
public ResponseEntity<Page<EAMDocumentTypeDTO>> searchTop(@RequestBody EAMDocumentTypeSearchContext context) {
Page<EAMDocumentType> domains = eamdocumenttypeService.searchTop(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(eamdocumenttypeMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
......@@ -10,10 +10,16 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
@Slf4j
@Configuration
public class SearchContextHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
@Value("${ibiz.pageLimit:1000}")
private int pageLimit=1000;
private static ObjectMapper objectMapper=new ObjectMapper();
@Override
......@@ -29,6 +35,9 @@ public class SearchContextHandlerMethodArgumentResolver implements HandlerMethod
for (String key : params.keySet()) {
set.put(key,params.get(key)[0]);
}
if((!set.containsKey("size")) ){
set.put("size",pageLimit);
}
String json=objectMapper.writeValueAsString(set);
return objectMapper.readValue(json,parameter.getParameterType());
}
......
......@@ -37,11 +37,11 @@
git clone -b master $para2 ibizassetmanagement/
export NODE_OPTIONS=--max-old-space-size=4096
cd ibizassetmanagement/
mvn clean package -Passetmanagement
cd assetmanagement-app/assetmanagement-app-assetmanagement
mvn -Passetmanagement docker:build
mvn -Passetmanagement docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/assetmanagement-app-assetmanagement.yaml iBizEE --with-registry-auth
mvn clean package -Passetapi
cd assetmanagement-provider/assetmanagement-provider-assetapi
mvn -Passetapi docker:build
mvn -Passetapi docker:push
docker -H $para1 stack deploy --compose-file=src/main/docker/assetmanagement-provider-assetapi.yaml iBizEE --with-registry-auth
</command>
</hudson.tasks.Shell>
</builders>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册