/* * 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 { /** * 分页查询 * * @param page * @param gen * @return */ IPage> getApplyPartPage(Page page, @Param("ew") QueryWrapper gen); /** * 分页查询未被汇报的申请材料 * * @param page * @param gen * @return */ IPage> getApplyPartPageForReport(Page page, @Param("ew") QueryWrapper gen); /** * 分页查询不合格的申请材料 * * @param page * @param gen * @param unqualifiedProcessId * @return */ IPage getApplyPartPageForUnqualified(Page page, @Param("ew") QueryWrapper gen, @Param("unqualifiedProcessId") Long unqualifiedProcessId); /** * 通过id删除检测报告材料表 * * @param id * @return */ int deleteByIdForReport(Long id); /** * 查询制造订单-检测标准 * * @param systemNo * @return */ List 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 selectApplyPart(@Param("idList") Set idList, @Param("locationNo") String locationNo); /** * 根据材料申请的id查询材料申请表(erp移库进不合格库的) * * @param idList * @param locationNo * @return */ List selectUnApplyPart(@Param("idList") Set 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 selectRegistrationApplyPart(@Param("idList") Set idList, @Param("locationNo") String locationNo); /** * 根据系统号查询工序id * * @param systemNo 系统号 * @return 工序id */ Long selectOperationIdBySystemNo(String systemNo); /** * 根据汇报id清空材料表汇报id * * @param reportId */ void clearReportId(Long reportId); List selectListByReportId(Long reportId); /** * 根据检测类型和SN号码查询applyPart * * @param lotBatchNo * @param applyType * @return */ List selectApplyApertByInspState(@Param("lotBatchNo") String lotBatchNo, @Param("applyType") String applyType); /** * 根据检测类型和系统编号查询ApplyPartDTO * @param systemNo * @return */ List 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 selectStockOperationStatus(@Param("systemNo") String systemNo); /** * 质检合格率统计报表 * @param qualityCheckRateInputDTO * @return */ IPage> getQualityCheckRate(Page page,@Param("input") QualityCheckRateInputDTO qualityCheckRateInputDTO); /** * 质检合格率统计柱状图 * @param qualityCheckRateInputDTO * @return */ List getQualityCheckRatePicture(@Param("input") QualityCheckRateInputDTO qualityCheckRateInputDTO); /** * 根据系统编号查询是否存在成品检测申请 * @param systemNo 系统编号 * @return */ boolean isExistFinishedApplyPart(@Param("systemNo") String systemNo); /** * 跟据系统编号查询车间订单配置的所有检测规则 * @param systemNo * @return */ List selectTestRulesBySystemNo(String systemNo); IPage getTestApplyPage(Page page, @Param("ew") QueryWrapper gen, @Param("queryType") Integer queryType); void removeReplacePart(Long id); }