diff --git a/tagApi-service/src/main/java/hw/tagApi/service/domain/HwTagRecord.java b/tagApi-service/src/main/java/hw/tagApi/service/domain/HwTagRecord.java index a4e4751..e45bd8b 100644 --- a/tagApi-service/src/main/java/hw/tagApi/service/domain/HwTagRecord.java +++ b/tagApi-service/src/main/java/hw/tagApi/service/domain/HwTagRecord.java @@ -1,123 +1,187 @@ package hw.tagApi.service.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; import hw.tagApi.common.annotation.Excel; import hw.tagApi.common.core.domain.BaseEntity; import hw.tagApi.common.annotation.Excel.Type; import lombok.Data; +import org.apache.poi.ss.usermodel.HorizontalAlignment; /** * 标签记录对象 hw_tag_record - * + * * @author Yinq * @date 2025-04-15 */ @EqualsAndHashCode(callSuper = true) @Data -public class HwTagRecord extends BaseEntity -{ +public class HwTagRecord extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键标识,RID */ - @Excel(name = "RID", type = Type.EXPORT) + /** + * 主键标识,RID + */ + @Excel(name = "RID") private Long rId; - /** TID */ - @Excel(name = "TID", type = Type.EXPORT) + /** + * TID + */ + @Excel(name = "TID") private String tId; - /** EPC */ - @Excel(name = "EPC", type = Type.EXPORT) + /** + * EPC + */ + @Excel(name = "EPC") private String epc; - /** 密码(预留字段) */ - @Excel(name = "密码", type = Type.EXPORT) + /** + * 密码(预留字段) + */ + @Excel(name = "密码") private String password; - /** 订单号,LOT */ - @Excel(name = "LOT", type = Type.EXPORT) + /** + * 订单号,LOT + */ + @Excel(name = "LOT") private String orderCode; - /** 批次编号,卷编号 */ - @Excel(name = "卷编号", type = Type.EXPORT) + /** + * 批次编号,卷编号 + */ + @Excel(name = "卷编号") private String batchNumber; - /** 标签序号,序号 */ - @Excel(name = "标签序号", type = Type.EXPORT) + /** + * 标签序号,序号 + */ + @Excel(name = "标签序号") private String tagSequence; - /** 总数量,本卷数量 */ - @Excel(name = "本卷数量", type = Type.EXPORT) + /** + * 总数量,本卷数量 + */ + @Excel(name = "本卷数量") private Long totalQuantity; - /** 标签批次号(预留字段) */ - @Excel(name = "标签批次号", type = Type.EXPORT) + /** + * 标签批次号(预留字段) + */ + @Excel(name = "标签批次号") private String tagBatch; - /** 型号,导入提供 */ - @Excel(name = "型号", type = Type.EXPORT) + /** + * 型号,导入提供 + */ + @Excel(name = "型号") private String modelCode; - /** 加工时间 */ + /** + * 加工时间 + */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "加工时间", type = Type.EXPORT, dateFormat = "yyyy/MM/dd HH:mm:ss") + @Excel(name = "加工时间", dateFormat = "yyyy/MM/dd HH:mm:ss") private Date processingTime; - /** 操作人员编号,生产人员编号 */ - @Excel(name = "生产人员编号", type = Type.EXPORT) + /** + * 操作人员编号,生产人员编号 + */ + @Excel(name = "生产人员编号") private String operatorId; - /** 测试结果 */ + /** + * 测试结果 + */ // @Excel(name = "测试结果") private String testResult; - /** 测试值 */ + /** + * 测试值 + */ // @Excel(name = "测试值") private String testValue; - /** 参考值 */ + /** + * 参考值 + */ // @Excel(name = "参考值") private String referenceValue; - /** 测试时间 */ + /** + * 测试时间 + */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // @Excel(name = "测试时间", width = 30, dateFormat = "yyyy-MM-dd") private Date testingTime; - /** 导入文件名 */ + /** + * 导入文件名 + */ // @Excel(name = "导入文件名") private String fileName; - /** 去向信息 */ + /** + * 去向信息 + */ @Excel(name = "去向信息") private String destinationInfo; - /** 是否在库 */ + /** + * 是否在库 + */ @Excel(name = "是否在库") private String libraryFlag; - /** 计划用途 */ + /** + * 计划用途 + */ @Excel(name = "计划用途") private String intendedUse; - /** 备注 */ + /** + * 备注 + */ @Excel(name = "备注") private String remark; - /** 数据状态标记 */ + @Excel(name = "", type = Type.EXPORT) + private String placeholderOne; + + @Excel(name = "", type = Type.EXPORT) + private String placeholderTwo; + + @Excel(name = "团队中心", type = Type.EXPORT, align = HorizontalAlignment.LEFT) + private String teamCenter; + + @Excel(name = "标签数据总库导出", type = Type.EXPORT, align = HorizontalAlignment.LEFT) + private String databaseExport; + + /** + * 数据状态标记 + */ private Integer delFlag; - /** 预留字段1 */ + /** + * 预留字段1 + */ // @Excel(name = "测试结果", type = Type.EXPORT) private String fields1; - /** 预留字段2 */ + /** + * 预留字段2 + */ // @Excel(name = "测试值", type = Type.EXPORT) private String fields2; - /** 预留字段3 */ + /** + * 预留字段3 + */ // @Excel(name = "参考值", type = Type.EXPORT) private String fields3; @@ -146,6 +210,11 @@ public class HwTagRecord extends BaseEntity */ private Integer queryResultsNumber; + /** + * 卷编号List + */ + private List batchNumberList; + @Override public String toString() { return "HwTagRecord{" + diff --git a/tagApi-service/src/main/java/hw/tagApi/service/mapper/HwTagRecordMapper.java b/tagApi-service/src/main/java/hw/tagApi/service/mapper/HwTagRecordMapper.java index 8520c31..517bf8d 100644 --- a/tagApi-service/src/main/java/hw/tagApi/service/mapper/HwTagRecordMapper.java +++ b/tagApi-service/src/main/java/hw/tagApi/service/mapper/HwTagRecordMapper.java @@ -98,5 +98,5 @@ public interface HwTagRecordMapper * @param epcs EPC列表 * @return 已存在的EPC集合 */ - public Set selectExistingEpcs(List epcs); + public List selectExistingEpcs(List epcs); } diff --git a/tagApi-service/src/main/java/hw/tagApi/service/service/IHwTagRecordService.java b/tagApi-service/src/main/java/hw/tagApi/service/service/IHwTagRecordService.java index ba70c22..b15d645 100644 --- a/tagApi-service/src/main/java/hw/tagApi/service/service/IHwTagRecordService.java +++ b/tagApi-service/src/main/java/hw/tagApi/service/service/IHwTagRecordService.java @@ -106,7 +106,7 @@ public interface IHwTagRecordService * @param epcs EPC列表 * @return 已存在的EPC集合 */ - public Set selectExistingEpcs(List epcs); + public List selectExistingEpcs(List epcs); /** * 导入数据 diff --git a/tagApi-service/src/main/java/hw/tagApi/service/service/impl/HwTagRecordServiceImpl.java b/tagApi-service/src/main/java/hw/tagApi/service/service/impl/HwTagRecordServiceImpl.java index 289534e..e792a77 100644 --- a/tagApi-service/src/main/java/hw/tagApi/service/service/impl/HwTagRecordServiceImpl.java +++ b/tagApi-service/src/main/java/hw/tagApi/service/service/impl/HwTagRecordServiceImpl.java @@ -187,11 +187,11 @@ public class HwTagRecordServiceImpl implements IHwTagRecordService { * @return 已存在的EPC集合 */ @Override - public Set selectExistingEpcs(List epcs) { + public List selectExistingEpcs(List epcs) { if (epcs == null || epcs.isEmpty()) { - return new HashSet<>(); + return new ArrayList<>(); } - return new HashSet<>(hwTagRecordMapper.selectExistingEpcs(epcs)); + return hwTagRecordMapper.selectExistingEpcs(epcs); } /** @@ -254,14 +254,13 @@ public class HwTagRecordServiceImpl implements IHwTagRecordService { // 如果不是更新模式,先批量查询所有TID Set existingTids = new HashSet<>(); boolean tIdFlag = ApiConstants.MODE_ADD.equals(importMode) || ApiConstants.MODE_ADD_NO_CHECK.equals(importMode); - if (tIdFlag) { - List allTids = tagList.stream() - .map(tag -> tag.get("TID").replace("-", "")) - .collect(Collectors.toList()); - existingTids = this.selectExistingTids(allTids); - } + List allTids = tagList.stream() + .map(tag -> tag.get("TID").replace("-", "")) + .collect(Collectors.toList()); + existingTids = this.selectExistingTids(allTids); + // 如果不是更新模式,批量查询所有EPC - Set existingEpcs = new HashSet<>(); + List existingEpcs = new ArrayList<>(); boolean epcCheckFlag = ApiConstants.MODE_ADD.equals(importMode) || ApiConstants.MODE_UPDATE.equals(importMode); if (epcCheckFlag) { List allEpcs = tagList.stream() @@ -305,7 +304,7 @@ public class HwTagRecordServiceImpl implements IHwTagRecordService { continue; } HwTagRecord record = new HwTagRecord(); - String lot = orderInfo.getOrDefault("orderNo","").replace("Lot", ""); + String lot = orderInfo.getOrDefault("orderNo", "").replace("Lot", ""); record.setOrderCode(lot); record.setBatchNumber(orderInfo.getOrDefault("batchNo", "")); record.setOperatorId(orderInfo.getOrDefault("operatorId", "")); @@ -337,16 +336,45 @@ public class HwTagRecordServiceImpl implements IHwTagRecordService { failCount++; continue; } - //校验EPC唯一 - if (epcCheckFlag && existingEpcs.contains(epc)) { - String errorMsg = String.format("EPC已存在:%s", epc); + if ((ApiConstants.MODE_UPDATE.equals(importMode) || ApiConstants.MODE_UPDATE_NO_CHECK.equals(importMode)) && !existingTids.contains(tid)) { + String errorMsg = String.format("数据库未查询到TID:%s,无法%s", tid, importMode); log.error(errorMsg); errorMessages.add(errorMsg); failCount++; continue; } + //校验EPC唯一 + if (epcCheckFlag) { + boolean isAddMode = ApiConstants.MODE_ADD.equals(importMode); + boolean isUpdateMode = ApiConstants.MODE_UPDATE.equals(importMode); + Set epcSet = isAddMode ? + existingEpcs.stream().map(HwTagRecord::getEpc).collect(Collectors.toSet()) : + Collections.emptySet(); + Map> epcMap = isUpdateMode ? + existingEpcs.stream().collect(Collectors.groupingBy(HwTagRecord::getEpc)) : + Collections.emptyMap(); + boolean conflict = false; + if (isAddMode && epcSet.contains(epc)) { + conflict = true; // ADD模式直接判断存在性 + } else if (isUpdateMode) { + // UPDATE模式:仅检查相同EPC但不同TID的情况 + List sameEpcs = epcMap.get(epc); + if (sameEpcs != null) { + conflict = sameEpcs.stream() + .anyMatch(r -> !r.getTId().equals(tid)); + } + } + if (conflict) { + String errorMsg = String.format("EPC已存在:%s", epc); + log.error(errorMsg); + errorMessages.add(errorMsg); + failCount++; + continue; + } + } // 更新方法 if ((ApiConstants.MODE_UPDATE.equals(importMode) || ApiConstants.MODE_UPDATE_NO_CHECK.equals(importMode)) && failCount == 0) { + this.updateHwTagRecordByTID(record); successCount++; continue; @@ -383,7 +411,7 @@ public class HwTagRecordServiceImpl implements IHwTagRecordService { failCount, String.join("; ", errorMessages))); } else { resFields.put(ApiConstants.IMPORT_STATUS, "导入成功"); - resFields.put(ApiConstants.DESCRIPTION, String.format("成功导入%d条数据", successCount)); + resFields.put(ApiConstants.DESCRIPTION, String.format(importMode + "成功导入%d条数据", successCount)); } } } catch (Exception e) { diff --git a/tagApi-service/src/main/java/hw/tagApi/service/service/impl/KDocsServiceImpl.java b/tagApi-service/src/main/java/hw/tagApi/service/service/impl/KDocsServiceImpl.java index 9f8f2cf..aa9fdcd 100644 --- a/tagApi-service/src/main/java/hw/tagApi/service/service/impl/KDocsServiceImpl.java +++ b/tagApi-service/src/main/java/hw/tagApi/service/service/impl/KDocsServiceImpl.java @@ -79,7 +79,7 @@ public class KDocsServiceImpl implements IKDocsService { } // 发送处理结果到回调接口 - httpClientUtils.sendResultToCallback(resList, ApiConstants.IN_CALLBACK_URL, ApiConstants.DATA_IMPORT); + httpClientUtils.sendResultToCallback(resList, ApiConstants.CALLBACK_URL, ApiConstants.DATA_IMPORT); }); return resApiContentList; @@ -149,12 +149,12 @@ public class KDocsServiceImpl implements IKDocsService { String epc = (String) fields.get("EPC"); selectTagRecord.setEpc(epc); } - if (fields.containsKey("搜索日期起点")) { - String startDate = (String) fields.get("搜索日期起点"); + if (fields.containsKey("筛选日期起点")) { + String startDate = (String) fields.get("筛选日期起点"); selectTagRecord.setStartDate(startDate); } - if (fields.containsKey("搜索日期终点")) { - String endDate = (String) fields.get("搜索日期终点"); + if (fields.containsKey("筛选日期终点")) { + String endDate = (String) fields.get("筛选日期终点"); selectTagRecord.setEndDate(endDate); } @@ -169,7 +169,7 @@ public class KDocsServiceImpl implements IKDocsService { if (data != null) { log.info("查询成功 - ID: {}, TID: {}, EPC: {}", queryId, data.getTId(), data.getEpc()); // 查询成功 - if (data.getQueryResultsNumber() > 1){ + if (data.getQueryResultsNumber() > 1) { response.getFields().put(ApiConstants.SELECT_STATUS, "系统错误"); response.getFields().put(ApiConstants.DESCRIPTION, "存在多个记录,请使用数据导出功能"); } else { @@ -196,12 +196,12 @@ public class KDocsServiceImpl implements IKDocsService { log.info("未找到记录 - ID: {}", queryId); // 未找到记录 response.getFields().put(ApiConstants.SELECT_STATUS, "未找到记录"); - if (fields.containsKey("搜索日期起点") && fields.containsKey("搜索日期终点")) { + if (fields.containsKey("筛选日期起点") && fields.containsKey("筛选日期终点")) { String message = String.format("已遍历整个数据库,生产日期从%s到%s,未找到匹配的记录。", - fields.get("搜索日期起点"), fields.get("搜索日期终点")); + fields.get("筛选日期起点"), fields.get("筛选日期终点")); response.getFields().put(ApiConstants.DESCRIPTION, message); log.debug("未找到记录详情 - ID: {}, 日期范围: {} - {}", - queryId, fields.get("搜索日期起点"), fields.get("搜索日期终点")); + queryId, fields.get("筛选日期起点"), fields.get("筛选日期终点")); } else { response.getFields().put(ApiConstants.DESCRIPTION, "未找到匹配的记录"); } @@ -241,19 +241,24 @@ public class KDocsServiceImpl implements IKDocsService { // 异步执行导出任务 executorService.execute(() -> { List resApiContentList = new ArrayList<>(); + Date nowDate = new Date(); for (ApiContent condition : content) { ApiContent response = new ApiContent(); response.setId(condition.getId()); try { Map fields = condition.getFields(); - String lot = fields.get("LOT") != null ? (String) fields.get("LOT") : ""; - String startDate = fields.get("导出日期起点") != null ? (String) fields.get("导出日期起点") : ""; - String endDate = fields.get("导出日期终点") != null ? (String) fields.get("导出日期终点") : ""; - String tagBatch = fields.get("标签批次号") != null ? (String) fields.get("标签批次号") : ""; - String batchNumber = fields.get("卷编号") != null ? (String) fields.get("卷编号") : ""; - String modelCode = fields.get("型号") != null ? (String) fields.get("型号") : ""; + String startDate = fields.get("筛选日期起点") != null ? (String) fields.get("筛选日期起点") : ""; + String endDate = fields.get("筛选日期终点") != null ? (String) fields.get("筛选日期终点") : ""; String TID = fields.get("TID") != null ? (String) fields.get("TID") : ""; String EPC = fields.get("EPC") != null ? (String) fields.get("EPC") : ""; + String remark = fields.get("备注") != null ? (String) fields.get("备注") : ""; + String lot = fields.get("LOT") != null ? (String) fields.get("LOT") : ""; + String tagBatch = fields.get("标签批次号") != null ? (String) fields.get("标签批次号") : ""; + String modelCode = fields.get("型号") != null ? (String) fields.get("型号") : ""; + String destinationInfo = fields.get("去向信息") != null ? (String) fields.get("去向信息") : ""; + String libraryFlag = fields.get("是否在库") != null ? (String) fields.get("是否在库") : ""; + String intendedUse = fields.get("计划用途") != null ? (String) fields.get("计划用途") : ""; + String batchNumber = fields.get("卷编号") != null ? (String) fields.get("卷编号") : ""; // 构建查询条件 HwTagRecord queryCondition = new HwTagRecord(); @@ -269,9 +274,6 @@ public class KDocsServiceImpl implements IKDocsService { if (StringUtils.hasText(tagBatch)) { queryCondition.setTagBatch(tagBatch); } - if (StringUtils.hasText(batchNumber)) { - queryCondition.setBatchNumber(batchNumber); - } if (StringUtils.hasText(modelCode)) { queryCondition.setModelCode(modelCode); } @@ -281,24 +283,55 @@ public class KDocsServiceImpl implements IKDocsService { if (StringUtils.hasText(EPC)) { queryCondition.setSelectEPC(EPC); } + if (StringUtils.hasText(remark)) { + queryCondition.setRemark(remark); + } + if (StringUtils.hasText(destinationInfo)) { + queryCondition.setDestinationInfo(destinationInfo); + } + if (StringUtils.hasText(libraryFlag)) { + queryCondition.setLibraryFlag(libraryFlag); + } + if (StringUtils.hasText(intendedUse)) { + queryCondition.setIntendedUse(intendedUse); + } + if (StringUtils.hasText(batchNumber) && !batchNumber.contains("-")) { + queryCondition.setBatchNumber(batchNumber); + } else if (StringUtils.hasText(batchNumber) && batchNumber.contains("-")) { + List batchNumberList = TagExcelUtil.splitHorizontalBarString(batchNumber); + queryCondition.setBatchNumberList(batchNumberList); + } // 执行查询 log.info("执行数据导出查询 - ID: {}", condition.getId()); long startTime = System.currentTimeMillis(); List records = tagRecordService.selectHwTagRecordList(queryCondition); - - Map responseFields = new HashMap<>(); if (records != null && !records.isEmpty()) { try { - String fileName = String.format("标签数据_%s.xlsx", condition.getId()); + SimpleDateFormat sDate = new SimpleDateFormat("yyyyMMdd-HHmm"); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); + + //组装数据 + records.get(0).setTeamCenter("导出时间"); + records.get(0).setDatabaseExport(sdf.format(nowDate)); + int classNum = 0; + for (String string : fields.keySet()) { + classNum++; + if (records.size() <= classNum) { + records.add(new HwTagRecord()); + } + records.get(classNum).setTeamCenter(string); + records.get(classNum).setDatabaseExport(String.valueOf(fields.get(string))); + } + + String fileName = String.format("团队中心-标签数据总库导出-%s.xlsx", sDate.format(nowDate)); String filePath = TagExcelUtil.generateTagExcel(records, fileName); long endTime = System.currentTimeMillis(); Duration duration = Duration.ofMillis(endTime - startTime); long minutes = duration.toMinutes(); long seconds = duration.minusMinutes(minutes).getSeconds(); Date futureDate = new Date(endTime + ApiConstants.PASS_TIME); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); log.info("数据库导出完成 - ID: {}, 记录数: {}, 耗时: {}分{}秒", condition.getId(), records.size(), minutes, seconds); responseFields.put(ApiConstants.EXPORT_STATUS, "导出成功"); responseFields.put(ApiConstants.DESCRIPTION, "耗时: " + minutes + "分" + seconds + "秒"); @@ -316,7 +349,6 @@ public class KDocsServiceImpl implements IKDocsService { } response.setFields(responseFields); - } catch (Exception e) { log.error("处理导出任务失败 - ID: {}", condition.getId(), e); response.setId(condition.getId()); @@ -329,7 +361,7 @@ public class KDocsServiceImpl implements IKDocsService { resApiContentList.add(response); } // 发送处理结果到回调接口 - httpClientUtils.sendResultToCallback(resApiContentList, ApiConstants.OUT_CALLBACK_URL, ApiConstants.DATA_EXPORT); + httpClientUtils.sendResultToCallback(resApiContentList, ApiConstants.CALLBACK_URL, ApiConstants.DATA_EXPORT); }); return result; diff --git a/tagApi-service/src/main/java/hw/tagApi/service/utils/TagExcelUtil.java b/tagApi-service/src/main/java/hw/tagApi/service/utils/TagExcelUtil.java index 169feac..8a5a1c0 100644 --- a/tagApi-service/src/main/java/hw/tagApi/service/utils/TagExcelUtil.java +++ b/tagApi-service/src/main/java/hw/tagApi/service/utils/TagExcelUtil.java @@ -38,11 +38,14 @@ public class TagExcelUtil { Sheet sheet = workbook.getSheetAt(0); Row row = sheet.getRow(0); - Cell cellI1 = row.getCell(8); // I列是第9列(索引8) - Cell cellJ1 = row.getCell(9); // J列是第10列(索引9) - boolean isInventoryFlag = validateCells(cellI1, cellJ1);//桌面读写器盘点模板 + String exportTemplate = getCellStringValue(row.getCell(0));//导出再导入模板 + boolean isInventoryFlag = validateCells(row.getCell(8), row.getCell(9));//桌面读写器盘点模板 - if (isInventoryFlag) { + if (StringUtils.hasText(exportTemplate) && exportTemplate.equals("RID")) { + List> tagList = parseTagList(sheet, 1); + result.put("tagList", tagList); + result.put("orderInfo", new HashMap<>()); + } else if (isInventoryFlag) { List> tagList = parseTagList(sheet, 1); result.put("tagList", tagList); result.put("orderInfo", new HashMap<>()); @@ -154,7 +157,7 @@ public class TagExcelUtil { List headers = new ArrayList<>(); // 获取最后一列的索引 int lastColumn = headerRow.getLastCellNum(); - + // 处理表头 for (int i = 0; i < lastColumn; i++) { Cell cell = headerRow.getCell(i); @@ -309,4 +312,53 @@ public class TagExcelUtil { } return true; } + + /** + * 当检测到"-"时,会将其拆分为连续的数字序列 + * + * @param input 字符串 + * @return + */ + public static List splitHorizontalBarString(String input) { + List result = new ArrayList<>(); + + if (input == null || input.isEmpty()) { + return result; + } + + if (input.contains("-")) { + String[] parts = input.split("-"); + if (parts.length == 2) { + try { + int start = Integer.parseInt(parts[0]); + int end = Integer.parseInt(parts[1]); + + // 确保start <= end + if (start > end) { + int temp = start; + start = end; + end = temp; + } + + // 生成连续数字序列 + for (int i = start; i <= end; i++) { + // 保持原始位数,前面补零 + String formatted = String.format("%0" + parts[0].length() + "d", i); + result.add(formatted); + } + } catch (NumberFormatException e) { + // 如果无法解析为数字,则直接添加原始字符串 + result.add(input); + } + } else { + // 如果"-"分割后不是两部分,则直接添加原始字符串 + result.add(input); + } + } else { + // 没有"-",直接添加 + result.add(input); + } + + return result; + } } \ No newline at end of file diff --git a/tagApi-service/src/main/resources/mapper/service/HwTagRecordMapper.xml b/tagApi-service/src/main/resources/mapper/service/HwTagRecordMapper.xml index fd0cc04..3007c23 100644 --- a/tagApi-service/src/main/resources/mapper/service/HwTagRecordMapper.xml +++ b/tagApi-service/src/main/resources/mapper/service/HwTagRecordMapper.xml @@ -90,6 +90,7 @@ and destination_info = #{destinationInfo} and library_flag = #{libraryFlag} and intended_use = #{intendedUse} + and remark like concat('%', #{remark}, '%') and fields_1 = #{fields1} and fields_2 = #{fields2} and fields_3 = #{fields3} @@ -98,6 +99,12 @@ and #{endDate} >= DATE_FORMAT(processing_time, '%Y/%m/%d') + + AND batch_number IN + + #{item} + + @@ -119,8 +126,8 @@ - + SELECT r_id, t_id, epc FROM hw_tag_record WHERE epc IN #{epc} @@ -232,23 +239,35 @@ t_id = #{tId}, epc = #{epc}, - password = #{password}, - order_code = #{orderCode}, - batch_number = #{batchNumber}, - tag_sequence = #{tagSequence}, + password = #{password}, + password = NULL, + order_code = #{orderCode}, + order_code = NULL, + batch_number = #{batchNumber}, + batch_number = NULL, + tag_sequence = #{tagSequence}, + tag_sequence = NULL, total_quantity = #{totalQuantity}, - tag_batch = #{tagBatch}, + tag_batch = #{tagBatch}, + tag_batch = NULL, model_code = #{modelCode}, processing_time = #{processingTime}, - operator_id = #{operatorId}, - test_result = #{testResult}, - test_value = #{testValue}, - reference_value = #{referenceValue}, + operator_id = #{operatorId}, + operator_id = NULL, + test_result = #{testResult}, + test_result = NULL, + test_value = #{testValue}, + test_value = NULL, + reference_value = #{referenceValue}, + reference_value = NULL, testing_time = #{testingTime}, - file_name = #{fileName}, - destination_info = #{destinationInfo}, - library_flag = #{libraryFlag}, - intended_use = #{intendedUse}, + file_name = #{fileName}, + file_name = NULL, + destination_info = #{destinationInfo}, + destination_info = NULL, + library_flag = #{libraryFlag}, + library_flag = NULL, + del_flag = #{delFlag}, fields_1 = #{fields1}, fields_2 = #{fields2}, @@ -257,7 +276,8 @@ create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, - remark = #{remark}, + remark = #{remark}, + remark = NULL, where t_id = #{tId}