试验管理
This commit is contained in:
parent
bf02fb1295
commit
3d7becfad4
|
|
@ -5,12 +5,14 @@ import com.bonus.aqgqj.annotation.LogAnnotation;
|
|||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.TestVo;
|
||||
import com.bonus.aqgqj.basis.service.ExperimentalService;
|
||||
import com.bonus.aqgqj.system.vo.EncryptedReq;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
|
@ -46,7 +48,8 @@ public class ExperimentalController {
|
|||
|
||||
@PostMapping(value = "getDetailList")
|
||||
@DecryptAndVerify(decryptedClass = ParamsDto.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "试验管理", operation = "查询试验详情列表", operDesc = "系统级事件", operType = "查询")
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "查询试验详情列表", operDesc = "系统级事件", operType = "查询")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:query')")
|
||||
public ServerResponse getDetailList(EncryptedReq<ParamsDto> data) {
|
||||
PageHelper.startPage(data.getData().getPage(), data.getData().getLimit());
|
||||
List<ExperimentalDetailVo> list = service.getDetailList(data.getData());
|
||||
|
|
@ -56,6 +59,7 @@ public class ExperimentalController {
|
|||
|
||||
/**
|
||||
* 查询试验模板数据、基础数据
|
||||
*
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
|
|
@ -66,4 +70,12 @@ public class ExperimentalController {
|
|||
public ServerResponse getTestBasicInfo(EncryptedReq<ParamsDto> data) {
|
||||
return service.getTestBasicInfo(data.getData());
|
||||
}
|
||||
|
||||
@PostMapping(value = "addTestData")
|
||||
@DecryptAndVerify(decryptedClass = TestVo.class)//加解密统一管理
|
||||
@LogAnnotation(operModul = "试验详情管理", operation = "新增试验数据", operDesc = "系统级事件", operType = "新增")
|
||||
// @PreAuthorize("@pms.hasPermission('sys:experimentalTest:add')")
|
||||
public ServerResponse addTestData(EncryptedReq<TestVo> data) {
|
||||
return service.addTestData(data.getData());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.bonus.aqgqj.basis.dao;
|
||||
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperBasisVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.TestVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -39,10 +41,31 @@ public interface ExperimentalMapper {
|
|||
|
||||
/**
|
||||
* 查询试验模板数据、基础数据
|
||||
*
|
||||
* @param dto
|
||||
* @return TestVo
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 14:23
|
||||
*/
|
||||
TestVo getTestBasicInfo(ParamsDto dto);
|
||||
|
||||
/**
|
||||
* 添加试验信息
|
||||
*
|
||||
* @param vo
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 16:13
|
||||
*/
|
||||
void addExper(TestVo vo);
|
||||
|
||||
/**
|
||||
* 添加试验依据信息数据
|
||||
* @param basisVos
|
||||
* @param id
|
||||
* @return void
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 17:05
|
||||
*/
|
||||
void addConfigBasis(@Param("list") List<ExperBasisVo> basisVos, @Param("id") Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ import lombok.Data;
|
|||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -30,26 +32,59 @@ public class TestVo {
|
|||
*/
|
||||
private Long configId;
|
||||
|
||||
@NotNull(message = "收样不能为空", groups = {Query.class})
|
||||
private Long sampleId;
|
||||
|
||||
/**
|
||||
* 收样日期
|
||||
*/
|
||||
@NotBlank(message = "收样日期不能为空", groups = {Query.class})
|
||||
@Pattern(regexp = "\\d{4}(\\-|\\/|\\.)\\d{1,2}\\1\\d{1,2}", message = "收样日期格式不正确", groups = {Query.class})
|
||||
private String sampleDate;
|
||||
/**
|
||||
* 送检单位ID
|
||||
*/
|
||||
private Long submit_unit;
|
||||
@NotNull(message = "送检单位不能为空", groups = {Query.class})
|
||||
private Long customId;
|
||||
/**
|
||||
* 送检单位名称
|
||||
*/
|
||||
private String customName;
|
||||
|
||||
/**
|
||||
* 样品数量
|
||||
*/
|
||||
@NotNull(message = "样品数量不能为空", groups = {Query.class})
|
||||
private Integer sampleQuantity;
|
||||
|
||||
/**
|
||||
* 主要实验设备名称
|
||||
*/
|
||||
private String experDev;
|
||||
/**
|
||||
* 主要实验设备型号
|
||||
*/
|
||||
private String experModule;
|
||||
/**
|
||||
* 主要实验设备编号
|
||||
*/
|
||||
private String experCode;
|
||||
/**
|
||||
* 校验日期
|
||||
*/
|
||||
private String checkTime;
|
||||
|
||||
/**
|
||||
* 试验日期
|
||||
*/
|
||||
@NotBlank(message = "试验日期不能为空", groups = {Query.class})
|
||||
@Pattern(regexp = "\\d{4}(\\-|\\/|\\.)\\d{1,2}\\1\\d{1,2}", message = "试验日期格式不正确", groups = {Query.class})
|
||||
private String experTime;
|
||||
/**
|
||||
* 下次试验日期
|
||||
*/
|
||||
@NotBlank(message = "下次试验日期不能为空", groups = {Query.class})
|
||||
@Pattern(regexp = "\\d{4}(\\-|\\/|\\.)\\d{1,2}\\1\\d{1,2}", message = "下次试验日期格式不正确", groups = {Query.class})
|
||||
private String nextExperTime;
|
||||
/**
|
||||
* 设备类型编码
|
||||
|
|
@ -127,6 +162,15 @@ public class TestVo {
|
|||
@Length(max = 256, message = "备注字符长度不能超过256", groups = {Query.class})
|
||||
private String remarsk;
|
||||
|
||||
/**
|
||||
* 审核状态
|
||||
*/
|
||||
private Integer auditStatus = 0;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status = 0;
|
||||
|
||||
/**
|
||||
* 主要试验设备、设备、试验依据、试验项等数据
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.aqgqj.basis.service;
|
|||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalDetailVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.ExperimentalVo;
|
||||
import com.bonus.aqgqj.basis.entity.vo.TestVo;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -37,10 +38,20 @@ public interface ExperimentalService {
|
|||
|
||||
/**
|
||||
* 查询试验模板数据、基础数据
|
||||
*
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 14:12
|
||||
*/
|
||||
ServerResponse getTestBasicInfo(ParamsDto data);
|
||||
|
||||
/**
|
||||
* 新增试验数据
|
||||
* @param data
|
||||
* @return ServerResponse
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 15:42
|
||||
*/
|
||||
ServerResponse addTestData(TestVo data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,26 @@
|
|||
package com.bonus.aqgqj.basis.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bonus.aqgqj.advice.ValidatorsUtils;
|
||||
import com.bonus.aqgqj.basis.dao.ExperimentStandardMapper;
|
||||
import com.bonus.aqgqj.basis.dao.ExperimentalMapper;
|
||||
import com.bonus.aqgqj.basis.entity.dto.ParamsDto;
|
||||
import com.bonus.aqgqj.basis.entity.vo.*;
|
||||
import com.bonus.aqgqj.basis.service.ExperimentalService;
|
||||
import com.bonus.aqgqj.utils.DateTimeHelper;
|
||||
import com.bonus.aqgqj.utils.ServerResponse;
|
||||
import com.bonus.aqgqj.webResult.Constants;
|
||||
import com.bonus.aqgqj.webResult.HttpStatus;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -32,6 +40,9 @@ public class ExperimentalServiceImpl implements ExperimentalService {
|
|||
@Resource(name = "ExperimentStandardMapper")
|
||||
private ExperimentStandardMapper standardMapper;
|
||||
|
||||
@Resource(name = "ValidatorsUtils")
|
||||
private ValidatorsUtils validatorsUtils;
|
||||
|
||||
@Override
|
||||
public List<ExperimentalVo> getList(ParamsDto dto) {
|
||||
List<ExperimentalVo> list = new ArrayList<>();
|
||||
|
|
@ -69,7 +80,7 @@ public class ExperimentalServiceImpl implements ExperimentalService {
|
|||
// 查询收样基本信息
|
||||
vo = mapper.getTestBasicInfo(dto);
|
||||
// 查询试验配置依据、试验设备、试验主要设备、试验项信息
|
||||
List<ExperBasisVo> basisVos= standardMapper.getExperBasis(vo.getConfigId());
|
||||
List<ExperBasisVo> basisVos = standardMapper.getExperBasis(vo.getConfigId());
|
||||
List<ConfigDevVo> deviceVos = standardMapper.getConfigDev(vo.getConfigId());
|
||||
List<ConfigMainDevVo> mainDevVos = standardMapper.getConfigMainDev(vo.getConfigId());
|
||||
List<ConfigItemsVo> configItemsVos = standardMapper.getConfigItems(vo.getConfigId());
|
||||
|
|
@ -86,4 +97,184 @@ public class ExperimentalServiceImpl implements ExperimentalService {
|
|||
}
|
||||
return ServerResponse.createSuccess(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ServerResponse addTestData(TestVo vo) {
|
||||
try {
|
||||
// 整体数据校验数据
|
||||
String validResult = validatorsUtils.valid(vo, TestVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, validResult);
|
||||
}
|
||||
if(validatorsDate(vo)){
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "下次试验日期不能早于试验日期");
|
||||
}
|
||||
String result = validatorsParams(vo.getParamsData());
|
||||
if (StringUtils.isNotBlank(result)) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, result);
|
||||
}
|
||||
TestVo testVo = handleConfigItem(vo);
|
||||
if (testVo == null) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "参数异常");
|
||||
}
|
||||
// 试验设备、试验主要设备、试验依据、试验项校验
|
||||
String result2 = singleValidators(testVo);
|
||||
if (StringUtils.isNotBlank(result2)) {
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, result2);
|
||||
}
|
||||
// 添加试验信息数据
|
||||
mapper.addExper(vo);
|
||||
// 添加试验依据信息数据
|
||||
mapper.addConfigBasis(vo.getBasisVos(),vo.getId());
|
||||
// 添加试验项数据 tb_exper_item
|
||||
// 添加试验项内容数据 tb_exper_items
|
||||
// 添加试验样品数据 tb_exper_dev
|
||||
// 添加试验项信息数据 tb_exper_dev_items
|
||||
// 添加试验项数据 tb_exper_dev_item
|
||||
|
||||
} catch (Exception e) {
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||
return ServerResponse.createByErrorMsg(HttpStatus.ERROR, "操作失败");
|
||||
}
|
||||
return ServerResponse.createBySuccessMsg("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证参数是否为空
|
||||
*
|
||||
* @param value
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 17:22
|
||||
*/
|
||||
public String validatorsParams(String value) {
|
||||
try {
|
||||
// 试验配置项、试验依据、试验设备、主要试验设备验证数据是否为空
|
||||
JSONObject obj = JSONObject.parseObject(value);
|
||||
JSONArray itemsList = obj.getJSONArray("items");
|
||||
JSONArray yjList = obj.getJSONArray("yjList");
|
||||
JSONArray devList = obj.getJSONArray("devList");
|
||||
JSONArray mainDevList = obj.getJSONArray("mainDevList");
|
||||
if (CollectionUtils.isEmpty(devList)) {
|
||||
return Constants.ERROR_1;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(mainDevList)) {
|
||||
return Constants.ERROR_2;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(yjList)) {
|
||||
return Constants.ERROR_3;
|
||||
}
|
||||
if (CollectionUtils.isEmpty(itemsList)) {
|
||||
return Constants.ERROR_4;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return Constants.ERROR_5;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理试验项、试验项内容、试验依据、试验设备、主要试验设备数据
|
||||
*
|
||||
* @param vo
|
||||
* @return List<ConfigItemsVo>
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 16:43
|
||||
*/
|
||||
public TestVo handleConfigItem(TestVo vo) {
|
||||
try {
|
||||
JSONObject obj = JSONObject.parseObject(vo.getParamsData());
|
||||
JSONArray yjList = obj.getJSONArray("yjList");
|
||||
JSONArray devList = obj.getJSONArray("devList");
|
||||
JSONArray mainDevList = obj.getJSONArray("mainDevList");
|
||||
JSONArray itemsList = obj.getJSONArray("items");
|
||||
List<ExperBasisVo> basisVos = yjList.toJavaList(ExperBasisVo.class);
|
||||
List<ConfigDevVo> deviceVos = devList.toJavaList(ConfigDevVo.class);
|
||||
List<ConfigMainDevVo> mainDeviceVos = mainDevList.toJavaList(ConfigMainDevVo.class);
|
||||
List<ConfigItemsVo> configItemsVos = itemsList.toJavaList(ConfigItemsVo.class);
|
||||
for (ConfigItemsVo configItemsVo : configItemsVos) {
|
||||
JSONArray itemArr = JSONObject.parseArray(configItemsVo.getItem());
|
||||
List<ConfigItemVo> configItemVos = itemArr.toJavaList(ConfigItemVo.class);
|
||||
configItemsVo.setItemList(configItemVos);
|
||||
}
|
||||
for (ConfigMainDevVo mainDeviceVo : mainDeviceVos) {
|
||||
vo.setExperDev(mainDeviceVo.getExperDevName());
|
||||
vo.setExperModule(mainDeviceVo.getExperDevModule());
|
||||
vo.setExperCode(mainDeviceVo.getExperDevCode());
|
||||
vo.setCheckTime(mainDeviceVo.getDevContractDate());
|
||||
}
|
||||
vo.setBasisVos(basisVos);
|
||||
vo.setDeviceVos(deviceVos);
|
||||
vo.setMainDeviceVos(mainDeviceVos);
|
||||
vo.setConfigItemsVos(configItemsVos);
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
return null;
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 试验项、试验项内容、试验依据、试验设备、主要试验设备数据校验
|
||||
*
|
||||
* @param vo
|
||||
* @return String
|
||||
* @author cwchen
|
||||
* @date 2024/7/18 19:17
|
||||
*/
|
||||
public String singleValidators(TestVo vo) {
|
||||
List<ConfigDevVo> deviceVos = vo.getDeviceVos();
|
||||
List<ConfigMainDevVo> mainDeviceVos = vo.getMainDeviceVos();
|
||||
List<ExperBasisVo> basisVos = vo.getBasisVos();
|
||||
List<ConfigItemsVo> configItemsVos = vo.getConfigItemsVos();
|
||||
for (ConfigDevVo deviceVo : deviceVos) {
|
||||
String validResult = validatorsUtils.valid(deviceVo, ConfigDevVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
}
|
||||
for (ConfigMainDevVo mainDeviceVo : mainDeviceVos) {
|
||||
String validResult = validatorsUtils.valid(mainDeviceVo, ConfigMainDevVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
}
|
||||
for (ExperBasisVo basisVo : basisVos) {
|
||||
String validResult = validatorsUtils.valid(basisVo, ExperBasisVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
}
|
||||
for (ConfigItemsVo configItemsVo : configItemsVos) {
|
||||
String validResult = validatorsUtils.valid(configItemsVo, ConfigItemsVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult)) {
|
||||
return validResult;
|
||||
}
|
||||
for (ConfigItemVo configItemVo : configItemsVo.getItemList()) {
|
||||
String validResult2 = validatorsUtils.valid(configItemVo, ConfigItemVo.Query.class);
|
||||
if (StringUtils.isNotBlank(validResult2)) {
|
||||
return validResult2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验试验时间和下次试验时间
|
||||
* @param vo
|
||||
* @return boolean
|
||||
* @author cwchen
|
||||
* @date 2024/7/20 16:56
|
||||
*/
|
||||
public boolean validatorsDate(TestVo vo) {
|
||||
long time = DateTimeHelper.getTimeStampConverter(vo.getExperTime(), Constants.FORMAT_STR);
|
||||
long time2 = DateTimeHelper.getTimeStampConverter(vo.getNextExperTime(), Constants.FORMAT_STR);
|
||||
if (time2 < time) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,4 +137,7 @@ public class Constants
|
|||
public static final String ERROR_3 = "试验依据不能为空";
|
||||
public static final String ERROR_4 = "试验项不能为空";
|
||||
public static final String ERROR_5 = "参数不能为空";
|
||||
public static final String FORMAT_STR = "yyyy-MM-dd";
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,73 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.aqgqj.basis.dao.ExperimentalMapper">
|
||||
<!--添加试验信息-->
|
||||
<insert id="addExper" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO tb_exper
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="sampleId != null">sample_id,</if>
|
||||
<if test="devTypeCode != null and devTypeCode != ''">dev_type_code,</if>
|
||||
<if test="devTypeName != null and devTypeName != ''">dev_type_name,</if>
|
||||
<if test="sampleQuantity != null">dev_num,</if>
|
||||
<if test="devModule != null and devModule!=''">dev_module,</if>
|
||||
<if test="sampleDate != null and sampleDate!=''">sample_date,</if>
|
||||
<if test="experTime != null and experTime!=''">exper_time,</if>
|
||||
<if test="nextExperTime != null and nextExperTime!=''">next_exper_time,</if>
|
||||
<if test="customId != null">submit_unit,</if>
|
||||
<if test="experLocal != null and experLocal!=''">submit_location,</if>
|
||||
<if test="experDev != null and experDev!=''">exper_dev,</if>
|
||||
<if test="experModule != null and experModule!=''">exper_module,</if>
|
||||
<if test="experCode != null and experCode!=''">exper_code,</if>
|
||||
<if test="checkTime != null and checkTime!=''">check_time,</if>
|
||||
<if test="experStand != null and experStand!=''">exper_stand,</if>
|
||||
<if test="experConclu != null and experConclu!=''">exper_conclu,</if>
|
||||
<if test="remarsk != null and remarsk!=''">remarsk,</if>
|
||||
audit_status,
|
||||
create_time,
|
||||
create_user,
|
||||
update_time,
|
||||
update_user,
|
||||
del_flag,
|
||||
status,
|
||||
id
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="sampleId != null">#{sampleId},</if>
|
||||
<if test="devTypeCode != null and devTypeCode != ''">#{devTypeCode},</if>
|
||||
<if test="devTypeName != null and devTypeName != ''">#{devTypeName},</if>
|
||||
<if test="sampleQuantity != null">#{sampleQuantity},</if>
|
||||
<if test="devModule != null and devModule!=''">#{devModule},</if>
|
||||
<if test="sampleDate != null and sampleDate!=''">#{sampleDate},</if>
|
||||
<if test="experTime != null and experTime!=''">#{experTime},</if>
|
||||
<if test="nextExperTime != null and nextExperTime!=''">#{nextExperTime},</if>
|
||||
<if test="customId != null">#{customId},</if>
|
||||
<if test="experLocal != null and experLocal!=''">#{experLocal},</if>
|
||||
<if test="experDev != null and experDev!=''">#{experDev},</if>
|
||||
<if test="experModule != null and experModule!=''">#{experModule},</if>
|
||||
<if test="experCode != null and experCode!=''">#{experCode},</if>
|
||||
<if test="checkTime != null and checkTime!=''">#{checkTime},</if>
|
||||
<if test="experStand != null and experStand!=''">#{experStand},</if>
|
||||
<if test="experConclu != null and experConclu!=''">#{experConclu},</if>
|
||||
<if test="remarsk != null and remarsk!=''">#{remarsk},</if>
|
||||
#{auditStatus}
|
||||
#{createTime},
|
||||
#{createUser},
|
||||
#{updateTime},
|
||||
#{updateUser},
|
||||
#{status},
|
||||
0,
|
||||
null
|
||||
</trim>
|
||||
</insert>
|
||||
<!--添加试验依据信息数据-->
|
||||
<insert id="addConfigBasis">
|
||||
INSERT INTO tb_config_basis(id,exper_id,exper_basis_name) VALUES
|
||||
<foreach collection="list" separator="," item="item">
|
||||
(
|
||||
null,#{id},#{item.basisName}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!--试验列表-->
|
||||
<select id="getList" resultType="com.bonus.aqgqj.basis.entity.vo.ExperimentalVo">
|
||||
|
|
@ -63,10 +130,15 @@
|
|||
SELECT DATE_FORMAT(ts.sample_date, '%Y-%m-%d') AS sampleDate,
|
||||
custom_id AS customId,
|
||||
custom_name AS customName,
|
||||
a.id AS configId
|
||||
a.id AS configId,
|
||||
a.dev_type_code AS devTypeCode,
|
||||
a.dev_type_name AS devTypeName,
|
||||
a.dev_module AS devModule,
|
||||
a.exper_local_code AS experLocalCode,
|
||||
a.exper_local AS experLocal
|
||||
FROM tb_sample ts
|
||||
LEFT JOIN (
|
||||
SELECT tsd.dev_type_code,tsc.id,tsd.sample_id
|
||||
SELECT tsd.dev_type_code,tsc.dev_type_name,tsc.dev_module,tsc.exper_local_code,tsc.exper_local,tsc.id,tsd.sample_id
|
||||
FROM tb_sample_device tsd
|
||||
LEFT JOIN tb_exper_config tsc ON tsc.dev_type_code = tsd.dev_type_code AND tsc.del_flag = 0
|
||||
WHERE tsd.sample_id = #{id} AND tsd.del_falg = 0 AND tsd.dev_type_code = #{devTypeCode}
|
||||
|
|
|
|||
Loading…
Reference in New Issue