bc_zhang 4 years ago
parent
commit
22196ab517

+ 1 - 0
.idea/compiler.xml

@@ -2,6 +2,7 @@
 <project version="4">
   <component name="CompilerConfiguration">
     <annotationProcessing>
+      <profile default="true" name="Default" enabled="true" />
       <profile name="Maven default annotation processors profile" enabled="true">
         <sourceOutputDir name="target/generated-sources/annotations" />
         <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />

+ 0 - 176
src/main/java/com/zglc/kg/controller/ArticleController.java

@@ -1,176 +0,0 @@
-package com.zglc.kg.controller;
-
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.zglc.kg.base.Result;
-import com.zglc.kg.entity.*;
-import com.zglc.kg.service.ArticleService;
-import com.zglc.kg.utils.FileTool;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.util.Date;
-import java.util.List;
-import com.zglc.kg.utils.*;
-import com.zglc.kg.utils.FileTypeUtil.Type;
-import javax.servlet.http.HttpServletRequest;
-
-@Api(tags = "资料管理接口")
-@RequestMapping("api/article")
-@CrossOrigin(allowCredentials = "true")
-@RestController
-public class ArticleController {
-
-    @Autowired
-    private ArticleService articleService;
-
-    @Value("${spring.article.sourcePath}")
-    private String sourcePath;
-
-    @ApiOperation("导入资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("import")
-    public Result<Object> importFile(HttpServletRequest request, @RequestParam("file")MultipartFile file){
-        Date date = new Date();
-        String sourcePath1;
-
-        sourcePath1 = "d:\\source";
-        String extName = ""; // 扩展名格式:
-
-//        String filePath = FileTool.fileUp(file, sourcePath1, date.getTime() + file.getOriginalFilename());
-        extName = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
-        String filePath = FileTool.fileUp(file, sourcePath1, date.getTime() + extName);
-
-        Type fileType = FileTypeUtil.getFileType(file.getOriginalFilename());
-        if (fileType == Type.DOC || fileType == Type.DOCX ||  fileType == Type.RTF ) {
-            DocToPdf.convertDoc2Pdf(filePath, sourcePath1);
-        }
-        else if (fileType == Type.PPT || fileType == Type.PPTX) {
-            Ppt2ToPdf.convertPpt2Pdf(filePath, sourcePath1);
-        }
-        //替换资源
-//        if (fileType != Type.PDF)
-//            filePath = filePath.replaceAll( fileType.getTypeName(),"pdf");
-
-        filePath = filePath.replaceAll( "d:","");
-
-        return Result.success(filePath);
-//        return Result.success(FileTool.fileUp(file, sourcePath2, date.getTime() + file.getOriginalFilename()));
-    }
-
-    @ApiOperation("浏览资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("browse")
-    public Result<String> browse(@RequestParam String filepath){
-        return articleService.browse(filepath);
-    }
-
-    @ApiOperation("增加资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("add")
-    public Result<String> add(@RequestBody ArticleEntity articleEntity){
-        return articleService.add(articleEntity);
-    }
-
-    @ApiOperation("修改资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("edit")
-    public Result<String> edit( @RequestBody ArticleEntity data){return  articleService.edit(data);}
-
-    @ApiOperation("查询资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("find")
-    public Result<List<ArticleEntity>> find(@RequestBody ArticleFind articleFind){
-        return articleService.find(articleFind);
-    }
-
-    @ApiOperation("多个删除资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("deleteByIds")
-    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){
-        return articleService.deleteByIds(deleteEntity.getIds());
-    }
-
-    @ApiOperation("删除资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("delete")
-    public Result<String> delete(@RequestParam Integer id){
-        return articleService.delete(id);
-    }
-
-
-    @ApiOperation("列出所有资料")
-    @ApiResponses({
-            @ApiResponse(code=0,message = "成功")
-    })
-    @GetMapping("listAll")
-    public Result<List<ArticleEntity>> listAll(){
-        List<ArticleEntity> lst = articleService.listAll();
-        return Result.result(lst!=null,"无数据",lst);
-    }
-
-    @ApiOperation("按关键字查找资料")
-    @ApiResponses({
-            @ApiResponse(code=0,message = "成功")
-    })
-    @GetMapping("listByKey")
-    public Result<PageInfo<ArticleEntity>> listByKey(@RequestParam String keyWords,int page,int size){
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(articleService.listByKey(keyWords)));
-    }
-
-    @ApiOperation("分页列出所有资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listpage")
-    public Result<PageInfo<ArticleEntity>> listpage(Integer page, Integer size) {
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(articleService.getAllArticle()));
-    }
-
-    @ApiOperation("分页按类型筛选资料")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("searchArticleType")
-    public Result<PageInfo<ArticleEntity>> searchByArticleType(String articleType,Integer page, Integer size) {
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>( articleService.searchByArticleType(articleType)));
-    }
-
-    @ApiOperation("逻辑搜索")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("advanceSearch")
-    public Result<List<ArticleEntity>> advanceSearch(@RequestBody LogicSearchEntity logicSearchEntity){
-        if (logicSearchEntity.getSize()> 0)
-            PageHelper.startPage(logicSearchEntity.getPage(), logicSearchEntity.getSize(), "id desc");
-        return Result.success(articleService.advanceSearch(logicSearchEntity));
-    }
-
-}
-
-

+ 0 - 124
src/main/java/com/zglc/kg/controller/EquipmentController.java

@@ -1,124 +0,0 @@
-package com.zglc.kg.controller;
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.zglc.kg.base.Result;
-import com.zglc.kg.entity.DeleteEntity;
-import com.zglc.kg.entity.EquipmentEntity;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import com.zglc.kg.service.EquipmentService;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-/**
- * 部门
- *
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-14 14:42:47
- * @description Refactoring 1st
- *
- */
-
-@Api(tags = "装备管理接口")
-@RequestMapping("api/equipment")
-@CrossOrigin(allowCredentials = "true")
-@RestController
-
-public class EquipmentController {
-
-    @Resource
-    private final EquipmentService equipmentService;
-    @Autowired(required = false)
-    public EquipmentController(EquipmentService faultRecordService){
-        this.equipmentService = faultRecordService;
-    }
-
-    @ApiOperation("分页列出所有装备")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listpage")
-    public Result<PageInfo<EquipmentEntity>> listpage(Integer page, Integer size) {
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(equipmentService.getAllFaultRecord()));
-    }
-
-    @ApiOperation("列出所有装备")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listAll")
-    public Result<List<EquipmentEntity>> listAll() {
-        return Result.success(equipmentService.listAll());
-    }
-
-//    @ApiOperation("按参数列出所有")
-//    @ApiResponses({
-//            @ApiResponse(code = 0, message = "成功")
-//    })
-//    @GetMapping("listBy")
-//    public Result<List<FaultRecordEntity>> listBy(Integer departmentId,Integer roleId) {
-//        return Result.success(faultRecordService.searchAllUser(departmentId,roleId,null,null));
-//    }
-//
-//    @ApiOperation("分页条件筛选")
-//    @ApiResponses({
-//            @ApiResponse(code = 0, message = "成功")
-//    })
-//    @GetMapping("searchData")
-//    public Result<PageInfo<FaultRecordEntity>> searchData(Integer departmentId,Integer roleId,Integer nameType,String name,Integer page, Integer size) {
-//        PageHelper.startPage(page, size, "id desc");
-//        return Result.success(new PageInfo<>( faultRecordService.searchAllUser(departmentId,roleId,nameType,name)));
-//    }
-
-    @ApiOperation("装备数量统计")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getCount")
-    public  Result<Integer> getCount(){return  Result.success(equipmentService.getCount());}
-
-    @ApiOperation("按装备ID查找")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("get")
-    public  Result<EquipmentEntity> get(@RequestParam Integer id){return  Result.success(equipmentService.getEquipment(id));}
-
-    @ApiOperation("按装备名称查询")
-    @GetMapping("getByName")
-    public Result<List<EquipmentEntity>> findByName(@RequestParam("name") String name){
-        return equipmentService.findByName(name);
-    }
-
-    @ApiOperation("增添装备")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("add")
-    public Result<String> add(@RequestBody EquipmentEntity data){return  equipmentService.add(data);}
-
-    @ApiOperation("删除装备")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("delete")
-    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  equipmentService.delete(deleteEntity.getIds());}
-
-    @ApiOperation("修改装备")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("edit")
-    public Result<String> edit( @RequestBody EquipmentEntity data){return  equipmentService.edit(data);}
-
-
-
-}

+ 0 - 477
src/main/java/com/zglc/kg/controller/FaultRecordController.java

@@ -1,477 +0,0 @@
-package com.zglc.kg.controller;
-
-import com.github.pagehelper.PageHelper;
-import com.github.pagehelper.PageInfo;
-import com.zglc.kg.base.Result;
-import com.zglc.kg.entity.DeleteEntity;
-
-import com.zglc.kg.entity.*;
-import com.zglc.kg.service.*;
-import com.zglc.kg.utils.DateTool;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 部门
- *
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-14 14:42:47
- * @description Refactoring 1st
- *
- */
-
-@Api(tags = "故障记录接口")
-@RequestMapping("api/faultrecord")
-@CrossOrigin(allowCredentials = "true")
-@RestController
-
-public class FaultRecordController {
-    @Resource
-    private final FaultRecordService faultRecordService;
-
-
-    @Autowired(required = false)
-    public FaultRecordController(FaultRecordService faultRecordService){
-        this.faultRecordService = faultRecordService;
-    }
-
-    @ApiOperation("分页列出所有故障记录")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("listpage")
-    public Result<PageInfo<FaultRecordEntity>> listpage(Integer page, Integer size) {
-        PageHelper.startPage(page, size, "id desc");
-        return Result.success(new PageInfo<>(faultRecordService.getAllFaultRecord()));
-    }
-
-    @ApiOperation("故障记录数量统计")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getCount")
-    public  Result<Integer> getCount(){return  Result.success(faultRecordService.getCount());}
-
-    @ApiOperation("按故障记录ID查找")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("get")
-    public  Result<FaultRecordEntity> get(@RequestParam Integer id){
-        return  Result.success(faultRecordService.getFaultRecord(id));}
-
-
-
-    @ApiOperation("按故障记录名称查找")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getByName")
-    public Result<List<FaultRecordEntity>> getByName(@RequestParam("name") String name){
-        return faultRecordService.findByName(name);
-    }
-
-    @ApiOperation("HMC代码查詢")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getByHmc")
-    public Result<Map<String, Object>> getByHmc(String keyword,String type){
-        return faultRecordService.getByHmc(keyword, type);
-    }
-
-    @ApiOperation("MFL查詢")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getByMfl")
-    public Result<Map<String, Object>> getByMfl(String keyword,String type){
-        return faultRecordService.getByMfl(keyword, type);
-    }
-
-    @ApiOperation("PFL查詢")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getByPfl")
-    public Result<Map<String, Object>> getByPfl(String keyword,String type){
-        return faultRecordService.getByPfl(keyword, type);
-    }
-
-    @ApiOperation("GMP查詢")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getByGmp")
-    public Result<Map<String, Object>> getByGmp(String keyword,String type){
-        return faultRecordService.getByGmp(keyword, type);
-    }
-
-    @ApiOperation("增添故障记录")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("add")
-    public Result<String> add(@RequestBody FaultRecordEntity data){return  faultRecordService.add(data);}
-
-    @ApiOperation("删除故障记录")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("delete")
-    public Result<String> delete(@RequestBody DeleteEntity deleteEntity){return  faultRecordService.delete(deleteEntity.getIds());}
-
-    @ApiOperation("修改故障记录")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("edit")
-    public Result<String> edit( @RequestBody FaultRecordEntity data){return  faultRecordService.edit(data);}
-
-    @ApiOperation("统计")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("statistics")
-    public Result<Map<Object,Object>> statistics(@RequestBody FaultRecordStatistics faultRecordStatistics){
-
-        return faultRecordService.statistics(faultRecordStatistics);
-    }
-    @ApiOperation("查询故障记录")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("findByFault")
-    public Result<List<FaultRecordEntity>> findByFault(@RequestBody FaultFind faultFind){
-
-        return faultRecordService.faultFind(faultFind);
-    }
-
-    @ApiOperation("手动统计")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("faultsta")
-    public Result<PageInfo<FaultRecordEntity>> faultSta(Integer page, Integer size, String startTime, String endTime, String name) {
-        PageHelper.startPage(page, size, "id desc");
-        Date startTime1 = DateTool.stringToDate(startTime);
-        Date endTime1 = DateTool.stringToDate(endTime);
-        return Result.success(new PageInfo<>(faultRecordService.faultSta1(startTime1,endTime1,name)));
-    }
-
-
-
-    @ApiOperation("批量导入故障记录")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("addBatch")
-    public Result<Boolean> importFile(HttpServletRequest request, @RequestParam("file") MultipartFile file) throws IOException {
-        return Result.success(faultRecordService.getExcelContext(file));
-    }
-
-    @ApiOperation("逻辑搜索")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("advanceSearch")
-    public Result<PageInfo<FaultRecordEntity>> advanceSearch(@RequestBody LogicSearchEntity logicSearchEntity) {
-        if (logicSearchEntity.getSize()> 0)
-            PageHelper.startPage(logicSearchEntity.getPage(), logicSearchEntity.getSize(), "id desc");
-        return Result.success(new PageInfo<>(faultRecordService.advanceSearch(logicSearchEntity)));
-    }
-
-    @ApiOperation("处理故障")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("changeDone")
-    public Result<String> changeDone( @RequestParam int id,@RequestParam int isDone){return  Result.success(faultRecordService.changeDone(id,isDone));}
-
-    @ApiOperation("按系统统计故障记录")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("systemSta")
-    public Result<List<StatisticEntity>> systemSta(String startTime, String endTime ){
-        Date startTime1 = DateTool.stringToDate(startTime);
-        Date endTime1 = DateTool.stringToDate(endTime);
-        return  Result.success(faultRecordService.systemSta(startTime1,endTime1));
-    }
-    //遍历数组,找到严重数量,高发时机,时机分布,高发专业,专业分布,系统分布,机号分布,故障件分布等
-    static String[] SERIOUSTYPE= {"严重","一般"};
-    public List<StatisticEntity> getStaByType(List<FaultRecordEntity> faultRecordEntities,int nType){
-        List<StatisticEntity> lst = new ArrayList<>();
-        switch (nType){
-            case 0:{
-                StatisticEntity sta = new StatisticEntity();
-                sta.setParentName(SERIOUSTYPE[faultRecordEntities.get(0).getIs_error()]);
-                sta.setRecordCount(0);
-                lst.add(sta);
-                for (FaultRecordEntity faultRecordEntity: faultRecordEntities) {
-                    sta = null;
-                    for (StatisticEntity st:lst){
-                        if (SERIOUSTYPE[faultRecordEntity.getIs_error()].compareTo(st.getParentName()) == 0){
-                            sta = st;
-                            break;
-                        }
-                    }
-                    if (sta == null){
-                        sta = new StatisticEntity();
-                        sta.setParentName(SERIOUSTYPE[faultRecordEntities.get(0).getIs_error()]);
-                        sta.setRecordCount(1);
-                        lst.add(sta);
-                    }else{
-                        sta.setRecordCount(sta.getRecordCount()+1);
-                    }
-                }
-            }break;
-            case 1:{
-                StatisticEntity sta = new StatisticEntity();
-                sta.setParentName(faultRecordEntities.get(0).getDiscover_opportunity());
-                sta.setRecordCount(0);
-                lst.add(sta);
-                for (FaultRecordEntity faultRecordEntity: faultRecordEntities) {
-                    sta = null;
-                    for (StatisticEntity st:lst){
-                        if (faultRecordEntity.getDiscover_opportunity().compareTo(st.getParentName()) == 0){
-                            sta = st;
-                            break;
-                        }
-                    }
-                    if (sta == null){
-                        sta = new StatisticEntity();
-                        sta.setParentName(faultRecordEntity.getDiscover_opportunity());
-                        sta.setRecordCount(1);
-                        lst.add(sta);
-                    }else{
-                        sta.setRecordCount(sta.getRecordCount()+1);
-                    }
-                }
-            }break;
-            case 2:{
-                StatisticEntity sta = new StatisticEntity();
-                sta.setParentName(faultRecordEntities.get(0).getMajor());
-                sta.setRecordCount(0);
-                lst.add(sta);
-                for (FaultRecordEntity faultRecordEntity: faultRecordEntities) {
-                    sta = null;
-                    for (StatisticEntity st:lst){
-                        if (faultRecordEntity.getMajor().compareTo(st.getParentName()) == 0){
-                            sta = st;
-                            break;
-                        }
-                    }
-                    if (sta == null){
-                        sta = new StatisticEntity();
-                        sta.setParentName(faultRecordEntity.getMajor());
-                        sta.setRecordCount(1);
-                        lst.add(sta);
-                    }else{
-                        sta.setRecordCount(sta.getRecordCount()+1);
-                    }
-                }
-            }break;
-            case 3:{
-                StatisticEntity sta = new StatisticEntity();
-                sta.setParentName(faultRecordEntities.get(0).getFaultparts_system());
-                sta.setRecordCount(0);
-                lst.add(sta);
-                for (FaultRecordEntity faultRecordEntity: faultRecordEntities) {
-                    sta = null;
-                    for (StatisticEntity st:lst){
-                        if (faultRecordEntity.getFaultparts_system().compareTo(st.getParentName()) == 0){
-                            sta = st;
-                            break;
-                        }
-                    }
-                    if (sta == null){
-                        sta = new StatisticEntity();
-                        sta.setParentName(faultRecordEntity.getFaultparts_system());
-                        sta.setRecordCount(1);
-                        lst.add(sta);
-                    }else{
-                        sta.setRecordCount(sta.getRecordCount()+1);
-                    }
-                }
-            }break;
-            case 4:{
-                StatisticEntity sta = new StatisticEntity();
-                sta.setParentName(faultRecordEntities.get(0).getAircraft_no());
-                sta.setRecordCount(0);
-                lst.add(sta);
-                for (FaultRecordEntity faultRecordEntity: faultRecordEntities) {
-                    sta = null;
-                    for (StatisticEntity st:lst){
-                        if (faultRecordEntity.getAircraft_no().compareTo(st.getParentName()) == 0){
-                            sta = st;
-                            break;
-                        }
-                    }
-                    if (sta == null){
-                        sta = new StatisticEntity();
-                        sta.setParentName(faultRecordEntity.getAircraft_no());
-                        sta.setRecordCount(1);
-                        lst.add(sta);
-                    }else{
-                        sta.setRecordCount(sta.getRecordCount()+1);
-                    }
-                }
-            }break;
-            case 5:{
-                StatisticEntity sta = new StatisticEntity();
-                sta.setParentName(faultRecordEntities.get(0).getDevice_name());
-                sta.setRecordCount(0);
-                lst.add(sta);
-                for (FaultRecordEntity faultRecordEntity: faultRecordEntities) {
-                    sta = null;
-                    for (StatisticEntity st:lst){
-                        if (faultRecordEntity.getDevice_name().compareTo(st.getParentName()) == 0){
-                            sta = st;
-                            break;
-                        }
-                    }
-                    if (sta == null){
-                        sta = new StatisticEntity();
-                        sta.setParentName(faultRecordEntity.getDevice_name());
-                        sta.setRecordCount(1);
-                        lst.add(sta);
-                    }else{
-                        sta.setRecordCount(sta.getRecordCount()+1);
-                    }
-                }
-            }break;
-        }
-
-        return lst;
-    }
-    @ApiOperation("单机统计")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("singleSta")
-    public Result<SingleStaResultEntity> singleSta(@RequestBody SingleStaEntity singleStaEntity){
-        SingleStaResultEntity singleStaResultEntity = new SingleStaResultEntity();
-        List<FaultRecordEntity> faultRecordEntities = faultRecordService.singleSta(singleStaEntity);
-        if (faultRecordEntities.size() > 0) {
-            singleStaResultEntity.setFaultCount(faultRecordEntities.size());
-
-            singleStaResultEntity.setSeriousSta(getStaByType(faultRecordEntities, 0));
-            int nMax = 0;
-            for (StatisticEntity sta : singleStaResultEntity.getSeriousSta()) {
-                if (sta.getParentName().compareTo("严重") == 0) {
-                    singleStaResultEntity.setSeriousCount(sta.getRecordCount());
-                }
-            }
-            singleStaResultEntity.setOptSta(getStaByType(faultRecordEntities, 1));
-            nMax = 0;
-            for (StatisticEntity sta : singleStaResultEntity.getOptSta()) {
-                if (sta.getRecordCount() > nMax) {
-                    nMax = sta.getRecordCount();
-                    singleStaResultEntity.setTopOPT(sta.getParentName());
-                }
-            }
-            singleStaResultEntity.setMajorSta(getStaByType(faultRecordEntities, 2));
-            nMax = 0;
-            for (StatisticEntity sta : singleStaResultEntity.getMajorSta()) {
-                if (sta.getRecordCount() > nMax) {
-                    nMax = sta.getRecordCount();
-                    singleStaResultEntity.setTopMajor(sta.getParentName());
-                }
-            }
-            singleStaResultEntity.setSystemSta(getStaByType(faultRecordEntities, 3));
-            singleStaResultEntity.setAirNoSta(faultRecordService.singleStaAll(singleStaEntity));
-            singleStaResultEntity.setDeviceSta(getStaByType(faultRecordEntities, 5));
-        }
-        return  Result.success(singleStaResultEntity);
-    }
-
-    @ApiOperation("专业统计")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @PostMapping("majorSta")
-    public Result<SingleStaResultEntity> majorSta(@RequestBody SingleStaEntity singleStaEntity){
-        SingleStaResultEntity singleStaResultEntity = new SingleStaResultEntity();
-        List<FaultRecordEntity> faultRecordEntities = faultRecordService.majorSta(singleStaEntity);
-        if (faultRecordEntities.size() > 0) {
-            singleStaResultEntity.setFaultCount(faultRecordEntities.size());
-            singleStaResultEntity.setSeriousSta(getStaByType(faultRecordEntities, 0));
-            int nMax = 0;
-            for (StatisticEntity sta : singleStaResultEntity.getSeriousSta()) {
-                if (sta.getParentName().compareTo("严重") == 0) {
-                    singleStaResultEntity.setSeriousCount(sta.getRecordCount());
-                }
-            }
-            singleStaResultEntity.setOptSta(getStaByType(faultRecordEntities, 1));
-            nMax = 0;
-            for (StatisticEntity sta : singleStaResultEntity.getOptSta()) {
-                if (sta.getRecordCount() > nMax) {
-                    nMax = sta.getRecordCount();
-                    singleStaResultEntity.setTopOPT(sta.getParentName());
-                }
-            }
-            singleStaResultEntity.setSystemSta(getStaByType(faultRecordEntities, 3));
-            nMax = 0;
-            for (StatisticEntity sta : singleStaResultEntity.getSystemSta()) {
-                if (sta.getRecordCount() > nMax) {
-                    nMax = sta.getRecordCount();
-                    singleStaResultEntity.setTopSystem(sta.getParentName());
-                }
-            }
-            singleStaResultEntity.setMajorSta(faultRecordService.majorStaAll(singleStaEntity));
-            singleStaResultEntity.setDeviceSta(getStaByType(faultRecordEntities, 5));
-        }
-        return  Result.success(singleStaResultEntity);
-    }
-
-    @ApiOperation("获取记录中的所有机型")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getAirType")
-    public Result<List<StatisticEntity>> getAirType(){
-        return Result.success(faultRecordService.getAirType());
-    }
-
-    @ApiOperation("获取记录中机型的所有机号")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getAirNo")
-    public Result<List<StatisticEntity>> getAirNo(@RequestParam String airType){
-        return Result.success(faultRecordService.getAirNo(airType));
-    }
-
-    @ApiOperation("获取记录中机型的所有专业")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getMajor")
-    public Result<List<StatisticEntity>> getMajor(@RequestParam String airType){
-        return Result.success(faultRecordService.getMajor(airType));
-    }
-
-    @ApiOperation("获取记录单位级别")
-    @ApiResponses({
-            @ApiResponse(code = 0, message = "成功")
-    })
-    @GetMapping("getDepartment")
-    public Result<List<StatisticEntity>> getDepartment(@RequestParam int departmentLevel,@RequestParam String parentName){
-        return Result.success(faultRecordService.getDepartment(parentName,departmentLevel));
-    }
-}

+ 0 - 28
src/main/java/com/zglc/kg/dao/ArticleDao.java

@@ -1,28 +0,0 @@
-package com.zglc.kg.dao;
-
-import com.zglc.kg.entity.ArticleEntity;
-import com.zglc.kg.entity.ArticleFind;
-import org.springframework.stereotype.Repository;
-import org.apache.ibatis.annotations.Param;
-
-import tk.mybatis.mapper.common.Mapper;
-
-import java.util.List;
-
-@Repository
-public interface ArticleDao extends Mapper<ArticleEntity> {
-
-    List<ArticleEntity> find(ArticleFind find);
-
-    List<ArticleEntity> find1(ArticleFind find);
-
-    Integer add(ArticleEntity articleEntity);
-
-    List<ArticleEntity> findByName(@Param("name") String name);
-
-    List<ArticleEntity> refindByName(@Param("name1") String name1,@Param("name2") String name2);
-
-    Integer addBatch(List<ArticleEntity> list);
-
-
-}

+ 0 - 28
src/main/java/com/zglc/kg/dao/EquipmentDao.java

@@ -1,28 +0,0 @@
-package com.zglc.kg.dao;
-
-import com.zglc.kg.entity.EquipmentEntity;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-import tk.mybatis.mapper.common.Mapper;
-
-import java.util.List;
-
-/**
- * 用户
- *
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-14 01:33:53
- * @description Refactoring 1st
- *
- */
-@Repository
-public interface EquipmentDao extends Mapper<EquipmentEntity> {
-	List<EquipmentEntity> listAll();
-
-	Integer getCount();
-
-	Integer batchAdd(List<String> list);
-
-	List<EquipmentEntity> findByName(@Param("name") String name);
-}

+ 0 - 83
src/main/java/com/zglc/kg/dao/FaultRecordDao.java

@@ -1,83 +0,0 @@
-package com.zglc.kg.dao;
-
-import com.zglc.kg.entity.FaultFind;
-import com.zglc.kg.entity.FaultRecordEntity;
-import com.zglc.kg.entity.StatisticEntity;
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-import tk.mybatis.mapper.common.Mapper;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 用户
- *
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-14 01:33:53
- * @description Refactoring 1st
- *
- */
-@Repository
-public interface FaultRecordDao extends Mapper<FaultRecordEntity> {
-	List<FaultRecordEntity> listAll();
-
-	Integer getCount();
-
-	List<FaultRecordEntity> findByName(@Param("name") String name);
-	List<FaultRecordEntity> refindByName(@Param("name1") String name1,@Param("name2") String name2);
-
-	List<FaultRecordEntity> findByHmc(@Param("name") String name);
-
-	List<FaultRecordEntity> findByMfl(@Param("name") String name);
-
-	List<FaultRecordEntity> findByPfl(@Param("name") String name);
-
-	List<FaultRecordEntity> findByGmp(@Param("name") String name);
-
-	Integer statistics(Map<String, Object> params);
-
-	List<FaultRecordEntity> faultsta(FaultFind faultFind);
-	List<FaultRecordEntity> faultsta1(Date startTime, Date endTime, String device_name);
-
-
-	List<FaultRecordEntity> faultFind(FaultFind faultFind);
-
-	List<Map<String, Object>> findAllDevice(@Param("deviceId")Integer id);
-
-	Integer addBatch(List<FaultRecordEntity> list);
-
-	List<StatisticEntity> staByAirType(Date startTime, Date endTime);
-	List<StatisticEntity> staByDevice(Date startTime, Date endTime, String aircraftType);
-
-	List<FaultRecordEntity> sortByDevice(Date startTime, Date endTime, String aircraftType);
-
-	List<StatisticEntity> staBySystem(Date startTime, Date endTime);
-
-	List<FaultRecordEntity> singleSta(String aircraft_type,String airNo,Date startTime, Date endTime);
-
-	List<StatisticEntity> singleStaAll(String aircraft_type,Date startTime, Date endTime);
-
-	List<FaultRecordEntity> majorSta(String aircraft_type,String major,Date startTime, Date endTime);
-
-	List<StatisticEntity> majorStaAll(String aircraft_type,Date startTime, Date endTime);
-
-	List<StatisticEntity> getD1();
-
-	List<StatisticEntity> getD2(String war_zone);
-
-	List<StatisticEntity> getD3(String army);
-
-	List<StatisticEntity> getD4(String dimision);
-
-	List<StatisticEntity> getAirNo(String aircraft_type);
-
-	List<StatisticEntity> getSystem(String major);
-
-	List<StatisticEntity> getMajor(String aircraft_type);
-
-	List<StatisticEntity> getAirType();
-
-}

+ 2 - 11
src/main/java/com/zglc/kg/entity/AircraftEntity.java

@@ -16,16 +16,7 @@ public class AircraftEntity {
     @Column(name = "aircraft_type")
     private String aircraft_type;
 
-    @Column(name = "aircraft_descripte")
-    private String aircraft_descripte;
-
-    @Column(name = "ending_time")
-    private String ending_time;
-
-    @Column(name = "input_time")
-    private String input_time;
-
-    @Column(name = "file_path")
-    private String file_path;
+    @Column(name = "aircraft_describe")
+    private String aircraft_describe;
 
 }

+ 0 - 59
src/main/java/com/zglc/kg/entity/ArticleEntity.java

@@ -1,59 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import javax.persistence.*;
-
-@Getter
-@Setter
-@Table(name ="t_article")
-public class ArticleEntity {
-
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private Integer id;
-
-    @Column(name = "title")
-    private String title;
-
-    @Column(name = "author")
-    private String author;
-
-    @Column(name = "input_time")
-    private String input_time;
-
-    @Column(name = "keywords")
-    private String keywords;
-
-    @Column(name = "aircraft")
-    private String aircraft;
-
-    @Column(name = "aircraft_system")
-    private String aircraft_system;
-
-    @Column(name = "article_number")
-    private String article_number;
-
-    @Column(name = "major_name")
-    private String major_name;
-
-    @Column(name = "article_type")
-    private String article_type;
-
-    @Column(name = "file_path")
-    private String file_path;
-
-    @Column(name = "hmc")
-    private String hmc;
-
-    @Column(name = "mfl")
-    private String mfl;
-
-    @Column(name = "pfl")
-    private String pfl;
-
-    @Column(name = "gmp")
-    private String gmp;
-}

+ 0 - 16
src/main/java/com/zglc/kg/entity/ArticleFind.java

@@ -1,16 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Getter;
-import lombok.Setter;
-
-@Getter
-@Setter
-public class ArticleFind {
-    private  String userName;
-
-    private String keyword;
-
-    private String firstString;
-
-    private String seconndString;
-}

+ 0 - 62
src/main/java/com/zglc/kg/entity/EquipmentEntity.java

@@ -1,62 +0,0 @@
-package com.zglc.kg.entity;
-import javax.persistence.*;
-import java.io.Serializable;
-
-import lombok.Data;
-
-/**
- * 部门
- *
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-14 23:23:33
- * @description Refactoring 1st
- *
- */
-@Data
-@Table(name = "t_equipment")
-public class EquipmentEntity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /**
-     *
-     */
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private Integer id;
-
-    /**
-     * 名称
-     */
-    @Column(name = "equipment_name")
-    private String equipment_name;
-
-    /**
-     * 型号
-     */
-    @Column(name = "equipment_type")
-    private String equipment_type;
-
-    /**
-     * 使用时间
-     */
-    @Column(name = "equipment_time")
-    private String equipment_time;
-
-    /**
-     * 报废时间
-     */
-    @Column(name = "retirement_time")
-    private String retirement_time;
-
-    /**
-     *备注
-     */
-    @Column(name = "mark")
-    private String mark;
-
-
-
-
-}

+ 0 - 25
src/main/java/com/zglc/kg/entity/FaultFind.java

@@ -1,25 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Data;
-import lombok.NoArgsConstructor;
-
-import java.util.Date;
-
-@Data
-@NoArgsConstructor
-public class FaultFind {
-
-    private String device_name;
-
-    private Date startTime;
-
-    private Date endTime;
-
-    private String systemName;
-
-    private String subSystemName;
-
-    private String aircraftType;
-
-    private String manual_name;
-}

+ 0 - 232
src/main/java/com/zglc/kg/entity/FaultRecordEntity.java

@@ -1,232 +0,0 @@
-package com.zglc.kg.entity;
-import javax.persistence.*;
-import java.io.Serializable;
-import java.util.Date;
-import lombok.Data;
-
-/**
- * 部门
- *
- * @author wcf
- * @email mnhwa@163.com
- * @date 2020-02-14 23:23:33
- * @description Refactoring 1st
- *
- */
-@Data
-@Table(name = "t_faultrecord")
-public class FaultRecordEntity implements Serializable {
-    private static final long serialVersionUID = 1L;
-
-    /** id  */
-    @Id
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Column(name = "id")
-    private Integer id;
-
-    @Column(name = "war_zone")
-    private String war_zone;
-
-    @Column(name = "army")
-    private String army;
-
-    @Column(name = "division")
-    private String division;
-
-    @Column(name = "brigade")
-    private String brigade;
-
-    @Column(name = "fault_time")
-    private Date fault_time;
-
-    @Column(name = "is_history")
-    private String is_history;
-
-    @Column(name = "aircraft_type")
-    private String aircraft_type;
-
-    @Column(name = "discover_opportunity")
-    private String discover_opportunity;
-
-    @Column(name = "up_down")
-    private Integer up_down;
-
-    @Column(name = "discoverer")
-    private String discoverer;
-
-    @Column(name = "info_sources")
-    private String info_sources;
-
-    @Column(name = "fault_content")
-    private String fault_content;
-
-    @Column(name = "is_falsealarm")
-    private String is_falsealarm;
-
-    @Column(name = "fault_degree")
-    private String fault_degree;
-
-    @Column(name = "fault_consequence")
-    private String fault_consequence;
-
-    @Column(name = "missflight_times")
-    private Integer missflight_times;
-
-    @Column(name = "impact_times")
-    private Integer impact_times;
-
-    @Column(name = "fault_liability")
-    private String fault_liability;
-
-    @Column(name = "fault_location")
-    private String fault_location;
-
-    @Column(name = "major")
-    private String major;
-
-    @Column(name = "fault_reason")
-    private String fault_reason;
-
-    @Column(name = "reviewer")
-    private String reviewer;
-
-    @Column(name = "review_time")
-    private Date review_time;
-
-    @Column(name = "repair_time")
-    private Date repair_time;
-
-    @Column(name = "repair_hours")
-    private Integer repair_hours;
-
-    @Column(name = "repair_peoplenum")
-    private Integer repair_peoplenum;
-
-    @Column(name = "repaired_time")
-    private Date repaired_time;
-
-    @Column(name = "classification")
-    private String classification;
-
-    @Column(name = "is_grounded")
-    private String is_grounded;
-
-    @Column(name = "reporting_department")
-    private String reporting_department;
-
-    @Column(name = "device_name")
-    private String device_name;
-
-    @Column(name = "device_type")
-    private String device_type;
-
-    @Column(name = "replace_device")
-    private String replace_device;
-
-    @Column(name = "replace_type")
-    private String replace_type;
-
-    @Column(name = "diagnosis_method")
-    private String diagnosis_method;
-
-    @Column(name = "diagnosis_people")
-    private String diagnosis_people;
-
-    @Column(name = "faultparts_date")
-    private Date faultparts_date;
-
-    @Column(name = "faultparts_hours")
-    private Integer faultparts_hours;
-
-    @Column(name = "faultparts_worktimes")
-    private Integer faultparts_worktimes;
-
-    @Column(name = "faultparts_renovation_manu")
-    private String faultparts_renovation_manu;
-
-    @Column(name = "faultparts_renovation_hours")
-    private Integer faultparts_renovation_hours;
-
-    @Column(name = "faultparts_renovation_times")
-    private Integer faultparts_renovation_times;
-
-    @Column(name = "repair_method")
-    private String repair_method;
-
-    @Column(name = "repair_person")
-    private String repair_person;
-
-    @Column(name = "replace_device_hours")
-    private Integer replace_device_hours;
-
-    @Column(name = "replace_device_repairhours")
-    private Integer replace_device_repairhours;
-
-    @Column(name = "replace_device_repairtimes")
-    private Integer replace_device_repairtimes;
-
-    @Column(name = "replace_device_applytimes")
-    private Integer replace_device_applytimes;
-
-    @Column(name = "replace_device_manufacturer")
-    private String replace_device_manufacturer;
-
-    @Column(name = "faultparts_system")
-    private String faultparts_system;
-
-    @Column(name = "inspector")
-    private String inspector;
-
-    @Column(name = "handling_opinions")
-    private String handling_opinions;
-
-    @Column(name = "remark")
-    private String remark;
-
-    @Column(name = "hmc")
-    private String hmc;
-
-    @Column(name = "mfl")
-    private String mfl;
-
-    @Column(name = "pfl")
-    private String pfl;
-
-    @Column(name = "gmp")
-    private String gmp;
-
-    @Column(name = "device_no")
-    private String device_no;
-
-    @Column(name = "product_no")
-    private String product_no;
-
-    @Column(name = "device_productor")
-    private String device_productor;
-
-    @Column(name = "aircraft_no")
-    private String aircraft_no;
-
-    @Column(name = "is_hide")
-    private int is_hide;
-
-    @Column(name = "is_almost")
-    private int is_almost;
-
-    @Column(name = "is_error")
-    private int is_error;
-
-    @Column(name = "is_undefined")
-    private int is_undefined;
-
-    @Column(name = "is_done")
-    private int is_done;
-
-    @Column(name = "defect_name")
-    private String defect;
-
-    @Column(name = "file_path")
-    private String filePath;
-
-
-}

+ 0 - 23
src/main/java/com/zglc/kg/entity/FaultRecordStatistics.java

@@ -1,23 +0,0 @@
-package com.zglc.kg.entity;
-
-import lombok.Getter;
-import lombok.Setter;
-
-import java.util.Date;
-
-@Getter
-@Setter
-public class FaultRecordStatistics {
-
-    private Integer aircarftId;
-
-    private Date startTime;
-
-    private Date endTime;
-
-    private String Type;
-
-    private Integer startyear;
-
-    private Integer endyear;
-}

+ 0 - 190
src/main/java/com/zglc/kg/service/ArticleService.java

@@ -1,190 +0,0 @@
-package com.zglc.kg.service;
-
-
-import com.zglc.kg.base.Result;
-import com.zglc.kg.dao.ArticleDao;
-import com.zglc.kg.entity.*;
-import com.zglc.kg.utils.FileTypeUtil;
-import com.zglc.kg.utils.FileUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import tk.mybatis.mapper.entity.Example;
-import com.zglc.kg.utils.FileTypeUtil.Type;
-
-import java.util.Iterator;
-import java.util.List;
-
-@Service
-public class ArticleService {
-
-    @Autowired
-    private ArticleDao articleDao;
-
-    public Result<String> add(ArticleEntity articleEntity){
-        if (articleEntity.getFile_path().isEmpty())
-            return Result.fail("file path cannot be empty or null!");
-        int index = articleDao.add(articleEntity);
-        if (index > 0)
-            return Result.success("添加成功!");
-        else
-            return Result.fail("添加到数据库失败!");
-    }
-
-    public Result<List<ArticleEntity>> find(ArticleFind articleFind){
-        List<ArticleEntity> list = articleDao.find(articleFind);
-        return Result.success(list);
-    }
-
-    public List<ArticleEntity> find1(ArticleFind articleFind) {
-        List<ArticleEntity> list = articleDao.find1(articleFind);
-        return list;
-    }
-
-    public Result<List<ArticleEntity>> findByName(String name){
-        if (name==null || "".equals(name)){
-            return Result.result(false, "名称不能为空", null);
-        }
-        List<ArticleEntity> list = articleDao.findByName("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public Result<List<ArticleEntity>> refindByName(String name1,String name2){
-        if (name1==null || "".equals(name1)){
-            return Result.result(false, "名称不能为空", null);
-        }
-        List<ArticleEntity> list = articleDao.refindByName("%" + name1 + "%","%" + name2 + "%");
-        return Result.success(list);
-    }
-
-    public Result<String> delete(Integer id){
-        Integer index = articleDao.deleteByPrimaryKey(id);
-        return Result.success(""+index);
-    }
-
-    public Result<String> browse(String filepath){
-        Type fileType = FileTypeUtil.getFileType(filepath);
-        if (fileType == Type.DOC ) {
-            filepath = filepath.replaceAll( "doc","pdf");
-        }
-        if (fileType == Type.DOCX ) {
-            filepath = filepath.replaceAll( "docx","pdf");
-        }
-        if (fileType == Type.PPT ) {
-            filepath = filepath.replaceAll( "ppt","pdf");
-        }
-        if (fileType == Type.PPTX ) {
-            filepath = filepath.replaceAll( "pptx","pdf");
-        }
-        return Result.success(filepath);
-    }
-
-    public Result<String> edit(ArticleEntity data) {
-        boolean flag = true;
-        String msg = "";
-        ArticleEntity tmpData = articleDao.selectByPrimaryKey(data.getId());
-        if (tmpData != null) {
-            if (!tmpData.getFile_path().equals(data.getFile_path())){
-                //删除旧文件
-                FileUtils.deleteFile(tmpData.getFile_path());
-                //更新文件路径
-                int index = articleDao.updateByPrimaryKeySelective(data);
-                if (index == 0) {
-                    flag = false;
-                    msg = "技术资料修改失败";
-                } else {
-                    msg = "技术资料修改成功";
-                }
-            }else{
-                int index = articleDao.updateByPrimaryKeySelective(data);
-                if (index == 0) {
-                    flag = false;
-                    msg = "技术资料修改失败";
-                } else {
-                    msg = "技术资料修改成功";
-                }
-            }
-        } else {
-            flag = false;
-            msg = "技术资料不存在!";
-        }
-        return Result.result(flag, msg, msg);
-
-    }
-
-    public Result<String> deleteByIds(List<Integer> ids){
-        boolean flag = true;
-        String msg = "";
-        Iterator iter = ids.iterator();
-        while(iter.hasNext()) {
-            Integer id = (Integer) iter.next();
-            if (id > 0)
-            {
-                int index = articleDao.deleteByPrimaryKey(id);
-                if (index == 0) {
-                    flag = false;
-                    msg += "删除失败!" + id + ";";
-                } else {
-                    msg += "删除成功!" + id + ";";
-                }
-            }
-        }
-        return Result.result(flag, msg, msg);
-    }
-
-    public List<ArticleEntity> listAll(){return articleDao.selectAll();}
-
-    public List<ArticleEntity> listByKey(String keyWords){
-        Example example = new Example(ArticleEntity.class);
-        example.createCriteria().andLike("keywords","%" + keyWords + "%");
-        return articleDao.selectByExample(example);
-    }
-
-    public List<ArticleEntity> getAllArticle() {
-        String msg = "";
-        Example example = new Example(ArticleEntity.class);
-        example.createCriteria().andNotEqualTo("id", 1);
-        return articleDao.selectByExample(example);
-    }
-
-    public List<ArticleEntity> searchByArticleType(String articleType) {
-        Example example = new Example(ArticleEntity.class);
-        Example.Criteria criteria = example.createCriteria();
-        if (articleType != null)
-            criteria.andEqualTo("article_type", articleType);
-        else
-            criteria.andIsNull("article_type");
-        if (criteria.isValid())
-            return articleDao.selectByExample(example);
-        else
-            return getAllArticle();
-    }
-    public static final String SEARCHTYPE[] = {"aircraft","aircraft_system","major_name"};
-    public void setLogicString(int nType ,Example.Criteria criteria,int nKey,String v)
-    {
-        switch (nType){
-            case 0:criteria.andLike(SEARCHTYPE[nKey],v);break;
-            case 1:criteria.orLike(SEARCHTYPE[nKey],v);break;
-            case 2:criteria.andNotLike(SEARCHTYPE[nKey],v);break;
-            default:
-                break;
-        }
-    }
-
-    public List<ArticleEntity> advanceSearch(LogicSearchEntity logicSearchEntity) {
-        Example example = new Example(ArticleEntity.class);
-        Example.Criteria criteria = example.createCriteria();
-        criteria.andLike("title","%"+logicSearchEntity.getMasterKey()+"%");
-        if (logicSearchEntity.getFirstLogic() != -1)
-        {
-            setLogicString(logicSearchEntity.getFirstLogic(),criteria,logicSearchEntity.getFirstType(),logicSearchEntity.getFirstKey());
-            if (logicSearchEntity.getSecondLogic() != -1)
-            {
-                setLogicString(logicSearchEntity.getSecondLogic(),criteria,logicSearchEntity.getSearchType(),logicSearchEntity.getSecondKey());
-                if (logicSearchEntity.getThirdLogic() != -1)
-                    setLogicString(logicSearchEntity.getThirdLogic(),criteria,logicSearchEntity.getThirdType(),logicSearchEntity.getThirdKey());
-            }
-        }
-        return articleDao.selectByExample(example);
-    }
-
-}

+ 0 - 129
src/main/java/com/zglc/kg/service/EquipmentService.java

@@ -1,129 +0,0 @@
-package com.zglc.kg.service;
-import com.zglc.kg.entity.EquipmentEntity;
-import com.zglc.kg.dao.EquipmentDao;
-import org.springframework.stereotype.Service;
-import com.zglc.kg.base.Result;
-import tk.mybatis.mapper.entity.Example;
-
-import java.util.Iterator;
-import java.util.List;
-
-@Service
-
-public class EquipmentService {
-
-    private EquipmentDao equipmentDao;
-
-    public EquipmentService(EquipmentDao equipmentDao) {
-        this.equipmentDao = equipmentDao;
-    }
-
-
-    public List<EquipmentEntity> getAllFaultRecord() {
-        String msg = "";
-        Example example = new Example(EquipmentEntity.class);
-        example.createCriteria().andNotEqualTo("id", 1);
-        return equipmentDao.selectByExample(example);
-    }
-
-    public List<EquipmentEntity> listAll() {
-        return equipmentDao.listAll();
-    }
-
-//    public List<FaultRecordEntity> searchAllFaultRecord(Integer id, Integer roleId, Integer nameType, String name) {
-//
-//        Example example = new Example(FaultRecordEntity.class);
-//        Example.Criteria criteria = example.createCriteria();
-//        if (departmentId != 0)
-//            criteria.andEqualTo("departmentId", departmentId);
-//        if (roleId != 0)
-//            criteria.andEqualTo("roleId", roleId);
-//        if(name != null)
-//        {
-//            if (nameType == 0 )
-//                criteria.andLike("userName", "%" + name + "%");
-//            else
-//                criteria.andLike("realName", "%" + name + "%");
-//            criteria.andNotEqualTo("id", 1);
-//        }
-//        if (criteria.isValid())
-//            return faultRecordDao.selectByExample(example);
-//        else
-//            return getAllUser();
-//    }
-
-    public EquipmentEntity getEquipment(Integer id) {
-        return equipmentDao.selectByPrimaryKey(id);
-    }
-
-//    public FaultRecordEntity getUserByName(String userName) {
-//        Example example = new Example(FaultRecordEntity.class);
-//        example.createCriteria().andEqualTo("userName", userName);
-//        return faultRecordDao.selectOneByExample(example);
-//    }
-
-    public Integer getCount() {
-        return equipmentDao.getCount();
-    }
-
-    public Result<String> add(EquipmentEntity data) {
-        data.setId(null);
-        boolean flag = true;
-        String msg = "";
-        int index = equipmentDao.insertSelective(data);
-        if (index == 0) {
-            flag = false;
-            msg = "添加装备信息失败!";
-        } else {
-            msg = "添加装备信息成功!";
-        }
-
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<String> delete(List<Integer> ids) {
-        boolean flag = true;
-        String msg = "";
-        Iterator iter = ids.iterator();
-        while(iter.hasNext()) {
-            Integer id = (Integer)iter.next();
-            int index = equipmentDao.deleteByPrimaryKey(id);
-            if (index == 0) {
-                flag = false;
-                msg += "装备信息删除失败!" + id + ";";
-            } else {
-                msg += "装备信息删除成功!" + id + ";";
-            }
-        }
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<String> edit(EquipmentEntity data) {
-        boolean flag = true;
-        String msg = "";
-        EquipmentEntity tmpData = equipmentDao.selectByPrimaryKey(data.getId());
-        if (tmpData != null) {
-            int index = equipmentDao.updateByPrimaryKeySelective(data);
-            if (index == 0) {
-                flag = false;
-                msg = "装备信息修改失败";
-            } else {
-                msg = "装备信息修改成功";
-            }
-        } else {
-            flag = false;
-            msg = "装备信息不存在!";
-        }
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<List<EquipmentEntity>> findByName(String name){
-        if (name == null ||"".equals(name)){
-            return Result.result(false, "名称不能为空" ,null);
-        }
-        List<EquipmentEntity> list = equipmentDao.findByName("%" + name + "%");
-        return Result.success(list);
-    }
-
-
-}

+ 0 - 527
src/main/java/com/zglc/kg/service/FaultRecordService.java

@@ -1,527 +0,0 @@
-package com.zglc.kg.service;
-
-import com.zglc.kg.dao.AircraftDao;
-import com.zglc.kg.entity.*;
-import com.zglc.kg.dao.FaultRecordDao;
-import com.zglc.kg.utils.ExcelUtils;
-import org.apache.poi.ss.usermodel.Sheet;
-import org.apache.poi.ss.usermodel.Workbook;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.zglc.kg.base.Result;
-import org.springframework.web.multipart.MultipartFile;
-import tk.mybatis.mapper.entity.Example;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-@Service
-public class FaultRecordService {
-
-
-
-    @Autowired
-    private FaultRecordDao faultRecordDao;
-
-    @Autowired
-    private AircraftDao aircraftDao;
-
-    @Autowired
-    private RepairManualService repairManualService;
-
-
-    public List<FaultRecordEntity> getAllFaultRecord() {
-        return faultRecordDao.selectAll();
-    }
-
-    public List<FaultRecordEntity> listAll() {
-        return faultRecordDao.listAll();
-    }
-
-    //关于统计排序,先获取机型的记录数量和每一个机型的故障件记录数量
-    //当要导出记录要,从数据库中获取每一个机型排序后的数据,然后再根据上面故障件统计的排序对数据再次排序
-    //数据库中排序后的结果没有对机型进行数据量排序,但已经进行了初步排序
-
-    public FaultRecordEntity getFaultRecord(Integer id) {
-        return faultRecordDao.selectByPrimaryKey(id);
-    }
-
-    public Integer getCount() {
-        return faultRecordDao.getCount();
-    }
-
-    public Result<String> add(FaultRecordEntity data) {
-        data.setId(null);
-        boolean flag = true;
-        String msg = "";
-        int index = faultRecordDao.insertSelective(data);
-        if (index == 0) {
-            flag = false;
-            msg = "添加故障记录失败!";
-        } else {
-            msg = "添加故障记录成功!";
-        }
-
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<String> delete(List<Integer> ids) {
-        boolean flag = true;
-        String msg = "";
-        Iterator iter = ids.iterator();
-        while (iter.hasNext()) {
-            Integer id = (Integer) iter.next();
-            int index = faultRecordDao.deleteByPrimaryKey(id);
-            if (index == 0) {
-                flag = false;
-                msg += "故障记录删除失败!" + id + ";";
-            } else {
-                msg += "故障记录删除成功!" + id + ";";
-            }
-        }
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<String> edit(FaultRecordEntity data) {
-        boolean flag = true;
-        String msg = "";
-        FaultRecordEntity tmpData = faultRecordDao.selectByPrimaryKey(data.getId());
-        if (tmpData != null) {
-            int index = faultRecordDao.updateByPrimaryKeySelective(data);
-            if (index == 0) {
-                flag = false;
-                msg = "故障记录修改失败";
-            } else {
-                msg = "故障记录修改成功";
-            }
-        } else {
-            flag = false;
-            msg = "故障记录不存在!";
-        }
-        return Result.result(flag, msg, msg);
-    }
-
-    public Result<List<FaultRecordEntity>> findByName(String name) {
-        if (name == null || "".equals(name)) {
-            return Result.result(false, "名称不能为空!", null);
-        }
-        List<FaultRecordEntity> list = faultRecordDao.findByName("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public Result<List<FaultRecordEntity>> refindByName(String name1,String name2){
-        if (name1==null || "".equals(name1)){
-            return Result.result(false, "名称不能为空", null);
-        }
-        List<FaultRecordEntity> list = faultRecordDao.refindByName("%" + name1 + "%","%" + name2 + "%");
-        return Result.success(list);
-    }
-
-    public Result<Map<Object,Object>> statistics(FaultRecordStatistics faultRecordStatistics) {
-
-        return Result.success(statisCal(faultRecordStatistics));
-    }
-
-    private Map<Object,Object> statisCal(FaultRecordStatistics faultRecordStatistics) {
-        List<Map<String, Object>> list = faultRecordDao.findAllDevice(faultRecordStatistics.getAircarftId());
-        Map<Object,Object> result = new HashMap<>();
-        Map params = new HashMap<>();
-        params.put("aircraftId", faultRecordStatistics.getAircarftId());
-        for (Map<String, Object> m : list) {
-            Map<String, Integer> res = new LinkedHashMap<>();
-            params.put("device",m.get("id").toString());
-            for (int year = faultRecordStatistics.getStartyear(); year <= faultRecordStatistics.getEndyear(); year++) {
-                if ("month".equals(faultRecordStatistics.getType())) {
-                    for (int month = 0; month <= 11; month++) {
-                        Date start = null;
-                        Date end = null;
-                        start = new Date(year - 1900, month, 1);
-                        if (month == 0 || month == 2 || month == 4 || month == 6 || month == 7 || month == 9 || month == 11) {
-                            end = new Date(year - 1900, month, 31, 23, 59, 59);
-                        }
-                        if (month == 1) {
-                            end = new Date(year - 1900, month, 28, 23, 59, 59);
-                        }else {
-                            end = new Date(year - 1900, month, 30, 23, 59, 59);
-                        }
-                        params.put("startTime", start);
-                        params.put("endTime", end);
-
-                        Integer count = faultRecordDao.statistics(params);
-                        res.put(year + "." + (month + 1), count);
-                    }
-                }
-                if ("quarter".equals(faultRecordStatistics.getType())){
-                    for (int i = 1;i<=4;i++){
-                        Date start = new Date(year - 1900, 3*(i-1), 1);
-                        Date end = null;
-                        if (i == 1||i==4){
-                            end = new Date(year-1900,3*i-1,31,23,59,59);
-                        }else {
-                            end = new Date(year-1900,3*i-1,30,23,59,59);
-                        }
-                        params.put("startTime", start);
-                        params.put("endTime", end);
-                        Integer count = faultRecordDao.statistics(params);
-                        res.put(year + "." + i, count);
-                    }
-                }
-                if ("year".equals(faultRecordStatistics.getType())){
-                    Date start = new Date(year - 1900, 0, 1);
-                    Date end = new Date(year - 1900, 11, 31,23,59,59);
-                    params.put("startTime", start);
-                    params.put("endTime", end);
-                    Integer count = faultRecordDao.statistics(params);
-                    res.put(year+"", count);
-                }
-            }
-            result.put(m.get("device_name"), res);
-        }
-
-        return result;
-    }
-
-    public Result<List<FaultRecordEntity>> faultFind(FaultFind faultFind) {
-        List<FaultRecordEntity> list = faultRecordDao.faultFind(faultFind);
-        return Result.success(list);
-    }
-
-    public Result<List<FaultRecordEntity>> faultSta(FaultFind faultFind) {
-        List<FaultRecordEntity> list = faultRecordDao.faultsta(faultFind);
-        return Result.success(list);
-    }
-
-    public List<FaultRecordEntity> faultSta1(Date startTime, Date endTime, String name) {
-        return faultRecordDao.faultsta1(startTime,endTime,name);
-    }
-
-    public List<StatisticEntity> systemSta(Date startTime, Date endTime) {
-        return faultRecordDao.staBySystem(startTime,endTime);
-    }
-
-    public Boolean getExcelContext(MultipartFile file){
-        Workbook wb = ExcelUtils.readExcel(file);
-        Sheet sheet = ExcelUtils.getSheet(wb, "sheet1");
-        Map<String, Integer> heads = ExcelUtils.getHeads(sheet);
-
-        List<FaultRecordEntity> list = new ArrayList<>();
-        for(int i = 1; i<= sheet.getLastRowNum(); i++) {
-            System.out.println("current import record row: " + i+1);
-            boolean flag1 = false;
-            boolean flag2 = false;
-            FaultRecordEntity fault = new FaultRecordEntity();
-            fault.setFault_time(ExcelUtils.getDateValue(sheet,i,heads.get("发现日期")));
-            fault.setAircraft_type(ExcelUtils.getCeilValue(sheet,i,heads.get("机型")));
-            if (fault.getAircraft_type().isEmpty() || fault.getAircraft_type() == null)
-                flag1 = true;
-            if (ExcelUtils.getCeilValue(sheet,i,heads.get("机型")) != null) {
-                AircraftEntity aircraft = new AircraftEntity();
-                aircraft.setAircraft_type(ExcelUtils.getCeilValue(sheet,i,heads.get("机型")));
-                SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
-                aircraft.setInput_time(date.format(new Date()));
-                aircraftDao.addNotExist(aircraft);
-            }
-            if ( fault.getAircraft_no() == null || fault.getAircraft_no().isEmpty())
-                flag2 = true;
-            if (flag1 & flag2) continue;
-            fault.setAircraft_no(ExcelUtils.getCeilValue(sheet,i,heads.get("飞机号")));
-            fault.setProduct_no(ExcelUtils.getCeilValue(sheet,i,heads.get("出厂号")));
-            fault.setMajor(ExcelUtils.getCeilValue(sheet,i,heads.get("专业")));
-            fault.setFaultparts_system(ExcelUtils.getCeilValue(sheet,i,heads.get("故障件所属系统")));
-            fault.setDevice_name(ExcelUtils.getCeilValue(sheet,i,heads.get("故障件名称")));
-            fault.setDevice_type(ExcelUtils.getCeilValue(sheet,i,heads.get("故障件型别")));
-            fault.setInfo_sources(ExcelUtils.getCeilValue(sheet,i,heads.get("故障信息来源")));
-            fault.setFault_content(ExcelUtils.getCeilValue(sheet,i,heads.get("故障描述")));
-            fault.setFault_reason(ExcelUtils.getCeilValue(sheet,i,heads.get("故障原因")));
-            fault.setDiscover_opportunity(ExcelUtils.getCeilValue(sheet,i,heads.get("发现时机")));
-            fault.setDiagnosis_method(ExcelUtils.getCeilValue(sheet,i,heads.get("故障判断方法")));
-            fault.setRepair_method(ExcelUtils.getCeilValue(sheet,i,heads.get("排除方法")));
-            fault.setWar_zone(ExcelUtils.getCeilValue(sheet,i,heads.get("战区")));
-            fault.setArmy(ExcelUtils.getCeilValue(sheet,i,heads.get("军")));
-            fault.setDivision(ExcelUtils.getCeilValue(sheet,i,heads.get("师")));
-            fault.setBrigade(ExcelUtils.getCeilValue(sheet,i,heads.get("团")));
-            String tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("起落"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setUp_down(Integer.parseInt(ExcelUtils.getCeilValue(sheet,i,heads.get("起落"))));
-            }
-            fault.setDiscoverer(ExcelUtils.getCeilValue(sheet,i,heads.get("发现人")));
-            fault.setIs_falsealarm(ExcelUtils.getCeilValue(sheet,i,heads.get("是否虚警")));
-            fault.setFault_degree(ExcelUtils.getCeilValue(sheet,i,heads.get("故障性质")));
-            fault.setFault_consequence(ExcelUtils.getCeilValue(sheet,i,heads.get("故障后果")));
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("误飞次数"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setMissflight_times(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("误飞次数"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("影响次数"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setImpact_times(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("影响次数"))));
-            }
-            fault.setDevice_productor(ExcelUtils.getCeilValue(sheet,i,heads.get("故障件制造厂")));
-            fault.setDevice_no(ExcelUtils.getCeilValue(sheet,i,heads.get("故障件号码")));
-            fault.setFault_liability(ExcelUtils.getCeilValue(sheet,i,heads.get("故障责任")));
-            fault.setFault_location(ExcelUtils.getCeilValue(sheet,i,heads.get("故障发生地点")));
-            fault.setReviewer(ExcelUtils.getCeilValue(sheet,i,heads.get("审核人")));
-            fault.setReview_time(ExcelUtils.getDateValue(sheet,i,heads.get("审核时间")));
-            fault.setRepair_time(ExcelUtils.getDateValue(sheet,i,heads.get("排除时间")));
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("排故工时"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setRepair_hours(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("排故工时"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("排故人数"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setRepair_peoplenum(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("排故人数"))));
-            }
-            fault.setRepaired_time(ExcelUtils.getDateValue(sheet,i,heads.get("排故时间")));
-            fault.setClassification(ExcelUtils.getCeilValue(sheet,i,heads.get("分类")));
-            fault.setIs_grounded(ExcelUtils.getCeilValue(sheet,i,heads.get("是否停飞")));
-            fault.setReporting_department(ExcelUtils.getCeilValue(sheet,i,heads.get("报告部门")));
-            fault.setReplace_device(ExcelUtils.getCeilValue(sheet,i,heads.get("故换件名称")));
-            fault.setReplace_type(ExcelUtils.getCeilValue(sheet,i,heads.get("故换件型别")));
-            fault.setDiagnosis_people(ExcelUtils.getCeilValue(sheet,i,heads.get("故障判明人")));
-            fault.setFaultparts_date(ExcelUtils.getDateValue(sheet,i,heads.get("故障件装机日期")));
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("故障件总工作时次"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setFaultparts_hours(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("故障件总工作时次"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("故障件装本机工作次"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setFaultparts_worktimes(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("故障件装本机工作次"))));
-            }
-            fault.setFaultparts_renovation_manu(ExcelUtils.getCeilValue(sheet,i,heads.get("故障件翻修厂")));
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("故障件修后时次"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setFaultparts_renovation_hours(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("故障件修后时次"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("故障件翻修次数"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setFaultparts_renovation_times(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("故障件翻修次数"))));
-            }
-            fault.setRepair_person(ExcelUtils.getCeilValue(sheet,i,heads.get("排故人")));
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("故换件总工作时次"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setReplace_device_hours(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("故换件总工作时次"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("故换件翻修次数"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setReplace_device_repairtimes(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("故换件翻修次数"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("故换件修后时次"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setReplace_device_repairhours(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("故换件修后时次"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("排故领件次数"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setReplace_device_applytimes(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("排故领件次数"))));
-            }
-            fault.setReplace_device_manufacturer(ExcelUtils.getCeilValue(sheet,i,heads.get("故换件翻修厂")));
-            fault.setIs_history(ExcelUtils.getCeilValue(sheet,i,heads.get("是否历史")));
-            fault.setInspector(ExcelUtils.getCeilValue(sheet,i,heads.get("检查人")));
-            fault.setHandling_opinions(ExcelUtils.getCeilValue(sheet,i,heads.get("处理意见")));
-            fault.setHmc(ExcelUtils.getCeilValue(sheet,i,heads.get("HMC代码")));
-            fault.setMfl(ExcelUtils.getCeilValue(sheet,i,heads.get("MFL")));
-            fault.setPfl(ExcelUtils.getCeilValue(sheet,i,heads.get("PFL")));
-            fault.setGmp(ExcelUtils.getCeilValue(sheet,i,heads.get("GMP")));
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("是否偶发"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setIs_almost(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("是否偶发"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("是否严重故障"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setIs_error(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("是否严重故障"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("是否未定位"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setIs_undefined(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("是否未定位"))));
-            }
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("是否解决"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setIs_done(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("是否解决"))));
-            }
-            fault.setRemark(ExcelUtils.getCeilValue(sheet,i,heads.get("备注")));
-            tmp = ExcelUtils.getCeilValue(sheet,i,heads.get("隐藏"));
-            if (tmp != null && !tmp.isEmpty()) {
-                fault.setIs_hide(Integer.parseInt(ExcelUtils.getCeilValue(sheet, i, heads.get("隐藏"))));
-            }
-            list.add(fault);
-        }
-        faultRecordDao.addBatch(list);
-        return true;
-    }
-    public static final String SEARCHTYPE[] = {"aircraft_type","faultparts_system","major"};
-
-    public void setLogicString(int nType ,Example.Criteria criteria,int nKey,String v)
-    {
-        switch (nType){
-            case 0:criteria.andLike(SEARCHTYPE[nKey],v);break;
-            case 1:criteria.orLike(SEARCHTYPE[nKey],v);break;
-            case 2:criteria.andNotLike(SEARCHTYPE[nKey],v);break;
-            default:
-                break;
-        }
-    }
-
-    public List<FaultRecordEntity> advanceSearch(LogicSearchEntity logicSearchEntity) {
-        Example example = new Example(FaultRecordEntity.class);
-        Example.Criteria criteria = example.createCriteria();
-        criteria.andLike("device_name","%"+logicSearchEntity.getMasterKey()+"%");
-        if (logicSearchEntity.getFirstLogic() != -1)
-        {
-            setLogicString(logicSearchEntity.getFirstLogic(),criteria,logicSearchEntity.getFirstType(),logicSearchEntity.getFirstKey());
-            if (logicSearchEntity.getSecondLogic() != -1)
-            {
-              setLogicString(logicSearchEntity.getSecondLogic(),criteria,logicSearchEntity.getSearchType(),logicSearchEntity.getSecondKey());
-              if (logicSearchEntity.getThirdLogic() != -1)
-                  setLogicString(logicSearchEntity.getThirdLogic(),criteria,logicSearchEntity.getThirdType(),logicSearchEntity.getThirdKey());
-            }
-        }
-        return faultRecordDao.selectByExample(example);
-    }
-
-    public String changeDone(int id, int isDone){
-        if (id <= 0)
-            return "故障缺陷不存在!";
-        FaultRecordEntity faultRecordEntity = faultRecordDao.selectByPrimaryKey(id);
-        if (faultRecordEntity == null)
-        {
-            return   "故障缺陷不存在!";
-        }
-        faultRecordEntity.setIs_done(isDone);
-        int n =  faultRecordDao.updateByPrimaryKeySelective(faultRecordEntity);
-        if (n >0)
-            return "处理成功!";
-        else
-            return "处理失败";
-    }
-
-    public Result<Map<String, Object>> getByHmc(String keyword,String type){
-        Map<String, Object> map = new HashMap<>();
-        if (type == null || "".equals(type) || "all".equals(type)){
-            map.put("repairManual", repairManualService.findByHmc(keyword));
-            map.put("faultRecord", findByHmc(keyword));
-        }else if("faultRecord".equals(type)){
-            map.put("faultRecord", findByHmc(keyword));
-        }else if("repairManual".equals(type)){
-            map.put("repairManual", repairManualService.findByHmc(keyword));
-        }
-        return Result.success(map);
-    }
-
-    public Result<List<FaultRecordEntity>> findByHmc(String name) {
-        if (name == null || "".equals(name)) {
-            return Result.result(false, "名称不能为空!", null);
-        }
-        List<FaultRecordEntity> list = faultRecordDao.findByHmc("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public Result<Map<String, Object>> getByMfl(String keyword,String type){
-        Map<String, Object> map = new HashMap<>();
-        if (type == null || "".equals(type) || "all".equals(type)){
-            map.put("repairManual", repairManualService.findByMfl(keyword));
-            map.put("faultRecord", findByMfl(keyword));
-        }else if("faultRecord".equals(type)){
-            map.put("faultRecord", findByMfl(keyword));
-        }else if("repairManual".equals(type)){
-            map.put("repairManual", repairManualService.findByMfl(keyword));
-        }
-        return Result.success(map);
-    }
-
-    public Result<List<FaultRecordEntity>> findByMfl(String name) {
-        if (name == null || "".equals(name)) {
-            return Result.result(false, "名称不能为空!", null);
-        }
-        List<FaultRecordEntity> list = faultRecordDao.findByMfl("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public Result<Map<String, Object>> getByPfl(String keyword,String type){
-        Map<String, Object> map = new HashMap<>();
-        if (type == null || "".equals(type) || "all".equals(type)){
-            map.put("repairManual", repairManualService.findByPfl(keyword));
-            map.put("faultRecord", findByPfl(keyword));
-        }else if("faultRecord".equals(type)){
-            map.put("faultRecord", findByPfl(keyword));
-        }else if("repairManual".equals(type)){
-            map.put("repairManual", repairManualService.findByPfl(keyword));
-        }
-        return Result.success(map);
-    }
-
-    public Result<List<FaultRecordEntity>> findByPfl(String name) {
-        if (name == null || "".equals(name)) {
-            return Result.result(false, "名称不能为空!", null);
-        }
-        List<FaultRecordEntity> list = faultRecordDao.findByPfl("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public Result<Map<String, Object>> getByGmp(String keyword,String type){
-        Map<String, Object> map = new HashMap<>();
-        if (type == null || "".equals(type) || "all".equals(type)){
-            map.put("repairManual", repairManualService.findByGmp(keyword));
-            map.put("faultRecord", findByGmp(keyword));
-        }else if("faultRecord".equals(type)){
-            map.put("faultRecord", findByGmp(keyword));
-        }else if("repairManual".equals(type)){
-            map.put("repairManual", repairManualService.findByGmp(keyword));
-        }
-        return Result.success(map);
-    }
-
-    public Result<List<FaultRecordEntity>> findByGmp(String name) {
-        if (name == null || "".equals(name)) {
-            return Result.result(false, "名称不能为空!", null);
-        }
-        List<FaultRecordEntity> list = faultRecordDao.findByGmp("%" + name + "%");
-        return Result.success(list);
-    }
-
-    public List<StatisticEntity> getAirNo(String air_type){
-        return faultRecordDao.getAirNo(air_type);
-    }
-
-    public List<StatisticEntity> getMajor(String air_type){
-        return faultRecordDao.getMajor(air_type);
-    }
-
-    public List<StatisticEntity> getSystem(String major){
-        return faultRecordDao.getSystem(major);
-    }
-
-    public List<StatisticEntity> getDepartment(String parent,int level){
-        List<StatisticEntity> lst =  new ArrayList<>();
-        switch (level){
-            case 0:lst = faultRecordDao.getD1();break;
-            case 1:lst = faultRecordDao.getD2(parent);break;
-            case 2:lst = faultRecordDao.getD3(parent);break;
-            case 3:lst = faultRecordDao.getD4(parent);break;
-        }
-       return lst ;
-    }
-
-    public List<FaultRecordEntity> singleSta(SingleStaEntity singleStaEntity){
-
-        return faultRecordDao.singleSta(singleStaEntity.getAirType(),singleStaEntity.getAirNo(),singleStaEntity.getStartTime(),singleStaEntity.getEndTme());
-    }
-
-    public List<StatisticEntity> singleStaAll(SingleStaEntity singleStaEntity){
-
-        return faultRecordDao.singleStaAll(singleStaEntity.getAirType(),singleStaEntity.getStartTime(),singleStaEntity.getEndTme());
-    }
-
-    public List<FaultRecordEntity> majorSta(SingleStaEntity singleStaEntity){
-
-        return faultRecordDao.majorSta(singleStaEntity.getAirType(),singleStaEntity.getMajor(),
-                singleStaEntity.getStartTime(),singleStaEntity.getEndTme());
-    }
-
-    public List<StatisticEntity> majorStaAll(SingleStaEntity singleStaEntity){
-
-        return faultRecordDao.majorStaAll(singleStaEntity.getAirType(),singleStaEntity.getStartTime(),singleStaEntity.getEndTme());
-    }
-
-    public List<StatisticEntity> getAirType(){
-        return faultRecordDao.getAirType();
-    }
-
-}

+ 8 - 11
src/main/resources/mapping/AircraftDao.xml

@@ -4,27 +4,24 @@
 <mapper namespace="com.zglc.kg.dao.AircraftDao">
 
     <!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.AircraftEntity" id="userMap">
+    <resultMap type="com.zglc.kg.entity.AircraftEntity" id="aircraftMap">
         <result property="id" column="id"/>
         <result property="aircraft_type" column="aircraft_type"/>
-        <result property="aircraft_descripte" column="aircraft_descripte"/>
-        <result property="ending_time" column="ending_time"/>
-        <result property="input_time" column="input_time"/>
-        <result property="file_path" column="file_path"/>
+        <result property="aircraft_describe" column="aircraft_describe"/>
     </resultMap>
 
     <insert id="addNotExist" parameterType="com.zglc.kg.entity.AircraftEntity">
-        INSERT INTO t_aircraft (aircraft_type, aircraft_descripte, ending_time, input_time, file_path)
-        SELECT #{aircraft_type},#{aircraft_descripte},#{ending_time},#{input_time},#{file_path}
+        INSERT INTO t_aircraft (aircraft_type,aircraft_describe)
+        SELECT #{aircraft_type},#{aircraft_describe}
         FROM DUAL WHERE NOT EXISTS (SELECT id FROM t_aircraft WHERE t_aircraft.aircraft_type = #{aircraft_type})
     </insert>
 
-    <select id="findByName" parameterType="String" resultMap="userMap">
-        select  id, aircraft_type, aircraft_descripte, ending_time, input_time, file_path from t_aircraft
+    <select id="findByName" parameterType="String" resultMap="aircraftMap">
+        select  * from t_aircraft
         where aircraft_type like #{name}
     </select>
-    <select id="listAll" resultMap="userMap">
-        select  id, aircraft_type, aircraft_descripte, ending_time, input_time, file_path from t_aircraft
+    <select id="listAll" resultMap="aircraftMap">
+        select  * from t_aircraft
     </select>
 
     <select id="findMinId" resultType="Integer">

+ 0 - 83
src/main/resources/mapping/ArticleDao.xml

@@ -1,83 +0,0 @@
-<?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.zglc.kg.dao.ArticleDao">
-
-    <!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.ArticleEntity" id="article">
-        <result property="id" column="id"/>
-        <result property="title" column="title"/>
-        <result property="author" column="author"/>
-        <result property="input_time" column="input_time"/>
-        <result property="keywords" column="keywords"/>
-        <result property="aircraft" column="aircraft"/>
-        <result property="aircraft_system" column="aircraft_system"/>
-        <result property="article_number" column="article_number"/>
-        <result property="major_name" column="major_name"/>
-        <result property="article_type" column="article_type"/>
-        <result property="file_path" column="file_path"/>
-        <result property="hmc" column="hmc"/>
-        <result property="mfl" column="mfl"/>
-        <result property="pfl" column="pfl"/>
-        <result property="gmp" column="gmp"/>
-    </resultMap>
-
-    <select id="find" parameterType="com.zglc.kg.entity.ArticleFind" resultMap="article">
-        select * from t_article where 1=1
-        <if test="userName != null">
-            and author like (CONCAT(CONCAT('%',#{userName}),'%'))
-        </if>
-        <if test="keyword != null">
-            and keywords like (CONCAT(CONCAT('%',#{keyword}),'%'))
-        </if>
-<!--        <if test="startTime != null">-->
-<!--            and input_time <![CDATA[>=]]> #{startTime}-->
-<!--        </if>-->
-<!--        <if test="endTime != null">-->
-<!--            and input_time <![CDATA[<=]]> {endTime}-->
-<!--        </if>-->
-    </select>
-
-    <select id="find1" parameterType="com.zglc.kg.entity.ArticleFind" resultMap="article">
-        select * from t_article where 1=1
-        <if test="userName != null">
-            and author like (CONCAT(CONCAT('%',#{userName}),'%'))
-        </if>
-        <if test="keyword != null">
-            and title like (CONCAT(CONCAT('%',#{keyword}),'%'))
-        </if>
-
-    </select>
-
-    <select id="findByName" parameterType="String" resultMap="article">
-        select * from t_article where title like #{name}
-    </select>
-
-    <select id="refindByName" parameterType="String" resultMap="article">
-        select * from (select * from t_article where title like #{name1} ) as a where title like #{name2}
-    </select>
-
-    <select id="multFind" parameterType="com.zglc.kg.entity.ArticleFind" resultMap="article">
-        select * from (select * from t_article where )
-        <if test="userName != null">
-            and author like (CONCAT(CONCAT('%',#{userName}),'%'))
-        </if>
-        <if test="keyword != null">
-            and keywords like (CONCAT(CONCAT('%',#{keyword}),'%'))
-        </if>
-
-    </select>
-
-    <insert id="add" parameterType="com.zglc.kg.entity.ArticleEntity">
-        insert into t_article (title,author,input_time,keywords,aircraft,aircraft_system,article_number,major_name,article_type,file_path,hmc,mfl,pfl,gmp) values
-        (#{title},#{author},#{input_time},#{keywords},#{aircraft},#{aircraft_system},#{article_number},#{major_name},#{article_type},#{file_path},#{item.hmc},#{item.mfl},#{item.pfl},#{item.gmp})
-    </insert>
-
-    <insert id="addBatch" parameterType="java.util.ArrayList">
-        insert into t_article(title,author,input_time,keywords,aircraft,aircraft_system,article_number,major_name,article_type,file_path,hmc,mfl,pfl,gmp) values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.title},#{item.author},#{item.input_time},#{item.keywords},#{item.aircraft},#{item.aircraft_system},#{item.article_number},#{item.major_name},#{item.article_type},#{item.file_path},#{item.hmc},#{item.mfl},#{item.pfl},#{item.gmp})
-        </foreach>
-    </insert>
-
-</mapper>

+ 0 - 41
src/main/resources/mapping/EquipmentDao.xml

@@ -1,41 +0,0 @@
-<?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.zglc.kg.dao.EquipmentDao">
-
-	<!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.EquipmentEntity" id="userMap">
-        <result property="id" column="id"/>
-        <result property="equipment_name" column="equipment_name"/>
-        <result property="equipment_type" column="equipment_type"/>
-        <result property="equipment_time" column="equipment_time"/>
-        <result property="retirement_time" column="retirement_time"/>
-        <result property="mark" column="mark"/>
-    </resultMap>
-
-    <select id="listAll" resultMap="userMap">
-        select id,equipment_name,equipment_type,equipment_time,retirement_time,mark
-        from t_equipment
-        where id > 1
-    </select>
-
-    <select id="getCount" resultType="java.lang.Integer">
-        select count(1)
-        from t_equipment
-        where id > 1
-    </select>
-
-    <insert id="batchAdd" parameterType="java.util.List">
-        <foreach collection="list" item="equ" separator=";">
-            insert into t_equipment (equipment_type)
-            SELECT #{equ.equipment_type}
-            FROM DUAL WHERE NOT EXISTS (SELECT equipment_type FROM  t_equipment WHERE equipment_type = #{equ.equipment_type})
-        </foreach>
-    </insert>
-
-    <select id="findByName" parameterType="String" resultMap="userMap">
-        select id,equipment_name,equipment_type, equipment_time, retirement_time,mark from t_equipment where equipment_type
-        like #{name}
-    </select>
-
-</mapper>

+ 0 - 247
src/main/resources/mapping/FaultRecordDao.xml

@@ -1,247 +0,0 @@
-<?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.zglc.kg.dao.FaultRecordDao">
-
-	<!-- 可根据自己的需求,是否要使用 -->
-    <resultMap type="com.zglc.kg.entity.FaultRecordEntity" id="userMap">
-        <result property="id" column="id"/>
-        <result property="equipment_id" column="equipment_id"/>
-        <result property="equipment_name" column="equipment_name"/>
-        <result property="device_id" column="device_id"/>
-        <result property="device_name" column="device_name"/>
-        <result property="fault_content" column="fault_content"/>
-        <result property="repair_method" column="repair_method"/>
-        <result property="fault_time" column="fault_time"/>
-        <result property="repaired_time" column="repaired_time"/>
-        <result property="fault_status" column="fault_status"/>
-        <result property="major" column="major"/>
-        <result property="faultparts_system" column="faultparts_system"/>
-        <result property="is_error" column="is_error"/>
-        <result property="discover_opportunity" column="discover_opportunity"/>
-        <result property="mark" column="mark"/>
-    </resultMap>
-
-    <resultMap type="com.zglc.kg.entity.StatisticEntity" id="staMap">
-        <result property="parentName" column="parentName"/>
-        <result property="recordCount" column="recordCount"/>
-    </resultMap>
-
-    <select id="listAll" resultMap="userMap">
-        select *
-        from t_faultrecord
-        where id > 1
-    </select>
-
-    <select id="getCount" resultType="java.lang.Integer">
-        select count(1)
-        from t_faultrecord
-        where id > 1
-    </select>
-
-    <select id="findByName" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  device_name like #{name}
-    </select>
-
-    <select id="refindByName" parameterType="String" resultMap="userMap">
-        select * from (select * from t_faultrecord where device_name like #{name1} ) as a where device_name like #{name2}
-    </select>
-
-    <select id="statistics" parameterType="java.util.Map" resultType="Integer">
-        select count(1) from t_faultrecord where device_id = #{device}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="staByAirType" parameterType="java.util.Map" resultMap="staMap">
-        select aircraft_type as parentName,count(id)  as recordCount from t_faultrecord
-        where
-            fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            group by aircraft_type
-    </select>
-
-    <select id="staByDevice" parameterType="java.util.Map" resultMap="staMap">
-        select device_name as parentName,count(id) as recordCount from t_faultrecord
-        where aircraft_type = #{aircraftType}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            group by device_name
-    </select>
-
-    <select id="sortByDevice" parameterType="java.util.Map" resultMap="userMap">
-        select * from t_faultrecord
-        where aircraft_type = #{aircraftType}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            order by fault_time,fault_time desc
-    </select>
-
-<!--    <select id="faultsta" parameterType="java.util.Map" resultType="Integer">-->
-    <select id="faultsta" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select * from t_faultrecord where device_name = #{device_name}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="faultsta1" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select * where device_name = #{device_name}
-            and fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="faultFind" parameterType="com.zglc.kg.entity.FaultFind" resultMap="userMap">
-        select  * from t_faultrecord where 1=1
-<!--        <if test="aircraft != null">-->
-<!--            and device_id in (select id from t_device where aircraft_type = #{aircraft})-->
-<!--        </if>-->
-<!--        <if test="firstDevice != null">-->
-<!--            and device_id in (select id from t_device where parent = #{firstDevice})-->
-<!--        </if>-->
-<!--        <if test="secondDevice !=null">-->
-<!--            and device_id = #{secondDevice}-->
-<!--        </if>-->
-        <if test="startTime != null">
-            and fault_time <![CDATA[>=]]> #{startTime}
-        </if>
-        <if test="endTime != null">
-            and fault_time <![CDATA[<=]]> {endTime}
-        </if>
-        <if test="device_name != null">
-            and device_name like (CONCAT(CONCAT('%',#{device_name}),'%'))
-        </if>
-    </select>
-
-    <select id="findAllDevice" parameterType="Integer" resultType="java.util.Map">
-        SELECT DISTINCT(id), device_type as 'device_name' FROM t_device where aircraft_id = #{deviceId}
-    </select>
-
-    <insert id="addBatch" parameterType="java.util.ArrayList">
-        insert into t_faultrecord (fault_time,aircraft_type,aircraft_no,product_no,major,faultparts_system,device_name,device_type, info_sources,
-        fault_content,fault_reason,discover_opportunity,diagnosis_method,war_zone,army,division,brigade,up_down,
-        discoverer,is_falsealarm,fault_degree,fault_consequence,missflight_times,impact_times,device_productor,device_no,
-        fault_liability,fault_location,reviewer,review_time,repair_time,repair_hours,repair_peoplenum,repaired_time,classification,is_grounded,reporting_department,
-        replace_device,replace_type,diagnosis_people,faultparts_date,faultparts_hours,faultparts_worktimes,faultparts_renovation_manu,
-        faultparts_renovation_hours,faultparts_renovation_times,repair_method,repair_person,replace_device_hours,replace_device_repairhours,replace_device_repairtimes,replace_device_applytimes,replace_device_manufacturer,
-        is_history,inspector,handling_opinions,hmc,mfl,pfl,gmp,is_almost,is_error,is_undefined,is_done,remark,is_hide) values
-        <foreach collection="list" item="item" separator=",">
-            (#{item.fault_time},#{item.aircraft_type},#{item.aircraft_no},#{item.product_no},#{item.major},#{item.faultparts_system}, #{item.device_name},#{item.device_type},#{item.info_sources},
-            #{item.fault_content},#{item.fault_reason},#{item.discover_opportunity},#{item.diagnosis_method},#{item.war_zone},#{item.army},#{item.division},#{item.brigade},#{item.up_down},
-            #{item.discoverer},#{item.is_falsealarm},#{item.fault_degree},#{item.fault_consequence},#{item.missflight_times},#{item.impact_times},#{item.device_productor},#{item.device_no},
-            #{item.fault_liability},#{item.fault_location},#{item.reviewer},#{item.review_time},#{item.repair_time},#{item.repair_hours},#{item.repair_peoplenum},#{item.repaired_time},#{item.classification},#{item.is_grounded},#{item.reporting_department},
-            #{item.replace_device},#{item.replace_type},#{item.diagnosis_people},#{item.faultparts_date},#{item.faultparts_hours},#{item.faultparts_worktimes},#{item.faultparts_renovation_manu},
-            #{item.faultparts_renovation_hours},#{item.faultparts_renovation_times},#{item.repair_method},#{item.repair_person},#{item.replace_device_hours},#{item.replace_device_repairhours},#{item.replace_device_repairtimes},#{item.replace_device_applytimes},#{item.replace_device_manufacturer},
-            #{item.is_history},#{item.inspector},#{item.handling_opinions},#{item.hmc},#{item.mfl},#{item.pfl},#{item.gmp},#{item.is_almost},#{item.is_error},#{item.is_undefined},#{item.is_done},#{item.remark},#{item.is_hide})
-        </foreach>
-    </insert>
-
-    <select id="staBySystem" parameterType="java.util.ArrayList" resultMap="staMap">
-        select faultparts_system as parentName,count(id)  as recordCount from t_faultrecord
-        where
-            fault_time <![CDATA[>=]]> #{startTime}
-            and fault_time <![CDATA[<=]]> #{endTime}
-            group by faultparts_system
-    </select>
-
-    <select id="findByHmc" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  hmc like #{name}
-    </select>
-
-    <select id="findByMfl" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  mfl like #{name}
-    </select>
-
-    <select id="findByPfl" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  pfl like #{name}
-    </select>
-
-    <select id="findByGmp" parameterType="String" resultMap="userMap">
-            select *  from t_faultrecord where  gmp like #{name}
-    </select>
-
-    <select id="singleSta" parameterType="java.util.ArrayList" resultMap="userMap">
-            select device_name,faultparts_system,is_error,major,discover_opportunity from t_faultrecord
-            where aircraft_type = #{aircraft_type}
-                <if test="airNo != '-1'">
-                    and aircraft_no = #{airNo}
-                </if>
-                and fault_time <![CDATA[>=]]> #{startTime}
-                and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="singleStaAll" parameterType="java.util.ArrayList" resultMap="staMap">
-        select aircraft_no as parentName,count(id)  as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        and fault_time <![CDATA[>=]]> #{startTime}
-        and fault_time <![CDATA[<=]]> #{endTime}
-        group by aircraft_no
-    </select>
-
-    <select id="getD1" resultMap="staMap">
-        select war_zone as parentName,count(id)  as recordCount from t_faultrecord
-        group by war_zone
-    </select>
-
-    <select id="getD2" parameterType="String" resultMap="staMap">
-        select army as parentName,count(id)  as recordCount from t_faultrecord
-        where war_zone = #{war_zone}
-        group by army
-    </select>
-
-    <select id="getD3" parameterType="String" resultMap="staMap">
-        select dimision as parentName,count(id)  as recordCount from t_faultrecord
-        where army = #{army}
-        group by dimision
-    </select>
-
-    <select id="getD4" parameterType="String" resultMap="staMap">
-        select brigade as parentName,count(id)  as recordCount from t_faultrecord
-        where dimision = #{dimision}
-        group by brigade
-    </select>
-
-    <select id="getAirNo" parameterType="String" resultMap="staMap">
-        select aircraft_no as parentName,count(id)  as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        group by aircraft_no
-    </select>
-
-    <select id="getAirType"  resultMap="staMap">
-        select aircraft_type as parentName,count(id)  as recordCount from t_faultrecord
-        group by aircraft_type
-    </select>
-
-    <select id="getSystem" parameterType="String" resultMap="staMap">
-        select faultparts_system as parentName,count(id)  as recordCount from t_faultrecord
-        where major = #{major}
-        group by faultparts_system
-    </select>
-
-    <select id="getMajor" parameterType="String" resultMap="staMap">
-        select major as parentName,count(id)  as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        group by major
-    </select>
-
-    <select id="getDevice" parameterType="String" resultMap="staMap">
-        select device_name as parentName,count(id)  as recordCount from t_faultrecord
-        where faultparts_system = #{faultparts_system}
-        group by major
-    </select>
-
-    <select id="majorSta" parameterType="java.util.ArrayList" resultMap="userMap">
-        select faultparts_system,device_name,is_error,discover_opportunity from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        and major = #{major}
-        and fault_time <![CDATA[>=]]> #{startTime}
-        and fault_time <![CDATA[<=]]> #{endTime}
-    </select>
-
-    <select id="majorStaAll" parameterType="java.util.ArrayList" resultMap="staMap">
-        select major as parentName,count(id) as recordCount from t_faultrecord
-        where aircraft_type = #{aircraft_type}
-        and fault_time <![CDATA[>=]]> #{startTime}
-        and fault_time <![CDATA[<=]]> #{endTime}
-        group by major
-    </select>
-</mapper>