Commit d3e78a0d authored by KeYong's avatar KeYong

报告预览下载接口

parent 6cc85104
package com.yeejoin.amos.fas.common.enums;
/**
* 模板分类
*
* @author DELL
*/
public enum WordTemplateTypeEum {
StationDrilReport("应急演练报告", "StationDrilReport.ftl");
private String label;
private String templateFile;
WordTemplateTypeEum(String label, String templateFile) {
this.label = label;
this.templateFile = templateFile;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getTemplateFile() {
return templateFile;
}
public void setTemplateFile(String templateFile) {
this.templateFile = templateFile;
}
}
......@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName("c_plan_report")
......@@ -19,6 +21,9 @@ public class PlanReport extends BaseEntity {
@TableField("title")
private String title;
@TableField(value = "drill_date")
private Date drillDate;
@TableField("address")
private String address;
......
......@@ -141,6 +141,12 @@
<artifactId>amos-component-security</artifactId>
<version>1.7.13-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>15.8.0</version>
<classifier>jdk16</classifier>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -2,7 +2,6 @@ package com.yeejoin.amos.fas.business.action;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.rule.MethodParam;
import com.yeejoin.amos.component.rule.RuleActionBean;
......@@ -17,7 +16,7 @@ import com.yeejoin.amos.fas.business.action.result.SafteyPlanResult;
import com.yeejoin.amos.fas.business.action.result.message.AbstractActionResultMessage;
import com.yeejoin.amos.fas.business.action.util.ContingencyLogPublisher;
import com.yeejoin.amos.fas.business.dao.mapper.PlanDetailMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PlanOperationRecordMapper;
import com.yeejoin.amos.fas.business.dao.mapper.PlanReportMapper;
import com.yeejoin.amos.fas.business.dao.repository.IContingencyPlanInstanceRepository;
import com.yeejoin.amos.fas.business.dao.repository.IPlanDetailDao;
import com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao;
......@@ -26,27 +25,20 @@ import com.yeejoin.amos.fas.business.service.impl.RuleRunigSnapshotServiceImpl;
import com.yeejoin.amos.fas.business.service.intfc.*;
import com.yeejoin.amos.fas.business.service.model.ToipResponse;
import com.yeejoin.amos.fas.business.util.JSONUtil;
import com.yeejoin.amos.fas.business.vo.*;
import com.yeejoin.amos.fas.business.vo.ButtonJsonVO;
import com.yeejoin.amos.fas.business.vo.PlanStepJsonVO;
import com.yeejoin.amos.fas.business.vo.Toke;
import com.yeejoin.amos.fas.common.enums.ContingencyPlanStatusEnum;
import com.yeejoin.amos.fas.common.enums.PlanRecordStatusEnum;
import com.yeejoin.amos.fas.common.enums.PlanTypeEnum;
import com.yeejoin.amos.fas.core.enums.NumberEnum;
import com.yeejoin.amos.fas.core.util.DateUtil;
import com.yeejoin.amos.fas.dao.entity.ContingencyPlanInstance;
import com.yeejoin.amos.fas.dao.entity.Equipment;
import com.yeejoin.amos.fas.dao.entity.PlanDetail;
import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord;
import com.yeejoin.amos.fas.datasync.bo.PlanDetailSyncBo;
import com.yeejoin.amos.fas.datasync.bo.PlanOperationRecordSyncBo;
import org.apache.commons.io.IOUtils;
import com.yeejoin.amos.fas.dao.entity.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.core.io.Resource;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
......@@ -56,11 +48,9 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
......@@ -110,15 +100,9 @@ public class ContingencyAction implements CustomerAction {
private IContingencyInstance contingencyInstance;
@Autowired
private PlanOperationRecordMapper planOperationRecordMapper;
@Autowired
private PlanDetailMapper planDetailMapper;
@Autowired
private IPlanVisual3dService planVisual3dService;
@Autowired
private ContingencyInstanceInfoService contingencyInstanceInfoService;
@Autowired
......@@ -153,14 +137,16 @@ public class ContingencyAction implements CustomerAction {
private IPlanDetailDao planDetailDao;
@Autowired
private IPlanOperationRecordDao planOperationRecordDao;
@Autowired
private com.yeejoin.amos.component.rule.RuleTrigger ruleTrigger;
@Autowired
private IEquipmentFireEquipmentService equipmentFireEquipmentService;
@Autowired
private IPlanStepService iPlanStepService;
@Autowired
IPlanReportService planReportService;
/**
* @param stepCode 当前步骤编号
* @param stepName 当前步骤名称
......@@ -713,12 +699,12 @@ public class ContingencyAction implements CustomerAction {
}
// 结束预案 更新预案记录表,预案状态
PlanOperationRecord PlanOperationRecord = planOperationRecordDao.findByBatchNo(batchNo);
if (PlanOperationRecord != null && PlanOperationRecord.getStatus() == PlanRecordStatusEnum.OPERATION.getCode()) {
PlanOperationRecord.setStatus(PlanRecordStatusEnum.COMPLETE.getCode());
PlanOperationRecord.setEndTime(new Date());
PlanOperationRecord record = planOperationRecordDao.save(PlanOperationRecord);
Optional<PlanDetail> optionalPlanDetail = planDetailDao.findById(PlanOperationRecord.getPlanId());
PlanOperationRecord planOperationRecord = planOperationRecordDao.findByBatchNo(batchNo);
if (planOperationRecord != null && planOperationRecord.getStatus() == PlanRecordStatusEnum.OPERATION.getCode()) {
planOperationRecord.setStatus(PlanRecordStatusEnum.COMPLETE.getCode());
planOperationRecord.setEndTime(new Date());
PlanOperationRecord record = planOperationRecordDao.save(planOperationRecord);
Optional<PlanDetail> optionalPlanDetail = planDetailDao.findById(planOperationRecord.getPlanId());
if (optionalPlanDetail.get() != null) {
PlanDetail planDetail = optionalPlanDetail.get();
planDetail.setStatus(ContingencyPlanStatusEnum.AVAILABLE.getCode());
......@@ -730,6 +716,8 @@ public class ContingencyAction implements CustomerAction {
// 结束预案,更新预案信息表结束时间
contingencyInstanceInfoService.updateEndTimeById(batchNo);
// 生成演练报告
planReportService.createReport(batchNo);
this.sendcmd("message", paramObj, result);
redisTemplate.delete("contingencyRo");
......
......@@ -10,11 +10,13 @@ import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import com.yeejoin.amos.fas.dao.entity.PlanReport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping(value = "/planReport")
......@@ -76,4 +78,29 @@ public class PlanReportController extends BaseController {
return CommonResponseUtil.success(resultPage);
}
@Permission
@ApiOperation(value = "更新", notes = "更新")
@PutMapping(value = "/update")
public CommonResponse updateReport(@RequestBody PlanReport planReport) {
PlanReport report = iPlanReportService.updateReport(planReport);
return CommonResponseUtil.success(report);
}
@ApiOperation(value = "下载报告", notes = "下载报告")
@GetMapping(value = "/download")
public void download(HttpServletRequest request, HttpServletResponse response,
@ApiParam(value = "id", required = true) @RequestParam String id) {
iPlanReportService.download(request, response, id);
}
@ApiOperation(value = "预览报告", notes = "预览报告")
@GetMapping(value = "/preview")
public CommonResponse preview(
@ApiParam(value = "id", required = true) @RequestParam String id) {
PlanReport report = planReportMapper.getById(Long.valueOf(id));
return CommonResponseUtil.success(iPlanReportService.preview(report));
}
}
......@@ -19,4 +19,6 @@ public interface PlanReportMapper extends BaseMapper<PlanReport> {
List<PlanReport> getByPage(PlanReport planReport);
PlanReport getById(@Param("id") Long id);
PlanReport getByBatchNo(@Param("batchNo") String batchNo);
}
......@@ -2,13 +2,103 @@ package com.yeejoin.amos.fas.business.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.component.robot.BadRequest;
import com.yeejoin.amos.fas.business.dao.mapper.PlanReportMapper;
import com.yeejoin.amos.fas.business.dao.repository.IPlanOperationRecordDao;
import com.yeejoin.amos.fas.business.service.intfc.IPlanReportService;
import com.yeejoin.amos.fas.business.util.MyByteArrayMultipartFile;
import com.yeejoin.amos.fas.business.util.WordTemplateUtils;
import com.yeejoin.amos.fas.common.enums.WordTemplateTypeEum;
import com.yeejoin.amos.fas.core.util.DateUtil;
import com.yeejoin.amos.fas.dao.entity.PlanOperationRecord;
import com.yeejoin.amos.fas.dao.entity.PlanReport;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import org.apache.http.client.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@Service
public class PlanReportServiceImpl extends ServiceImpl<PlanReportMapper, PlanReport> implements IPlanReportService{
public class PlanReportServiceImpl extends ServiceImpl<PlanReportMapper, PlanReport> implements IPlanReportService {
@Autowired
PlanReportMapper planReportMapper;
@Autowired
private IPlanOperationRecordDao planOperationRecordDao;
@Override
public void download(HttpServletRequest request, HttpServletResponse response, String id) {
PlanReport report = planReportMapper.getById(Long.valueOf(id));
WordTemplateUtils instance = WordTemplateUtils.getInstance();
Map<String, Object> map = getWordMap(report);
try {
instance.exportMillCertificateWord(request, response, map, (String) map.get("document_name"),
WordTemplateTypeEum.StationDrilReport.getTemplateFile());
} catch (IOException e) {
throw new BadRequest("下载应急演练报告失败!");
}
}
@Override
public String preview(PlanReport report) {
Map<String, Object> map = getWordMap(report);
SimpleDateFormat dateStat = new SimpleDateFormat("yyyy年MM月dd日");
String documentNameTime = dateStat.format(new Date());
WordTemplateUtils instance = WordTemplateUtils.getInstance();
String urlString = "";
File filepdf = null;
try {
filepdf = instance.getWordFileItem(map, "应急演练报告" + documentNameTime, WordTemplateTypeEum.StationDrilReport.getTemplateFile(), "pdf");
filepdf.getAbsolutePath();
MultipartFile multipartFile = new MyByteArrayMultipartFile("file", "file.pdf", "application/pdf", file2byte(filepdf));
FeignClientResult<Map<String, String>> result = Systemctl.fileStorageClient.updateCommonFile(multipartFile);
if (result != null) {
Iterator<String> it = result.getResult().keySet().iterator();
while (it.hasNext()) {
urlString = it.next();
}
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (filepdf != null) {
filepdf.delete();
}
}
return urlString;
}
@Override
public void createReport(String batchNo) {
Assert.notNull(batchNo, "batchNo 不能为空!");
PlanReport report = planReportMapper.getByBatchNo(batchNo);
String url = preview(report);
report.setReportUrl(url);
planReportMapper.updateById(report);
}
@Override
public PlanReport updateReport(PlanReport report) {
String url = preview(report);
report.setReportUrl(url);
planReportMapper.updateById(report);
return null;
}
@Override
public Page<PlanReport> getByPage(PlanReport planReport) {
......@@ -21,4 +111,47 @@ public class PlanReportServiceImpl extends ServiceImpl<PlanReportMapper, PlanRep
}
return objectPage;
}
private Map<String, Object> getWordMap(PlanReport report) {
Map<String, Object> map = new HashMap<String, Object>();
PlanOperationRecord operationRecord = planOperationRecordDao.findByBatchNo(report.getBatchNo());
SimpleDateFormat dateStat = new SimpleDateFormat("HH:mm");
SimpleDateFormat drillDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// 活动主题
map.put("drill_title", report.getTitle());
// 演练时间
map.put("drill_date", ObjectUtils.isEmpty(report.getDrillDate()) ? "" : drillDateFormat.format(report.getDrillDate()));
// 主持人
map.put("compere", report.getCompere());
// 演练地点
map.put("drill_address", report.getAddress());
// 参与人员
map.put("attend_person", report.getAttendPerson());
// 演习题目
map.put("drill_topic", report.getDrillTopic());
// 处理过程
map.put("handle_process", report.getHandleProcess());
// 预案开始时间
map.put("start_time", dateStat.format(operationRecord.getStartTime()));
// 预案结束时间
map.put("end_time", dateStat.format(operationRecord.getEndTime()));
// 演习总结
map.put("drill_summary", report.getDrillSummary());
// 审核
map.put("examine_result", report.getExamineResult());
return map;
}
public static byte[] file2byte(File file) {
try (FileInputStream in = new FileInputStream(file);) {
//当文件没有结束时,每次读取一个字节显示
byte[] data = new byte[in.available()];
in.read(data);
return data;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
......@@ -4,6 +4,18 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yeejoin.amos.fas.dao.entity.PlanReport;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface IPlanReportService extends IService<PlanReport> {
Page<PlanReport> getByPage(PlanReport planReport);
void download(HttpServletRequest request, HttpServletResponse response, String id);
String preview(PlanReport report);
void createReport(String batchNo);
PlanReport updateReport(PlanReport report);
}
package com.yeejoin.amos.fas.business.util;
import lombok.NonNull;
import org.springframework.web.multipart.MultipartFile;
import java.io.*;
public class MyByteArrayMultipartFile implements MultipartFile {
private String name;
private String originalFilename;
private String contentType;
public MyByteArrayMultipartFile(String name, String originalFilename, String contentType, @NonNull byte[] bytes) {
super();
this.name = name;
this.originalFilename = originalFilename;
this.contentType = contentType;
this.bytes = bytes;
}
public MyByteArrayMultipartFile() {
super();
// TODO Auto-generated constructor stub
}
public String getName() {
return name;
}
public String getOriginalFilename() {
return originalFilename;
}
public String getContentType() {
return contentType;
}
public byte[] getBytes() {
return bytes;
}
@NonNull
byte[] bytes;
@Override
public boolean isEmpty() {
return bytes.length == 0;
}
@Override
public long getSize() {
return bytes.length;
}
@Override
public InputStream getInputStream() {
return new ByteArrayInputStream(bytes);
}
@Override
public void transferTo(File destination) throws IOException {
OutputStream outputStream = null;
try {
outputStream = new FileOutputStream(destination);
outputStream.write(bytes);
} finally {
if (outputStream != null) {
outputStream.close();
}
}
}
}
package com.yeejoin.amos.fas.business.util;
import com.aspose.words.License;
import com.aspose.words.SaveFormat;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import freemarker.template.Configuration;
import freemarker.template.Template;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import sun.misc.BASE64Encoder;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.Map;
import java.util.Properties;
import java.util.UUID;
public class WordTemplateUtils {
private static String fileUploadDir;
private Configuration configuration;
private static WordTemplateUtils wordTemplateUtils;
private WordTemplateUtils() {
configuration = new Configuration();
configuration.setDefaultEncoding("utf-8");
}
public static synchronized WordTemplateUtils getInstance() {
if (wordTemplateUtils == null) {
//添加你的内容
Properties props;
try {
props = PropertiesLoaderUtils.loadAllProperties("application-dev.properties");
fileUploadDir = (String) props.get("file.uploadUrl");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
wordTemplateUtils = new WordTemplateUtils();
}
return wordTemplateUtils;
}
public void exportMillCertificateWord(HttpServletRequest request, HttpServletResponse response, Map map,
String title, String ftlFile) throws IOException {
configuration.setClassForTemplateLoading(this.getClass(), "/ftl");
Template freemarkerTemplate = configuration.getTemplate(ftlFile, "UTF-8");
File file = null;
InputStream fin = null;
ServletOutputStream out = null;
try {
// 调用工具类的createDoc方法生成Word文档
file = createDoc(map, freemarkerTemplate);
fin = new FileInputStream(file);
response.setCharacterEncoding("utf-8");
response.setContentType("application/msword");
// 设置浏览器以下载的方式处理该文件名
String fileName = (StringUtils.isNotEmpty(title) ? title : getUUID()) + ".doc";
response.setHeader("Content-Disposition",
"attachment;filename=".concat(String.valueOf(URLEncoder.encode(fileName, "UTF-8"))));
out = response.getOutputStream();
// 缓冲区
byte[] buffer = new byte[512];
int bytesToRead = -1;
// 通过循环将读入的Word文件的内容输出到浏览器中
while ((bytesToRead = fin.read(buffer)) != -1) {
out.write(buffer, 0, bytesToRead);
}
} finally {
if (fin != null) {
fin.close();
}
if (out != null) {
out.close();
}
if (file != null) {
file.delete();
}// 删除临时文件
}
}
/**
* 生成文件名
*
* @param * @param
* @return
*/
public static String getUUID() {
return UUID.randomUUID().toString().replace("-", "");
}
public File getWordFileItem(Map map, String title, String ftlFile,String type) throws IOException {
configuration.setClassForTemplateLoading(this.getClass(), "/ftl");
Template freemarkerTemplate = configuration.getTemplate(ftlFile, "UTF-8");
File filepdf = new File("sellPlan.pdf");
File file = createDoc(map, freemarkerTemplate);
try (
// 调用工具类的createDoc方法生成Word文档
InputStream fin = new FileInputStream(file);
OutputStream os = new FileOutputStream(filepdf);
) {
wordTopdfByAspose(fin, os,type);
return filepdf;
} finally {
if (file != null) {
file.delete();
}// 删除临时文件
}
}
private static File createDoc(Map<?, ?> dataMap, Template template) {
String name = "sellPlan.doc";
File f = new File(name);
Template t = template;
try {
// 这个地方不能使用FileWriter因为需要指定编码类型否则生成的Word文档会因为有无法识别的编码而无法打开
Writer w = new OutputStreamWriter(new FileOutputStream(f), "utf-8");
t.process(dataMap, w);
w.close();
} catch (Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
return f;
}
public boolean wordTopdfByAspose(InputStream inputStream, OutputStream outputStream,String type) {
// 验证License 若不验证则转化出的pdf文档会有水印产生
if (!getLicense()) {
return false;
}
try {
// 将源文件保存在com.aspose.words.Document中,具体的转换格式依靠里面的save方法
com.aspose.words.Document doc = new com.aspose.words.Document(inputStream);
// 全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF,EPUB, XPS, SWF 相互转换
if("pdf".equals(type)){
doc.save(outputStream, SaveFormat.PDF);
}else {
doc.save(outputStream, SaveFormat.DOCX);
}
} catch (Exception e) {
e.printStackTrace();
return false;
} finally {
if (outputStream != null) {
try {
outputStream.flush();
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return true;
}
// 官方文档的要求 无需理会
public static boolean getLicense() {
boolean result = false;
try {
String s = "<License><Data><Products><Product>Aspose.Total for Java</Product><Product>Aspose.Words for Java</Product></Products><EditionType>Enterprise</EditionType><SubscriptionExpiry>20991231</SubscriptionExpiry><LicenseExpiry>20991231</LicenseExpiry><SerialNumber>8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7</SerialNumber></Data><Signature>sNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppo+d0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU=</Signature></License>";
ByteArrayInputStream is = new ByteArrayInputStream(s.getBytes());
License aposeLic = new License();
aposeLic.setLicense(is);
result = true;
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
/**
* 获得图片的base64码
*
* @param src 图片路径
* @return String
*/
@SuppressWarnings("deprecation")
public String getImageBase(String src) {
if (StringUtils.isEmpty(src)) {
return "";
}
src = src.replaceAll("\\.\\.", "");
String fileName = fileUploadDir + src;
File file = new File(fileName);
if (!file.exists()) {
return "";
}
byte[] data = null;
try (InputStream in = new FileInputStream(file);) {
data = new byte[in.available()];
} catch (IOException e1) {
e1.printStackTrace();
}
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(data);
}
}
......@@ -9,6 +9,7 @@
`report_url`,
`title`,
`create_date`,
`drill_date`,
`address`,
`compere`,
`attend_person`,
......@@ -23,12 +24,12 @@
)
VALUES
(
#{id},#{batchNo},#{reportUrl},#{title},#{createDate},#{address},#{compere},#{attendPerson},#{drillTopic},#{handleProcess},#{drillSummary},#{examineResult},#{bizOrgName}, #{bizOrgCode}, #{drillType},#{drillEquip}
#{id},#{batchNo},#{reportUrl},#{title},#{createDate},#{drillDate},#{address},#{compere},#{attendPerson},#{drillTopic},#{handleProcess},#{drillSummary},#{examineResult},#{bizOrgName}, #{bizOrgCode}, #{drillType},#{drillEquip}
)
</insert>
<delete id="deleteById">
delete from c_plan_report where id = #{id}
<delete id="deleteById">
delete from c_plan_report where id = #{id}
</delete>
<select id="getByCount" resultType="java.lang.Integer">
......@@ -84,7 +85,11 @@
LIMIT #{pageNumber},#{pageSize}
</select>
<select id="getById" resultType="com.yeejoin.amos.fas.dao.entity.PlanReport">
select * from c_plan_report where id = #{id}
<select id="getById" resultType="com.yeejoin.amos.fas.dao.entity.PlanReport">
select * from c_plan_report where id = #{id}
</select>
<select id="getByBatchNo" resultType="com.yeejoin.amos.fas.dao.entity.PlanReport">
select * from c_plan_report where batch_no = #{batchNo}
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment