package com.chinaztt.mes.production.mapper;
|
|
import com.baomidou.mybatisplus.annotation.SqlParser;
|
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.production.dto.EmsMachineYieldDTO;
|
import com.chinaztt.mes.production.dto.ProductOutputDTO;
|
import com.chinaztt.mes.production.dto.ProductOutputLabelDTO;
|
import com.chinaztt.mes.production.entity.ProductOutput;
|
import com.chinaztt.mes.production.excel.ProductOutPutData;
|
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Param;
|
|
import java.math.BigDecimal;
|
import java.util.List;
|
|
/**
|
* 报工产出表
|
*
|
* @author cxf
|
* @date 2020-11-17 10:12:32
|
*/
|
@Mapper
|
public interface ProductOutputMapper extends BaseMapper<ProductOutput> {
|
|
/**
|
* 根据主表id查询
|
*
|
* @param mainId
|
* @return
|
*/
|
List<ProductOutputDTO> getByMainId(Long mainId);
|
|
/**
|
* 分页查询生产进度
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<List<ProductOutputDTO>> getProductionProgress(Page page, @Param("ew") QueryWrapper<ProductOutputDTO> gen);
|
|
|
/**
|
* 根据报工主表删除员工产出记录
|
*
|
* @param mainId
|
*/
|
void deleteStaffOutByMainId(Long mainId);
|
|
/**
|
* 根据报工主表删除人工记录
|
*
|
* @param mainId
|
* @return
|
*/
|
int deleteArtificialInformationByMainId(Long mainId);
|
|
/**
|
* 根据产出id获取产出明细
|
*
|
* @param id
|
* @return
|
*/
|
List<ProductOutputDTO> getProductOutPutById(Long id);
|
|
/**
|
* 通过上班记录id查询产量
|
*
|
* @param dutyRecordId
|
* @return
|
*/
|
List<ProductOutputDTO> getOutputByDutyRecordId(Long dutyRecordId);
|
|
/**
|
* 通过上班记录idList查询产量
|
*
|
* @param dutyRecordIdList
|
* @return
|
*/
|
List<ProductOutputDTO> getOutputByDutyRecordIdList(@Param("dutyRecordIdList")List<Long> dutyRecordIdList);
|
|
/**
|
* 分页查询汇报产出
|
*
|
* @param page
|
* @param gen
|
* @return
|
*/
|
IPage<ProductOutputDTO> getOutputList(Page page, @Param("ew") QueryWrapper<ProductOutputDTO> gen, @Param("dto") ProductOutputDTO productOutputDTO);
|
|
/**
|
* 扫码查询汇报产出
|
*
|
* @param productOutputDTO
|
* @return
|
*/
|
List<ProductOutputDTO> getOutputListByScan(@Param("dto") ProductOutputDTO productOutputDTO);
|
|
/**
|
* 查询产出汇总数量
|
*
|
* @param gen
|
* @return
|
*/
|
BigDecimal getSumProductQty(@Param("ew") QueryWrapper<ProductOutputDTO> gen,@Param("dto") ProductOutputDTO productOutputDTO);
|
|
/**
|
* 工作站id获取报工产出
|
*
|
* @param page
|
* @param gen
|
* @param id
|
* @return
|
*/
|
IPage<List<ProductOutputDTO>> getProductOut(Page page, @Param("ew") QueryWrapper<ProductOutputDTO> gen, @Param("id") Long id);
|
|
|
/**
|
* 根据产出id 逻辑删除数据
|
*
|
* @param id
|
* @return
|
*/
|
int deleteProductOutPutById(Long id);
|
|
|
/**
|
* 查询交接班的产出
|
*
|
* @param opeartionTaskId 工单id
|
* @param workstationId 工作站id
|
* @return
|
*/
|
List<ProductOutputDTO> getShiftProductOutByOpIdAndWsId(@Param("workstationId") Long workstationId, @Param("opeartionTaskId") Long opeartionTaskId);
|
|
/**
|
* 根据报工产出SN查询产出明细
|
* @param sn
|
* @return
|
*/
|
List<ProductOutputDTO> getProductOutDetailsBySN(@Param("sn") String sn);
|
|
/**
|
* 获取交班后产出数量
|
*
|
* @param outputIds
|
* @return
|
*/
|
Integer getShiftedNumberByOutputIds(@Param("outputIds") List<Long> outputIds);
|
|
/**
|
* 清空交班id数据
|
* @param id
|
*/
|
void clearShiftOutputId(Long id);
|
|
int batchInsert(@Param("list") List<ProductOutputDTO> list);
|
/**
|
* 报工产出的导出
|
*
|
* @param operationTaskId
|
* @return
|
*/
|
List<ProductOutPutData> exportList(@Param("operationTaskId") Long operationTaskId, @Param("workstationId") Long workstationId);
|
|
/**
|
* 批量标签打印
|
* @param ids
|
* @return
|
*/
|
List<ProductOutputLabelDTO> batchLabelPrint(@Param("ids") List<Long> ids);
|
/**
|
* 根据产出批次号汇总产出数量(将交接班的产量一起汇总)
|
* @param batchNo
|
* @return
|
*/
|
BigDecimal sumProdOutQtyByBatchNo(@Param("batchNo") String batchNo);
|
|
/**
|
* 根据工单id查找产出
|
* @param operationTaskId
|
* @return
|
*/
|
List<ProductOutputDTO> selectByTaskId(@Param("id") Long operationTaskId);
|
|
/**
|
* 根据工单id查询草稿状态产出
|
* @param id
|
* @return
|
*/
|
List<ProductOutputDTO> getDraftProductOut(@Param("id") Long id);
|
|
/**
|
* 根据班次id查询人员产量工资
|
* @param dutyRecordId
|
* @return
|
*/
|
List<ProductOutputDTO> getStaffProductionWage(@Param("dutyRecordId") Long dutyRecordId);
|
|
/**
|
* 获取工单交班状态(参照 报工单查询交班状态方法)
|
* 实际生产环境下,一条报工单对应一条产出记录
|
* @param productMainId
|
* @return
|
*/
|
String judgeChangeshift(@Param("productMainId") Long productMainId);
|
|
|
/**
|
* 查找超报所需参数
|
* @param operationTaskId
|
* @return
|
*/
|
List<ProductOutputDTO> selectCheckOverProduction(@Param("id") Long operationTaskId);
|
|
|
/**
|
* 获取工单交班状态(参照 报工单查询交班状态方法)
|
* 实际生产环境下,一条报工单对应一条产出记录
|
* @param productMainIdList
|
* @return
|
*/
|
Integer countChangeshiftByList(@Param("productMainIdList") List<Long> productMainIdList);
|
|
/**
|
* 查询该上班记录下报工状态
|
* @param dutyRecordId
|
* @return
|
*/
|
List<String> getStateByDutyRecordId(@Param("dutyRecordId") Long dutyRecordId);
|
|
|
|
List<ProductOutputDTO> getDutyRecordByOutputId(@Param("productOutId") Long productOutId);
|
|
List<EmsMachineYieldDTO.MachineYieldDetailInfo> getEmsMachineYield(@Param("machineCode") String machineCode,
|
@Param("beginDate") String beginDate,
|
@Param("endDate") String endDate,
|
@Param("sqlDateFormat") String sqlDateFormat,
|
@Param("showDateFormat") String showDateFormat);
|
}
|