浏览代码

【CHG】更新送检记录查询接口

ZhaoMn 3 年之前
父节点
当前提交
aa2cc9ced6
共有 14 个文件被更改,包括 272 次插入322 次删除
  1. 35 41
      railway-admin/src/main/java/com/railway/web/controller/business/safetool/SecExperimentController.java
  2. 0 2
      railway-admin/src/main/java/com/railway/web/controller/business/safetool/SecScheduledController.java
  3. 1 1
      railway-business/src/main/java/com/railway/business/safetool/domain/SecExperiment.java
  4. 57 0
      railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecExpInfoVo.java
  5. 2 5
      railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecExpToolsVo.java
  6. 0 30
      railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecScheduledDetailCountVo.java
  7. 0 29
      railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecScheduledDetailVo.java
  8. 0 58
      railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecScheduledToolDetailVo.java
  9. 6 5
      railway-business/src/main/java/com/railway/business/safetool/mapper/SecExperimentMapper.java
  10. 0 7
      railway-business/src/main/java/com/railway/business/safetool/mapper/SecScheduledMapper.java
  11. 8 4
      railway-business/src/main/java/com/railway/business/safetool/service/ISecExperimentService.java
  12. 91 89
      railway-business/src/main/java/com/railway/business/safetool/service/impl/SecExperimentServiceImpl.java
  13. 72 27
      railway-business/src/main/resources/mapper/safetool/SecExperimentMapper.xml
  14. 0 24
      railway-business/src/main/resources/mapper/safetool/SecScheduledMapper.xml

+ 35 - 41
railway-admin/src/main/java/com/railway/web/controller/business/safetool/SecExperimentController.java

@@ -2,8 +2,8 @@ package com.railway.web.controller.business.safetool;
 
 
 import com.railway.business.safetool.domain.vo.SecExpAddParmVo;
-import com.railway.business.safetool.domain.vo.SecExpDetailVo;
 import com.railway.business.safetool.domain.vo.SecExpEndParmVo;
+import com.railway.business.safetool.domain.vo.SecExpInfoVo;
 import com.railway.business.safetool.domain.vo.SecExpListParmVo;
 import com.railway.business.safetool.domain.vo.SecExpListVo;
 import com.railway.business.safetool.domain.vo.SecExpNQParmVo;
@@ -32,52 +32,46 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping(value = "business/safetool/sec/experiment")
 public class SecExperimentController extends BaseController {
 
-    private final ISecExperimentService secExperimentService;
+  private final ISecExperimentService secExperimentService;
 
-    public SecExperimentController(ISecExperimentService secExperimentService) {
-        this.secExperimentService = secExperimentService;
-    }
+  public SecExperimentController(ISecExperimentService secExperimentService) {
+    this.secExperimentService = secExperimentService;
+  }
 
-    @ApiOperation(value = "新增")
-    @PostMapping("/add")
-    public AjaxResult add(@Validated @RequestBody SecExpAddParmVo secExpAddParmVo) {
-        return toAjax(secExperimentService.create(secExpAddParmVo));
-    }
+  @ApiOperation(value = "新增")
+  @PostMapping("/add")
+  public AjaxResult add(@Validated @RequestBody SecExpAddParmVo secExpAddParmVo) {
+    return toAjax(secExperimentService.create(secExpAddParmVo));
+  }
 
-//    @ApiOperation(value = "删除")
-//    @DeleteMapping("/{ids}")
-//    public AjaxResult delete(@RequestParam String[] ids) {
-//        return toAjax(secExperimentService.delete(ids));
-//    }
+  @ApiOperation(value = "完成实验")
+  @PostMapping("/expEnd")
+  public AjaxResult expEnd(@RequestBody @Valid SecExpEndParmVo p) {
+    return toAjax(secExperimentService.update(p));
+  }
 
-    @ApiOperation(value = "完成实验")
-    @PostMapping("/expEnd")
-    public AjaxResult expEnd(@RequestBody @Valid SecExpEndParmVo p) {
-        return toAjax(secExperimentService.update(p));
-    }
+  @ApiOperation(value = "设置安全工具是否合格")
+  @PostMapping("/setToolNQ")
+  public AjaxResult setToolNQ(@RequestBody @Valid SecExpNQParmVo p) {
 
-    @ApiOperation(value = "设置安全工具是否合格")
-    @PostMapping("/setToolNQ")
-    public AjaxResult setToolNQ(@RequestBody @Valid SecExpNQParmVo p) {
+    return toAjax(secExperimentService.nq(p));
+  }
 
-        return toAjax(secExperimentService.nq(p));
-    }
+  @ApiOperation(value = "送检记录详情")
+  @GetMapping(value = {"/", "/{id}"})
+  public AjaxResult getInfo(@PathVariable String id) {
+    SecExpInfoVo info = secExperimentService.getInfo(id);
+    AjaxResult ajax = AjaxResult.success();
+    ajax.put("info", info);
+    return ajax;
+  }
 
-    @ApiOperation(value = "送检记录详情")
-    @GetMapping(value = {"/", "/{id}"})
-    public AjaxResult getInfo( @PathVariable String id) {
-        List<SecExpDetailVo>  info = secExperimentService.getInfo(id);
-        AjaxResult ajax = AjaxResult.success();
-        ajax.put("info",info);
-        return ajax;
-    }
-
-    @ApiOperation(value = "送检记录列表")
-    @GetMapping(value = "list")
-    public TableDataInfo getList(SecExpListParmVo secExperiment) {
-        startPage();
-        List<SecExpListVo> list = secExperimentService.getList(secExperiment);
-        return getDataTable(list);
-    }
+  @ApiOperation(value = "送检记录列表")
+  @GetMapping(value = "list")
+  public TableDataInfo getList(SecExpListParmVo secExperiment) {
+    startPage();
+    List<SecExpListVo> list = secExperimentService.getList(secExperiment);
+    return getDataTable(list);
+  }
 
 }

+ 0 - 2
railway-admin/src/main/java/com/railway/web/controller/business/safetool/SecScheduledController.java

@@ -88,7 +88,6 @@ public class SecScheduledController extends BaseController {
     } catch (Exception e) {
       return toAjax(0);
     }
-
   }
 
   @ApiOperation(value = "增加计划中的安全工具")
@@ -99,6 +98,5 @@ public class SecScheduledController extends BaseController {
     } catch (Exception e) {
       return error(e.getMessage());
     }
-
   }
 }

+ 1 - 1
railway-business/src/main/java/com/railway/business/safetool/domain/SecExperiment.java

@@ -43,7 +43,7 @@ public class SecExperiment extends BaseEntity{
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date scheduledTime;
 
-    @ApiModelProperty(value = "送检日期")
+    @ApiModelProperty(value = "实验日期")
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date expDate;
 

+ 57 - 0
railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecExpInfoVo.java

@@ -0,0 +1,57 @@
+package com.railway.business.safetool.domain.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+import lombok.Data;
+
+/**
+ * 送检记录详情
+ * @author lijie 2021-12-04
+ */
+@Data
+@ApiModel("送检记录详情")
+public class SecExpInfoVo implements Serializable {
+
+    @ApiModelProperty(value = "主键", hidden = true)
+    private Long id;
+
+    @ApiModelProperty(value = "车间")
+    private Long deptId;
+
+    @ApiModelProperty(value = "车间名称")
+    private String deptName;
+
+    @ApiModelProperty(value = "实验室id 部门表类型为实验室")
+    private Long labId;
+
+    @ApiModelProperty(value = "实验室Name 部门表类型为实验室")
+    private String labName;
+
+    @ApiModelProperty(value = "送检计划id")
+    private Long schedledId;
+
+    @ApiModelProperty(value = "截止时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date endTime;
+
+    @ApiModelProperty(value = "实验日期")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date expDate;
+
+    @ApiModelProperty(value = "状态,0待实验,1已实验")
+    private String state;
+
+    @ApiModelProperty(value = "送检人")
+    private String sjName;
+
+    @ApiModelProperty(value = "实验人")
+    private String syName;
+
+    @ApiModelProperty(value = "分组数据")
+    private List<SecExpToolsVo> baseSafetyTools;
+
+}

+ 2 - 5
railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecExpToolsVo.java

@@ -13,20 +13,17 @@ import java.io.Serializable;
 @Data
 @ApiModel("送检记录安全工具")
 public class SecExpToolsVo implements Serializable {
+
     @ApiModelProperty(value = "安全工具ID")
     protected Long toolId;
 
     @ApiModelProperty(value = "编号")
     protected String toolCode;
 
-    @ApiModelProperty(value = "id")
+    @ApiModelProperty(value = "检验-工具 记录ID")
     protected Long id;
 
     @ApiModelProperty(value = "是否合格")
     protected String isok;
 
-
-    public SecExpToolsVo() {
-    }
-
 }

+ 0 - 30
railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecScheduledDetailCountVo.java

@@ -1,30 +0,0 @@
-package com.railway.business.safetool.domain.vo;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.io.Serializable;
-import java.util.List;
-import lombok.Data;
-
-/**
- * 安全工具计划表
- *
- * @author lijie 2021-12-04
- */
-@Data
-@ApiModel("安全工具计划详情 待送检工具")
-public class SecScheduledDetailCountVo implements Serializable {
-
-  @ApiModelProperty(value = "工具名")
-  private String toolName;
-
-  @ApiModelProperty(value = "数量")
-  private String c;
-
-  @ApiModelProperty(value = "单位")
-  private String unit;
-
-  @ApiModelProperty(value = "分组数据")
-  private List<SecScheduledToolVo> baseSafetyTools;
-
-}

+ 0 - 29
railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecScheduledDetailVo.java

@@ -1,29 +0,0 @@
-package com.railway.business.safetool.domain.vo;
-
-import com.railway.business.safetool.domain.SecScheduled;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.List;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-
-/**
- * 安全工具计划表
- *
- * @author lijie 2021-12-04
- */
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ApiModel("安全工具计划详情 待送检工具")
-public class SecScheduledDetailVo extends SecScheduled {
-
-  @ApiModelProperty(value = "车间名称")
-  private String deptName;
-
-  @ApiModelProperty(value = "实验室名称")
-  private String labName;
-
-  @ApiModelProperty(value = "工具汇总")
-  private List<SecScheduledDetailCountVo> toolCount;
-
-}

+ 0 - 58
railway-business/src/main/java/com/railway/business/safetool/domain/vo/SecScheduledToolDetailVo.java

@@ -1,58 +0,0 @@
-package com.railway.business.safetool.domain.vo;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.io.Serializable;
-import java.util.Date;
-import lombok.Data;
-import org.hibernate.validator.constraints.Length;
-
-/**
- * 安全工具计划表
- *
- * @author lijie 2021-12-04
- */
-@Data
-@ApiModel("安全工具计划详情 待送检工具")
-public class SecScheduledToolDetailVo implements Serializable {
-
-  @ApiModelProperty(value = "主键", hidden = true)
-  protected Long id;
-
-  @ApiModelProperty(value = "车间id")
-  protected Long deptId;
-
-  @ApiModelProperty(value = "车间名称")
-  private String deptName;
-
-  @ApiModelProperty(value = "实验室id 部门表类型为实验室")
-  protected Long labId;
-
-  @ApiModelProperty(value = "实验室名称")
-  private String labName;
-
-  @ApiModelProperty(value = "计划送检日期")
-  @JsonFormat(pattern = "yyyy-MM-dd")
-  protected Date scheduledTime;
-
-  @ApiModelProperty(value = "工具主键")
-  private Long toolId;
-
-  @ApiModelProperty(value = "名称")
-  @Length(min = 1, max = 100, message = "【名称】长度必须介于 {min} 和 {max} 之间")
-  private String toolName;
-
-  @ApiModelProperty(value = "编号")
-  @Length(min = 1, max = 50, message = "【编号】长度必须介于 {min} 和 {max} 之间")
-  private String toolCode;
-
-  @ApiModelProperty(value = "类型(名称字典)")
-  @Length(min = 1, max = 10, message = "【类型(名称字典)】长度必须介于 {min} 和 {max} 之间")
-  private String toolType;
-
-  @ApiModelProperty(value = "单位")
-  @Length(min = 1, max = 10, message = "【单位】长度必须介于 {min} 和 {max} 之间")
-  private String unit;
-
-}

+ 6 - 5
railway-business/src/main/java/com/railway/business/safetool/mapper/SecExperimentMapper.java

@@ -1,18 +1,17 @@
 package com.railway.business.safetool.mapper;
 
 import com.github.pagehelper.Page;
-
 import com.railway.business.safetool.domain.SecExperiment;
 import com.railway.business.safetool.domain.vo.SecExpAddParmVo;
-import com.railway.business.safetool.domain.vo.SecExpDetailVo;
+import com.railway.business.safetool.domain.vo.SecExpInfoVo;
 import com.railway.business.safetool.domain.vo.SecExpListParmVo;
 import com.railway.business.safetool.domain.vo.SecExpListVo;
+import com.railway.business.safetool.domain.vo.SecExpToolsVo;
+import java.util.List;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
-import java.util.List;
-
 /**
 * 送检记录表
 * @author lijie
@@ -39,7 +38,9 @@ public interface SecExperimentMapper {
     /**
     * 获取单个
     */
-    List<SecExpDetailVo> getInfo(@Param("id") String id);
+    SecExpInfoVo getInfo(@Param("id") String id);
+
+    List<SecExpToolsVo> listSafetyTools(@Param("id") String id);
 
     /**
     * 查询列表

+ 0 - 7
railway-business/src/main/java/com/railway/business/safetool/mapper/SecScheduledMapper.java

@@ -3,10 +3,8 @@ package com.railway.business.safetool.mapper;
 import com.github.pagehelper.Page;
 import com.railway.business.safetool.domain.SecScheduled;
 import com.railway.business.safetool.domain.vo.SecScheduledCountVo;
-import com.railway.business.safetool.domain.vo.SecScheduledDetailCountVo;
 import com.railway.business.safetool.domain.vo.SecScheduledListParmVo;
 import com.railway.business.safetool.domain.vo.SecScheduledToolListVo;
-import java.util.List;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
@@ -42,11 +40,6 @@ public interface SecScheduledMapper {
      */
     SecScheduledToolListVo getInfo(@Param("id") String id);
 
-    /**
-    * 获取单个
-    */
-    List<SecScheduledDetailCountVo> getScheduledTools(@Param("id") String id);
-
     /**
     * 查询列表
     */

+ 8 - 4
railway-business/src/main/java/com/railway/business/safetool/service/ISecExperimentService.java

@@ -1,8 +1,11 @@
 package com.railway.business.safetool.service;
 
-import com.railway.business.safetool.domain.SecExperiment;
-import com.railway.business.safetool.domain.vo.*;
-
+import com.railway.business.safetool.domain.vo.SecExpAddParmVo;
+import com.railway.business.safetool.domain.vo.SecExpEndParmVo;
+import com.railway.business.safetool.domain.vo.SecExpInfoVo;
+import com.railway.business.safetool.domain.vo.SecExpListParmVo;
+import com.railway.business.safetool.domain.vo.SecExpListVo;
+import com.railway.business.safetool.domain.vo.SecExpNQParmVo;
 import java.util.List;
 /**
 * 送检记录表
@@ -23,10 +26,11 @@ public interface ISecExperimentService{
     */
     int update(SecExpEndParmVo secExperiment);
     int nq(SecExpNQParmVo nq);
+
     /**
     * 获取单个
     */
-    List<SecExpDetailVo>  getInfo(String id);
+    SecExpInfoVo getInfo(String id);
 
     /**
     * 查询列表

+ 91 - 89
railway-business/src/main/java/com/railway/business/safetool/service/impl/SecExperimentServiceImpl.java

@@ -3,11 +3,12 @@ package com.railway.business.safetool.service.impl;
 import com.railway.business.safetool.domain.SecExperiment;
 import com.railway.business.safetool.domain.SecExperimentTool;
 import com.railway.business.safetool.domain.vo.SecExpAddParmVo;
-import com.railway.business.safetool.domain.vo.SecExpDetailVo;
 import com.railway.business.safetool.domain.vo.SecExpEndParmVo;
+import com.railway.business.safetool.domain.vo.SecExpInfoVo;
 import com.railway.business.safetool.domain.vo.SecExpListParmVo;
 import com.railway.business.safetool.domain.vo.SecExpListVo;
 import com.railway.business.safetool.domain.vo.SecExpNQParmVo;
+import com.railway.business.safetool.domain.vo.SecExpToolsVo;
 import com.railway.business.safetool.mapper.SecExperimentMapper;
 import com.railway.business.safetool.mapper.SecExperimentToolMapper;
 import com.railway.business.safetool.mapper.SecScheduledMapper;
@@ -18,106 +19,107 @@ import java.util.List;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+
 /**
-* 送检记录表
-* @author lijie
-* @date 2021/12/25
-*/
+ * 送检记录表
+ *
+ * @author lijie
+ * @date 2021/12/25
+ */
 @Service
 public class SecExperimentServiceImpl implements ISecExperimentService {
 
-	private final SecScheduledMapper scheduledMapper;
-	private final SecExperimentMapper secExperimentMapper;
-	private final SecExperimentToolMapper secExperimentToolMapper;
-
-	public SecExperimentServiceImpl(
-			SecScheduledMapper scheduledMapper,
-			SecExperimentMapper secExperimentMapper,
-			SecExperimentToolMapper secExperimentToolMapper) {
-		this.scheduledMapper = scheduledMapper;
-		this.secExperimentMapper = secExperimentMapper;
-		this.secExperimentToolMapper = secExperimentToolMapper;
-	}
+  private final SecScheduledMapper scheduledMapper;
+  private final SecExperimentMapper secExperimentMapper;
+  private final SecExperimentToolMapper secExperimentToolMapper;
 
-	/**
-	* 新增
-	*/
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public int create(SecExpAddParmVo secExpAddParmVo) {
-		secExpAddParmVo.setCreateby(SecurityUtils.getUsername());
-		int r = secExperimentMapper.insertExp(secExpAddParmVo);
+  public SecExperimentServiceImpl(
+      SecScheduledMapper scheduledMapper,
+      SecExperimentMapper secExperimentMapper,
+      SecExperimentToolMapper secExperimentToolMapper) {
+    this.scheduledMapper = scheduledMapper;
+    this.secExperimentMapper = secExperimentMapper;
+    this.secExperimentToolMapper = secExperimentToolMapper;
+  }
 
-		if(r>0){
-			String secid = secExpAddParmVo.getSecid();
-			String expid = secExpAddParmVo.getId();
-			String createby = SecurityUtils.getUsername();
-			secExperimentMapper.insertTool(secid,expid,createby);
-		}
-		//设置已送检状态
-		if(r>0){
-			r =scheduledMapper.updateScheduled(secExpAddParmVo.getSecid(),"1");
-		}
-		return r;
-	}
+  /**
+   * 新增
+   */
+  @Override
+  @Transactional(rollbackFor = Exception.class)
+  public int create(SecExpAddParmVo secExpAddParmVo) {
+    secExpAddParmVo.setCreateby(SecurityUtils.getUsername());
+    int r = secExperimentMapper.insertExp(secExpAddParmVo);
 
+    if (r > 0) {
+      String secid = secExpAddParmVo.getSecid();
+      String expid = secExpAddParmVo.getId();
+      String createby = SecurityUtils.getUsername();
+      secExperimentMapper.insertTool(secid, expid, createby);
+    }
+    //设置已送检状态
+    if (r > 0) {
+      r = scheduledMapper.updateScheduled(secExpAddParmVo.getSecid(), "1");
+    }
+    return r;
+  }
 
 
-	/**
-	* 更新
-	*/
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public int update(SecExpEndParmVo p) {
-		SecExperiment secExperiment = new SecExperiment();
-		BeanUtils.copyProperties(p,secExperiment);
-		secExperiment.setState("1");
-		secExperiment.setExpDate(new Date());
-		secExperiment.setUpdateTime(new Date());
-    	secExperiment.setUpdateBy(SecurityUtils.getUsername());
-		int r = secExperimentMapper.update(secExperiment);
-		if(r>0){
-			//设置待送检状态
-			r =secExperimentMapper.updateScheduled(secExperiment.getId(),"0");
-		}
-		return r;
-	}
+  /**
+   * 更新
+   */
+  @Override
+  @Transactional(rollbackFor = Exception.class)
+  public int update(SecExpEndParmVo p) {
+    SecExperiment secExperiment = new SecExperiment();
+    BeanUtils.copyProperties(p, secExperiment);
+    secExperiment.setState("1");
+    secExperiment.setExpDate(new Date());
+    secExperiment.setUpdateTime(new Date());
+    secExperiment.setUpdateBy(SecurityUtils.getUsername());
+    int r = secExperimentMapper.update(secExperiment);
+    if (r > 0) {
+      //设置待送检状态
+      r = secExperimentMapper.updateScheduled(secExperiment.getId(), "0");
+    }
+    return r;
+  }
 
-	/**
-	 * 设置安全工具
-	 * @param p 设置参数
-	 * @return 设置结果
-	 */
-	@Override
-	@Transactional(rollbackFor = Exception.class)
-	public int nq(SecExpNQParmVo p) {
-		SecExperimentTool set = new SecExperimentTool();
-		BeanUtils.copyProperties(p,set);
-		set.setUpdateTime(new Date());
-		set.setUpdateBy(SecurityUtils.getUsername());
-		return secExperimentToolMapper.update(set);
-	}
-	/**
-	* 获取单个
-	*/
-	@Override
-	public List<SecExpDetailVo>  getInfo(String id) {
+  /**
+   * 设置安全工具
+   *
+   * @param p 设置参数
+   * @return 设置结果
+   */
+  @Override
+  @Transactional(rollbackFor = Exception.class)
+  public int nq(SecExpNQParmVo p) {
+    SecExperimentTool set = new SecExperimentTool();
+    BeanUtils.copyProperties(p, set);
+    set.setUpdateTime(new Date());
+    set.setUpdateBy(SecurityUtils.getUsername());
+    return secExperimentToolMapper.update(set);
+  }
 
+  /**
+   * 获取单个
+   */
+  @Override
+  public SecExpInfoVo getInfo(String id) {
 
-		List<SecExpDetailVo> r = secExperimentMapper.getInfo(id);
-		r.forEach( vo->
-				vo.setC(vo.getBaseSafetyTools().size()+"")
-		);
-		return r;
+    SecExpInfoVo r = secExperimentMapper.getInfo(id);
+    List<SecExpToolsVo> baseSafetyTools = secExperimentMapper.listSafetyTools(id);
+    r.setBaseSafetyTools(baseSafetyTools);
+    return r;
 
-	}
+  }
 
-	/**
-	* 查询列表
-	*/
-	@Override
-	public List<SecExpListVo> getList(SecExpListParmVo parm) {
-		parm.setDeptId(SecurityUtils.getLoginUser().getDeptId());
-		return secExperimentMapper.getList(parm);
-	}
+  /**
+   * 查询列表
+   */
+  @Override
+  public List<SecExpListVo> getList(SecExpListParmVo parm) {
+    parm.setDeptId(SecurityUtils.getLoginUser().getDeptId());
+    return secExperimentMapper.getList(parm);
+  }
 }

+ 72 - 27
railway-business/src/main/resources/mapper/safetool/SecExperimentMapper.xml

@@ -3,32 +3,6 @@
   "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.railway.business.safetool.mapper.SecExperimentMapper">
 
-  <resultMap id="BaseResultMap" type="com.railway.business.safetool.domain.vo.SecExpDetailVo">
-    <result column="toolName" property="toolName"/>
-    <result column="unit" property="unit"/>
-    <collection property="baseSafetyTools"
-      ofType="com.railway.business.safetool.domain.vo.SecExpToolsVo">
-      <result column="tool_id" property="toolId"/>
-      <result column="tool_code" property="toolCode"/>
-      <result column="id" property="id"/>
-      <result column="isok" property="isok"/>
-    </collection>
-
-  </resultMap>
-
-
-  <resultMap id="listResultMap" type="com.railway.business.safetool.domain.vo.SecExpListVo">
-    <result column="id" property="id"/>
-    <result column="state" property="state"/>
-    <result column="scheduled_time" property="scheduledTime"/>
-    <result column="end_time" property="endTime"/>
-    <result column="exp_date" property="expDate"/>
-    <result column="dept_name" property="deptName"/>
-    <result column="lab_name" property="labName"/>
-    <result column="real_name" property="realName"/>
-
-  </resultMap>
-
 
   <insert id="insertExp" keyProperty="id"
     parameterType="com.railway.business.safetool.domain.vo.SecExpAddParmVo">
@@ -80,7 +54,21 @@
     select schedled_id from sec_experiment where id = #{id}
     )
   </update>
-  <select id="getInfo" resultMap="BaseResultMap">
+
+  <resultMap id="BaseResultMap" type="com.railway.business.safetool.domain.vo.SecExpDetailVo">
+    <result column="toolName" property="toolName"/>
+    <result column="unit" property="unit"/>
+    <collection property="baseSafetyTools"
+      ofType="com.railway.business.safetool.domain.vo.SecExpToolsVo">
+      <result column="tool_id" property="toolId"/>
+      <result column="tool_code" property="toolCode"/>
+      <result column="id" property="id"/>
+      <result column="isok" property="isok"/>
+    </collection>
+
+  </resultMap>
+
+  <select id="getInfo1" resultMap="BaseResultMap">
     select d3.dict_label toolName ,t.unit,t.tool_id,t.tool_code,r.id,r.isok
     FROM sec_experiment s
     LEFT JOIN sec_experiment_tool r
@@ -94,6 +82,63 @@
     and s.id=#{id}
   </select>
 
+  <resultMap id="ToolsResultMap" type="com.railway.business.safetool.domain.vo.SecExpToolsVo">
+    <result column="tool_id" property="toolId"/>
+    <result column="tool_code" property="toolCode"/>
+    <result column="id" property="id"/>
+    <result column="isok" property="isok"/>
+  </resultMap>
+
+  <select id="listSafetyTools" resultMap="ToolsResultMap">
+    select d3.dict_label toolName, t.unit,t.tool_id, t.tool_code, r.id, r.isok
+    FROM sec_experiment_tool r
+    LEFT JOIN sec_experiment s ON r.exp_id = s.id
+    LEFT JOIN base_safety_tool t ON t.tool_id = r.tool_id
+    left join sys_dept d1 on s.dept_id = d1.dept_id
+    left join sys_dept d2 on s.lab_id = d2.dept_id
+    left join sys_dict_data d3 on d3.dict_type = 'tool_type' and d3.dict_value = t.tool_type
+    WHERE s.del_flag = '0' and t.del_flag = '0' and t.state = '1'
+    and s.id=#{id}
+  </select>
+
+
+  <resultMap id="InfoResultMap" type="com.railway.business.safetool.domain.vo.SecExpInfoVo">
+    <result column="id" property="id"/>
+    <result column="state" property="state"/>
+    <result column="end_time" property="endTime"/>
+    <result column="exp_date" property="expDate"/>
+    <result column="dept_name" property="deptName"/>
+    <result column="lab_name" property="labName"/>
+    <result column="sj_name" property="sjName"/>
+    <result column="sy_name" property="syName"/>
+    <result column="dept_id" property="deptId"/>
+    <result column="lab_id" property="labId"/>
+    <result column="scheduled_id" property="schedledId"/>
+    <result column="deptName" property="deptName"/>
+    <result column="labName" property="labName"/>
+  </resultMap>
+
+  <select id="getInfo" resultMap="InfoResultMap">
+    select e.id,e.state,e.scheduled_time,e.end_time,e.exp_date,e.dept_name,e.lab_name,
+    u.real_name as sj_name, u.real_name as sy_name
+    from sec_experiment e
+    left join sys_user u on e.create_by = u.user_name
+    where e.id=#{id}
+  </select>
+
+
+  <resultMap id="listResultMap" type="com.railway.business.safetool.domain.vo.SecExpListVo">
+    <result column="id" property="id"/>
+    <result column="state" property="state"/>
+    <result column="scheduled_time" property="scheduledTime"/>
+    <result column="end_time" property="endTime"/>
+    <result column="exp_date" property="expDate"/>
+    <result column="dept_name" property="deptName"/>
+    <result column="lab_name" property="labName"/>
+    <result column="real_name" property="realName"/>
+
+  </resultMap>
+
   <select id="getList" resultMap="listResultMap">
 
     select e.id,e.state,e.scheduled_time,e.end_time,e.exp_date,e.dept_name,e.lab_name,u.real_name

+ 0 - 24
railway-business/src/main/resources/mapper/safetool/SecScheduledMapper.xml

@@ -175,28 +175,4 @@
     and s.id=#{id}
   </select>
 
-  <resultMap id="ScheduledToolsResultMap"
-    type="com.railway.business.safetool.domain.vo.SecScheduledDetailCountVo">
-    <result column="toolName" property="toolName"/>
-    <result column="unit" property="unit"/>
-    <collection property="baseSafetyTools"
-      ofType="com.railway.business.safetool.domain.vo.SecScheduledToolVo">
-      <result column="tool_id" property="toolId"/>
-      <result column="tool_code" property="toolCode"/>
-      <result column="id" property="id"/>
-    </collection>
-  </resultMap>
-
-  <select id="getScheduledTools" resultMap="ScheduledToolsResultMap">
-    select d3.dict_label toolName ,t.unit,t.tool_id,t.tool_code
-    FROM sec_scheduled s
-    LEFT JOIN sec_scheduled_tool r ON r.scheduled_id = s.id
-    INNER JOIN base_safety_tool t ON t.tool_id = r.tool_id
-    left join sys_dept d1 on s.dept_id = d1.dept_id
-    left join sys_dept d2 on s.lab_id = d2.dept_id
-    left join sys_dict_data d3 on d3.dict_type = 'tool_type' and d3.dict_value = t.tool_type
-    WHERE s.del_flag = '0' and s.state = 0 and t.del_flag = '0' and t.state = '1'
-    and s.id=#{id}
-  </select>
-
 </mapper>