/*
|
* Copyright (c) 2018-2025, ztt All rights reserved.
|
*
|
* Redistribution and use in source and binary forms, with or without
|
* modification, are permitted provided that the following conditions are met:
|
*
|
* Redistributions of source code must retain the above copyright notice,
|
* this list of conditions and the following disclaimer.
|
* Redistributions in binary form must reproduce the above copyright
|
* notice, this list of conditions and the following disclaimer in the
|
* documentation and/or other materials provided with the distribution.
|
* Neither the name of the pig4cloud.com developer nor the names of its
|
* contributors may be used to endorse or promote products derived from
|
* this software without specific prior written permission.
|
* Author: ztt
|
*/
|
|
package com.chinaztt.mes.quality.mapper;
|
|
import com.alibaba.fastjson.JSONObject;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.chinaztt.mes.quality.dto.*;
|
import com.chinaztt.mes.quality.entity.ApplyPart;
|
import com.chinaztt.mes.quality.entity.TestStandard;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
|
import java.util.List;
|
import java.util.Set;
|
|
/**
|
* 检测申请材料表
|
*
|
* @author cxf
|
* @date 2021-04-01 13:34:51
|
*/
|
@Mapper
|
public interface ApplyPartMapper extends BaseMapper<ApplyPart> {
|
/**
|
* 分页查询
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<ApplyPartDTO>> getApplyPartPage(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen);
|
|
/**
|
* 分页查询未被汇报的申请材料
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<ApplyPartDTO>> getApplyPartPageForReport(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen);
|
|
/**
|
* 分页查询不合格的申请材料
|
*
|
* @param page
|
* @param gen
|
* @param unqualifiedProcessId
|
* @return
|
*/
|
IPage<ApplyPartDTO> getApplyPartPageForUnqualified(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen, @Param("unqualifiedProcessId") Long unqualifiedProcessId);
|
|
/**
|
* 通过id删除检测报告材料表
|
*
|
* @param id
|
* @return
|
*/
|
int deleteByIdForReport(Long id);
|
|
/**
|
* 查询制造订单-检测标准
|
*
|
* @param systemNo
|
* @return
|
*/
|
List<TestStandard> findTestStandardNoBySystemNo(String systemNo);
|
|
/**
|
* 获取DTO
|
*
|
* @param id
|
* @return
|
*/
|
ApplyPartDTO getApplyPartDtoById(Long id);
|
|
/**
|
* 根据系统编号查询产出零件信息
|
*
|
* @param systemNo
|
* 改造(22-09-13)报检时需要对交接班的产出进行产量的汇总
|
* @return
|
*/
|
JSONObject selectShowInfoBySystemNo(String systemNo);
|
|
/**
|
* 根据材料申请的id查询材料申请表(erp移库进合格库的)
|
*
|
* @param idList
|
* @param locationNo
|
* @return
|
*/
|
List<JSONObject> selectApplyPart(@Param("idList") Set<Long> idList, @Param("locationNo") String locationNo);
|
|
/**
|
* 根据材料申请的id查询材料申请表(erp移库进不合格库的)
|
*
|
* @param idList
|
* @param locationNo
|
* @return
|
*/
|
List<JSONObject> selectUnApplyPart(@Param("idList") Set<Long> idList, @Param("locationNo") String locationNo);
|
|
/**
|
* 根据系统唯一编号查出零件id
|
*
|
* @param systemNo
|
* @return
|
*/
|
Long selectPartIdBySystemNo(String systemNo);
|
|
/**
|
* 根据申请零件查询申请类型
|
*
|
* @param applyPartId
|
* @return
|
*/
|
String selectApplyTypeByApplyPartId(Long applyPartId);
|
|
/**
|
* 根据材料申请的id查询材料申请表(登记检验结果的)
|
*
|
* @param idList
|
* @param locationNo
|
* @return
|
*/
|
List<JSONObject> selectRegistrationApplyPart(@Param("idList") Set<Long> idList, @Param("locationNo") String locationNo);
|
|
/**
|
* 根据系统号查询工序id
|
*
|
* @param systemNo 系统号
|
* @return 工序id
|
*/
|
Long selectOperationIdBySystemNo(String systemNo);
|
|
/**
|
* 根据汇报id清空材料表汇报id
|
*
|
* @param reportId
|
*/
|
void clearReportId(Long reportId);
|
|
List<ApplyPart> selectListByReportId(Long reportId);
|
|
/**
|
* 根据检测类型和SN号码查询applyPart
|
*
|
* @param lotBatchNo
|
* @param applyType
|
* @return
|
*/
|
List<ApplyPart> selectApplyApertByInspState(@Param("lotBatchNo") String lotBatchNo, @Param("applyType") String applyType);
|
|
/**
|
* 根据检测类型和系统编号查询ApplyPartDTO
|
* @param systemNo
|
* @return
|
*/
|
List<ApplyPartDTO> getApplyPartDtoBySysNoAndAppType(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据系统编号查询对应的成品检检测汇报编号
|
* @param systemNo 系统编号
|
* @return
|
*/
|
String getFinishedProductReportNo(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据系统编号判断产出是否是最后一道工序
|
* @param systemNo 系统编号
|
* @return
|
*/
|
Boolean isLastOperationBySystemNo(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据产出系统编号获取对应的工序编号
|
* @param systemNo 系统编号
|
* @return 工序编号
|
*/
|
String selectOperationNoBySystemNo(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据产出系统编号判断是否需要自动创建成品检检测申请
|
* @param systemNo 系统编号
|
* @return true:需要自动创建成品检;false:不需要自动创建成品检
|
*/
|
Boolean isConfigFinishedProdTest(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据产出系统编号判断是否存在工序检、尾检这种从待检移合格或不合格的检测申请规则配置
|
* @param systemNo 系统编号
|
* @return true:存在该配置;false:不存在该配置
|
*/
|
Boolean isConfigMoveLibraryTest(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据系统编号判断是否存在检测申请配置
|
* @param systemNo 产出系统编号
|
* @return
|
*/
|
Boolean isExistTestApplyConfigBySystemNo(@Param("systemNo") String systemNo);
|
|
/**
|
* 根据检测类型及批次号判断是否存在该申请材料
|
* @param applyType 申请类型
|
* @param systemNo 系统号
|
* @return
|
*/
|
Long isAutoApplyPartExist(@Param("applyType") String applyType,@Param("systemNo") String systemNo);
|
|
/**
|
* 根据检测申请表id查找对应库存是否为工序库存
|
* @param id
|
* @return
|
*/
|
List<Boolean> selectStockOperationStatus(@Param("systemNo") String systemNo);
|
|
/**
|
* 质检合格率统计报表
|
* @param qualityCheckRateInputDTO
|
* @return
|
*/
|
IPage<List<QualityCheckRateDTO>> getQualityCheckRate(Page page,@Param("input") QualityCheckRateInputDTO qualityCheckRateInputDTO);
|
|
/**
|
* 质检合格率统计柱状图
|
* @param qualityCheckRateInputDTO
|
* @return
|
*/
|
List<QualityCheckRatePictureDTO> getQualityCheckRatePicture(@Param("input") QualityCheckRateInputDTO qualityCheckRateInputDTO);
|
|
/**
|
* 根据系统编号查询是否存在成品检测申请
|
* @param systemNo 系统编号
|
* @return
|
*/
|
boolean isExistFinishedApplyPart(@Param("systemNo") String systemNo);
|
|
/**
|
* 跟据系统编号查询车间订单配置的所有检测规则
|
* @param systemNo
|
* @return
|
*/
|
List<String> selectTestRulesBySystemNo(String systemNo);
|
|
IPage<ApplyPartDTO> getTestApplyPage(Page page, @Param("ew") QueryWrapper<ApplyPartDTO> gen, @Param("queryType") Integer queryType);
|
|
void removeReplacePart(Long id);
|
}
|