package cn.estsh.i3plus.pojo.mes.sqlpack;

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.MesEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import cn.estsh.i3plus.pojo.mes.bean.*;
import cn.estsh.i3plus.pojo.mes.bean.template.BasImportTemplate;
import cn.estsh.i3plus.pojo.mes.bean.template.BasImportTemplateDetails;
import cn.estsh.i3plus.pojo.mes.dbinterface.MesInterfaceDataMapper;
import cn.estsh.i3plus.pojo.mes.model.MgnPaintPolishingReportModel;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * @Description:
 * @Reference: Mes 条件封装
 * @Author: Crish
 * @CreateDate:2019-04-22-14:58
 * @Modify:
 **/
public class MesHqlPack {

    /**
     * 通用查询条件
     *
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getAllBaseData(String organizeCode) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_DEAL.NO.getValue(), "isDeleted", packBean);
        return packBean;
    }

    public static DdlPackBean getMesPcnByCondition(MesPcn mesPcn, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(mesPcn.getConnectIp())) {
            DdlPreparedPack.getStringLikerPack(mesPcn.getConnectIp(), "connectIp", packBean);
        }
        if (!StringUtils.isEmpty(mesPcn.getPcnName())) {
            DdlPreparedPack.getStringLikerPack(mesPcn.getPcnName(), "pcnName", packBean);
        }
        if (!StringUtils.isEmpty(mesPcn.getPcnCode())) {
            DdlPreparedPack.getStringLikerPack(mesPcn.getPcnCode(), "pcnCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPcn.getAreaCode())) {
            DdlPreparedPack.getStringLikerPack(mesPcn.getAreaCode(), "areaCode", packBean);
        }
        if (mesPcn.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(mesPcn.getIsValid(), "isValid", packBean);
        }
        return packBean;
    }

    /**
     * 生产计划查询条件封装
     *
     * @param mesPlanOrder
     * @return
     */
    public static DdlPackBean getPlanOrderCondition(MesPlanOrder mesPlanOrder, String organizeCode) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_DEAL.NO.getValue(), "isDeleted", packBean);

        if (!StringUtils.isEmpty(mesPlanOrder.getOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesPlanOrder.getOrderNo(), "orderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesPlanOrder.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesPlanOrder.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesPlanOrder.getPlanType() + "") && mesPlanOrder.getPlanTypeVal() != 0) {
            DdlPreparedPack.getNumEqualPack(mesPlanOrder.getPlanType(), "planType", packBean);
        }
        if (!StringUtils.isEmpty(mesPlanOrder.getStatus() + "") && mesPlanOrder.getStatusVal() != 0) {
            DdlPreparedPack.getNumEqualPack(mesPlanOrder.getStatus(), "status", packBean);
        }

        if (!StringUtils.isEmpty(mesPlanOrder.getCreateUser())) {
            DdlPreparedPack.getStringLikerPack(mesPlanOrder.getCreateUser(), "createUser", packBean);
        }
        if (!StringUtils.isEmpty(mesPlanOrder.getCustOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesPlanOrder.getCustOrderNo(), "custOrderNo", packBean);
        }

        // 时间段查询
        if (!StringUtil.isEmpty(mesPlanOrder.getStartTimeStart()) || !StringUtil.isEmpty(mesPlanOrder.getStartTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesPlanOrder.getStartTimeStart(),
                    mesPlanOrder.getStartTimeEnd(),
                    "startTime", packBean, true);
        }
        if (!StringUtil.isEmpty(mesPlanOrder.getEndTimeStart()) || !StringUtil.isEmpty(mesPlanOrder.getEndTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesPlanOrder.getEndTimeStart(),
                    mesPlanOrder.getEndTimeEnd(),
                    "endTime", packBean, true);
        }
        if (!StringUtil.isEmpty(mesPlanOrder.getCreateDateTimeStart()) || !StringUtil.isEmpty(mesPlanOrder.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesPlanOrder.getCreateDateTimeStart(),
                    mesPlanOrder.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 物料信息查询条件封装
     *
     * @param mesPart
     * @return
     */
    public static DdlPackBean getPartCondition(MesPart mesPart, String organizeCode) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_DEAL.NO.getValue(), "isDeleted", packBean);

        if (!StringUtils.isEmpty(mesPart.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesPart.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesPart.getPartName())) {
            DdlPreparedPack.getStringLikerPack(mesPart.getPartName(), "partName", packBean);
        }
        if (!StringUtils.isEmpty(mesPart.getCategoryCode1())) {
            DdlPreparedPack.getStringEqualPack(mesPart.getCategoryCode1(), "categoryCode1", packBean);
        }
        if (!StringUtils.isEmpty(mesPart.getCategoryCode2())) {
            DdlPreparedPack.getStringEqualPack(mesPart.getCategoryCode2(), "categoryCode2", packBean);
        }
        if (!StringUtils.isEmpty(mesPart.getCategoryCode3())) {
            DdlPreparedPack.getStringEqualPack(mesPart.getCategoryCode3(), "categoryCode3", packBean);
        }
        if (!StringUtils.isEmpty(mesPart.getProduceCategoryCode()) && mesPart.getProduceCategoryCode().toUpperCase().equals("WXJ")) {
            DdlPreparedPack.getStringEqualPack("WXJ", "produceCategoryCode", packBean);
        } else {
            DdlPreparedPack.getStringNoEqualPack("WXJ", "produceCategoryCode", packBean);
        }
        return packBean;
    }

    /**
     * 生产工单查询条件封装
     *
     * @param mesWorkOrder
     * @return
     */
    public static DdlPackBean getWorkOrderCondition(MesWorkOrder mesWorkOrder, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(mesWorkOrder.getOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesWorkOrder.getOrderNo(), "orderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesWorkOrder.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getPartNameRdd())) {
            DdlPreparedPack.getStringLikerPack(mesWorkOrder.getPartNameRdd(), "partNameRdd", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getWorkOrderStatus() + "") && mesWorkOrder.getWorkOrderStatusVal() != 0) {
            DdlPreparedPack.getNumEqualPack(mesWorkOrder.getWorkOrderStatus(), "workOrderStatus", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(mesWorkOrder.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (mesWorkOrder.getApprovalStatus() != null) {
            DdlPreparedPack.getNumEqualPack(mesWorkOrder.getApprovalStatus(), "approvalStatus", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getWorkOrderType() + "") && mesWorkOrder.getWorkOrderTypeVal() != 0) {
            DdlPreparedPack.getNumEqualPack(mesWorkOrder.getWorkOrderType(), "workOrderType", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getCustOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesWorkOrder.getCustOrderNo(), "custOrderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getPlanOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesWorkOrder.getPlanOrderNo(), "planOrderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getCreateUser())) {
            DdlPreparedPack.getStringLikerPack(mesWorkOrder.getCreateUser(), "createUser", packBean);
        }
        if (mesWorkOrder.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(mesWorkOrder.getIsValid(), "isValid", packBean);
        }

        // 时间段查询
        if (!StringUtil.isEmpty(mesWorkOrder.getStartTimeStart()) || !StringUtil.isEmpty(mesWorkOrder.getStartTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesWorkOrder.getStartTimeStart(),
                    mesWorkOrder.getStartTimeEnd(),
                    "startTime", packBean, true);
        }
        if (!StringUtil.isEmpty(mesWorkOrder.getEndTimeStart()) || !StringUtil.isEmpty(mesWorkOrder.getEndTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesWorkOrder.getEndTimeStart(),
                    mesWorkOrder.getEndTimeEnd(),
                    "endTime", packBean, true);
        }
        if (!StringUtil.isEmpty(mesWorkOrder.getCreateDateTimeStart()) || !StringUtil.isEmpty(mesWorkOrder.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesWorkOrder.getCreateDateTimeStart(),
                    mesWorkOrder.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        DdlPreparedPack.getStringLikerPack(mesWorkOrder.getAreaCode(), "areaCode", packBean);
        DdlPreparedPack.getOrderDefault(mesWorkOrder);
        return packBean;
    }

    /**
     * 生产队列查询条件封装
     *
     * @param mesQueueOrder
     * @return
     */
    public static DdlPackBean getQueueOrder(MesQueueOrder mesQueueOrder, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(mesQueueOrder.getCustFlagNoStart())) {
            DdlPreparedPack.getStringBiggerPack(mesQueueOrder.getCustFlagNoStart(), "custFlagNo", packBean);
        }

        if (!StringUtils.isEmpty(mesQueueOrder.getCustFlagNoEnd() + "")) {
            DdlPreparedPack.getStringSmallerPack(mesQueueOrder.getCustFlagNoEnd(), "custFlagNo", packBean);
        }

        if (!StringUtils.isEmpty(mesQueueOrder.getOrderNo() + "")) {
            DdlPreparedPack.getStringLikerPack(mesQueueOrder.getOrderNo(), "orderNo", packBean);
        }

        if (mesQueueOrder.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(mesQueueOrder.getIsValid(), "isValid", packBean);
        }

        if (!StringUtils.isEmpty(mesQueueOrder.getWorkType())) {
            DdlPreparedPack.getStringEqualPack(mesQueueOrder.getWorkType(), "workType", packBean);
        }
        if (!StringUtils.isEmpty(mesQueueOrder.getCustProdLineCode())) {
            DdlPreparedPack.getStringLikerPack(mesQueueOrder.getCustProdLineCode(), "custProdLineCode", packBean);
        }
        if (!StringUtils.isEmpty(mesQueueOrder.getPgCode())) {
            DdlPreparedPack.getStringLikerPack(mesQueueOrder.getPgCode(), "pgCode", packBean);
        }
        if (mesQueueOrder.getQueueType() != null) {
            DdlPreparedPack.getNumEqualPack(mesQueueOrder.getQueueType(), "queueType", packBean);
        }

        // 只查询创建状态的队列
        DdlPreparedPack.getNumEqualPack(MesEnumUtil.QUEUE_ORDER_STATUS.NORMAL.getValue(), "status", packBean);

        if (!StringUtil.isEmpty(mesQueueOrder.getCreateDateTimeStart()) || !StringUtil.isEmpty(mesQueueOrder.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesQueueOrder.getCreateDateTimeStart(),
                    mesQueueOrder.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        // DdlPreparedPack.getOrderDefault(mesQueueOrder);
        return packBean;
    }

    /**
     * 通用查询条件
     *
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getAllBaseDataByNormalPro(BaseBean baseBean, String organizeCode) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(baseBean.getIsValid(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_DEAL.NO.getValue(), "isDeleted", packBean);
        return packBean;
    }

    /**
     * MES区域信息查询条件封装
     *
     * @param mesArea
     * @return
     */
    public static DdlPackBean getMesArea(MesArea mesArea, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesArea, organizeCode);
        if (!StringUtils.isEmpty(mesArea.getAreaCode())) {
            DdlPreparedPack.getStringLikerPack(mesArea.getAreaCode(), "areaCode", packBean);
        }
        if (!StringUtils.isEmpty(mesArea.getAreaName())) {
            DdlPreparedPack.getStringLikerPack(mesArea.getAreaName(), "areaName", packBean);
        }

        return packBean;
    }

    /**
     * MES工作中心信息查询条件封装
     *
     * @param mesWorkCenter
     * @return
     */
    public static DdlPackBean getMesWorkCenter(MesWorkCenter mesWorkCenter, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesWorkCenter, organizeCode);
        if (!StringUtils.isEmpty(mesWorkCenter.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCenter.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCenter.getWorkCenterName())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCenter.getWorkCenterName(), "workCenterName", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCenter.getAreaCode())) {
            DdlPreparedPack.getStringEqualPack(mesWorkCenter.getAreaCode(), "areaCode", packBean);
        }
        return packBean;
    }

    /**
     * MES工作单元信息查询条件封装
     *
     * @param mesWorkCell
     * @return
     */
    public static DdlPackBean getMesWorkCell(MesWorkCell mesWorkCell, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesWorkCell, organizeCode);
        if (!StringUtils.isEmpty(mesWorkCell.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCell.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCell.getAreaCode())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCell.getAreaCode(), "areaCode", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCell.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCell.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCell.getWorkCellName())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCell.getWorkCellName(), "workCellName", packBean);
        }

        return packBean;
    }

    /**
     * 流程查询条件封装
     *
     * @param mesRoute
     * @return
     */
    public static DdlPackBean packHqlMesRoute(MesRoute mesRoute, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesRoute, organizeCode);
        DdlPreparedPack.getStringLikerPack(mesRoute.getRouteCode(), "routeCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesRoute.getRouteName(), "routeName", packBean);
        return packBean;
    }

    /**
     * 产品流程配置查询条件封装
     *
     * @param mesProdRouteCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean packHqlMesProdRouteCfg(MesProdRouteCfg mesProdRouteCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesProdRouteCfg, organizeCode);
        DdlPreparedPack.getStringEqualPack(mesProdRouteCfg.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringEqualPack(mesProdRouteCfg.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getStringEqualPack(mesProdRouteCfg.getRouteCode(), "routeCode", packBean);
        return packBean;
    }

    /**
     * MES班次信息查询条件封装
     *
     * @param shift
     * @return
     */
    public static DdlPackBean getMesShift(MesShift shift, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(shift, organizeCode);
        if (!StringUtils.isEmpty(shift.getShiftCode())) {
            DdlPreparedPack.getStringLikerPack(shift.getShiftCode(), "shiftCode", packBean);
        }
        if (!StringUtils.isEmpty(shift.getShiftName())) {
            DdlPreparedPack.getStringLikerPack(shift.getShiftName(), "shiftName", packBean);
        }
        if (!StringUtils.isEmpty(shift.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(shift.getWorkCenterCode(), "workCenterCode", packBean);
        }

        return packBean;
    }

    /**
     * MES班组信息查询条件封装
     *
     * @param shiftGroup
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesShiftGroup(MesShiftGroup shiftGroup, String organizeCode) {

        DdlPackBean packBean = getAllBaseDataByNormalPro(shiftGroup, organizeCode);
        if (!StringUtils.isEmpty(shiftGroup.getGroupCode())) {
            DdlPreparedPack.getStringLikerPack(shiftGroup.getGroupCode(), "groupCode", packBean);
        }
        if (!StringUtils.isEmpty(shiftGroup.getGroupName())) {
            DdlPreparedPack.getStringLikerPack(shiftGroup.getGroupName(), "groupName", packBean);
        }
        if (!StringUtils.isEmpty(shiftGroup.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(shiftGroup.getWorkCenterCode(), "workCenterCode", packBean);
        }
        return packBean;
    }

    /**
     * MES班次休息信息查询条件封装
     *
     * @param shiftRest
     * @return
     */
    public static DdlPackBean getMesShiftRest(MesShiftRest shiftRest, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(shiftRest, organizeCode);
        if (!StringUtils.isEmpty(shiftRest.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(shiftRest.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(shiftRest.getShiftCode())) {
            DdlPreparedPack.getStringEqualPack(shiftRest.getShiftCode(), "shiftCode", packBean);
        }

        return packBean;
    }

    /**
     * MES 报废信息查询
     *
     * @param mesScrap
     * @return
     */
    public static DdlPackBean getMesScrap(MesScrap mesScrap, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(mesScrap.getScrapCode())) {
            DdlPreparedPack.getStringLikerPack(mesScrap.getScrapCode(), "scrapCode", packBean);
        }
        if (!StringUtils.isEmpty(mesScrap.getScrapName())) {
            DdlPreparedPack.getStringLikerPack(mesScrap.getScrapName(), "scrapName", packBean);
        }
        if (mesScrap.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(mesScrap.getIsValid(), "isValid", packBean);
        }
        return packBean;
    }


    /**
     * MES 开线管控
     *
     * @param wcCheck
     * @return
     */
    public static DdlPackBean getMesWcCheck(MesWcCheck wcCheck, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(wcCheck, organizeCode);
//        DdlPreparedPack.getNumEqualPack(mesWcCheck.getIsValid(),"isValid",packBean);
        DdlPreparedPack.getStringLikerPack(wcCheck.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getStringLikerPack(wcCheck.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringEqualPack(wcCheck.getCheckType(), "checkType", packBean);
        DdlPreparedPack.getStringLikerPack(wcCheck.getCheckObj(), "checkObj", packBean);
        DdlPreparedPack.getStringLikerPack(wcCheck.getCheckItem(), "checkItem", packBean);
        return packBean;
    }

    /**
     * MES PCN系统配置信息条件查询
     *
     * @param mesConfig
     * @return
     */
    public static DdlPackBean getMesConfig(MesConfig mesConfig, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        DdlPreparedPack.getStringLikerPack(mesConfig.getCfgCode(), "cfgCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesConfig.getCfgName(), "cfgName", packBean);
        DdlPreparedPack.getStringEqualPack(mesConfig.getCfgKey(), "cfgKey", packBean);
        DdlPreparedPack.getStringEqualPack(mesConfig.getCfgType(), "cfgType", packBean);
        DdlPreparedPack.getNumEqualPack(mesConfig.getIsValid(), "isValid", packBean);
        return packBean;
    }

    /**
     * MES 维修信息条件查询
     *
     * @param mesRepair
     * @return
     */
    public static DdlPackBean getMesRepair(MesRepair mesRepair, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(mesRepair.getRepairCode())) {
            DdlPreparedPack.getStringLikerPack(mesRepair.getRepairCode(), "repairCode", packBean);
        }
        if (!StringUtils.isEmpty(mesRepair.getRepairName())) {
            DdlPreparedPack.getStringLikerPack(mesRepair.getRepairName(), "repairName", packBean);
        }
        if (mesRepair.getRepairType() != null) {
            DdlPreparedPack.getStringEqualPack(mesRepair.getRepairType(), "repairType", packBean);
        }
        if (mesRepair.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(mesRepair.getIsValid(), "isValid", packBean);
        }

        return packBean;
    }

    /**
     * MES 上传文件FastDfs封装
     *
     * @param esop
     * @return
     */
    public static DdlPackBean getEsopExcludeById(MesEsop esop, String org) {
        DdlPackBean packBean = getAllBaseData(org);
        DdlPreparedPack.getStringEqualPack(esop.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringEqualPack(esop.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getStringEqualPack(esop.getWorkCellCode(), "workCellCode", packBean);
        DdlPreparedPack.getNumNOEqualPack(esop.getId(), "id", packBean);
        return packBean;
    }

    public static DdlPackBean getEsop(MesEsop esop, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(esop, organizeCode);
        DdlPreparedPack.getStringEqualPack(esop.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getStringLikerPack(esop.getPartNo(), "partNo", packBean);
        return packBean;
    }

    /**
     * 事件分页获取封装
     *
     * @param mesEvent
     * @param
     * @return
     */
    public static DdlPackBean getMesEvent(MesEvent mesEvent) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEvent, mesEvent.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesEvent.getButtonCode(), "buttonCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesEvent.getEventCode(), "eventCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesEvent.getEventName(), "eventName", packBean);
        return packBean;
    }

    public static DdlPackBean getMesEventExcludeById(MesEvent mesEvent) {
        DdlPackBean packBean = getAllBaseData(mesEvent.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesEvent.getEventCode(), "eventCode", packBean);
        DdlPreparedPack.getNumNOEqualPack(mesEvent.getId(), "id", packBean);
        return packBean;
    }

    public static DdlPackBean getMesEventByButtonCode(String buttonCode, String org) {
        DdlPackBean packBean = getAllBaseData(org);
        DdlPreparedPack.getStringEqualPack(buttonCode, "buttonCode", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        return packBean;
    }

    public static DdlPackBean getMesEventByEventCode(MesEvent mesEvent) {
        DdlPackBean packBean = getAllBaseData(mesEvent.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesEvent.getEventCode(), "eventCode", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        return packBean;
    }

    public static DdlPackBean getMesEventByEventName(MesEvent mesEvent) {
        DdlPackBean packBean = getAllBaseData(mesEvent.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesEvent.getEventName(), "eventName", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        return packBean;
    }

    public static DdlPackBean getMesActionByActionCode(MesAction mesAction, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesAction, organizeCode);
        DdlPreparedPack.getStringEqualPack(mesAction.getActionCode(), "actionCode", packBean);
        return packBean;
    }

    public static DdlPackBean getMesActionByActionName(MesAction mesAction, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesAction, organizeCode);
        DdlPreparedPack.getStringEqualPack(mesAction.getActionName(), "actionName", packBean);
        return packBean;
    }

    public static DdlPackBean getMesActionExcludeById(MesAction mesAction) {
        DdlPackBean packBean = getAllBaseData(mesAction.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesAction.getActionCode(), "actionCode", packBean);
        DdlPreparedPack.getNumNOEqualPack(mesAction.getId(), "id", packBean);
        return packBean;
    }

    /**
     * 动作分页获取封装
     *
     * @param mesAction
     * @return
     */
    public static DdlPackBean getMesAction(MesAction mesAction) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesAction, mesAction.getOrganizeCode());
        DdlPreparedPack.getStringRightLikerPack(mesAction.getActionCode(), "actionCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesAction.getActionName(), "actionName", packBean);
        DdlPreparedPack.getNumEqualPack(mesAction.getActionType(), "actionType", packBean);

        return packBean;
    }

    /**
     * 函数分页获取封装
     *
     * @param mesMethod
     * @return
     */
    public static DdlPackBean getMesMethod(MesMethod mesMethod) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesMethod, mesMethod.getOrganizeCode());
        DdlPreparedPack.getStringRightLikerPack(mesMethod.getMethodCode(), "methodCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesMethod.getMethodName(), "methodName", packBean);
        DdlPreparedPack.getStringRightLikerPack(mesMethod.getCallClass(), "callClass", packBean);

        return packBean;
    }

    public static DdlPackBean getMesMethodByMethodCode(MesMethod mesMethod) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesMethod, mesMethod.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesMethod.getMethodCode(), "methodCode", packBean);
        return packBean;
    }

    public static DdlPackBean getMesMethodByMethodName(MesMethod mesMethod) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesMethod, mesMethod.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesMethod.getMethodName(), "methodName", packBean);
        return packBean;
    }

    /**
     * 事件动作分页获取封装
     *
     * @param mesActionMethod
     * @return
     */
    public static DdlPackBean getMesActionMethod(MesActionMethod mesActionMethod) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesActionMethod, mesActionMethod.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesActionMethod.getActionCode(), "actionCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesActionMethod.getMethodCode(), "methodCode", packBean);
        return packBean;
    }

    /**
     * 事件动作分页获取封装
     *
     * @param mesEventAction
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEventAction(MesEventAction mesEventAction, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEventAction, organizeCode);
        if (!StringUtils.isEmpty(mesEventAction.getOrganizeCode())) {
            DdlPreparedPack.getStringEqualPack(mesEventAction.getOrganizeCode(), "organizeCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEventAction.getEventCode())) {
            DdlPreparedPack.getStringLikerPack(mesEventAction.getEventCode(), "eventCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEventAction.getActionCode())) {
            DdlPreparedPack.getStringLikerPack(mesEventAction.getActionCode(), "actionCode", packBean);
        }

        return packBean;
    }

    /******************created by wynne*************/
    /**
     * MES工序信息查询条件封装
     *
     * @param process
     * @return
     */
    public static DdlPackBean getMesProcess(MesProcess process, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(process, organizeCode);
        if (!StringUtils.isEmpty(process.getProcessCode())) {
            DdlPreparedPack.getStringLikerPack(process.getProcessCode(), "processCode", packBean);
        }
        if (!StringUtils.isEmpty(process.getProcessName())) {
            DdlPreparedPack.getStringLikerPack(process.getProcessName(), "processName", packBean);
        }

        return packBean;
    }

    /**
     * MES工步信息查询条件封装
     *
     * @param step
     * @return
     */
    public static DdlPackBean getMesStep(MesStep step, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(step, organizeCode);
        if (!StringUtils.isEmpty(step.getStepCode())) {
            DdlPreparedPack.getStringLikerPack(step.getStepCode(), "stepCode", packBean);
        }
        if (!StringUtils.isEmpty(step.getStepName())) {
            DdlPreparedPack.getStringLikerPack(step.getStepName(), "stepName", packBean);
        }
        if (!StringUtils.isEmpty(step.getStepType())) {
            DdlPreparedPack.getStringLikerPack(step.getStepType(), "stepType", packBean);
        }

        return packBean;
    }

    /**
     * MES工步信息查询条件封装
     *
     * @param staff
     * @return
     */
    public static DdlPackBean getStaff(MesStaff staff, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(staff, organizeCode);
        if (!StringUtils.isEmpty(staff.getUserCode())) {
            DdlPreparedPack.getStringLikerPack(staff.getUserCode(), "userCode", packBean);
        }
        if (!StringUtils.isEmpty(staff.getUserName())) {
            DdlPreparedPack.getStringLikerPack(staff.getUserName(), "userName", packBean);
        }
        if (!StringUtils.isEmpty(staff.getSkillLevel())) {
            DdlPreparedPack.getNumEqualPack(staff.getSkillLevel(), "skillLevel", packBean);
        }

        return packBean;
    }

    /**
     * 产线看板矩阵
     *
     * @param boardLineMatrix
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getBoardLineMatrix(MesBoardLineMatrix boardLineMatrix, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(boardLineMatrix, organizeCode);
        if (!StringUtils.isEmpty(boardLineMatrix.getAreaCode())) {
            DdlPreparedPack.getStringLikerPack(boardLineMatrix.getAreaCode(), "areaCode", packBean);
        }
        if (!StringUtils.isEmpty(boardLineMatrix.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(boardLineMatrix.getWorkCenterCode(), "workCenterCode", packBean);
        }

        return packBean;
    }

    /**
     * MES工步参数信息查询条件封装
     *
     * @param stepParam
     * @return
     */
    public static DdlPackBean getMesStepParam(MesStepParam stepParam, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(stepParam, organizeCode);
        if (!StringUtils.isEmpty(stepParam.getStepCode())) {
            DdlPreparedPack.getStringEqualPack(stepParam.getStepCode(), "stepCode", packBean);
        }
        if (!StringUtils.isEmpty(stepParam.getParamCode())) {
            DdlPreparedPack.getStringLikerPack(stepParam.getParamCode(), "paramCode", packBean);
        }
        if (!StringUtils.isEmpty(stepParam.getParamName())) {
            DdlPreparedPack.getStringLikerPack(stepParam.getParamName(), "paramName", packBean);
        }

        return packBean;
    }

    /**
     * MES工序工作单元对应关系查询条件封装
     *
     * @param routeProcessCell
     * @return
     */
    public static DdlPackBean getMesRouteProcessCell(MesRouteProcessCell routeProcessCell, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(routeProcessCell, organizeCode);
        if (!StringUtils.isEmpty(routeProcessCell.getRouteCode())) {
            DdlPreparedPack.getStringEqualPack(routeProcessCell.getRouteCode(), "routeCode", packBean);
        }
        if (!StringUtils.isEmpty(routeProcessCell.getProcessCode())) {
            DdlPreparedPack.getStringEqualPack(routeProcessCell.getProcessCode(), "processCode", packBean);
        }
        if (!StringUtils.isEmpty(routeProcessCell.getWorkCellCode())) {
            DdlPreparedPack.getStringEqualPack(routeProcessCell.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(routeProcessCell.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(routeProcessCell.getWorkCenterCode(), "workCenterCode", packBean);
        }

        return packBean;
    }

    /**
     * MES BOM信息查询条件封装
     *
     * @param bom
     * @return
     */
    public static DdlPackBean getMesBom(MesBom bom, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(bom, organizeCode);
        if (!StringUtils.isEmpty(bom.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(bom.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(bom.getItemPartNo())) {
            DdlPreparedPack.getStringLikerPack(bom.getItemPartNo(), "itemPartNo", packBean);
        }
        if (!StringUtils.isEmpty(bom.getBomVersion())) {
            DdlPreparedPack.getStringLikerPack(bom.getBomVersion(), "bomVersion", packBean);
        }

        return packBean;
    }

    /**
     * MES工序BOM信息查询条件封装
     *
     * @param stationBom
     * @return
     */
    public static DdlPackBean getStationBom(MesStationBom stationBom, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(stationBom, organizeCode);
        DdlPreparedPack.getStringLikerPack(stationBom.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringLikerPack(stationBom.getItemPartNo(), "itemPartNo", packBean);
        DdlPreparedPack.getStringEqualPack(stationBom.getWorkCellCode(), "workCellCode", packBean);
        DdlPreparedPack.getStringEqualPack(stationBom.getWorkCenterCode(), "workCenterCode", packBean);
        return packBean;
    }

    public static DdlPackBean getStationBomExcludeById(MesStationBom stationBom, String org) {
        DdlPackBean packBean = getAllBaseData(org);
        DdlPreparedPack.getStringEqualPack(stationBom.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringEqualPack(stationBom.getItemPartNo(), "itemPartNo", packBean);
        DdlPreparedPack.getStringEqualPack(stationBom.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getStringEqualPack(stationBom.getWorkCellCode(), "workCellCode", packBean);
        DdlPreparedPack.getNumEqualPack(stationBom.getIsFeed(), "isFeed", packBean);
        DdlPreparedPack.getNumNOEqualPack(stationBom.getId(), "id", packBean);
        return packBean;
    }

    /**
     * MES 客户信息查询条件封装
     *
     * @param customer
     * @return
     */
    public static DdlPackBean getMesCustomer(MesCustomer customer, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(customer, organizeCode);
        if (!StringUtils.isEmpty(customer.getCustomerCode())) {
            DdlPreparedPack.getStringLikerPack(customer.getCustomerCode(), "customerCode", packBean);
        }
        if (!StringUtils.isEmpty(customer.getCustomerName())) {
            DdlPreparedPack.getStringLikerPack(customer.getCustomerName(), "customerName", packBean);
        }

        return packBean;
    }

    /**
     * MES 客户产线信息查询条件封装
     *
     * @param custProdLine
     * @return
     */
    public static DdlPackBean getMesCustProdLine(MesCustProdLine custProdLine, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(custProdLine, organizeCode);
        if (!StringUtils.isEmpty(custProdLine.getCustProdLineCode())) {
            DdlPreparedPack.getStringLikerPack(custProdLine.getCustProdLineCode(), "custProdLineCode", packBean);
        }
        if (!StringUtils.isEmpty(custProdLine.getCustProdLineName())) {
            DdlPreparedPack.getStringLikerPack(custProdLine.getCustProdLineName(), "custProdLineName", packBean);
        }

        return packBean;
    }

    /**
     * MES 客户零件关系信息查询条件封装
     *
     * @param customerPart
     * @return
     */
    public static DdlPackBean getMesCustomerPart(MesCustomerPart customerPart, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(customerPart, organizeCode);
        if (!StringUtils.isEmpty(customerPart.getCustomerCode())) {
            DdlPreparedPack.getStringEqualPack(customerPart.getCustomerCode(), "customerCode", packBean);
        }
        if (!StringUtils.isEmpty(customerPart.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(customerPart.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(customerPart.getCustomerPartNo())) {
            DdlPreparedPack.getStringLikerPack(customerPart.getCustomerPartNo(), "customerPartNo", packBean);
        }
        if (!StringUtils.isEmpty(customerPart.getCustomerPartName())) {
            DdlPreparedPack.getStringLikerPack(customerPart.getCustomerPartName(), "customerPartName", packBean);
        }

        return packBean;
    }

    /**
     * MES 设备关键数据信息查询条件封装
     *
     * @param keyData
     * @return
     */
    public static DdlPackBean getMesKeyData(MesKeyData keyData, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(keyData, organizeCode);
        DdlPreparedPack.getStringLikerPack(keyData.getKeyDataCode(), "keyDataCode", packBean);
        DdlPreparedPack.getStringLikerPack(keyData.getKeyDataName(), "keyDataName", packBean);
        return packBean;
    }

    public static DdlPackBean getMesSpcKeyData(MesSpcKeyData keyData, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(keyData, organizeCode);
        if (!StringUtils.isEmpty(keyData.getObjectCode())) {
            DdlPreparedPack.getStringEqualPack(keyData.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(keyData.getFieldCode())) {
            DdlPreparedPack.getStringEqualPack(keyData.getFieldCode(), "fieldCode", packBean);
        }
        if (keyData.getObjectType() != null && keyData.getObjectType() != 0) {
            DdlPreparedPack.getNumEqualPack(keyData.getObjectType(), "objectType", packBean);
        }
        if (!StringUtils.isEmpty(keyData.getKdCondition())) {
            DdlPreparedPack.getStringEqualPack(keyData.getKdCondition(), "kdCondition", packBean);
        }
        if (!StringUtils.isEmpty(keyData.getKdName())) {
            DdlPreparedPack.getStringEqualPack(keyData.getKdName(), "kdName", packBean);
        }
        if (!StringUtils.isEmpty(keyData.getKdCode())) {
            DdlPreparedPack.getStringEqualPack(keyData.getKdCode(), "kdCode", packBean);
        }
        if (keyData.getSpecLsl() != null) {
            DdlPreparedPack.getNumEqualPack(keyData.getSpecLsl(), "specLsl", packBean);
        }
        if (keyData.getSpecUsl() != null) {
            DdlPreparedPack.getNumEqualPack(keyData.getSpecUsl(), "specUsl", packBean);
        }
        return packBean;
    }

    /**
     * MES 物料关键数据关系信息查询条件封装
     *
     * @param kpData
     * @return
     */
    public static DdlPackBean getMesKpData(MesKpData kpData, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(kpData, organizeCode);
        DdlPreparedPack.getStringLikerPack(kpData.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringLikerPack(kpData.getKeyDataCode(), "keyDataCode", packBean);
        return packBean;
    }

    /**
     * MES 产品配置类型信息查询条件封装
     *
     * @param prodCfgType
     * @return
     */
    public static DdlPackBean getMesProdCfgType(MesProdCfgType prodCfgType, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(prodCfgType, organizeCode);
        if (!StringUtils.isEmpty(prodCfgType.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringLikerPack(prodCfgType.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }
        if (!StringUtils.isEmpty(prodCfgType.getProdCfgTypeName())) {
            DdlPreparedPack.getStringLikerPack(prodCfgType.getProdCfgTypeName(), "prodCfgTypeName", packBean);
        }

        return packBean;
    }

    /**
     * MES 产品配置信息查询条件封装
     *
     * @param
     * @return
     */

    public static DdlPackBean getMesProdCfgExcludeById(MesProdRouteCfg mesProdRouteCfg, String org) {
        DdlPackBean packBean = getAllBaseData(org);
        DdlPreparedPack.getStringEqualPack(mesProdRouteCfg.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringEqualPack(mesProdRouteCfg.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getNumNOEqualPack(mesProdRouteCfg.getId(), "id", packBean);
        return packBean;
    }

    public static DdlPackBean getMesProdCfg(MesProdCfg prodCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(prodCfg, organizeCode);
        if (!StringUtils.isEmpty(prodCfg.getProdCfgCode())) {
            DdlPreparedPack.getStringLikerPack(prodCfg.getProdCfgCode(), "prodCfgCode", packBean);
        }
        if (!StringUtils.isEmpty(prodCfg.getProdCfgName())) {
            DdlPreparedPack.getStringLikerPack(prodCfg.getProdCfgName(), "prodCfgName", packBean);
        }
        if (!StringUtils.isEmpty(prodCfg.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringEqualPack(prodCfg.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }

        return packBean;
    }

    /**
     * MES 产品配置关系信息查询条件封装
     *
     * @param prodCfgDetail
     * @return
     */
    public static DdlPackBean getMesProdCfgDetail(MesProdCfgDetail prodCfgDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(prodCfgDetail, organizeCode);
        if (!StringUtils.isEmpty(prodCfgDetail.getProdCfgCode())) {
            DdlPreparedPack.getStringEqualPack(prodCfgDetail.getProdCfgCode(), "prodCfgCode", packBean);
        }
        if (!StringUtils.isEmpty(prodCfgDetail.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(prodCfgDetail.getPartNo(), "partNo", packBean);
        }

        return packBean;
    }

    /**
     * MES 检验单查询条件封装
     *
     * @param qcOrder
     * @return
     */
    public static DdlPackBean getMesQcOrder(MesQcOrder qcOrder, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(qcOrder, organizeCode);
        if (!StringUtils.isEmpty(qcOrder.getOrderNo())) {
            DdlPreparedPack.getStringEqualPack(qcOrder.getOrderNo(), "orderNo", packBean);
        }
        if (!StringUtils.isEmpty(qcOrder.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(qcOrder.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(qcOrder.getPartName())) {
            DdlPreparedPack.getStringLikerPack(qcOrder.getPartName(), "partName", packBean);
        }
        if (!StringUtils.isEmpty(qcOrder.getSupplierCode())) {
            DdlPreparedPack.getStringEqualPack(qcOrder.getSupplierCode(), "supplierCode", packBean);
        }
        if (!StringUtils.isEmpty(qcOrder.getCheckType())) {
            DdlPreparedPack.getNumEqualPack(qcOrder.getCheckType(), "checkType", packBean);
        }
        if (!StringUtils.isEmpty(qcOrder.getWorkCenterCode())) {
            DdlPreparedPack.getNumEqualPack(qcOrder.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(qcOrder.getRelationOrderNo())) {
            DdlPreparedPack.getNumEqualPack(qcOrder.getRelationOrderNo(), "relationOrderNo", packBean);
        }
        // 时间段查询
        if (!StringUtils.isEmpty(qcOrder.getCreateDateTimeStart()) || !StringUtils.isEmpty(qcOrder.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    qcOrder.getCreateDateTimeStart(),
                    qcOrder.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        if (!StringUtils.isEmpty(qcOrder.getModifyDateTimeStart()) || !StringUtils.isEmpty(qcOrder.getModifyDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    qcOrder.getModifyDateTimeStart(),
                    qcOrder.getModifyDateTimeEnd(),
                    "modifyDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * MES 检验单查询条件封装
     *
     * @param qcOrderDetail
     * @return
     */
    public static DdlPackBean getMesQcDetailReport(MesQcOrderDetail qcOrderDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(qcOrderDetail, organizeCode);
        if (!StringUtils.isEmpty(qcOrderDetail.getOrderNo())) {
            DdlPreparedPack.getStringEqualPack(qcOrderDetail.getOrderNo(), "orderNo", packBean);
        }
        if (!StringUtils.isEmpty(qcOrderDetail.getCheckType())) {
            DdlPreparedPack.getNumEqualPack(qcOrderDetail.getCheckType(), "checkType", packBean);
        }
        return packBean;
    }

    /**
     * MES 物料信息查询条件封装
     *
     * @param part
     * @return
     */
    public static DdlPackBean getMesPart(MesPart part, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(part, organizeCode);
        if (!StringUtils.isEmpty(part.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(part.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(part.getPartName())) {
            DdlPreparedPack.getStringLikerPack(part.getPartName(), "partName", packBean);
        }
        if (!StringUtils.isEmpty(part.getCategoryCode1())) {
            DdlPreparedPack.getStringEqualPack(part.getCategoryCode1(), "categoryCode1", packBean);
        }
        if (!StringUtils.isEmpty(part.getCategoryCode2())) {
            DdlPreparedPack.getStringEqualPack(part.getCategoryCode2(), "categoryCode2", packBean);
        }
        if (!StringUtils.isEmpty(part.getCategoryCode3())) {
            DdlPreparedPack.getStringEqualPack(part.getCategoryCode3(), "categoryCode3", packBean);
        }

        return packBean;
    }

    /**
     * MES 物料分类信息查询条件封装
     *
     * @param partCategory
     * @return
     */
    public static DdlPackBean getMesPartCategory(MesPartCategory partCategory, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(partCategory, organizeCode);
        if (!StringUtils.isEmpty(partCategory.getCategoryCode())) {
            DdlPreparedPack.getStringLikerPack(partCategory.getCategoryCode(), "categoryCode", packBean);
        }
        if (!StringUtils.isEmpty(partCategory.getCategoryName())) {
            DdlPreparedPack.getStringLikerPack(partCategory.getCategoryName(), "categoryName", packBean);
        }

        return packBean;
    }

    /**
     * MES 包装规格信息查询条件封装
     *
     * @param packSpec
     * @return
     */
    public static DdlPackBean getMesPackSpec(MesPackSpec packSpec, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(packSpec, organizeCode);
        if (!StringUtils.isEmpty(packSpec.getSpecCode())) {
            DdlPreparedPack.getStringLikerPack(packSpec.getSpecCode(), "specCode", packBean);
        }
        if (!StringUtils.isEmpty(packSpec.getSpecName())) {
            DdlPreparedPack.getStringLikerPack(packSpec.getSpecName(), "specName", packBean);
        }

        return packBean;
    }

    /**
     * MES 产品类型信息查询条件封装
     *
     * @param produceCategory
     * @return
     */
    public static DdlPackBean getMesProduceCategory(MesProduceCategory produceCategory, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(produceCategory, organizeCode);
        if (!StringUtils.isEmpty(produceCategory.getProduceCategoryCode())) {
            DdlPreparedPack.getStringLikerPack(produceCategory.getProduceCategoryCode(), "produceCategoryCode", packBean);
        }
        if (!StringUtils.isEmpty(produceCategory.getProduceCategoryName())) {
            DdlPreparedPack.getStringLikerPack(produceCategory.getProduceCategoryName(), "produceCategoryName", packBean);
        }

        return packBean;
    }

    /**
     * MES 关键件条码规则信息查询条件封装
     *
     * @param kpsnRule
     * @return
     */
    public static DdlPackBean getMesKpsnRule(MesKpsnRule kpsnRule, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(kpsnRule, organizeCode);
        if (!StringUtils.isEmpty(kpsnRule.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(kpsnRule.getPartNo(), "partNo", packBean);
        }

        return packBean;
    }

    /**
     * MES 产品排程清单信息查询条件封装
     *
     * @param partScheduleBom
     * @return
     */
    public static DdlPackBean getMesPartScheduleBom(MesPartScheduleBom partScheduleBom, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(partScheduleBom, organizeCode);
        if (!StringUtils.isEmpty(partScheduleBom.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(partScheduleBom.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(partScheduleBom.getItemPartNo())) {
            DdlPreparedPack.getStringLikerPack(partScheduleBom.getItemPartNo(), "itemPartNo", packBean);
        }

        return packBean;
    }

    /**
     * MES对象与dao对应关系查询条件封装
     *
     * @param objectDao
     * @return
     */
    public static DdlPackBean getMesObjectDao(MesObjectDao objectDao, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(objectDao, organizeCode);
        if (!StringUtils.isEmpty(objectDao.getObjectCode())) {
            DdlPreparedPack.getStringLikerPack(objectDao.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(objectDao.getDaoClass())) {
            DdlPreparedPack.getStringLikerPack(objectDao.getDaoClass(), "daoClass", packBean);
        }

        return packBean;
    }

    /**
     * MES-PCN同步配置查询条件封装
     *
     * @param pcnSyncCfg
     * @return
     */
    public static DdlPackBean getMesPcnSyncCfg(MesPcnSyncCfg pcnSyncCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(pcnSyncCfg, organizeCode);
        DdlPreparedPack.getStringLikerPack(pcnSyncCfg.getObjectCode(), "objectCode", packBean);
        DdlPreparedPack.getStringLikerPack(pcnSyncCfg.getPcnCode(), "pcnCode", packBean);
        DdlPreparedPack.getNumEqualPack(pcnSyncCfg.getSyncType(), "syncType", packBean);
        return packBean;
    }

    /**
     * MES工作单元参数配置查询条件封装
     *
     * @param workCellParamCfg
     * @return
     */
    public static DdlPackBean getMesWorkCellParamCfg(MesWorkCellParamCfg workCellParamCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(workCellParamCfg, organizeCode);
        if (!StringUtils.isEmpty(workCellParamCfg.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(workCellParamCfg.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(workCellParamCfg.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(workCellParamCfg.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(workCellParamCfg.getParamCode())) {
            DdlPreparedPack.getStringLikerPack(workCellParamCfg.getParamCode(), "paramCode", packBean);
        }

        return packBean;
    }

    /**
     * MES工作单元参数查询条件封装
     *
     * @param workCellParam
     * @return
     */
    public static DdlPackBean getMesWorkCellParam(MesWorkCellParam workCellParam, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(workCellParam, organizeCode);
        if (!StringUtils.isEmpty(workCellParam.getParamCode())) {
            DdlPreparedPack.getStringLikerPack(workCellParam.getParamCode(), "paramCode", packBean);
        }
        if (null != workCellParam.getParamType()) {
            DdlPreparedPack.getNumEqualPack(workCellParam.getParamType(), "paramType", packBean);
        }
        if (null != workCellParam.getParamModel()) {
            DdlPreparedPack.getNumEqualPack(workCellParam.getParamModel(), "paramModel", packBean);
        }
        return packBean;
    }


    /**
     * MES工作单元队列查询条件封装
     *
     * @param workCellPoint
     * @return
     */
    public static DdlPackBean getMesWorkCellPoint(MesWorkCellPoint workCellPoint, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(workCellPoint, organizeCode);
        if (!StringUtils.isEmpty(workCellPoint.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(workCellPoint.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(workCellPoint.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(workCellPoint.getWorkCenterCode(), "workCenterCode", packBean);
        }
        return packBean;
    }

    /**
     * PLC设备信息配置查询条件封装
     *
     * @param plcConfigure
     * @return
     */
    public static DdlPackBean getMesPLCConfigure(MesPLCConfigure plcConfigure, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(plcConfigure, organizeCode);
        if (!StringUtils.isEmpty(plcConfigure.getAreaCode())) {
            DdlPreparedPack.getStringEqualPack(plcConfigure.getAreaCode(), "areaCode", packBean);
        }
        if (!StringUtils.isEmpty(plcConfigure.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(plcConfigure.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(plcConfigure.getWorkCellCode())) {
            DdlPreparedPack.getStringEqualPack(plcConfigure.getWorkCellCode(), "workCellCode", packBean);
        }
        return packBean;
    }

    /**
     * Mes条码生成规则
     *
     * @param numberRule
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesNumberRule(MesNumberRule numberRule, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(numberRule, organizeCode);
        if (!StringUtils.isEmpty(numberRule.getRuleCode())) {
            DdlPreparedPack.getStringLikerPack(numberRule.getRuleCode(), "ruleCode", packBean);
        }
        if (!StringUtils.isEmpty(numberRule.getNumberRule())) {
            DdlPreparedPack.getStringLikerPack(numberRule.getNumberRule(), "numberRule", packBean);
        }
        if (!StringUtils.isEmpty(numberRule.getPrefix())) {
            DdlPreparedPack.getStringLikerPack(numberRule.getPrefix(), "prefix", packBean);
        }
        if (null != numberRule.getIsCycle()) {
            DdlPreparedPack.getNumEqualPack(numberRule.getIsCycle(), "isCycle", packBean);
        }
        return packBean;
    }

    /**
     * mes-pcn定时任务清单
     *
     * @param mesPcnTask
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesPcnTask(MesPcnTask mesPcnTask, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesPcnTask, organizeCode);
        if (!StringUtils.isEmpty(mesPcnTask.getTaskCode())) {
            DdlPreparedPack.getStringLikerPack(mesPcnTask.getTaskCode(), "taskCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPcnTask.getTaskName())) {
            DdlPreparedPack.getStringLikerPack(mesPcnTask.getTaskName(), "taskName", packBean);
        }
        return packBean;
    }

    /**
     * 条码生成规则校验同一机构下条码规则唯一性
     *
     * @param numberRule
     * @param id
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesNumberRuleCheck(String numberRule, Long id, String organizeCode) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
        DdlPreparedPack.getStringEqualPack(numberRule, "numberRule", packBean);
        if (null != id) {
            DdlPreparedPack.getNumNOEqualPack(id, "id", packBean);
        }
        return packBean;
    }

    /**
     * 系统业务动作
     *
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesAllData(String organizeCode) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        return packBean;
    }

    /**
     * 按钮条件配置
     *
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesButtonStatus(MesButtonStatus buttonStatus, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(buttonStatus, organizeCode);
        if (!StringUtils.isEmpty(buttonStatus.getButtonCode())) {
            DdlPreparedPack.getStringLikerPack(buttonStatus.getButtonCode(), "buttonCode", packBean);
        }
        return packBean;
    }

    /**
     * 工单审批查询
     *
     * @param mesWorkOrder
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getApprovalData(MesWorkOrder mesWorkOrder, String organizeCode) {
        DdlPackBean packBean = MesHqlPack.getAllBaseData(organizeCode);
        DdlPreparedPack.getStringEqualPack(mesWorkOrder.getWorkCenterCode(), "workCenterCode", packBean);
        if (!StringUtils.isEmpty(mesWorkOrder.getOrderNo())) {
            DdlPreparedPack.getStringEqualPack(mesWorkOrder.getOrderNo(), "orderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkOrder.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(mesWorkOrder.getPartNo(), "partNo", packBean);
        }
        DdlPreparedPack.getNumEqualPack(MesEnumUtil.WORK_ORDER_APPROVAL_STATUS.WAIT_APPROVAL.getValue(), "approvalStatus", packBean);
        DdlPreparedPack.getNumEqualPack(MesEnumUtil.WORK_ORDER_STATUS.CREATE.getValue(), "workOrderStatus", packBean);
        DdlPreparedPack.getOrderByPack(new String[]{String.valueOf(CommonEnumUtil.ASC_OR_DESC.ASC.getValue())}, new String[]{"startTime", "shiftCode"}, packBean);
        return packBean;
    }

    /**
     * MES Plc设备信息配置查询条件封装
     *
     * @param mesPlc
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesPlc(MesPlc mesPlc, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesPlc, organizeCode);
        if (!StringUtils.isEmpty(mesPlc.getPlcCode())) {
            DdlPreparedPack.getStringLikerPack(mesPlc.getPlcCode(), "plcCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPlc.getPlcName())) {
            DdlPreparedPack.getStringLikerPack(mesPlc.getPlcName(), "plcName", packBean);
        }
        if (!StringUtils.isEmpty(mesPlc.getChannel())) {
            DdlPreparedPack.getStringLikerPack(mesPlc.getChannel(), "channel", packBean);
        }
        if (!StringUtils.isEmpty(mesPlc.getTagAddress())) {
            DdlPreparedPack.getStringEqualPack(mesPlc.getTagAddress(), "tagAddress", packBean);
        }
        if (!StringUtils.isEmpty(mesPlc.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(mesPlc.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPlc.getPlcCode())) {
            DdlPreparedPack.getStringEqualPack(mesPlc.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPlc.getEquipmentCode())) {
            DdlPreparedPack.getStringEqualPack(mesPlc.getEquipmentCode(), "equipmentCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPlc.getObjectCode())) {
            DdlPreparedPack.getStringEqualPack(mesPlc.getObjectCode(), "objectCode", packBean);
        }
        return packBean;
    }

    /**
     * MES DB地址清单查询条件封装
     *
     * @param mesDatasource
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesDatasource(MesDatasource mesDatasource, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesDatasource, organizeCode);
        if (!StringUtils.isEmpty(mesDatasource.getDsCode())) {
            DdlPreparedPack.getStringLikerPack(mesDatasource.getDsCode(), "dsCode", packBean);
        }
        if (!StringUtils.isEmpty(mesDatasource.getDsType())) {
            DdlPreparedPack.getStringLikerPack(mesDatasource.getDsType(), "dsType", packBean);
        }
        if (!StringUtils.isEmpty(mesDatasource.getDsDbName())) {
            DdlPreparedPack.getStringLikerPack(mesDatasource.getDsDbName(), "dsDbName", packBean);
        }
        return packBean;
    }

    /**
     * MES 设备故障处理方法查询条件封装
     *
     * @param mesFaultMethod
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesFaultMethod(MesFaultMethod mesFaultMethod, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesFaultMethod, organizeCode);
        if (!StringUtils.isEmpty(mesFaultMethod.getFmCode())) {
            DdlPreparedPack.getStringLikerPack(mesFaultMethod.getFmCode(), "fmCode", packBean);
        }
        if (!StringUtils.isEmpty(mesFaultMethod.getFmName())) {
            DdlPreparedPack.getStringLikerPack(mesFaultMethod.getFmName(), "fmName", packBean);
        }
        if (!StringUtils.isEmpty(mesFaultMethod.getFmType())) {
            DdlPreparedPack.getStringLikerPack(mesFaultMethod.getFmType(), "fmType", packBean);
        }
        return packBean;
    }

    /**
     * MES 设备故障处理措施查询条件封装
     *
     * @param mesEquFaultMethod
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquFaultMethod(MesEquFaultMethod mesEquFaultMethod, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquFaultMethod, organizeCode);
        if (!StringUtils.isEmpty(mesEquFaultMethod.getFmCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultMethod.getFmCode(), "fmCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEquFaultMethod.getFmName())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultMethod.getFmName(), "fmName", packBean);
        }
        if (!StringUtils.isEmpty(mesEquFaultMethod.getEquipmentCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultMethod.getEquipmentCode(), "equipmentCode", packBean);
        }
        return packBean;
    }

    /**
     * MES 设备故障原因查询条件封装
     *
     * @param mesEquFaultCause
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquFaultCause(MesEquFaultCause mesEquFaultCause, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquFaultCause, organizeCode);
        if (!StringUtils.isEmpty(mesEquFaultCause.getFcCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultCause.getFcCode(), "fcCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEquFaultCause.getFcName())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultCause.getFcName(), "fcName", packBean);
        }
        if (!StringUtils.isEmpty(mesEquFaultCause.getEquipmentCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultCause.getEquipmentCode(), "equipmentCode", packBean);
        }
        return packBean;
    }

    /**
     * MES 设备故障原因查询条件封装
     *
     * @param mesFaultCause
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesFaultCause(MesFaultCause mesFaultCause, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesFaultCause, organizeCode);
        if (!StringUtils.isEmpty(mesFaultCause.getFcCode())) {
            DdlPreparedPack.getStringLikerPack(mesFaultCause.getFcCode(), "fcCode", packBean);
        }
        if (!StringUtils.isEmpty(mesFaultCause.getFcName())) {
            DdlPreparedPack.getStringLikerPack(mesFaultCause.getFcName(), "fcName", packBean);
        }
        if (!StringUtils.isEmpty(mesFaultCause.getFcType())) {
            DdlPreparedPack.getStringLikerPack(mesFaultCause.getFcType(), "fcType", packBean);
        }
        return packBean;
    }

    /**
     * MES 设备故障现象查询条件封装
     *
     * @param mesFaultPhenomenon
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesFaultPhenomenon(MesFaultPhenomenon mesFaultPhenomenon, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesFaultPhenomenon, organizeCode);
        if (!StringUtils.isEmpty(mesFaultPhenomenon.getFpCode())) {
            DdlPreparedPack.getStringLikerPack(mesFaultPhenomenon.getFpCode(), "fpCode", packBean);
        }
        if (!StringUtils.isEmpty(mesFaultPhenomenon.getFpName())) {
            DdlPreparedPack.getStringLikerPack(mesFaultPhenomenon.getFpName(), "fpName", packBean);
        }
        if (!StringUtils.isEmpty(mesFaultPhenomenon.getFpType())) {
            DdlPreparedPack.getStringLikerPack(mesFaultPhenomenon.getFpType(), "fpType", packBean);
        }
        return packBean;
    }

    /**
     * MES 设备故障现象查询条件封装
     *
     * @param mesEquFaultPhenomenon
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquFaultPhenomenon(MesEquFaultPhenomenon mesEquFaultPhenomenon, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquFaultPhenomenon, organizeCode);
        if (!StringUtils.isEmpty(mesEquFaultPhenomenon.getFpCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultPhenomenon.getFpCode(), "fpCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEquFaultPhenomenon.getFpName())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultPhenomenon.getFpName(), "fpName", packBean);
        }
        if (!StringUtils.isEmpty(mesEquFaultPhenomenon.getEquipmentCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquFaultPhenomenon.getEquipmentCode(), "equipmentCode", packBean);
        }
        return packBean;
    }

    /**
     * MES 过程质量检验查询条件封装
     *
     * @param mesQcCheckStandard
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQcCheckStandard(MesQcCheckStandard mesQcCheckStandard, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesQcCheckStandard, organizeCode);
        if (!StringUtils.isEmpty(mesQcCheckStandard.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(mesQcCheckStandard.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckStandard.getWorkCellCode())) {
            DdlPreparedPack.getStringEqualPack(mesQcCheckStandard.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckStandard.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(mesQcCheckStandard.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (mesQcCheckStandard.getCheckType() != null) {
            DdlPreparedPack.getNumEqualPack(mesQcCheckStandard.getCheckType(), "checkType", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckStandard.getCheckItem())) {
            DdlPreparedPack.getStringLikerPack(mesQcCheckStandard.getCheckItem(), "checkItem", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckStandard.getCheckItemType())) {
            DdlPreparedPack.getStringLikerPack(mesQcCheckStandard.getCheckItemType(), "checkItemType", packBean);
        }
        return packBean;
    }

    /**
     * MES 缺陷查询条件封装
     *
     * @param mesDefect
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesDefect(MesDefect mesDefect, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesDefect, organizeCode);
        if (!StringUtils.isEmpty(mesDefect.getDefectCode())) {
            DdlPreparedPack.getStringLikerPack(mesDefect.getDefectCode(), "defectCode", packBean);
        }
        if (!StringUtils.isEmpty(mesDefect.getDefectName())) {
            DdlPreparedPack.getStringLikerPack(mesDefect.getDefectName(), "defectName", packBean);
        }
        if (!StringUtils.isEmpty(mesDefect.getDefectType())) {
            DdlPreparedPack.getStringLikerPack(mesDefect.getDefectType(), "defectType", packBean);
        }
        return packBean;
    }

    /**
     * 设备通知对象配置 查询条件封装
     *
     * @param mesEquNotifyObjectCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquNotifyObjectCfg(MesEquNotifyObjectCfg mesEquNotifyObjectCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquNotifyObjectCfg, organizeCode);
        if (!StringUtils.isEmpty(mesEquNotifyObjectCfg.getNotifyObjectCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquNotifyObjectCfg.getNotifyObjectCode(), "notifyObjectCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEquNotifyObjectCfg.getNotifyObjectName())) {
            DdlPreparedPack.getStringLikerPack(mesEquNotifyObjectCfg.getNotifyObjectName(), "notifyObjectName", packBean);
        }
        if (!StringUtils.isEmpty(mesEquNotifyObjectCfg.getNotifyObjectValueRdd())) {
            DdlPreparedPack.getStringLikerPack(mesEquNotifyObjectCfg.getNotifyObjectValue(), "notifyObjectValueRdd", packBean);
        }
        if (!StringUtils.isEmpty(mesEquNotifyObjectCfg.getNotifyObjectType())) {
            DdlPreparedPack.getNumEqualPack(mesEquNotifyObjectCfg.getNotifyObjectType(), "notifyObjectType", packBean);
        }
        return packBean;
    }

    /**
     * 设备作业通知配置  查询条件封装
     *
     * @param mesEquTaskNotifyCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquTaskNotifyCfg(MesEquTaskNotifyCfg mesEquTaskNotifyCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquTaskNotifyCfg, organizeCode);
        if (!StringUtils.isEmpty(mesEquTaskNotifyCfg.getNotifyObjectCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquTaskNotifyCfg.getNotifyObjectCode(), "notifyObjectCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskNotifyCfg.getTaskType())) {
            DdlPreparedPack.getNumEqualPack(mesEquTaskNotifyCfg.getTaskType(), "taskType", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskNotifyCfg.getNotifyType())) {
            DdlPreparedPack.getNumEqualPack(mesEquTaskNotifyCfg.getNotifyType(), "notifyType", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskNotifyCfg.getNotifyCondition())) {
            DdlPreparedPack.getNumEqualPack(mesEquTaskNotifyCfg.getNotifyCondition(), "notifyCondition", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskNotifyCfg.getNotifyPattern())) {
            DdlPreparedPack.getNumEqualPack(mesEquTaskNotifyCfg.getNotifyPattern(), "notifyPattern", packBean);
        }
        return packBean;
    }

    /**
     * 设备任务配置  查询条件封装
     *
     * @param equTaskPlanCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean findEquTaskPlanCfg(MesEquTaskPlanCfg equTaskPlanCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(equTaskPlanCfg, organizeCode);
        if (!StringUtils.isEmpty(equTaskPlanCfg.getPlanCfgCode())) {
            DdlPreparedPack.getStringLikerPack(equTaskPlanCfg.getPlanCfgCode(), "planCfgCode", packBean);
        }
        if (!StringUtils.isEmpty(equTaskPlanCfg.getDisplayText())) {
            DdlPreparedPack.getStringLikerPack(equTaskPlanCfg.getDisplayText(), "displayText", packBean);
        }
        return packBean;
    }

    /**
     * MES 类型信息查询条件封装
     *
     * @param mesTypeCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesTypeCfg(MesTypeCfg mesTypeCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesTypeCfg, organizeCode);
        if (!StringUtils.isEmpty(mesTypeCfg.getTypeCode())) {
            DdlPreparedPack.getStringEqualPack(mesTypeCfg.getTypeCode(), "typeCode", packBean);
        }
        if (!StringUtils.isEmpty(mesTypeCfg.getBusinessTypeCode())) {
            DdlPreparedPack.getStringLikerPack(mesTypeCfg.getBusinessTypeCode(), "businessTypeCode", packBean);
        }
        if (!StringUtils.isEmpty(mesTypeCfg.getTypeName())) {
            DdlPreparedPack.getStringLikerPack(mesTypeCfg.getTypeName(), "typeName", packBean);
        }
        if (!StringUtils.isEmpty(mesTypeCfg.getBusinessTypeName())) {
            DdlPreparedPack.getStringLikerPack(mesTypeCfg.getBusinessTypeName(), "businessTypeName", packBean);
        }
        return packBean;
    }

    /**
     * MES 缺陷原因查询条件封装
     *
     * @param mesDefectCause
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesDefectCause(MesDefectCause mesDefectCause, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesDefectCause, organizeCode);
        if (!StringUtils.isEmpty(mesDefectCause.getDcCode())) {
            DdlPreparedPack.getStringLikerPack(mesDefectCause.getDcCode(), "dcCode", packBean);
        }
        if (!StringUtils.isEmpty(mesDefectCause.getDcName())) {
            DdlPreparedPack.getStringLikerPack(mesDefectCause.getDcName(), "dcName", packBean);
        }
        if (!StringUtils.isEmpty(mesDefectCause.getDcType())) {
            DdlPreparedPack.getStringLikerPack(mesDefectCause.getDcType(), "dcType", packBean);
        }
        return packBean;
    }

    /**
     * 按条件分页查询mes设备点检保养维修作业
     *
     * @param mesEquTaskDetail
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquTaskDetailByTaskNo(MesEquTaskDetail mesEquTaskDetail, String organizeCode) {
        DdlPackBean packBean = getMesAllData(organizeCode);
        if (!StringUtils.isEmpty(mesEquTaskDetail.getTaskNo())) {
            DdlPreparedPack.getStringEqualPack(mesEquTaskDetail.getTaskNo(), "taskNo", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskDetail.getEquipmentCode())) {
            DdlPreparedPack.getStringLikerPack(mesEquTaskDetail.getEquipmentCode(), "equipmentCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskDetail.getActionStatus())) {
            DdlPreparedPack.getNumEqualPack(mesEquTaskDetail.getActionStatus(), "actionStatus", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskDetail.getFinalResult())) {
            DdlPreparedPack.getNumEqualPack(mesEquTaskDetail.getFinalResult(), "finalResult", packBean);
        }
        return packBean;
    }

    /**
     * 按条件分页查询首检件配置信息
     *
     * @param mesFiCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesFiCfg(MesFiCfg mesFiCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesFiCfg, organizeCode);
        if (!StringUtils.isEmpty(mesFiCfg.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(mesFiCfg.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesFiCfg.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(mesFiCfg.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesFiCfg.getCustCode())) {
            DdlPreparedPack.getStringLikerPack(mesFiCfg.getCustCode(), "custCode", packBean);
        }
        return packBean;
    }

    /**
     * 维修记录
     *
     * @param mesEquTaskRepairRecord
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquTaskRepairRecord(MesEquTaskRepairRecord mesEquTaskRepairRecord, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquTaskRepairRecord, organizeCode);
        if (!StringUtils.isEmpty(mesEquTaskRepairRecord.getEquipmentCode())) {
            DdlPreparedPack.getStringEqualPack(mesEquTaskRepairRecord.getEquipmentCode(), "equipmentCode", packBean);
        }
        return packBean;
    }

    /**
     * 点检或保养记录
     *
     * @param mesEquTaskStandardRecord
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEquTaskStandardRecord(MesEquTaskStandardRecord mesEquTaskStandardRecord, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesEquTaskStandardRecord, organizeCode);
        if (!StringUtils.isEmpty(mesEquTaskStandardRecord.getEquipmentCode())) {
            DdlPreparedPack.getStringEqualPack(mesEquTaskStandardRecord.getEquipmentCode(), "equipmentCode", packBean);
        }
        if (!StringUtils.isEmpty(mesEquTaskStandardRecord.getTaskType())) {
            DdlPreparedPack.getNumEqualPack(mesEquTaskStandardRecord.getTaskType(), "taskType", packBean);
        }
        return packBean;
    }

    /**
     * 对象结构
     *
     * @param mesObjectCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesObjectCfg(MesObjectCfg mesObjectCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesObjectCfg, organizeCode);
        if (!StringUtils.isEmpty(mesObjectCfg.getObjectCode())) {
            DdlPreparedPack.getStringLikerPack(mesObjectCfg.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(mesObjectCfg.getFieldCode())) {
            DdlPreparedPack.getStringLikerPack(mesObjectCfg.getFieldCode(), "fieldCode", packBean);
        }
        if (!StringUtils.isEmpty(mesObjectCfg.getFieldName())) {
            DdlPreparedPack.getStringLikerPack(mesObjectCfg.getFieldName(), "fieldName", packBean);
        }
        if (!StringUtils.isEmpty(mesObjectCfg.getFieldType())) {
            DdlPreparedPack.getStringLikerPack(mesObjectCfg.getFieldType(), "fieldType", packBean);
        }
        return packBean;
    }

    /**
     * 数据对象
     *
     * @param mesDataObject
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesDataObject(MesDataObject mesDataObject, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesDataObject, organizeCode);
        if (!StringUtils.isEmpty(mesDataObject.getObjectCode())) {
            DdlPreparedPack.getStringLikerPack(mesDataObject.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(mesDataObject.getObjectName())) {
            DdlPreparedPack.getStringLikerPack(mesDataObject.getObjectName(), "objectName", packBean);
        }
        if (mesDataObject.getOperateType() != null) {
            DdlPreparedPack.getNumEqualPack(mesDataObject.getOperateType(), "operateType", packBean);
        }
        if (!StringUtils.isEmpty(mesDataObject.getFieldPk())) {
            DdlPreparedPack.getStringLikerPack(mesDataObject.getFieldPk(), "fieldPk", packBean);
        }
        return packBean;
    }

    /**
     * 产品包装关系
     *
     * @param mesProdPack
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesProdPack(MesProdPack mesProdPack, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesProdPack, organizeCode);
        if (!StringUtils.isEmpty(mesProdPack.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(mesProdPack.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesProdPack.getCustomerCode())) {
            DdlPreparedPack.getStringLikerPack(mesProdPack.getCustomerCode(), "customerCode", packBean);
        }
        if (!StringUtils.isEmpty(mesProdPack.getPackSpec())) {
            DdlPreparedPack.getStringLikerPack(mesProdPack.getPackSpec(), "packSpec", packBean);
        }
        if (!StringUtils.isEmpty(mesProdPack.getPackLabelTemplate())) {
            DdlPreparedPack.getStringLikerPack(mesProdPack.getPackLabelTemplate(), "packLabelTemplate", packBean);
        }
        if (!StringUtils.isEmpty(mesProdPack.getProdLabelTemplate())) {
            DdlPreparedPack.getStringLikerPack(mesProdPack.getProdLabelTemplate(), "prodLabelTemplate", packBean);
        }
        return packBean;
    }

    /**
     * 产品编码配置
     *
     * @param mesProductEncodeCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesProductEncodeCfg(MesProductEncodeCfg mesProductEncodeCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesProductEncodeCfg, organizeCode);
        if (!StringUtils.isEmpty(mesProductEncodeCfg.getMatchValue())) {
            DdlPreparedPack.getStringLikerPack(mesProductEncodeCfg.getMatchValue(), "matchValue", packBean);
        }
        if (!StringUtils.isEmpty(mesProductEncodeCfg.getCodeType())) {
            DdlPreparedPack.getNumEqualPack(mesProductEncodeCfg.getCodeType(), "codeType", packBean);
        }
        if (!StringUtils.isEmpty(mesProductEncodeCfg.getMatchType())) {
            DdlPreparedPack.getNumEqualPack(mesProductEncodeCfg.getMatchType(), "matchType", packBean);
        }
        if (!StringUtils.isEmpty(mesProductEncodeCfg.getRuleCode())) {
            DdlPreparedPack.getStringEqualPack(mesProductEncodeCfg.getRuleCode(), "ruleCode", packBean);
        }
        return packBean;
    }

    /**
     * 客户订单
     *
     * @param mesCustOrder
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesCustOrder(MesCustOrder mesCustOrder, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesCustOrder, organizeCode);
        if (!StringUtils.isEmpty(mesCustOrder.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesCustOrder.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesCustOrder.getOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesCustOrder.getOrderNo(), "orderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesCustOrder.getCustCode())) {
            DdlPreparedPack.getStringLikerPack(mesCustOrder.getCustCode(), "custCode", packBean);
        }
        if (!StringUtils.isEmpty(mesCustOrder.getCustOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesCustOrder.getCustOrderNo(), "custOrderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesCustOrder.getCreateUser())) {
            DdlPreparedPack.getStringLikerPack(mesCustOrder.getCreateUser(), "createUser", packBean);
        }
        if (mesCustOrder.getOrderType() != null) {
            DdlPreparedPack.getNumEqualPack(mesCustOrder.getOrderType(), "orderType", packBean);
        }
        if (mesCustOrder.getStatus() != null) {
            DdlPreparedPack.getNumEqualPack(mesCustOrder.getStatus(), "status", packBean);
        }
        if (!StringUtils.isEmpty(mesCustOrder.getOrderTimeStart()) || !StringUtils.isEmpty(mesCustOrder.getOrderTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesCustOrder.getOrderTimeStart(),
                    mesCustOrder.getOrderTimeEnd(),
                    "orderDate", packBean, true);
        }
        if (!StringUtils.isEmpty(mesCustOrder.getCreateDateTimeStart()) || !StringUtils.isEmpty(mesCustOrder.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesCustOrder.getCreateDateTimeStart(),
                    mesCustOrder.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 模板配置
     *
     * @param mesLabelTemplate
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesLabelTemplate(MesLabelTemplate mesLabelTemplate, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesLabelTemplate, organizeCode);
        if (!StringUtils.isEmpty(mesLabelTemplate.getTemplateCode())) {
            DdlPreparedPack.getStringLikerPack(mesLabelTemplate.getTemplateCode(), "templateCode", packBean);
        }
        if (!StringUtils.isEmpty(mesLabelTemplate.getTemplateName())) {
            DdlPreparedPack.getStringLikerPack(mesLabelTemplate.getTemplateName(), "templateName", packBean);
        }
        return packBean;
    }

    /**
     * 关键动作
     *
     * @param mesKeyAction
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesKeyAction(MesKeyAction mesKeyAction, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesKeyAction, organizeCode);
        if (!StringUtils.isEmpty(mesKeyAction.getActionCode())) {
            DdlPreparedPack.getStringLikerPack(mesKeyAction.getActionCode(), "actionCode", packBean);
        }
        if (!StringUtils.isEmpty(mesKeyAction.getActionName())) {
            DdlPreparedPack.getStringLikerPack(mesKeyAction.getActionName(), "actionName", packBean);
        }
        if (!StringUtils.isEmpty(mesKeyAction.getActionDesc())) {
            DdlPreparedPack.getStringLikerPack(mesKeyAction.getActionDesc(), "actionDesc", packBean);
        }
        if (!StringUtils.isEmpty(mesKeyAction.getActionClass())) {
            DdlPreparedPack.getStringLikerPack(mesKeyAction.getActionClass(), "actionClass", packBean);
        }
        return packBean;
    }

    /**
     * 动作接口配置
     *
     * @param mesActionIf
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesActionIf(MesActionIf mesActionIf, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesActionIf, organizeCode);
        if (!StringUtils.isEmpty(mesActionIf.getActionCode())) {
            DdlPreparedPack.getStringLikerPack(mesActionIf.getActionCode(), "actionCode", packBean);
        }
        if (!StringUtils.isEmpty(mesActionIf.getIfCode())) {
            DdlPreparedPack.getStringLikerPack(mesActionIf.getIfCode(), "ifCode", packBean);
        }
        return packBean;
    }

    /**
     * 接口清单
     *
     * @param mesIf
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesIf(MesIf mesIf, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesIf, organizeCode);
        if (!StringUtils.isEmpty(mesIf.getIfCode())) {
            DdlPreparedPack.getStringLikerPack(mesIf.getIfCode(), "ifCode", packBean);
        }
        if (!StringUtils.isEmpty(mesIf.getIfName())) {
            DdlPreparedPack.getStringLikerPack(mesIf.getIfName(), "ifName", packBean);
        }
        if (!StringUtils.isEmpty(mesIf.getIfConnectType())) {
            DdlPreparedPack.getStringLikerPack(mesIf.getIfConnectType(), "ifConnectType", packBean);
        }
        if (!StringUtils.isEmpty(mesIf.getIfClass())) {
            DdlPreparedPack.getStringLikerPack(mesIf.getIfClass(), "ifClass", packBean);
        }
        return packBean;
    }

    /**
     * 过程条码报表
     *
     * @param mesProduceSn
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesProduceSn(MesProduceSn mesProduceSn, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesProduceSn, organizeCode);
        if (!StringUtils.isEmpty(mesProduceSn.getWorkOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSn.getWorkOrderNo(), "workOrderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSn.getPartNo())) {
            DdlPreparedPack.getStringRightLikerPack(mesProduceSn.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSn.getSerialNumber())) {
            DdlPreparedPack.getStringEqualPack(mesProduceSn.getSerialNumber(), "serialNumber", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSn.getProductSn())) {
            DdlPreparedPack.getStringEqualPack(mesProduceSn.getProductSn(), "productSn", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSn.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSn.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (mesProduceSn.getSnStatus() != null) {
            DdlPreparedPack.getNumEqualPack(mesProduceSn.getSnStatus(), "snStatus", packBean);
        }
        if (mesProduceSn.getQcStatus() != null) {
            DdlPreparedPack.getNumEqualPack(mesProduceSn.getQcStatus(), "qcStatus", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSn.getVinCode())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSn.getVinCode(), "vinCode", packBean);
        }
        if (!StringUtil.isEmpty(mesProduceSn.getOutWorkCenterTimeEnd())) {
            DdlPreparedPack.getStringSmallerPack(mesProduceSn.getOutWorkCenterTimeEnd(), "outWorkCenterTime", packBean);
        }
        if (!StringUtil.isEmpty(mesProduceSn.getOutWorkCenterTimeStart())) {
            DdlPreparedPack.getStringBiggerPack(mesProduceSn.getOutWorkCenterTimeStart(), "outWorkCenterTime", packBean);
//            DdlPreparedPack.timeBuilder(
//                    mesProduceSn.getOutWorkCenterStartTime(),
//                    mesProduceSn.getOutWorkCenterEndTime(),
//                    "outWorkCenterTime", packBean, true);
        }
        if (!StringUtils.isEmpty(mesProduceSn.getCreateDateTimeStart()) || !StringUtils.isEmpty(mesProduceSn.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesProduceSn.getCreateDateTimeStart(),
                    mesProduceSn.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 物料追溯
     *
     * @param mesProdBindRecord
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesProdBindRecord(MesProdBindRecord mesProdBindRecord, String organizeCode, List<String> serialNumbers) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesProdBindRecord, organizeCode);
        if (!StringUtils.isEmpty(mesProdBindRecord.getItemPartNo())) {
            DdlPreparedPack.getStringRightLikerPack(mesProdBindRecord.getItemPartNo(), "itemPartNo", packBean);
        }
        if (!CollectionUtils.isEmpty(serialNumbers)) {
            DdlPreparedPack.getInPackList(serialNumbers, "serialNumber", packBean);
        }
        if (!StringUtils.isEmpty(mesProdBindRecord.getSerialNumber())) {
            DdlPreparedPack.getStringEqualPack(mesProdBindRecord.getSerialNumber(), "serialNumber", packBean);
        }
        if (!StringUtils.isEmpty(mesProdBindRecord.getKpSn())) {
            DdlPreparedPack.getStringLikerPack(mesProdBindRecord.getKpSn(), "kpSn", packBean);
        }
        if (!StringUtils.isEmpty(mesProdBindRecord.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesProdBindRecord.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesProdBindRecord.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(mesProdBindRecord.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(mesProdBindRecord.getLotNo())) {
            DdlPreparedPack.getStringLikerPack(mesProdBindRecord.getLotNo(), "lotNo", packBean);
        }
        if (mesProdBindRecord.getIsBindKey() != null) {
            DdlPreparedPack.getNumEqualPack(mesProdBindRecord.getIsBindKey(), "isBindKey", packBean);
        }
        if (mesProdBindRecord.getActionType() != null) {
            DdlPreparedPack.getNumEqualPack(mesProdBindRecord.getActionType(), "actionType", packBean);
        }
        if (!StringUtils.isEmpty(mesProdBindRecord.getSupplierCode())) {
            DdlPreparedPack.getStringLikerPack(mesProdBindRecord.getSupplierCode(), "supplierCode", packBean);
        }
        if (!StringUtils.isEmpty(mesProdBindRecord.getCreateDateTimeStart()) || !StringUtils.isEmpty(mesProdBindRecord.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesProdBindRecord.getCreateDateTimeStart(),
                    mesProdBindRecord.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 包装明细
     *
     * @param ifPackageDetail
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getIfPackageDetail(IfPackageDetail ifPackageDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(ifPackageDetail, organizeCode);
        if (!StringUtils.isEmpty(ifPackageDetail.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(ifPackageDetail.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(ifPackageDetail.getPackageNo())) {
            DdlPreparedPack.getStringLikerPack(ifPackageDetail.getPackageNo(), "partNo", packBean);
        }
        DdlPreparedPack.timeBuilder(
                ifPackageDetail.getCreateDateTimeStart(),
                ifPackageDetail.getCreateDateTimeEnd(),
                "createDatetime", packBean, true);
        return packBean;
    }

    /**
     * 不良记录
     *
     * @param defectRecord
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesDefectRecord(MesDefectRecord defectRecord, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(defectRecord, organizeCode);
        if (!StringUtils.isEmpty(defectRecord.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(defectRecord.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getSerialNumber())) {
            DdlPreparedPack.getStringLikerPack(defectRecord.getSerialNumber(), "serialNumber", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(defectRecord.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getWorkCellCode())) {
            DdlPreparedPack.getStringEqualPack(defectRecord.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getDefectCode())) {
            DdlPreparedPack.getStringEqualPack(defectRecord.getDefectCode(), "defectCode", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getWorkOrderNo())) {
            DdlPreparedPack.getStringLikerPack(defectRecord.getWorkOrderNo(), "workOrderNo", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getRepairStatus())) {
            DdlPreparedPack.getNumEqualPack(defectRecord.getRepairStatus(), "repairStatus", packBean);
        }

        if (!StringUtils.isEmpty(defectRecord.getCreateDateTimeStart()) || !StringUtils.isEmpty(defectRecord.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    defectRecord.getCreateDateTimeStart(),
                    defectRecord.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 过程质量检测数据
     *
     * @param mesQcCheckData
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQcCheckData(MesQcCheckData mesQcCheckData, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesQcCheckData, organizeCode);
        if (!StringUtils.isEmpty(mesQcCheckData.getPartNo())) {
            DdlPreparedPack.getStringRightLikerPack(mesQcCheckData.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckData.getOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesQcCheckData.getOrderNo(), "orderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckData.getSn())) {
            DdlPreparedPack.getStringEqualPack(mesQcCheckData.getSn(), "sn", packBean);
        }
        if (mesQcCheckData.getCheckType() != null) {
            DdlPreparedPack.getNumEqualPack(mesQcCheckData.getCheckType(), "checkType", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckData.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesQcCheckData.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckData.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(mesQcCheckData.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(mesQcCheckData.getCreateDateTimeStart()) || !StringUtils.isEmpty(mesQcCheckData.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesQcCheckData.getCreateDateTimeStart(),
                    mesQcCheckData.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 条码履历报表
     *
     * @param mesProduceSnTravel
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesProduceSnTravel(MesProduceSnTravel mesProduceSnTravel, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesProduceSnTravel, organizeCode);
        if (!StringUtils.isEmpty(mesProduceSnTravel.getWorkOrderNo())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSnTravel.getWorkOrderNo(), "workOrderNo", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSnTravel.getPartNo())) {
            DdlPreparedPack.getStringRightLikerPack(mesProduceSnTravel.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSnTravel.getSerialNumber())) {
            DdlPreparedPack.getStringEqualPack(mesProduceSnTravel.getSerialNumber(), "serialNumber", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSnTravel.getProductSn())) {
            DdlPreparedPack.getStringEqualPack(mesProduceSnTravel.getProductSn(), "productSn", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSnTravel.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSnTravel.getWorkCellCode(), "workCellCode", packBean);
        }
        if (mesProduceSnTravel.getSnStatus() != null) {
            DdlPreparedPack.getNumEqualPack(mesProduceSnTravel.getSnStatus(), "snStatus", packBean);
        }
        if (mesProduceSnTravel.getQcStatus() != null) {
            DdlPreparedPack.getNumEqualPack(mesProduceSnTravel.getQcStatus(), "qcStatus", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSnTravel.getVinCode())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSnTravel.getVinCode(), "vinCode", packBean);
        }
        if (!StringUtil.isEmpty(mesProduceSnTravel.getOutWorkCenterTimeStart())) {
            DdlPreparedPack.getStringBiggerPack(mesProduceSnTravel.getOutWorkCenterTimeStart(), "outWorkCenterTime", packBean);
        }
        if (!StringUtil.isEmpty(mesProduceSnTravel.getOutWorkCenterTimeEnd())) {
            DdlPreparedPack.getStringSmallerPack(mesProduceSnTravel.getOutWorkCenterTimeEnd(), "outWorkCenterTime", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSnTravel.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSnTravel.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesProduceSnTravel.getCreateDateTimeStart()) || !StringUtils.isEmpty(mesProduceSnTravel.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesProduceSnTravel.getCreateDateTimeStart(),
                    mesProduceSnTravel.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 物料对象
     *
     * @param partObject
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesPartObject(MesPartObject partObject, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(partObject, organizeCode);
        if (!StringUtils.isEmpty(partObject.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(partObject.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(partObject.getObjectCode())) {
            DdlPreparedPack.getStringLikerPack(partObject.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(partObject.getObjectName())) {
            DdlPreparedPack.getStringLikerPack(partObject.getObjectName(), "objectName", packBean);
        }
        if (!StringUtils.isEmpty(partObject.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(partObject.getWorkCenterCode(), "workCenterCode", packBean);
        }
        return packBean;
    }

    /**
     * 质量标准配置
     *
     * @param qualityStandardCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQualityStandardCfg(MesQualityStandardCfg qualityStandardCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(qualityStandardCfg, organizeCode);
        if (!StringUtils.isEmpty(qualityStandardCfg.getStandardType())) {
            DdlPreparedPack.getNumEqualPack(qualityStandardCfg.getStandardType(), "standardType", packBean);
        }
        if (!StringUtils.isEmpty(qualityStandardCfg.getObjectKey())) {
            DdlPreparedPack.getStringLikerPack(qualityStandardCfg.getObjectKey(), "objectKey", packBean);
        }
        if (!StringUtils.isEmpty(qualityStandardCfg.getObjectType())) {
            DdlPreparedPack.getNumEqualPack(qualityStandardCfg.getObjectType(), "objectType", packBean);
        }
        if (!StringUtils.isEmpty(qualityStandardCfg.getObjectKeyValue())) {
            DdlPreparedPack.getStringLikerPack(qualityStandardCfg.getObjectKeyValue(), "objectKeyValue", packBean);
        }
        return packBean;
    }

    /**
     * JIS发运模式
     *
     * @param patternJis
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getPatternJisCondition(MesPatternJis patternJis, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(patternJis, organizeCode);
        if (!StringUtils.isEmpty(patternJis.getPatternNo())) {
            DdlPreparedPack.getStringLikerPack(patternJis.getPatternNo(), "patternNo", packBean);
        }
        if (!StringUtils.isEmpty(patternJis.getQueueNo())) {
            DdlPreparedPack.getNumEqualPack(patternJis.getQueueNo(), "queueNo", packBean);
        }
        if (!StringUtils.isEmpty(patternJis.getHandleNo())) {
            DdlPreparedPack.getNumEqualPack(patternJis.getHandleNo(), "handleNo", packBean);
        }
        if (!StringUtils.isEmpty(patternJis.getPatternType())) {
            DdlPreparedPack.getNumEqualPack(patternJis.getPatternType(), "patternType", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getMesSpcKeyData(MesSpcKeyData spcKeyData) {
        DdlPackBean packBean = getAllBaseData(spcKeyData.getOrganizeCode());
        if (!StringUtils.isEmpty(spcKeyData.getIsValid())) {
            DdlPreparedPack.getNumEqualPack(spcKeyData.getIsValid(), "isValid", packBean);
        }
        if (!StringUtils.isEmpty(spcKeyData.getKdCode())) {
            DdlPreparedPack.getStringEqualPack(spcKeyData.getKdCode(), "kdCode", packBean);
        }
        if (spcKeyData.getObjectType() != null) {
            DdlPreparedPack.getNumEqualPack(spcKeyData.getObjectType(), "objectType", packBean);
        }
        if (!StringUtils.isEmpty(spcKeyData.getObjectCode())) {
            DdlPreparedPack.getStringEqualPack(spcKeyData.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(spcKeyData.getFieldCode())) {
            DdlPreparedPack.getStringEqualPack(spcKeyData.getFieldCode(), "fieldCode", packBean);
        }
        return packBean;
    }

    /**
     * 监听任务查询条件封装
     *
     * @param monitorTask
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesMonitorTask(MesMonitorTask monitorTask, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(monitorTask.getTaskNo())) {
            DdlPreparedPack.getStringLikerPack(monitorTask.getTaskNo(), "taskNo", packBean);
        }
        if (!StringUtils.isEmpty(monitorTask.getTaskName())) {
            DdlPreparedPack.getStringLikerPack(monitorTask.getTaskName(), "taskName", packBean);
        }
        if (!StringUtils.isEmpty(monitorTask.getTaskObjectType())) {
            DdlPreparedPack.getNumEqualPack(monitorTask.getTaskObjectType(), "taskObjectType", packBean);
        }
        if (!StringUtils.isEmpty(monitorTask.getTaskStatus())) {
            DdlPreparedPack.getNumEqualPack(monitorTask.getTaskStatus(), "taskStatus", packBean);
        }
        if (monitorTask.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(monitorTask.getIsValid(), "isValid", packBean);
        }
        return packBean;
    }

    /**
     * 监听任务明细查询条件封装
     *
     * @param monitorTaskDetail
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesMonitorTaskDetail(MesMonitorTaskDetail monitorTaskDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(monitorTaskDetail.getTaskNo())) {
            DdlPreparedPack.getStringLikerPack(monitorTaskDetail.getTaskNo(), "taskNo", packBean);
        }
        if (!StringUtils.isEmpty(monitorTaskDetail.getDataObjectNo())) {
            DdlPreparedPack.getStringLikerPack(monitorTaskDetail.getDataObjectNo(), "dataObjectNo", packBean);
        }
        if (!StringUtils.isEmpty(monitorTaskDetail.getStoreObjectCode())) {
            DdlPreparedPack.getStringLikerPack(monitorTaskDetail.getStoreObjectCode(), "storeObjectCode", packBean);
        }
        if (monitorTaskDetail.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(monitorTaskDetail.getIsValid(), "isValid", packBean);
        }
        if (monitorTaskDetail.getCollectType() != null) {
            DdlPreparedPack.getNumEqualPack(monitorTaskDetail.getCollectType(), "collectType", packBean);
        }
        return packBean;
    }

    /**
     * 客户JIT生产队列
     *
     * @param queueJitActual
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQueueJitActual(MesQueueJitActual queueJitActual, List<String> orderList, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        if (!StringUtils.isEmpty(queueJitActual.getJisActualNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitActual.getJisActualNo(), "jisActualNo", packBean);
        }
        if (!StringUtils.isEmpty(queueJitActual.getCustPlantCode())) {
            DdlPreparedPack.getStringLikerPack(queueJitActual.getCustPlantCode(), "custPlantCode", packBean);
        }
        if (!StringUtils.isEmpty(queueJitActual.getCustFlagNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitActual.getCustFlagNo(), "custFlagNo", packBean);
        }
        if (!StringUtils.isEmpty(queueJitActual.getVinCode())) {
            DdlPreparedPack.getStringLikerPack(queueJitActual.getVinCode(), "vinCode", packBean);
        }
        if (!StringUtils.isEmpty(queueJitActual.getProdCfgCode())) {
            DdlPreparedPack.getStringLikerPack(queueJitActual.getProdCfgCode(), "prodCfgCode", packBean);
        }
        if (!StringUtils.isEmpty(queueJitActual.getRelationVinCode())) {
            DdlPreparedPack.getStringLikerPack(queueJitActual.getRelationVinCode(), "relationVinCode", packBean);
        }
        if (queueJitActual.getStatus() != null) {
            DdlPreparedPack.getNumEqualPack(queueJitActual.getStatus(), "status", packBean);
        }
        if (!StringUtil.isEmpty(queueJitActual.getCreateDateTimeStart()) || !StringUtil.isEmpty(queueJitActual.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    queueJitActual.getCreateDateTimeStart(),
                    queueJitActual.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        if (!StringUtil.isEmpty(queueJitActual.getCustPointStartDate()) || !StringUtil.isEmpty(queueJitActual.getCustPointEndDate())) {
            DdlPreparedPack.timeBuilder(
                    queueJitActual.getCustPointStartDate(),
                    queueJitActual.getCustPointEndDate(),
                    "createDatetime", packBean, true);
        }
        if (!CollectionUtils.isEmpty(orderList)) {
            DdlPreparedPack.getInPackList(orderList, "jisActualNo", packBean);
        }
        DdlPreparedPack.getNumEqualPack(queueJitActual.getWoType(), "woType", packBean);
        return packBean;
    }

    /**
     * 生产组
     *
     * @param produceGroup
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesProduceGroup(MesProduceGroup produceGroup, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(produceGroup, organizeCode);
        if (!StringUtils.isEmpty(produceGroup.getPgCode())) {
            DdlPreparedPack.getStringLikerPack(produceGroup.getPgCode(), "pgCode", packBean);
        }
        if (!StringUtils.isEmpty(produceGroup.getPgName())) {
            DdlPreparedPack.getStringLikerPack(produceGroup.getPgName(), "pgName", packBean);
        }
        return packBean;
    }

    /**
     * 界面组件配置
     *
     * @param windowModule
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesWindowModule(MesWindowModule windowModule, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(windowModule, organizeCode);
        if (!StringUtils.isEmpty(windowModule.getWindowNo())) {
            DdlPreparedPack.getStringLikerPack(windowModule.getWindowNo(), "windowNo", packBean);
        }
        if (!StringUtils.isEmpty(windowModule.getModuleCode())) {
            DdlPreparedPack.getStringLikerPack(windowModule.getModuleCode(), "moduleCode", packBean);
        }
        if (!StringUtils.isEmpty(windowModule.getWindowModuleBack())) {
            DdlPreparedPack.getStringLikerPack(windowModule.getWindowModuleBack(), "windowModuleBack", packBean);
        }
        return packBean;
    }

    /**
     * 界面组件参数配置
     *
     * @param windowModuleParam
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesWindowModuleParam(MesWindowModuleParam windowModuleParam, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(windowModuleParam, organizeCode);
        if (!StringUtils.isEmpty(windowModuleParam.getWindowNo())) {
            DdlPreparedPack.getStringLikerPack(windowModuleParam.getWindowNo(), "windowNo", packBean);
        }
        if (!StringUtils.isEmpty(windowModuleParam.getModuleCode())) {
            DdlPreparedPack.getStringLikerPack(windowModuleParam.getModuleCode(), "moduleCode", packBean);
        }
        if (!StringUtils.isEmpty(windowModuleParam.getParamCode())) {
            DdlPreparedPack.getStringLikerPack(windowModuleParam.getParamCode(), "paramCode", packBean);
        }
        if (!StringUtils.isEmpty(windowModuleParam.getParamValue())) {
            DdlPreparedPack.getStringLikerPack(windowModuleParam.getParamValue(), "paramValue", packBean);
        }
        return packBean;
    }

    /**
     * 数据预警配置
     *
     * @param dataWarning
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesDataWarning(MesDataWarning dataWarning, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(dataWarning, organizeCode);
        if (!StringUtils.isEmpty(dataWarning.getObjectCode())) {
            DdlPreparedPack.getStringLikerPack(dataWarning.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(dataWarning.getWarningRule())) {
            DdlPreparedPack.getStringLikerPack(dataWarning.getWarningRule(), "warningRule", packBean);
        }
        if (!StringUtils.isEmpty(dataWarning.getWarningItem())) {
            DdlPreparedPack.getStringLikerPack(dataWarning.getWarningItem(), "warningItem", packBean);
        }
        if (!StringUtils.isEmpty(dataWarning.getInformMode())) {
            DdlPreparedPack.getNumEqualPack(dataWarning.getInformMode(), "informMode", packBean);
        }
        return packBean;
    }

    /**
     * 接口映射分页查询条件
     *
     * @param mesInterfaceDataMapper
     * @return
     */
    public static DdlPackBean packHqlMesInterfaceDataMapper(MesInterfaceDataMapper mesInterfaceDataMapper) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(mesInterfaceDataMapper.getSrcTableName(), "srcTableName", result);
        DdlPreparedPack.getStringLikerPack(mesInterfaceDataMapper.getDestBeanName(), "destBeanName", result);
        DdlPreparedPack.getStringLikerPack(mesInterfaceDataMapper.getBusiRoute(), "busiRoute", result);
        DdlPreparedPack.getStringLikerPack(mesInterfaceDataMapper.getGroupName(), "groupName", result);

        getStringBuilderPack(mesInterfaceDataMapper, result);

        return result;
    }

    /**
     * 封装公用查询参数
     *
     * @param bean   实体对象
     * @param hqlStr 查询语句
     * @return 封装完成的查询语句
     */
    public static DdlPackBean getStringBuilderPack(BaseBean bean, DdlPackBean hqlStr) {

        // 判断工厂代码是否为空
        if (org.apache.commons.lang3.StringUtils.isNotBlank(bean.getOrganizeCode())) {
            DdlPreparedPack.getStringEqualPack(bean.getOrganizeCode(), "organizeCode", hqlStr);
        }


        DdlPreparedPack.getStringEqualPack(bean.getCreateUser(), "createUser", hqlStr);
        if (org.apache.commons.lang3.StringUtils.isNotBlank(bean.getCreateDateTimeStart()) && org.apache.commons.lang3.StringUtils.isNotBlank(bean.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(bean.getCreateDateTimeStart(), bean.getCreateDateTimeEnd(), "createDatetime", hqlStr, true);
        }
        // 封装有效状态、删除状态、创建人和创建时间
        DdlPreparedPack.getNumEqualPack(bean.getIsValid(), "isValid", hqlStr);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", hqlStr);

        return hqlStr;
    }


    /**
     * 按条件分页查询产品条码补打印数据
     *
     * @param mesProduceSn
     * @return
     */
    public static DdlPackBean getProdSnPrint(MesProduceSn mesProduceSn) {
        DdlPackBean packBean = getAllBaseData(mesProduceSn.getOrganizeCode());
        if (!StringUtils.isEmpty(mesProduceSn.getSerialNumber())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSn.getSerialNumber(), "serialNumber", packBean);
        }

        if (!StringUtils.isEmpty(mesProduceSn.getProductSn())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSn.getProductSn(), "productSn", packBean);
        }

        if (!StringUtils.isEmpty(mesProduceSn.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesProduceSn.getPartNo(), "partNo", packBean);
        }

        if (!StringUtils.isEmpty(mesProduceSn.getSnStatus())) {
            DdlPreparedPack.getNumEqualPack(mesProduceSn.getSnStatus(), "snStatus", packBean);
        }
        DdlPreparedPack.getNumEqualPack(mesProduceSn.getPrintStatus(), "printStatus", packBean);
        DdlPreparedPack.getStringLikerPack(mesProduceSn.getWorkOrderNo(), "workOrderNo", packBean);

        // 时间段查询
        if (!StringUtils.isEmpty(mesProduceSn.getCreateDateTimeStart()) || !StringUtils.isEmpty(mesProduceSn.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesProduceSn.getCreateDateTimeStart(),
                    mesProduceSn.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        if (!StringUtils.isEmpty(mesProduceSn.getOutWorkCenterTimeStart()) || !StringUtils.isEmpty(mesProduceSn.getOutWorkCenterTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    mesProduceSn.getOutWorkCenterTimeStart(),
                    mesProduceSn.getOutWorkCenterTimeEnd(),
                    "outWorkCenterTime", packBean, true);
        }
        return packBean;
    }

    public static DdlPackBean getMesPartFormula(MesPartFormula mesPartFormula) {
        DdlPackBean packBean = getAllBaseData(mesPartFormula.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesPartFormula.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getNumEqualPack(mesPartFormula.getFormulaType(), "formulaType", packBean);
        DdlPreparedPack.getStringLikerPack(mesPartFormula.getFormulaContent(), "formulaContent", packBean);
        DdlPreparedPack.getNumEqualPack(mesPartFormula.getIsValid(), "isValid", packBean);
        return packBean;
    }

    /**
     * 看板
     *
     * @param board
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesBoard(MesBoard board, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(board, organizeCode);
        if (!StringUtils.isEmpty(board.getBoardCode())) {
            DdlPreparedPack.getStringLikerPack(board.getBoardCode(), "boardCode", packBean);
        }
        if (!StringUtils.isEmpty(board.getBoardName())) {
            DdlPreparedPack.getStringLikerPack(board.getBoardName(), "boardName", packBean);
        }
        if (!StringUtils.isEmpty(board.getBoardType())) {
            DdlPreparedPack.getStringLikerPack(board.getBoardType(), "boardType", packBean);
        }
        return packBean;
    }

    /**
     * 散件产品组配置
     *
     * @param mesProdScatterDetail
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesScatterDetail(MesProdScatterDetail mesProdScatterDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesProdScatterDetail, organizeCode);
        if (!StringUtils.isEmpty(mesProdScatterDetail.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesProdScatterDetail.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesProdScatterDetail.getPartName())) {
            DdlPreparedPack.getStringLikerPack(mesProdScatterDetail.getPartName(), "partName", packBean);
        }
        if (!StringUtils.isEmpty(mesProdScatterDetail.getProduceCtgyCode())) {
            DdlPreparedPack.getStringLikerPack(mesProdScatterDetail.getProduceCtgyCode(), "produceCtgyCode", packBean);
        }
        if (!StringUtils.isEmpty(mesProdScatterDetail.getSpCfgCode())) {
            DdlPreparedPack.getStringLikerPack(mesProdScatterDetail.getSpCfgCode(), "spCfgCode", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getMesBoardEquDetail(MesBoardEquDetail mesBoardEquDetail) {
        DdlPackBean packBean = getAllBaseData(mesBoardEquDetail.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesBoardEquDetail.getBoardCode(), "boardCode", packBean);
        DdlPreparedPack.getNumEqualPack(mesBoardEquDetail.getIsValid(), "isValid", packBean);
        return packBean;
    }

    public static DdlPackBean getMesBoardEquStatus(MesBoardEquStatus mesBoardEquStatus) {
        DdlPackBean packBean = getAllBaseData(mesBoardEquStatus.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesBoardEquStatus.getBoardCode(), "boardCode", packBean);
        DdlPreparedPack.getNumEqualPack(mesBoardEquStatus.getIsValid(), "isValid", packBean);
        return packBean;
    }

    /**
     * MES 人员技能
     *
     * @param mesSkills
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesSkills(MesSkills mesSkills, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesSkills, organizeCode);
        if (!StringUtils.isEmpty(mesSkills.getSkillCode())) {
            DdlPreparedPack.getStringLikerPack(mesSkills.getSkillCode(), "skillCode", packBean);
        }
        if (!StringUtils.isEmpty(mesSkills.getSkillName())) {
            DdlPreparedPack.getStringLikerPack(mesSkills.getSkillName(), "skillName", packBean);
        }
        return packBean;
    }

    /**
     * MES 工位技能
     *
     * @param mesWorkCellSkill
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesWorkCellSkill(MesWorkCellSkill mesWorkCellSkill) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesWorkCellSkill.getOrganizeCode());;
        if (!StringUtils.isEmpty(mesWorkCellSkill.getSkillCode())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCellSkill.getSkillCode(), "skillCode", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCellSkill.getSkillName())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCellSkill.getSkillName(), "skillName", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCellSkill.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCellSkill.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCellSkill.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCellSkill.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(mesWorkCellSkill.getWorkCellName())) {
            DdlPreparedPack.getStringLikerPack(mesWorkCellSkill.getWorkCellName(), "workCellName", packBean);
        }
        return packBean;
    }

    /**
     * MES 人员技能
     *
     * @param mesUserSkill
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesUserSkill(MesUserSkill mesUserSkill, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesUserSkill, organizeCode);
        if (!StringUtils.isEmpty(mesUserSkill.getSkillCode())) {
            DdlPreparedPack.getStringLikerPack(mesUserSkill.getSkillCode(), "skillCode", packBean);
        }
        if (!StringUtils.isEmpty(mesUserSkill.getSkillName())) {
            DdlPreparedPack.getStringLikerPack(mesUserSkill.getSkillName(), "skillName", packBean);
        }
        if (!StringUtils.isEmpty(mesUserSkill.getSkillLevel())) {
            DdlPreparedPack.getStringLikerPack(mesUserSkill.getSkillLevel(), "skillLevel", packBean);
        }
        if (!StringUtils.isEmpty(mesUserSkill.getUserEmpNo())) {
            DdlPreparedPack.getStringLikerPack(mesUserSkill.getUserEmpNo(), "userEmpNo", packBean);
        }
        if (!StringUtils.isEmpty(mesUserSkill.getUserName())) {
            DdlPreparedPack.getStringLikerPack(mesUserSkill.getUserName(), "userName", packBean);
        }
        return packBean;
    }

    /**
     * MES 班制维护
     *
     * @param mesShiftClass
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesShiftClass(MesShiftClass mesShiftClass, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesShiftClass, organizeCode);
        if (!StringUtils.isEmpty(mesShiftClass.getShiftClassCode())) {
            DdlPreparedPack.getStringLikerPack(mesShiftClass.getShiftClassCode(), "shiftClassCode", packBean);
        }
        if (!StringUtils.isEmpty(mesShiftClass.getShiftClassName())) {
            DdlPreparedPack.getStringLikerPack(mesShiftClass.getShiftClassName(), "shiftClassName", packBean);
        }
        return packBean;
    }

    /**
     * MES 班制班次维护
     *
     * @param mesShiftClassDetail
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesShiftDetailClass(MesShiftClassDetail mesShiftClassDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesShiftClassDetail, organizeCode);
        if (!StringUtils.isEmpty(mesShiftClassDetail.getShiftClassCode())) {
            DdlPreparedPack.getStringEqualPack(mesShiftClassDetail.getShiftClassCode(), "shiftClassCode", packBean);
        }
        if (!StringUtils.isEmpty(mesShiftClassDetail.getShiftClassName())) {
            DdlPreparedPack.getStringLikerPack(mesShiftClassDetail.getShiftClassName(), "shiftClassName", packBean);
        }
        if (!StringUtils.isEmpty(mesShiftClassDetail.getShiftCode())) {
            DdlPreparedPack.getStringEqualPack(mesShiftClassDetail.getShiftCode(), "shiftCode", packBean);
        }
        if (!StringUtils.isEmpty(mesShiftClassDetail.getShiftName())) {
            DdlPreparedPack.getStringLikerPack(mesShiftClassDetail.getShiftName(), "shiftName", packBean);
        }
        if (!StringUtils.isEmpty(mesShiftClassDetail.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(mesShiftClassDetail.getWorkCenterCode(), "workCenterCode", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getDataAuthCondition(MesDataAuth dataAuth, String organizeCode) {
        DdlPackBean packBean;
        if (dataAuth.getIsValidVal() == 0) {
            packBean = DdlPackBean.getDdlPackBean(organizeCode);
        } else {
            packBean = DdlPackBean.getDdlPackBean(organizeCode, dataAuth.getIsValidVal());
        }
        if (!StringUtils.isEmpty(dataAuth.getDataObject())) {
            DdlPreparedPack.getStringLikerPack(dataAuth.getDataObject(), "dataObject", packBean);
        }
        if (dataAuth.getRoleIdVal() > 0) {
            DdlPreparedPack.getNumEqualPack(dataAuth.getRoleIdVal(), "roleId", packBean);
        }
        return packBean;
    }

    /**
     * MES 车型等级查询条件封装
     *
     * @param modelGrade
     * @return
     */
    public static DdlPackBean getMesModelGrade(MesModelGrade modelGrade, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(modelGrade, organizeCode);
        if (!StringUtils.isEmpty(modelGrade.getGradeCode())) {
            DdlPreparedPack.getStringEqualPack(modelGrade.getGradeCode(), "gradeCode", packBean);
        }
        if (!StringUtils.isEmpty(modelGrade.getGradeName())) {
            DdlPreparedPack.getStringLikerPack(modelGrade.getGradeName(), "gradeName", packBean);
        }
        if (!StringUtils.isEmpty(modelGrade.getGradeFlagValue())) {
            DdlPreparedPack.getStringLikerPack(modelGrade.getGradeFlagValue(), "gradeFlagValue", packBean);
        }
        if (!StringUtils.isEmpty(modelGrade.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringEqualPack(modelGrade.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }
        return packBean;
    }

    /**
     * MES 产品颜色查询条件封装
     *
     * @param partColor
     * @return
     */
    public static DdlPackBean getMesPartColor(MesPartColor partColor, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(partColor, organizeCode);
        if (!StringUtils.isEmpty(partColor.getColorCode())) {
            DdlPreparedPack.getStringEqualPack(partColor.getColorCode(), "colorCode", packBean);
        }
        if (!StringUtils.isEmpty(partColor.getColorName())) {
            DdlPreparedPack.getStringLikerPack(partColor.getColorName(), "colorName", packBean);
        }
        if (!StringUtils.isEmpty(partColor.getIfColorCode())) {
            DdlPreparedPack.getStringEqualPack(partColor.getIfColorCode(), "ifColorCode", packBean);
        }
        if (!StringUtils.isEmpty(partColor.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringEqualPack(partColor.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }
        if (!StringUtils.isEmpty(partColor.getProduceCtgyCode())) {
            DdlPreparedPack.getStringEqualPack(partColor.getProduceCtgyCode(), "produceCtgyCode", packBean);
        }
        if (!StringUtils.isEmpty(partColor.getModelYear())) {
            DdlPreparedPack.getStringEqualPack(partColor.getModelYear(), "modelYear", packBean);
        }
        return packBean;
    }

    /**
     * MES 产品车型配置
     *
     * @param prodModelCfg
     * @return
     */
    public static DdlPackBean getMesProdModelCfg(MesProdModelCfg prodModelCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(prodModelCfg, organizeCode);
        if (!StringUtils.isEmpty(prodModelCfg.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringEqualPack(prodModelCfg.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }
        if (!StringUtils.isEmpty(prodModelCfg.getProduceCtgyCode())) {
            DdlPreparedPack.getStringEqualPack(prodModelCfg.getProduceCtgyCode(), "produceCtgyCode", packBean);
        }
        if (!StringUtils.isEmpty(prodModelCfg.getModelYear())) {
            DdlPreparedPack.getStringLikerPack(prodModelCfg.getModelYear(), "modelYear", packBean);
        }
        if (!StringUtils.isEmpty(prodModelCfg.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(prodModelCfg.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(prodModelCfg.getGradeCode())) {
            DdlPreparedPack.getStringEqualPack(prodModelCfg.getGradeCode(), "gradeCode", packBean);
        }
        return packBean;
    }

    /**
     * MES 车型散件配置清单
     *
     * @param scatterPartCfgBom
     * @return
     */
    public static DdlPackBean getMesScatterPartCfgBom(MesScatterPartCfgBom scatterPartCfgBom, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(scatterPartCfgBom, organizeCode);
        if (!StringUtils.isEmpty(scatterPartCfgBom.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartCfgBom.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartCfgBom.getProduceCtgyCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartCfgBom.getProduceCtgyCode(), "produceCtgyCode", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartCfgBom.getModelYear())) {
            DdlPreparedPack.getStringLikerPack(scatterPartCfgBom.getModelYear(), "modelYear", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartCfgBom.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(scatterPartCfgBom.getPartNo(), "partNo", packBean);
        }
        return packBean;
    }

    /**
     * MES 散件零件生产配置
     *
     * @param scatterPartProdCfg
     * @return
     */
    public static DdlPackBean getMesScatterPartProdCfg(MesScatterPartProdCfg scatterPartProdCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(scatterPartProdCfg, organizeCode);
        if (!StringUtils.isEmpty(scatterPartProdCfg.getCfgId())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getCfgId(), "cfgId", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getWorkCellCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getPartName())) {
            DdlPreparedPack.getStringLikerPack(scatterPartProdCfg.getPartName(), "partName", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getGradeCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getGradeCode(), "gradeCode", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getColorCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getColorCode(), "colorCode", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }
        if (!StringUtils.isEmpty(scatterPartProdCfg.getProduceCtgyCode())) {
            DdlPreparedPack.getStringEqualPack(scatterPartProdCfg.getProduceCtgyCode(), "produceCtgyCode", packBean);
        }
        return packBean;
    }

    /**
     * 导入模板信息分页查询条件
     *
     * @param template
     * @return
     */
    public static DdlPackBean packHqlBasImportTemplate(BasImportTemplate template) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(template.getTemplateName(), "templateName", result);
        DdlPreparedPack.getStringEqualPack(template.getTemplateCode(), "templateCode", result);
        DdlPreparedPack.getStringEqualPack(template.getGroupName(), "groupName", result);
        getStringBuilderPack(template, result);
        return result;
    }

    /**
     * 导入模板明细信息分页查询条件
     *
     * @param details
     * @return
     */
    public static DdlPackBean packHqlBasImportTemplateDetails(BasImportTemplateDetails details) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(details.getTemplateCode(), "templateCode", result);
        getStringBuilderPack(details, result);
        return result;
    }

    public static DdlPackBean getMesBlindRule(MesBlindRule mesBlindRule) {
        DdlPackBean packBean = getAllBaseData(mesBlindRule.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesBlindRule.getCarType(), "carType", packBean);
        DdlPreparedPack.getStringLikerPack(mesBlindRule.getCarColor(), "carColor", packBean);
        DdlPreparedPack.getStringLikerPack(mesBlindRule.getPartCode(), "partCode", packBean);
        DdlPreparedPack.getStringEqualPack(mesBlindRule.getPartName(), "partName", packBean);
        DdlPreparedPack.getStringEqualPack(mesBlindRule.getCarConfig(), "carConfig", packBean);
        DdlPreparedPack.getStringEqualPack(mesBlindRule.getCarLevel(), "carLevel", packBean);
        DdlPreparedPack.getStringEqualPack(mesBlindRule.getPartColor(), "partColor", packBean);
        DdlPreparedPack.getNumEqualPack(mesBlindRule.getIsValid(), "isValid", packBean);
        return packBean;
    }

    public static DdlPackBean getMesBlindTopicSetting(MesBlindTopicSetting mesBlindTopicSetting) {
        DdlPackBean packBean = getAllBaseData(mesBlindTopicSetting.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesBlindTopicSetting.getTopicCode(), "topicCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesBlindTopicSetting.getTopicDesc(), "topicDesc", packBean);
        DdlPreparedPack.getStringLikerPack(mesBlindTopicSetting.getWorkCellCode(), "workCellCode", packBean);
        DdlPreparedPack.getStringEqualPack(mesBlindTopicSetting.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getNumEqualPack(mesBlindTopicSetting.getTopicType(), "topicType", packBean);
        DdlPreparedPack.getNumEqualPack(mesBlindTopicSetting.getIsValid(), "isValid", packBean);
        return packBean;
    }

    /**
     * MES 校枪记录
     *
     * @param gunCalibrationRecord
     * @return
     */
    public static DdlPackBean getMesGunCalibrationRecord(MesGunCalibrationRecord gunCalibrationRecord, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(gunCalibrationRecord, organizeCode);
        if (!StringUtils.isEmpty(gunCalibrationRecord.getWorkCellCode())) {
            DdlPreparedPack.getStringEqualPack(gunCalibrationRecord.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(gunCalibrationRecord.getGunCode())) {
            DdlPreparedPack.getStringEqualPack(gunCalibrationRecord.getGunCode(), "gunCode", packBean);
        }
        if (gunCalibrationRecord.getCalibrationStatus() != null) {
            DdlPreparedPack.getNumEqualPack(gunCalibrationRecord.getCalibrationStatus(), "calibrationStatus", packBean);
        }
        if (!StringUtils.isEmpty(gunCalibrationRecord.getStartTime())) {
            DdlPreparedPack.getStringBiggerPack(gunCalibrationRecord.getStartTime(), "startTime", packBean);
        }
        if (!StringUtils.isEmpty(gunCalibrationRecord.getStartTime())) {
            DdlPreparedPack.getStringSmallerPack(gunCalibrationRecord.getEndTime(), "endTime", packBean);
        }
        return packBean;
    }

    /**
     * 物料校验项
     *
     * @param partCheck
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesPartCheck(MesPartCheck partCheck, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(partCheck, organizeCode);
        if (!StringUtils.isEmpty(partCheck.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(partCheck.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(partCheck.getObjectCode())) {
            DdlPreparedPack.getStringEqualPack(partCheck.getObjectCode(), "objectCode", packBean);
        }
        return packBean;
    }


    /**
     * 过程质量检测数据
     *
     * @param qcOrderDetail
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQcOrderDetailData(MesQcOrderDetail qcOrderDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(qcOrderDetail, organizeCode);
        if (!StringUtils.isEmpty(qcOrderDetail.getOrderNo())) {
            DdlPreparedPack.getStringRightLikerPack(qcOrderDetail.getOrderNo(), "orderNo", packBean);
        }
        if (qcOrderDetail.getCheckType() != null) {
            DdlPreparedPack.getNumEqualPack(qcOrderDetail.getCheckType(), "checkType", packBean);
        }
        if (!StringUtils.isEmpty(qcOrderDetail.getSerialNumber())) {
            DdlPreparedPack.getStringLikerPack(qcOrderDetail.getSerialNumber(), "serialNumber", packBean);
        }
        if (!StringUtils.isEmpty(qcOrderDetail.getCreateDateTimeStart()) || !StringUtils.isEmpty(qcOrderDetail.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(
                    qcOrderDetail.getCreateDateTimeStart(),
                    qcOrderDetail.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * MES AGV停机记录信息条件查询
     *
     * @param stopRecord
     * @return
     */
    public static DdlPackBean getMesAgvRecoredData(MesAgvStopRecord stopRecord, String organizeCode) {
        DdlPackBean packBean = getAllBaseData(organizeCode);
        DdlPreparedPack.getStringEqualPack(stopRecord.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getStringEqualPack(stopRecord.getWorkCellCode(), "workCellCode", packBean);
        DdlPreparedPack.getNumEqualPack(stopRecord.getStopType(), "stopType", packBean);
        DdlPreparedPack.getStringLikerPack(stopRecord.getProductSn(), "productSn", packBean);
        DdlPreparedPack.getStringEqualPack(stopRecord.getPartNo(), "partNo", packBean);
        if (!StringUtils.isEmpty(stopRecord.getStopStartTime()) || !StringUtils.isEmpty(stopRecord.getStopEndTime())) {
            DdlPreparedPack.timeBuilder(stopRecord.getCreateDateTimeStart(), stopRecord.getCreateDateTimeEnd(),
                    "stopStartTime", packBean, true);
        }
        return packBean;
    }

    /**
     * MES 工位缺陷查询条件封装
     *
     * @param workCellDefect
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesWorkCellDefect(MesWorkCellDefect workCellDefect, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(workCellDefect, organizeCode);
        if (!StringUtils.isEmpty(workCellDefect.getDefectCode())) {
            DdlPreparedPack.getStringLikerPack(workCellDefect.getDefectCode(), "defectCode", packBean);
        }
        if (!StringUtils.isEmpty(workCellDefect.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(workCellDefect.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(workCellDefect.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(workCellDefect.getWorkCenterCode(), "workCenterCode", packBean);
        }
        return packBean;
    }

    /**
     * 散件BOM
     *
     * @param scatterBomCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesScatterBomCfg(MesScatterBomCfg scatterBomCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(scatterBomCfg, organizeCode);
        if (!StringUtils.isEmpty(scatterBomCfg.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(scatterBomCfg.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(scatterBomCfg.getCustomerPartNo())) {
            DdlPreparedPack.getStringLikerPack(scatterBomCfg.getCustomerPartNo(), "customerPartNo", packBean);
        }
        if (!StringUtils.isEmpty(scatterBomCfg.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(scatterBomCfg.getWorkCellCode(), "workCellCode", packBean);
        }
        return packBean;
    }

    /**
     * 物料项目关系
     *
     * @param partProdCfgType
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesPartProdCfgType(MesPartProdCfgType partProdCfgType, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(partProdCfgType, organizeCode);
        if (!StringUtils.isEmpty(partProdCfgType.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(partProdCfgType.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(partProdCfgType.getCustCode())) {
            DdlPreparedPack.getStringLikerPack(partProdCfgType.getCustCode(), "custCode", packBean);
        }
        if (!StringUtils.isEmpty(partProdCfgType.getProdCfgTypeCode())) {
            DdlPreparedPack.getStringLikerPack(partProdCfgType.getProdCfgTypeCode(), "prodCfgTypeCode", packBean);
        }
        return packBean;
    }

    /**
     * 编码规则映射表
     *
     * @param encodeRuleMap
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesEncodeRuleMap(MesEncodeRuleMap encodeRuleMap, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(encodeRuleMap, organizeCode);
        if (!StringUtils.isEmpty(encodeRuleMap.getTypeCode())) {
            DdlPreparedPack.getStringLikerPack(encodeRuleMap.getTypeCode(), "typeCode", packBean);
        }
        if (!StringUtils.isEmpty(encodeRuleMap.getTypeName())) {
            DdlPreparedPack.getStringLikerPack(encodeRuleMap.getTypeName(), "typeName", packBean);
        }
        if (!StringUtils.isEmpty(encodeRuleMap.getBusinessCode())) {
            DdlPreparedPack.getStringLikerPack(encodeRuleMap.getBusinessCode(), "businessCode", packBean);
        }
        return packBean;
    }

    /**
     * 扩展对象配置
     *
     * @param extendObjectCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesExtendObjectCfg(MesExtendObjectCfg extendObjectCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(extendObjectCfg, organizeCode);
        if (!StringUtils.isEmpty(extendObjectCfg.getObjectCode())) {
            DdlPreparedPack.getStringLikerPack(extendObjectCfg.getObjectCode(), "objectCode", packBean);
        }
        if (!StringUtils.isEmpty(extendObjectCfg.getFieldCode())) {
            DdlPreparedPack.getStringLikerPack(extendObjectCfg.getFieldCode(), "fieldCode", packBean);
        }
        if (!StringUtils.isEmpty(extendObjectCfg.getFieldName())) {
            DdlPreparedPack.getStringLikerPack(extendObjectCfg.getFieldName(), "fieldName", packBean);
        }
        if (!StringUtils.isEmpty(extendObjectCfg.getFieldType())) {
            DdlPreparedPack.getNumEqualPack(extendObjectCfg.getFieldType(), "fieldType", packBean);
        }
        return packBean;
    }

    /**
     * 产品工作中心配置
     *
     * @param prodWorkCenter
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesProdWorkCenter(MesProdWorkCenter prodWorkCenter, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(prodWorkCenter, organizeCode);
        if (!StringUtils.isEmpty(prodWorkCenter.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(prodWorkCenter.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(prodWorkCenter.getRackNo())) {
            DdlPreparedPack.getStringLikerPack(prodWorkCenter.getRackNo(), "rackNo", packBean);
        }
        if (!StringUtils.isEmpty(prodWorkCenter.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(prodWorkCenter.getWorkCenterCode(), "workCenterCode", packBean);
        }
        return packBean;
    }

    /**
     * 客户JIT预装队列
     *
     * @param queueJitPlan
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQueueJitPlan(MesQueueJitPlan queueJitPlan, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(queueJitPlan, organizeCode);
        if (!StringUtils.isEmpty(queueJitPlan.getJisPlanNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlan.getJisPlanNo(), "jisPlanNo", packBean);
        }
        if (!StringUtils.isEmpty(queueJitPlan.getCustPlantCode())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlan.getCustPlantCode(), "custPlantCode", packBean);
        }
        if (!StringUtils.isEmpty(queueJitPlan.getCustFlagNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlan.getCustFlagNo(), "custFlagNo", packBean);
        }
        if (!StringUtils.isEmpty(queueJitPlan.getVinCode())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlan.getVinCode(), "vinCode", packBean);
        }
        if (queueJitPlan.getStatus() != null) {
            DdlPreparedPack.getNumEqualPack(queueJitPlan.getStatus(), "status", packBean);
        }
        if (!StringUtils.isEmpty(queueJitPlan.getPlanStartDate()) || !StringUtils.isEmpty(queueJitPlan.getPlanEndDate())) {
            DdlPreparedPack.timeBuilder(queueJitPlan.getPlanStartDate(), queueJitPlan.getPlanEndDate(),
                    "planDate", packBean, true);
        }
        if (!StringUtils.isEmpty(queueJitPlan.getCreateDateTimeStart()) || !StringUtils.isEmpty(queueJitPlan.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(queueJitPlan.getCreateDateTimeStart(), queueJitPlan.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * 客户JIT预装队列明细
     *
     * @param queueJitPlanDetail
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQueueJitPlanDetail(MesQueueJitPlanDetail queueJitPlanDetail, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(queueJitPlanDetail, organizeCode);
        if (!StringUtils.isEmpty(queueJitPlanDetail.getJisPlanNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlanDetail.getJisPlanNo(), "jisPlanNo", packBean);
        }
        if (!StringUtils.isEmpty(queueJitPlanDetail.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlanDetail.getPartNo(), "partNo", packBean);
        }
        return packBean;
    }

    /**
     * 客户JIT预装队列BOM
     *
     * @param queueJitPlanBom
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesQueueJitPlanBom(MesQueueJitPlanBom queueJitPlanBom, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(queueJitPlanBom, organizeCode);
        if (!StringUtils.isEmpty(queueJitPlanBom.getJisPlanNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlanBom.getJisPlanNo(), "jisPlanNo", packBean);
        }
        if (!StringUtils.isEmpty(queueJitPlanBom.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(queueJitPlanBom.getPartNo(), "partNo", packBean);
        }
        return packBean;
    }

    /**
     * 客户JIT队列下达配置
     *
     * @param jitIssueCfg
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesJitIssueCfg(MesJitIssueCfg jitIssueCfg, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(jitIssueCfg, organizeCode);
        if (!StringUtils.isEmpty(jitIssueCfg.getCustPlantCode())) {
            DdlPreparedPack.getStringLikerPack(jitIssueCfg.getCustPlantCode(), "custPlantCode", packBean);
        }
        if (jitIssueCfg.getCfgType() != null) {
            DdlPreparedPack.getNumEqualPack(jitIssueCfg.getCfgType(), "cfgType", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getMesLocation(MesLocation mesLocation) {
        DdlPackBean packBean = getAllBaseData(mesLocation.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesLocation.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringLikerPack(mesLocation.getLocationCode(), "locationCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesLocation.getLocationName(), "locationName", packBean);
        DdlPreparedPack.getNumEqualPack(mesLocation.getIsValid(), "isValid", packBean);
        return packBean;
    }

    /**
     * 条码照片关系
     *
     * @param snPhotoRelation
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getMesSnPhotoRelation(MesSnPhotoRelation snPhotoRelation, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(snPhotoRelation, organizeCode);
        if (!StringUtils.isEmpty(snPhotoRelation.getSerialNumber())) {
            DdlPreparedPack.getStringLikerPack(snPhotoRelation.getSerialNumber(), "serialNumber", packBean);
        }
        if (!StringUtils.isEmpty(snPhotoRelation.getPhotoName())) {
            DdlPreparedPack.getStringLikerPack(snPhotoRelation.getPhotoName(), "photoName", packBean);
        }
        if (!StringUtils.isEmpty(snPhotoRelation.getPhotoPath())) {
            DdlPreparedPack.getStringLikerPack(snPhotoRelation.getPhotoPath(), "photoPath", packBean);
        }
        if (!StringUtils.isEmpty(snPhotoRelation.getPhotoUrl())) {
            DdlPreparedPack.getStringLikerPack(snPhotoRelation.getPhotoUrl(), "photoUrl", packBean);
        }
        if (!StringUtils.isEmpty(snPhotoRelation.getPhotoOriginalPath())) {
            DdlPreparedPack.getStringLikerPack(snPhotoRelation.getPhotoUrl(), "photoOriginalPath", packBean);
        }
        if (!StringUtils.isEmpty(snPhotoRelation.getPhotoTransferPath())) {
            DdlPreparedPack.getStringLikerPack(snPhotoRelation.getPhotoUrl(), "photoTransferPath", packBean);
        }
        if (!StringUtils.isEmpty(snPhotoRelation.getPhotoTargetPath())) {
            DdlPreparedPack.getStringLikerPack(snPhotoRelation.getPhotoUrl(), "photoTargetPath", packBean);
        }
        return packBean;
    }

    /**
     * MES_BYPASS项映射关系
     *
     * @param bypassMapping
     * @param organizeCode
     * @return
     */
    public static DdlPackBean getBypassMapping(MesBypassMapping bypassMapping, String organizeCode) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(bypassMapping, organizeCode);
        if (!StringUtils.isEmpty(bypassMapping.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(bypassMapping.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(bypassMapping.getCheckName())) {
            DdlPreparedPack.getStringLikerPack(bypassMapping.getCheckName(), "checkName", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getMesSubPart(MesSubPart mesSubPart) {
        DdlPackBean packBean = getAllBaseData(mesSubPart.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesSubPart.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringLikerPack(mesSubPart.getSubPartNo(), "subPartNo", packBean);
        DdlPreparedPack.getStringLikerPack(mesSubPart.getSubFlag(), "subFlag", packBean);
        DdlPreparedPack.getNumEqualPack(mesSubPart.getIsValid(), "isValid", packBean);
        return packBean;
    }

    public static DdlPackBean getControlPlan(MesControlPlan controlPlan) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(controlPlan.getOrganizeCode(), controlPlan.getIsValid());
        if (!StringUtils.isEmpty(controlPlan.getWorkCenterCode())) {
            DdlPreparedPack.getStringEqualPack(controlPlan.getWorkCenterCode(), "workCenterCode", packBean);
        }
//        if (!StringUtils.isEmpty(controlPlan.getWorkCellCode())) {
//            DdlPreparedPack.getStringEqualPack(controlPlan.getWorkCellCode(), "workCellCode", packBean);
//        }
        if (!StringUtils.isEmpty(controlPlan.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(controlPlan.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(controlPlan.getCustCode())) {
            DdlPreparedPack.getStringEqualPack(controlPlan.getCustCode(), "custCode", packBean);
        }
        if (!StringUtils.isEmpty(controlPlan.getVersion())) {
            DdlPreparedPack.getNumberBiggerEqualPack(controlPlan.getVersion(), "version", packBean);
        }
        if (!StringUtils.isEmpty(controlPlan.getAuditType())) {
            DdlPreparedPack.getNumberBiggerEqualPack(controlPlan.getAuditType(), "auditType", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getMesPaintPolishing(MgnPaintPolishingReportModel paintPolishingReportModel, String organizeCode) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(paintPolishingReportModel.getOrganizeCode());
        if (!StringUtils.isEmpty(paintPolishingReportModel.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(paintPolishingReportModel.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(paintPolishingReportModel.getWorkOrderNo())) {
            DdlPreparedPack.getStringEqualPack(paintPolishingReportModel.getWorkOrderNo(), "workOrderNo", packBean);
        }
        if (!StringUtils.isEmpty(paintPolishingReportModel.getModifyStartDate()) || !StringUtils.isEmpty(paintPolishingReportModel.getModifyEndDate())) {
            DdlPreparedPack.timeBuilder(paintPolishingReportModel.getModifyStartDate(), paintPolishingReportModel.getModifyEndDate(),
                    "modifyDatetime", packBean, true);
        }
        return packBean;
    }

    public static DdlPackBean getMesExceptionAlertCfg(MesExceptionAlertCfg mesExceptionAlertCfg) {
        DdlPackBean packBean = getAllBaseData(mesExceptionAlertCfg.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(mesExceptionAlertCfg.getSrcMenuCode(), "srcMenuCode", packBean);
        DdlPreparedPack.getStringEqualPack(mesExceptionAlertCfg.getWorkCenterCode(), "workCenterCode", packBean);
        DdlPreparedPack.getNumEqualPack(mesExceptionAlertCfg.getIsValid(), "isValid", packBean);
        return packBean;
    }

    public static DdlPackBean getMesPaintDefect(MesDefectRecord defectRecord, String organizeCode) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
        if (!StringUtils.isEmpty(defectRecord.getPartNo())) {
            DdlPreparedPack.getStringEqualPack(defectRecord.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getWorkCellCode())) {
            DdlPreparedPack.getStringEqualPack(defectRecord.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getDefectActionType())) {
            DdlPreparedPack.getStringEqualPack(defectRecord.getDefectActionType(), "defectActionType", packBean);
        }
        if (!StringUtils.isEmpty(defectRecord.getCreateDateTimeStart()) || !StringUtils.isEmpty(defectRecord.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(defectRecord.getCreateDateTimeStart(), defectRecord.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * MES下线报工查询条件封装
     *
     * @param productOffLine
     * @return
     */
    public static DdlPackBean getIfProductOffLine(IfProductOffLine productOffLine) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(productOffLine, productOffLine.getOrganizeCode());
        if (!StringUtils.isEmpty(productOffLine.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(productOffLine.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(productOffLine.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(productOffLine.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(productOffLine.getCreateDateTimeStart()) || !StringUtils.isEmpty(productOffLine.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(productOffLine.getCreateDateTimeStart(), productOffLine.getCreateDateTimeEnd(),
                    "createDatetime", packBean, true);
        }
        return packBean;
    }

    /**
     * MES_看板自定义参数配置查询条件封装
     *
     * @param boardCustomParamCfg
     * @return
     */
    public static DdlPackBean getBoardCustomParamCfg(MesBoardCustomParamCfg boardCustomParamCfg) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(boardCustomParamCfg.getOrganizeCode());
        if (!StringUtils.isEmpty(boardCustomParamCfg.getBoardCode())) {
            DdlPreparedPack.getStringLikerPack(boardCustomParamCfg.getBoardCode(), "boardCode", packBean);
        }
        if (!StringUtils.isEmpty(boardCustomParamCfg.getParamCode())) {
            DdlPreparedPack.getStringLikerPack(boardCustomParamCfg.getParamCode(), "paramCode", packBean);
        }
        if (!StringUtils.isEmpty(boardCustomParamCfg.getParamName())) {
            DdlPreparedPack.getStringLikerPack(boardCustomParamCfg.getParamName(), "paramName", packBean);
        }
        return packBean;
    }


    /**
     * MES容器位置查询条件封装
     *
     * @param mesContainerLocation
     * @return
     */
    public static DdlPackBean getMesContainerLocation(MesContainerLocation mesContainerLocation) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesContainerLocation, mesContainerLocation.getOrganizeCode());
        if (!StringUtils.isEmpty(mesContainerLocation.getOrganizeCode())) {
            DdlPreparedPack.getStringLikerPack(mesContainerLocation.getOrganizeCode(), "organizeCode", packBean);
        }
        if (!StringUtils.isEmpty(mesContainerLocation.getCtCode())) {
            DdlPreparedPack.getStringLikerPack(mesContainerLocation.getCtCode(), "ctCode", packBean);
        }
        if (!StringUtils.isEmpty(mesContainerLocation.getCtLocationNo())) {
            DdlPreparedPack.getStringLikerPack(mesContainerLocation.getCtLocationNo(), "ctLocationNo", packBean);
        }
        return packBean;
    }

    /**
     * MES产品容器容量配置查询条件封装
     *
     * @param mesPartContainerCapacity
     * @return
     */
    public static DdlPackBean getMesPartContainerCapacity(MesPartContainerCapacity mesPartContainerCapacity) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesPartContainerCapacity, mesPartContainerCapacity.getOrganizeCode());
        if (!StringUtils.isEmpty(mesPartContainerCapacity.getOrganizeCode())) {
            DdlPreparedPack.getStringLikerPack(mesPartContainerCapacity.getOrganizeCode(), "organizeCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPartContainerCapacity.getPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesPartContainerCapacity.getPartNo(), "partNo", packBean);
        }
        if (!StringUtils.isEmpty(mesPartContainerCapacity.getCtCode())) {
            DdlPreparedPack.getStringLikerPack(mesPartContainerCapacity.getCtCode(), "ctCode", packBean);
        }
        if (!StringUtils.isEmpty(mesPartContainerCapacity.getCtLocationNo())) {
            DdlPreparedPack.getStringLikerPack(mesPartContainerCapacity.getCtLocationNo(), "ctLocationNo", packBean);
        }
        return packBean;
    }

    /**
     * MES客户条码规则查询条件封装
     *
     * @param mesCustomerSnRule
     * @return
     */
    public static DdlPackBean getMesCustomerSnRule(MesCustomerSnRule mesCustomerSnRule) {
        DdlPackBean packBean = getAllBaseDataByNormalPro(mesCustomerSnRule, mesCustomerSnRule.getOrganizeCode());
        if (!StringUtils.isEmpty(mesCustomerSnRule.getOrganizeCode())) {
            DdlPreparedPack.getStringLikerPack(mesCustomerSnRule.getOrganizeCode(), "organizeCode", packBean);
        }
        if (!StringUtils.isEmpty(mesCustomerSnRule.getCustomerCode())) {
            DdlPreparedPack.getStringLikerPack(mesCustomerSnRule.getCustomerCode(), "customerCode", packBean);
        }
        if (!StringUtils.isEmpty(mesCustomerSnRule.getCustomerPartNo())) {
            DdlPreparedPack.getStringLikerPack(mesCustomerSnRule.getCustomerPartNo(), "customerPartNo", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getMesFurnaceLocation(MesFurnaceLocation mesFurnaceLocation) {
        DdlPackBean packBean = getAllBaseData(mesFurnaceLocation.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesFurnaceLocation.getFnLocationNo(), "fnLocationNo", packBean);
        DdlPreparedPack.getStringLikerPack(mesFurnaceLocation.getModelNo(), "modelNo", packBean);
        DdlPreparedPack.getNumEqualPack(mesFurnaceLocation.getIsValid(), "isValid", packBean);
        return packBean;
    }

    /**
     * MES_看板自定义参数配置查询条件封装
     *
     * @param boardLineStaffMatrix
     * @return
     */
    public static DdlPackBean getBoardLineStaffMatrix(MesBoardLineStaffMatrix boardLineStaffMatrix) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(boardLineStaffMatrix.getOrganizeCode());
        if (!StringUtils.isEmpty(boardLineStaffMatrix.getBoardCode())) {
            DdlPreparedPack.getStringLikerPack(boardLineStaffMatrix.getBoardCode(), "boardCode", packBean);
        }
        if (!StringUtils.isEmpty(boardLineStaffMatrix.getWorkCellCode())) {
            DdlPreparedPack.getStringLikerPack(boardLineStaffMatrix.getWorkCellCode(), "workCellCode", packBean);
        }
        if (!StringUtils.isEmpty(boardLineStaffMatrix.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(boardLineStaffMatrix.getWorkCenterCode(), "workCenterCode", packBean);
        }
        if (!StringUtils.isEmpty(boardLineStaffMatrix.getUserCode())) {
            DdlPreparedPack.getStringLikerPack(boardLineStaffMatrix.getUserCode(), "userCode", packBean);
        }
        return packBean;
    }

    public static DdlPackBean getMesEnum(MesEnum mesEnum) {
        DdlPackBean packBean = getAllBaseData(mesEnum.getOrganizeCode());
        DdlPreparedPack.getStringLikerPack(mesEnum.getEnumCode(), "enumCode", packBean);
        DdlPreparedPack.getStringLikerPack(mesEnum.getEnumName(), "enumName", packBean);
        DdlPreparedPack.getStringLikerPack(mesEnum.getEnumValue(), "enumValue", packBean);
        DdlPreparedPack.getNumEqualPack(mesEnum.getIsValid(), "isValid", packBean);
        return packBean;
    }

    /**
     * MES_看板产线配置查询条件封装
     *
     * @param boardLine
     * @return
     */
    public static DdlPackBean getBoardLine(MesBoardLine boardLine) {
        DdlPackBean packBean = DdlPackBean.getDdlPackBean(boardLine.getOrganizeCode());
        if (!StringUtils.isEmpty(boardLine.getBoardCode())) {
            DdlPreparedPack.getStringLikerPack(boardLine.getBoardCode(), "boardCode", packBean);
        }
        if (!StringUtils.isEmpty(boardLine.getAreaCode())) {
            DdlPreparedPack.getStringLikerPack(boardLine.getAreaCode(), "areaCode", packBean);
        }
        if (!StringUtils.isEmpty(boardLine.getWorkCenterCode())) {
            DdlPreparedPack.getStringLikerPack(boardLine.getWorkCenterCode(), "workCenterCode", packBean);
        }
        return packBean;
    }

}
