lyq 3 달 전
부모
커밋
3bef802e95

+ 51 - 0
src/main/java/com/sooka/sponest/data/attach/domain/CenterdataTAttach.java

@@ -0,0 +1,51 @@
+package com.sooka.sponest.data.attach.domain;
+
+import com.ruoyi.common.core.web.domain.BaseEntity;
+import lombok.Data;
+
+/**
+ * 附件对象 centerdata_t_attach
+ *
+ * @author ruoyi
+ * @date 2022-06-11
+ */
+@Data
+public class CenterdataTAttach extends BaseEntity {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 业务ID
+     */
+    private String busId;
+
+    /**
+     * 路径
+     */
+    private String attachPath;
+
+    /**
+     * 业务类型(索引)
+     */
+    private String busIndx;
+
+    /**
+     * 附件来源
+     */
+    private String busSource;
+
+    /**
+     * 附件名称
+     */
+    private String fileName;
+
+    /**
+     * 附件类型
+     */
+    private String fileType;
+
+    /**
+     * 排序
+     */
+    private int attachSorts;
+}

+ 22 - 0
src/main/java/com/sooka/sponest/data/attach/mapper/CenterdataTAttachMapper.java

@@ -0,0 +1,22 @@
+package com.sooka.sponest.data.attach.mapper;
+
+import com.sooka.sponest.data.attach.domain.CenterdataTAttach;
+import com.sooka.sponest.monitor.base.util.database.MyDataSource;
+
+/**
+ * 附件Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-06-11
+ */
+public interface CenterdataTAttachMapper {
+
+    /**
+     * 新增附件
+     *
+     * @param centerdataTAttach 附件
+     * @return 结果
+     */
+    @MyDataSource("data")
+    int insertCenterdataTAttach(CenterdataTAttach centerdataTAttach);
+}

+ 20 - 0
src/main/java/com/sooka/sponest/data/attach/service/ICenterdataTAttachService.java

@@ -0,0 +1,20 @@
+package com.sooka.sponest.data.attach.service;
+
+import com.sooka.sponest.data.attach.domain.CenterdataTAttach;
+
+/**
+ * 附件Service接口
+ *
+ * @author ruoyi
+ * @date 2022-06-11
+ */
+public interface ICenterdataTAttachService {
+
+    /**
+     * 新增附件
+     *
+     * @param centerdataTAttach 附件
+     * @return 结果
+     */
+    int insertCenterdataTAttach(CenterdataTAttach centerdataTAttach);
+}

+ 48 - 0
src/main/java/com/sooka/sponest/data/attach/service/impl/CenterdataTAttachServiceImpl.java

@@ -0,0 +1,48 @@
+package com.sooka.sponest.data.attach.service.impl;
+
+import com.sooka.sponest.data.attach.domain.CenterdataTAttach;
+import com.sooka.sponest.data.attach.mapper.CenterdataTAttachMapper;
+import com.sooka.sponest.data.attach.service.ICenterdataTAttachService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 附件Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-06-11
+ */
+@Service
+public class CenterdataTAttachServiceImpl implements ICenterdataTAttachService {
+
+    @Autowired
+    private CenterdataTAttachMapper centerdataTAttachMapper;
+
+    /**
+     * 新增附件
+     *
+     * @param centerdataTAttach 附件
+     * @return 结果
+     */
+    @Override
+    public int insertCenterdataTAttach(CenterdataTAttach centerdataTAttach) {
+        /*
+         *ImageUpload返回是全路径,数据库保存不要ip和端口号
+         */
+        if (centerdataTAttach.getAttachPath().startsWith("http")) {
+            String attachPath = centerdataTAttach.getAttachPath();
+            if (centerdataTAttach.getAttachPath().contains("Download")) {
+                int i1 = attachPath.indexOf("group=");
+                attachPath = attachPath.replace("&&path=", "/");
+                attachPath = attachPath.substring(i1 + 6);
+                centerdataTAttach.setAttachPath(attachPath);
+            } else {
+                int i1 = attachPath.indexOf('/');
+                int i2 = attachPath.indexOf('/', i1 + 1);
+                int i3 = attachPath.indexOf('/', i2 + 1);
+                centerdataTAttach.setAttachPath(centerdataTAttach.getAttachPath().substring(i3 + 1, attachPath.length()));
+            }
+        }
+        return centerdataTAttachMapper.insertCenterdataTAttach(centerdataTAttach);
+    }
+}

+ 134 - 127
src/main/java/com/sooka/sponest/event/download/domain/CentereventTDownloads.java

@@ -11,149 +11,156 @@ import org.apache.commons.lang3.builder.ToStringStyle;
  * @author ruoyi
  * @date 2023-09-12
  */
-public class CentereventTDownloads extends BaseEntity
-        {
-private static final long serialVersionUID = 1L;
+public class CentereventTDownloads extends BaseEntity {
 
-    /** $column.columnComment */
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
     private String id;
 
-    /** 事件编码 */
-            @Excel(name = "事件编码")
+    /**
+     * 事件编码
+     */
+    @Excel(name = "事件编码")
     private String eventCode;
 
-    /** 事件名称 */
-            @Excel(name = "事件名称")
+    /**
+     * 事件名称
+     */
+    @Excel(name = "事件名称")
     private String eventName;
 
-    /** 视频路径 */
-            @Excel(name = "视频路径")
+    /**
+     * 视频路径
+     */
+    @Excel(name = "视频路径")
     private String path;
 
-    /** 视频下载是否成功 */
-            @Excel(name = "视频下载是否成功")
+    /**
+     * 视频下载是否成功
+     */
+    @Excel(name = "视频下载是否成功")
     private String flag;
 
-    /** 失败原因 */
-            @Excel(name = "失败原因")
+    /**
+     * 失败原因
+     */
+    @Excel(name = "失败原因")
     private String reason;
 
-    /** 创建人名称 */
-            @Excel(name = "创建人名称")
+    /**
+     * 创建人名称
+     */
+    @Excel(name = "创建人名称")
     private String createName;
 
-    /** 更新人名称 */
-            @Excel(name = "更新人名称")
+    /**
+     * 更新人名称
+     */
+    @Excel(name = "更新人名称")
     private String updateName;
 
     private String logId;
 
-            public String getAttachPath() {
-                return attachPath;
-            }
-
-            public void setAttachPath(String attachPath) {
-                this.attachPath = attachPath;
-            }
-
-            private String attachPath;
-
-            public String getLogId() {
-                return logId;
-            }
-
-            public void setLogId(String logId) {
-                this.logId = logId;
-            }
-
-            public void setId(String id)
-            {
-            this.id = id;
-            }
-
-    public String getId()
-            {
-            return id;
-            }
-    public void setEventCode(String eventCode)
-            {
-            this.eventCode = eventCode;
-            }
-
-    public String getEventCode()
-            {
-            return eventCode;
-            }
-    public void setEventName(String eventName)
-            {
-            this.eventName = eventName;
-            }
-
-    public String getEventName()
-            {
-            return eventName;
-            }
-    public void setPath(String path)
-            {
-            this.path = path;
-            }
-
-    public String getPath()
-            {
-            return path;
-            }
-    public void setFlag(String flag)
-            {
-            this.flag = flag;
-            }
-
-    public String getFlag()
-            {
-            return flag;
-            }
-    public void setReason(String reason)
-            {
-            this.reason = reason;
-            }
-
-    public String getReason()
-            {
-            return reason;
-            }
-    public void setCreateName(String createName)
-            {
-            this.createName = createName;
-            }
-
-    public String getCreateName()
-            {
-            return createName;
-            }
-    public void setUpdateName(String updateName)
-            {
-            this.updateName = updateName;
-            }
-
-    public String getUpdateName()
-            {
-            return updateName;
-            }
-
-@Override
-public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("eventCode", getEventCode())
-            .append("eventName", getEventName())
-            .append("path", getPath())
-            .append("flag", getFlag())
-            .append("reason", getReason())
-            .append("createBy", getCreateBy())
-            .append("createName", getCreateName())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateName", getUpdateName())
-            .append("updateTime", getUpdateTime())
-        .toString();
-        }
-        }
+    public String getAttachPath() {
+        return attachPath;
+    }
+
+    public void setAttachPath(String attachPath) {
+        this.attachPath = attachPath;
+    }
+
+    private String attachPath;
+
+    public String getLogId() {
+        return logId;
+    }
+
+    public void setLogId(String logId) {
+        this.logId = logId;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setEventCode(String eventCode) {
+        this.eventCode = eventCode;
+    }
+
+    public String getEventCode() {
+        return eventCode;
+    }
+
+    public void setEventName(String eventName) {
+        this.eventName = eventName;
+    }
+
+    public String getEventName() {
+        return eventName;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setFlag(String flag) {
+        this.flag = flag;
+    }
+
+    public String getFlag() {
+        return flag;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setCreateName(String createName) {
+        this.createName = createName;
+    }
+
+    public String getCreateName() {
+        return createName;
+    }
+
+    public void setUpdateName(String updateName) {
+        this.updateName = updateName;
+    }
+
+    public String getUpdateName() {
+        return updateName;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("eventCode", getEventCode())
+                .append("eventName", getEventName())
+                .append("path", getPath())
+                .append("flag", getFlag())
+                .append("reason", getReason())
+                .append("createBy", getCreateBy())
+                .append("createName", getCreateName())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateName", getUpdateName())
+                .append("updateTime", getUpdateTime())
+                .toString();
+    }
+}

+ 0 - 1
src/main/java/com/sooka/sponest/event/download/service/ICentereventTDownloadsService.java

@@ -1,6 +1,5 @@
 package com.sooka.sponest.event.download.service;
 
-
 import com.sooka.sponest.event.download.domain.CentereventTDownloads;
 import com.sooka.sponest.monitor.dahua.domain.PlayBackProperties;
 

+ 1 - 2
src/main/java/com/sooka/sponest/event/download/service/impl/CentereventTDownloadsServiceImpl.java

@@ -1,7 +1,6 @@
 package com.sooka.sponest.event.download.service.impl;
 
 import com.ruoyi.common.core.utils.DateUtils;
-import com.ruoyi.common.datascope.base.service.BaseService;
 import com.sooka.sponest.event.download.domain.CentereventTDownloads;
 import com.sooka.sponest.event.download.mapper.CentereventTDownloadsMapper;
 import com.sooka.sponest.event.download.service.ICentereventTDownloadsService;
@@ -13,7 +12,7 @@ import java.util.List;
 import java.util.Map;
 
 @Service
-public class CentereventTDownloadsServiceImpl extends BaseService implements ICentereventTDownloadsService {
+public class CentereventTDownloadsServiceImpl implements ICentereventTDownloadsService {
 
     @Autowired
     private CentereventTDownloadsMapper centereventTDownloadsMapper;

+ 37 - 9
src/main/java/com/sooka/sponest/monitor/dahua/controller/DahuaController.java

@@ -1,17 +1,22 @@
 package com.sooka.sponest.monitor.dahua.controller;
 
+import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
+import com.sooka.sponest.event.download.service.ICentereventTDownloadsService;
+import com.sooka.sponest.monitor.dahua.domain.PlayBackProperties;
 import com.sooka.sponest.monitor.dahua.service.DahuaService;
 import io.swagger.annotations.Api;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import javax.annotation.Resource;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
-
-import static org.springframework.web.bind.annotation.RequestMethod.*;
+import static org.springframework.web.bind.annotation.RequestMethod.POST;
 
 @Api(tags = "大华控制器")
 @RestController
@@ -19,18 +24,41 @@ import static org.springframework.web.bind.annotation.RequestMethod.*;
 @Slf4j
 public class DahuaController {
 
-    @Resource
-    DahuaService dahuaService;
+    @Autowired
+    private DahuaService dahuaService;
+
+    @Autowired
+    private ICentereventTDownloadsService downloadsService;
 
     /**
      * 摄像头获取回放
+     *
      * @return
      */
     @Log(title = "大华", businessType = BusinessType.OTHER)
-    @RequestMapping(value = "/getPlaybackByTime",method = POST)
-    public AjaxResult getPlaybackByTime(@RequestBody String properties) {
-        return dahuaService.getPlaybackByTime(properties);
+    @RequestMapping(value = "/getPlaybackByTime", method = POST)
+    public AjaxResult getPlaybackByTime(@RequestBody Map<String, Object> params) {
+        List<PlayBackProperties> list = downloadsService.downloadsCommon(params);
+        return dahuaService.getPlaybackByTime(list);
     }
 
-
+    /**
+     * 事件视频下载
+     *
+     * @param id
+     * @return
+     */
+    @Log(title = "事件视频下载", businessType = BusinessType.OTHER)
+    @GetMapping("/eventhandleDownload/{id}")
+    public AjaxResult eventhandleDownload(@PathVariable("id") String id) {
+        Map<String, Object> params = new HashMap<>();
+        params.put("id", id);
+        List<PlayBackProperties> list = downloadsService.downloadsCommon(params);
+        // 校验 已下载不让重复下载
+        if (StringUtils.isEmpty(list)) {
+            return AjaxResult.error("已下载的视频,不能重复下载!");
+        } else {
+            return dahuaService.getPlaybackByTime(list);
+        }
+    }
 }

+ 0 - 132
src/main/java/com/sooka/sponest/monitor/dahua/domain/CenterdataTAttach.java

@@ -1,132 +0,0 @@
- package com.sooka.sponest.monitor.dahua.domain;
-
- import com.ruoyi.common.core.annotation.Excel;
- import com.ruoyi.common.core.web.domain.BaseEntity;
- import io.swagger.annotations.ApiModelProperty;
- import org.apache.commons.lang3.builder.ToStringBuilder;
- import org.apache.commons.lang3.builder.ToStringStyle;
-
- import java.util.List;
-
- /**
-  * 附件对象 centerdata_t_attach
-  *
-  * @author ruoyi
-  * @date 2022-06-11
-  */
- public class CenterdataTAttach extends BaseEntity
- {
-     private static final long serialVersionUID = 1L;
-
-     /**
-      * 业务ID
-      */
-     @ApiModelProperty(value = "业务id", required = true)
-     @Excel(name = "业务ID")
-     private String busId;
-
-
-     public List<String> getBusIds() {
-         return busIds;
-     }
-
-     public void setBusIds(List<String> busIds) {
-         this.busIds = busIds;
-     }
-
-     private List<String> busIds;
-     /**
-      * 路径
-      */
-     @ApiModelProperty(value = "路径", required = false)
-     @Excel(name = "路径")
-     private String attachPath;
-
-     /**
-      * 业务类型(索引)
-      */
-     @ApiModelProperty(value = "业务类型", required = false)
-     @Excel(name = "业务类型")
-     private String busIndx;
-
-     /**
-      * 附件来源
-      */
-     @ApiModelProperty(value = "附件来源", required = false)
-     @Excel(name = "附件来源")
-     private String busSource;
-
-     /**
-      * 附件名称
-      */
-     @ApiModelProperty(value = "附件名称", required = false)
-     @Excel(name = "附件名称")
-     private String fileName;
-
-     /**
-      * 附件类型
-      */
-     @ApiModelProperty(value = "附件类型", required = false)
-     @Excel(name = "附件类型")
-     private String fileType;
-
-     public String getBusId() {
-         return busId;
-     }
-
-     public void setBusId(String busId) {
-         this.busId = busId;
-     }
-
-     public String getAttachPath() {
-         return attachPath;
-     }
-
-     public void setAttachPath(String attachPath) {
-         this.attachPath = attachPath;
-     }
-
-     public String getBusIndx() {
-         return busIndx;
-     }
-
-     public void setBusIndx(String busIndx) {
-         this.busIndx = busIndx;
-     }
-
-     public String getBusSource() {
-         return busSource;
-     }
-
-     public void setBusSource(String busSource) {
-         this.busSource = busSource;
-     }
-
-     public String getFileName() {
-         return fileName;
-     }
-
-     public void setFileName(String fileName) {
-         this.fileName = fileName;
-     }
-
-     public String getFileType() {
-         return fileType;
-     }
-
-     public void setFileType(String fileType) {
-         this.fileType = fileType;
-     }
-
-     @Override
-     public String toString() {
-         return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                 .append("busId", getBusId())
-                 .append("attachPath", getAttachPath())
-                 .append("busIndx", getBusIndx())
-                 .append("busSource", getBusSource())
-                 .append("fileName", getFileName())
-                 .append("fileType", getFileType())
-                 .toString();
-     }
- }

+ 4 - 19
src/main/java/com/sooka/sponest/monitor/dahua/service/impl/DahuaServiceImpl.java

@@ -1,9 +1,5 @@
 package com.sooka.sponest.monitor.dahua.service.impl;
 
-import com.alibaba.druid.support.json.JSONUtils;
-import com.alibaba.fastjson.JSON;
-import com.alibaba.nacos.shaded.com.google.gson.Gson;
-import com.dahuatech.hutool.core.codec.Base64;
 import com.dahuatech.hutool.core.io.FileUtil;
 import com.dahuatech.hutool.core.io.StreamProgress;
 import com.dahuatech.hutool.http.HttpUtil;
@@ -17,37 +13,26 @@ import com.dahuatech.icc.oauth.http.IccTokenResponse;
 import com.dahuatech.icc.util.BeanUtil;
 import com.ruoyi.common.core.constant.HttpStatus;
 import com.ruoyi.common.core.domain.R;
-import com.ruoyi.common.core.utils.DateUtils;
-import com.ruoyi.common.core.utils.StringUtils;
 import com.ruoyi.common.core.utils.uuid.IdUtils;
 import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.redis.service.RedisService;
 import com.ruoyi.system.api.domain.SysFile;
+import com.sooka.sponest.data.attach.domain.CenterdataTAttach;
+import com.sooka.sponest.data.attach.service.ICenterdataTAttachService;
 import com.sooka.sponest.event.download.domain.CentereventTDownloads;
 import com.sooka.sponest.event.download.service.ICentereventTDownloadsService;
 import com.sooka.sponest.monitor.base.service.impl.BaseService;
 import com.sooka.sponest.monitor.camera.domain.CentermonitorTCamera;
-import com.sooka.sponest.monitor.camera.mapper.CentermonitorTCameraMapper;
 import com.sooka.sponest.monitor.camera.service.ICentermonitorTCameraService;
-import com.sooka.sponest.monitor.dahua.domain.CenterdataTAttach;
 import com.sooka.sponest.monitor.dahua.domain.PlayBackProperties;
 import com.sooka.sponest.monitor.dahua.service.DahuaService;
-import com.sooka.sponest.monitor.dahua.utils.HttpEnum;
-import com.sooka.sponest.monitor.dahua.utils.HttpTestUtils;
-import com.sooka.sponest.monitor.remoteapi.service.data.RemoteDataBaseService;
 import com.sooka.sponest.monitor.remoteapi.service.file.RemoteFileBaseService;
 import com.sooka.sponest.monitor.util.Mp4ParserUtils;
-import org.apache.commons.collections4.CollectionUtils;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
-import javax.crypto.Cipher;
 import java.io.File;
-import java.nio.charset.StandardCharsets;
-import java.security.KeyFactory;
-import java.security.interfaces.RSAPublicKey;
-import java.security.spec.X509EncodedKeySpec;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -71,7 +56,7 @@ public class DahuaServiceImpl extends BaseService implements DahuaService {
     private RemoteFileBaseService fileBaseService;
 
     @Resource
-    private RemoteDataBaseService dataBaseService;
+    private ICenterdataTAttachService attachService;
 
     @Resource
     private ICentereventTDownloadsService downloadsService;
@@ -193,7 +178,7 @@ public class DahuaServiceImpl extends BaseService implements DahuaService {
                     attach.setFileName(sysFileR.getData().getName());
                     attach.setBusSource("PC");
                     attach.setFileType("video");
-                    dataBaseService.insertAttach(attach);
+                    attachService.insertCenterdataTAttach(attach);
                     //清空文件夹
                     File folder = new File(dssFileDownloadUrl);
                     File[] files = folder.listFiles();

+ 0 - 31
src/main/java/com/sooka/sponest/monitor/remoteapi/fallback/data/RemoteDataBaseServiceFallbackFactory.java

@@ -1,31 +0,0 @@
-package com.sooka.sponest.monitor.remoteapi.fallback.data;
-
-
-import com.ruoyi.common.core.domain.R;
-import com.sooka.sponest.monitor.dahua.domain.CenterdataTAttach;
-import com.sooka.sponest.monitor.remoteapi.service.data.RemoteDataBaseService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.cloud.openfeign.FallbackFactory;
-import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.PostMapping;
-
-@Component
-public class RemoteDataBaseServiceFallbackFactory implements FallbackFactory<RemoteDataBaseService> {
-
-    private static final Logger log = LoggerFactory.getLogger(RemoteDataBaseServiceFallbackFactory.class);
-
-    @Override
-    public RemoteDataBaseService create(Throwable cause) {
-        log.error("数据中心-服务调用失败:{}", cause.getMessage());
-
-        return new RemoteDataBaseService() {
-
-            @PostMapping("/attach/insertAttach")
-            public void insertAttach(CenterdataTAttach centerdataTAttach){}
-
-        };
-
-
-    }
-}

+ 0 - 24
src/main/java/com/sooka/sponest/monitor/remoteapi/service/data/RemoteDataBaseService.java

@@ -1,24 +0,0 @@
-package com.sooka.sponest.monitor.remoteapi.service.data;
-
-
-import com.ruoyi.common.core.domain.R;
-import com.sooka.sponest.monitor.dahua.domain.CenterdataTAttach;
-import com.sooka.sponest.monitor.remoteapi.fallback.data.RemoteDataBaseServiceFallbackFactory;
-import com.sooka.sponest.monitor.remoteapi.service.ModulesServiceNameContants;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-
-
-@FeignClient(
-        contextId = "RemoteDataBaseService",
-        value = ModulesServiceNameContants.CENTER_DATA,
-        fallbackFactory = RemoteDataBaseServiceFallbackFactory.class
-)
-public interface RemoteDataBaseService {
-
-    @PostMapping("/attach/insertAttach")
-    public void insertAttach(CenterdataTAttach centerdataTAttach);
-
-
-}

+ 28 - 0
src/main/resources/mapper/data/attach/CenterdataTAttachMapper.xml

@@ -0,0 +1,28 @@
+<?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="com.sooka.sponest.data.attach.mapper.CenterdataTAttachMapper">
+
+    <insert id="insertCenterdataTAttach" parameterType="CenterdataTAttach">
+        insert into centerdata_t_attach
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="busId != null">bus_id,</if>
+            <if test="attachPath != null">attach_path,</if>
+            <if test="busIndx != null">bus_indx,</if>
+            <if test="busSource != null">bus_source,</if>
+            <if test="fileName != null">file_name,</if>
+            <if test="fileType != null">file_type,</if>
+            <if test="attachSorts != null">attach_sorts,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="busId != null">#{busId},</if>
+            <if test="attachPath != null">#{attachPath},</if>
+            <if test="busIndx != null">#{busIndx},</if>
+            <if test="busSource != null">#{busSource},</if>
+            <if test="fileName != null">#{fileName},</if>
+            <if test="fileType != null">#{fileType},</if>
+            <if test="attachSorts != null">#{attachSorts},</if>
+        </trim>
+    </insert>
+</mapper>