package cn.estsh.i3plus.pojo.wms.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.WmsEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
import cn.estsh.i3plus.pojo.base.util.StringUtil;
import cn.estsh.i3plus.pojo.wms.bean.*;
import cn.estsh.i3plus.pojo.wms.bean.dynamictable.WmsFieldInfo;
import cn.estsh.i3plus.pojo.wms.bean.dynamictable.WmsSearchElementFunction;
import cn.estsh.i3plus.pojo.wms.bean.plugin.BasPlugin;
import cn.estsh.i3plus.pojo.wms.bean.template.BasImportTemplate;
import cn.estsh.i3plus.pojo.wms.bean.template.BasImportTemplateDetails;
import cn.estsh.i3plus.pojo.wms.dbinterface.WmsInterfaceDataMapper;
import cn.estsh.i3plus.pojo.wms.dto.WmsTmsShipDto;
import cn.estsh.i3plus.pojo.wms.engine.rule.EngineRulePersistence;
import com.google.common.base.Strings;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * @Description : 仓库管理对象封装
 * @Reference :
 * @Author : silliter.yuan
 * @CreateDate : 2018-10-31 10:45
 * @Modify:
 **/
public class WmsHqlPack {

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

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

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

        return hqlStr;
    }

    /**
     * @param wmsFix
     * @return
     */
    public static DdlPackBean packHqlWmsFix(WmsFix wmsFix) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringRightLikerPack(wmsFix.getFixId(), "fixId", result);
        DdlPreparedPack.getStringRightLikerPack(wmsFix.getFixMac(), "fixMac", result);
        DdlPreparedPack.getStringRightLikerPack(wmsFix.getFixName(), "fixName", result);

        if (StringUtils.isNotBlank(wmsFix.getOrganizeCode())) {
            DdlPreparedPack.getStringEqualPack(wmsFix.getOrganizeCode(), "organizeCode", result);
        }
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);

        DdlPreparedPack.getNumEqualPack(wmsFix.getIsValid(), "isValid", result);
        return result;
    }


    /**
     * 单位换算 分页查询
     *
     * @return
     */
    public static DdlPackBean packHqlWmsUnitConvertByPager(WmsUnitConvert wmsUnitConvert) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsUnitConvert.getUnitCode(), "unitCode", result);
        DdlPreparedPack.getStringEqualPack(wmsUnitConvert.getDestUnitCode(), "destUnitCode", result);

        getStringBuilderPack(wmsUnitConvert, result);

        return result;
    }


    /**
     * PO订单明细表 分页查询
     *
     * @param wmsPOMasterDetails
     * @return
     */
    public static DdlPackBean packHqlWmsPOMasterDetails(WmsPOMasterDetails wmsPOMasterDetails) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsPOMasterDetails.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMasterDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMasterDetails.getPartNameRdd(), "partNameRdd", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMasterDetails.getPlanTime(), "planTime", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMasterDetails.getPlanDate(), "planDate", result);

        getStringBuilderPack(wmsPOMasterDetails, result);

        return result;
    }

    /**
     * 库存移动单详情查询封装
     *
     * @param wmsDocMovementDetails
     * @return
     */
    public static DdlPackBean packWmsDocMovementDetails(WmsDocMovementDetails wmsDocMovementDetails) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        // 该查询封装用于单据主表查询明细使用equal 精准查询
        DdlPreparedPack.getStringEqualPack(wmsDocMovementDetails.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getNumEqualPack(wmsDocMovementDetails.getItemStatus(), "itemStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsDocMovementDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsDocMovementDetails.getDestZoneNo(), "destZoneNo", result);
        DdlPreparedPack.getStringLikerPack(wmsDocMovementDetails.getDestLocateNo(), "destLocateNo", result);
        getStringBuilderPack(wmsDocMovementDetails, result);

        return result;
    }

    /**
     * 查询任务合并的移库单明细 查询条件封装
     *
     * @param colName
     * @param orderNos
     * @return
     */
    public static DdlPackBean packWmsOrderDetailsByOrderNos(String colName, List<String> orderNos) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getInPack(orderNos, "orderNo", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", packBean);
        DdlPreparedPack.getOrderByPack(
                new Object[]{CommonEnumUtil.ASC_OR_DESC.DESC.getValue(), CommonEnumUtil.ASC_OR_DESC.DESC.getValue()},
                new String[]{colName, "orderNo"}, packBean);
        return packBean;
    }

    /**
     * 开口合同查询封装
     *
     * @param swebProcurementPlanOrder
     * @return
     */
    public static DdlPackBean packSwebProcurementPlanOrder(SwebProcurementPlanOrder swebProcurementPlanOrder) {
        DdlPackBean packBean = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(swebProcurementPlanOrder.getOrganizeCode(), "organizeCode", packBean);
        DdlPreparedPack.getStringEqualPack(swebProcurementPlanOrder.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringEqualPack(swebProcurementPlanOrder.getPartName(), "partName", packBean);
        DdlPreparedPack.getStringEqualPack(swebProcurementPlanOrder.getVendorCode(), "vendorNo", packBean);
        DdlPreparedPack.getStringEqualPack(swebProcurementPlanOrder.getVendorName(), "vendorName", packBean);
        DdlPreparedPack.getStringRightLikerPack(swebProcurementPlanOrder.getOrderNo(), "orderNo", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", packBean);
        getStringBuilderPack(swebProcurementPlanOrder, packBean);
        return packBean;
    }

    /**
     * 物理包装封装
     *
     * @param wmsPackage
     * @return
     */
    public static DdlPackBean packWmsPackage(WmsPackage wmsPackage) {
        DdlPackBean packBean = new DdlPackBean();
        //查询参数封装
        DdlPreparedPack.getNumEqualPack(wmsPackage.getOrganizeCode(), "organizeCode", packBean);
        DdlPreparedPack.getStringLikerPack(wmsPackage.getMemo(), "memo", packBean);
        DdlPreparedPack.getStringLikerPack(wmsPackage.getLocateNo(), "locateNo", packBean);
        DdlPreparedPack.getNumEqualPack(wmsPackage.getPrintStatus(), "printStatus", packBean);
        DdlPreparedPack.getStringLikePack(wmsPackage.getPackageNo()==null?"":wmsPackage.getPackageNo()+"%", "packageNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsPackage.getPackSpec(), "packSpec", packBean);
        DdlPreparedPack.getStringLikePack(wmsPackage.getPocketNo()==null?"":wmsPackage.getPocketNo()+"%", "pocketNo", packBean);
        DdlPreparedPack.getNumEqualPack(wmsPackage.getPackLevel(), "packLevel", packBean);
        DdlPreparedPack.getNumEqualPack(wmsPackage.getIsValid()==null?CommonEnumUtil.IS_VAILD.VAILD.getValue():wmsPackage.getIsValid(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", packBean);
        getStringBuilderPack(wmsPackage, packBean);
        return packBean;
    }

    /**
     * 库存移动单查询封装
     *
     * @param wmsDocMovementMaster
     * @return
     */
    public static DdlPackBean packWmsDocMovementMaster(WmsDocMovementMaster wmsDocMovementMaster) {
        DdlPackBean packBean = new DdlPackBean();

        //查询参数封装PROD_SCRAP
        DdlPreparedPack.getStringLikerPack(wmsDocMovementMaster.getOrderNo(), "orderNo", packBean);
        DdlPreparedPack.getNumEqualPack(wmsDocMovementMaster.getMoveType(), "moveType", packBean);
        DdlPreparedPack.getNumEqualPack(wmsDocMovementMaster.getBusiType(), "busiType", packBean);
        //滤掉业务类型
        if (!StringUtil.isEmpty(wmsDocMovementMaster.getFilterBusiType())) {
            List<Integer> filterBusiType = new ArrayList<>();
            for (String busiType : wmsDocMovementMaster.getFilterBusiType().split(",")) {
                filterBusiType.add(Integer.parseInt(busiType));
            }
            DdlPreparedPack.getNotInPackList(filterBusiType, "busiType", System.currentTimeMillis() + "", packBean);
        }
        DdlPreparedPack.getNumEqualPack(wmsDocMovementMaster.getOrderStatus(), "orderStatus", packBean);
        DdlPreparedPack.getStringEqualPack(wmsDocMovementMaster.getCustNo(), "custNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsDocMovementMaster.getErpSrcNo(), "erpSrcNo", packBean);
        DdlPreparedPack.getInPackList(wmsDocMovementMaster.getOrganizeCodeList(), "organizeCode", packBean);
        DdlPreparedPack.getStringLikerPack(wmsDocMovementMaster.getOrderNo(), "orderNo", packBean);
        DdlPreparedPack.getStringLikerPack(wmsDocMovementMaster.getCostCenter(), "costCenter", packBean);
        DdlPreparedPack.getStringLikerPack(wmsDocMovementMaster.getThirdRemake(), "thirdRemake", packBean);


        getStringBuilderPack(wmsDocMovementMaster, packBean);

        return packBean;
    }

    /**
     * 移库单号集合查询条件封装
     *
     * @param orderNoList
     * @param organizeCode
     * @return
     */
    public static DdlPackBean packWmsDocMovementMasterByOrderNos(List<String> orderNoList, String organizeCode) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getInPack(orderNoList, "orderNo", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", packBean);

        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", packBean);

        return packBean;
    }


    /**
     * PO订单主表信息 分页查询
     *
     * @param wmsPOMaster
     * @return
     */
    public static DdlPackBean packHqlWmsPOMaster(WmsPOMaster wmsPOMaster) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getPoType(), "poType", result);
        DdlPreparedPack.getNumEqualPack(wmsPOMaster.getPoStatus(), "poStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getSrc(), "src", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getIsAsn(), "isAsn", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getErpSrcNo(), "erpSrcNo", result);
        DdlPreparedPack.getStringRightLikerPack(wmsPOMaster.getContainerNo(), "containerNo", result);
        if (wmsPOMaster.getPriorRC() != null && wmsPOMaster.getPriorRC() == WmsEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) {
            ArrayList<Integer> numList = new ArrayList<>();
            numList.add(0);
            numList.add(wmsPOMaster.getPriorRC());
            numList.add(null);
            DdlPreparedPack.getNotOrIsNull(numList, "priorRC", result);
        } else {
            DdlPreparedPack.getNumEqualPack(wmsPOMaster.getPriorRC(), "priorRC", result);
        }

        if (!CollectionUtils.isEmpty(wmsPOMaster.getOrderNoList())) {
            DdlPreparedPack.getInPackList(wmsPOMaster.getOrderNoList(), "orderNo", result);
        } else {
            DdlPreparedPack.getStringRightLikerPack(wmsPOMaster.getOrderNo(), "orderNo", result);
        }

        //按创建时间查询单据信息
        if (StringUtils.isNotBlank(wmsPOMaster.getCreateDateTimeStart())) {
            DdlPreparedPack.timeBuilder(wmsPOMaster.getCreateDateTimeStart(),
                    wmsPOMaster.getCreateDateTimeEnd(), "createDatetime", result, true);
        }
        if (StringUtils.isNotBlank(wmsPOMaster.getCreateDateTimeEnd())) {
            DdlPreparedPack.timeBuilder(wmsPOMaster.getCreateDateTimeStart(),
                    wmsPOMaster.getCreateDateTimeEnd(), "createDatetime", result, true);
        }
        getStringBuilderPack(wmsPOMaster, result);

        return result;
    }

    /**
     * PO订单主表信息 分页查询(散件)
     *
     * @param wmsPOMaster
     * @return
     */
    public static DdlPackBean packHqlWmsPOMasterPart(WmsPOMaster wmsPOMaster) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getInPackArray(new Object[]{WmsEnumUtil.MASTER_ORDER_STATUS.CREATE.getValue(),
                WmsEnumUtil.MASTER_ORDER_STATUS.RECEIPT.getValue()}, "poStatus", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), "isPart", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getPoType(), "poType", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getSrc(), "src", result);
        DdlPreparedPack.getStringEqualPack(wmsPOMaster.getIsAsn(), "isAsn", result);

        getStringBuilderPack(wmsPOMaster, result);

        return result;
    }

    /**
     * 物流路线子表查询条件封装
     *
     * @param wmsRoutingDetail
     * @return
     */
    public static DdlPackBean packHqlWmsRoutingDetail(WmsRoutingDetail wmsRoutingDetail) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsRoutingDetail.getRoutingCode(), "routingCode", result);

        getStringBuilderPack(wmsRoutingDetail, result);
        return result;
    }

    /**
     * 物流路线子表查询条件封装
     *
     * @param routingCode
     * @return
     */
    @Deprecated
    public static DdlPackBean packHqlWmsRoutingChildren(String routingCode) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(routingCode, "routingCode", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(),
                "isDeleted", result);

        return result;
    }

    /**
     * 物流路线子表查询条件封装
     *
     * @param wmsRoutingAssign
     * @return
     */
    public static DdlPackBean packHqlWmsRoutingAssign(WmsRoutingAssign wmsRoutingAssign) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsRoutingAssign.getRoutingCode(), "routingCode", result);

        getStringBuilderPack(wmsRoutingAssign, result);
        return result;
    }

    /**
     * 物流路线主表查询条件封装
     *
     * @param wmsRoutingMaster
     * @return
     */
    public static DdlPackBean packHqlWmsRoutingMaster(WmsRoutingMaster wmsRoutingMaster) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(wmsRoutingMaster.getRoutingCode(), "routingCode", result);
        DdlPreparedPack.getStringLikerPack(wmsRoutingMaster.getRoutingName(), "routingName", result);

        getStringBuilderPack(wmsRoutingMaster, result);

        return result;
    }

    /**
     * 物料查询条件封装
     *
     * @param wmsPart
     * @return
     */
    public static DdlPackBean packHqlWmsPart(WmsPart wmsPart) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringRightLikerPack(wmsPart.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsPart.getPartName(), "partName", result);
        DdlPreparedPack.getStringLikerPack(wmsPart.getPartSpec(), "partSpec", result);
        if (!StringUtil.isEmpty(wmsPart.getPartType()) && wmsPart.getPartType().contains(",")) {
            String types[] = wmsPart.getPartType().split(",");
            List<String> partTypes = new ArrayList<>();
            for (String type : types) {
                partTypes.add(type);
            }
            DdlPreparedPack.getInPackList(partTypes, "partType", result);
        } else {
            DdlPreparedPack.getStringEqualPack(wmsPart.getPartType(), "partType", result);
        }
        DdlPreparedPack.getNumEqualPack(wmsPart.getSnControl(), "snControl", result);
        DdlPreparedPack.getNumEqualPack(wmsPart.getIsValuable(), "isValuable",result);
        getStringBuilderPack(wmsPart, result);

        return result;
    }

    /**
     * 抽点比例信息 分页查询
     *
     * @param wmsIbCheckPlan
     * @return
     */
    public static DdlPackBean packHqlWmsIbCheckPlan(WmsIbCheckPlan wmsIbCheckPlan) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringRightLikerPack(wmsIbCheckPlan.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsIbCheckPlan.getPartNameRdd(), "partNameRdd", result);
        getStringBuilderPack(wmsIbCheckPlan, result);

        if (wmsIbCheckPlan.getStartDateStart() != null || wmsIbCheckPlan.getStartDateEnd() != null) {
            DdlPreparedPack.timeBuilder(wmsIbCheckPlan.getStartDateStart(), wmsIbCheckPlan.getStartDateEnd(), "startDate", result, false);
        }
        if (wmsIbCheckPlan.getEndDateStart() != null || wmsIbCheckPlan.getEndDateEnd() != null) {
            DdlPreparedPack.timeBuilder(wmsIbCheckPlan.getEndDateStart(), wmsIbCheckPlan.getEndDateEnd(), "endDate", result, false);
        }

        return result;
    }

    /**
     * 交易类型信息 分页查询
     *
     * @param wmsTransType
     * @return
     */
    public static DdlPackBean packHqlWmsTransType(WmsTransType wmsTransType) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringRightLikerPack(wmsTransType.getTransTypeCode(), "transTypeCode", result);
        DdlPreparedPack.getStringLikerPack(wmsTransType.getTransTypeName(), "transTypeName", result);
        DdlPreparedPack.getNumEqualPack(wmsTransType.getOrderBackType(),"orderBackType",result);
        DdlPreparedPack.getNumEqualPack(wmsTransType.getAgId(), "agId", result);

        getStringBuilderPack(wmsTransType, result);

        return result;
    }

    /**
     * 供应商分页查询
     *
     * @param basVendor
     * @return
     */
    public static DdlPackBean packHqlBasVendor(BasVendor basVendor) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(basVendor.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringLikerPack(basVendor.getVendorName(), "vendorName", result);
        DdlPreparedPack.getStringLikerPack(basVendor.getVendorOwner(), "vendorOwner", result);
        DdlPreparedPack.getStringLikerPack(basVendor.getVendorDesc(), "vendorDesc", result);
        DdlPreparedPack.getStringLikerPack(basVendor.getVendorAddr(), "vendorAddr", result);
        DdlPreparedPack.getStringLikerPack(basVendor.getVendorEmail(), "vendorEmail", result);
        DdlPreparedPack.getNumEqualPack(basVendor.getIsAsn(), "isAsn", result);
        DdlPreparedPack.getNumEqualPack(basVendor.getVendorType(), "vendorType", result);

        getStringBuilderPack(basVendor, result);

        return result;
    }

    /**
     * 作业类型分页查询
     *
     * @param wmsOpType
     * @return
     */
    public static DdlPackBean packHqlWmsOpType(WmsOpType wmsOpType) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsOpType.getOpTypeCode(), "opTypeCode", result);
        DdlPreparedPack.getStringLikerPack(wmsOpType.getOpTypeName(), "opTypeName", result);
        DdlPreparedPack.getNumEqualPack(wmsOpType.getSeq(), "seq", result);

        getStringBuilderPack(wmsOpType, result);

        return result;
    }

    /**
     * 仓库分页查询条件
     *
     * @param wareHouse
     * @return
     */
    public static DdlPackBean packHqlWareHouse(WareHouse wareHouse) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wareHouse.getAddress(), "address", result);
        DdlPreparedPack.getStringLikerPack(wareHouse.getCode(), "code", result);
        DdlPreparedPack.getStringLikerPack(wareHouse.getName(), "name", result);

        getStringBuilderPack(wareHouse, result);

        return result;
    }

    /**
     * 仓库唯一性校验查询条件【用于添加和修改】
     *
     * @param wareHouse
     * @return
     */
    public static DdlPackBean packHqlWareHouseUnique(WareHouse wareHouse) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wareHouse.getName(), "name", result);
        DdlPreparedPack.getStringEqualPack(wareHouse.getCode(), "code", result);
        DdlPreparedPack.getNumNOEqualPack(wareHouse.getId(), "id", result);

        getStringBuilderPack(wareHouse, result);

        return result;
    }

    /**
     * 存储区信息 查询条件封装
     *
     * @param wmsZones
     * @return
     */
    public static DdlPackBean packHqlWmsZones(WmsZones wmsZones) {
        DdlPackBean result = new DdlPackBean();

        //仓库代码
        DdlPreparedPack.getStringEqualPack(wmsZones.getWhNo(), "whNo", result);
        //库存地代码
        DdlPreparedPack.getStringLikerPack(wmsZones.getAreaNo(), "areaNo", result);
        //存储区代码
        DdlPreparedPack.getStringLikerPack(wmsZones.getZoneNo(), "zoneNo", result);
        //存储区名称
        DdlPreparedPack.getStringLikerPack(wmsZones.getZoneName(), "zoneName", result);

        getStringBuilderPack(wmsZones, result);

        return result;
    }

    /**
     * 库位信息 分页查询
     *
     * @param wmsLocate
     * @return
     */
    public static DdlPackBean packHqlWmsLocates(WmsLocate wmsLocate) {
        //查询参数封装
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsLocate.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringEqualPack(wmsLocate.getLocateName(), "locateName", result);
        DdlPreparedPack.getNumEqualPack(wmsLocate.getLocateType(), "locateType", result);
        DdlPreparedPack.getStringEqualPack(wmsLocate.getWhNo(), "whNo", result);
        if (wmsLocate.getZoneNo() != null) {
            DdlPreparedPack.getInPackArray(wmsLocate.getZoneNo().split(","), "zoneNo", result);
        }
        if (wmsLocate.getLocateNoArr() != null) {
            DdlPreparedPack.getInPackArray(wmsLocate.getLocateNoArr(), "locateNo", result);
        }
        // DdlPreparedPack.getStringEqualPack(wmsLocate.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getNumEqualPack(wmsLocate.getStatus(), "status", result);

        getStringBuilderPack(wmsLocate, result);

        return result;
    }

    /**
     * 拉动规则  分页查询
     * @param rule
     * @return
     */
    public static DdlPackBean packHqlWmsPullRule(WmsPullRule rule) {
        //查询参数封装
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(rule.getPullWay(), "pullWay", result);

        getStringBuilderPack(rule, result);
        return result;
    }

    /**
     * 根据类型查询库位分页
     *
     * @param wmsLocate
     * @return
     */
    public static DdlPackBean packHqlWmsLocatesByType(WmsLocate wmsLocate) {
        DdlPackBean result = new DdlPackBean();
        //查询参数封装
        DdlPreparedPack.getNumEqualPack(wmsLocate.getLocateType(), "locateType", result);
        getStringBuilderPack(wmsLocate, result);
        return result;
    }

    /**
     * 库位物料信息 分页查询
     *
     * @param wmsLocatePart
     * @return
     */
    public static DdlPackBean packHqlWmsLocatePart(WmsLocatePart wmsLocatePart) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        //DdlPreparedPack.getStringLikerPack(wmsLocatePart.getLocateType().toString(), "locateType", result);
        DdlPreparedPack.getStringLikerPack(wmsLocatePart.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringLikerPack(wmsLocatePart.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsLocatePart.getPartNameRdd(), "partNameRdd", result);

        getStringBuilderPack(wmsLocatePart, result);

        return result;
    }

    public static DdlPackBean packHqlWmsOpTypeUnique(WmsOpType wmsOpType) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsOpType.getOpTypeCode(), "opTypeCode", result);
        DdlPreparedPack.getStringLikerPack(wmsOpType.getOpTypeName(), "opTypeName", result);

        getStringBuilderPack(wmsOpType, result);

        return result;
    }

    /**
     * 客户信息 查询条件封装
     *
     * @param basCustomer
     * @return
     */
    public static DdlPackBean packHqlBasCustomer(BasCustomer basCustomer) {
        DdlPackBean result = new DdlPackBean();

        //客户编号
        DdlPreparedPack.getStringLikerPack(basCustomer.getCustNo(), "custNo", result);
        //客户简称
        DdlPreparedPack.getStringLikerPack(basCustomer.getCustName(), "custName", result);
        //客户全称
        DdlPreparedPack.getStringLikerPack(basCustomer.getCustDesc(), "custDesc", result);

        getStringBuilderPack(basCustomer, result);

        return result;
    }

    /**
     * 客户发往地信息 查询条件封装
     *
     * @param wmsShippingFlag
     * @return
     */
    public static DdlPackBean packHqlWmsShippingFlag(WmsShippingFlag wmsShippingFlag) {
        DdlPackBean result = new DdlPackBean();

        //供应商编号
        DdlPreparedPack.getStringEqualPack(wmsShippingFlag.getFlagNo(), "flagNo", result);
        //客户编号
        DdlPreparedPack.getStringEqualPack(wmsShippingFlag.getCustNo(), "custNo", result);
        //供应商简称
        DdlPreparedPack.getStringLikerPack(wmsShippingFlag.getFlagName(), "flagName", result);
        //供应商全称
        DdlPreparedPack.getStringLikerPack(wmsShippingFlag.getFlagDesc(), "flagDesc", result);

        getStringBuilderPack(wmsShippingFlag, result);

        return result;
    }

    /**
     * ASN订单分页查询条件
     *
     * @param wmsASNMaster
     * @return
     */
    public static DdlPackBean packHqlWmsASNMaster(WmsASNMaster wmsASNMaster) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringRightLikerPack(wmsASNMaster.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getNumEqualPack(wmsASNMaster.getAsnType(), "asnType", result);
        DdlPreparedPack.getNumEqualPack(wmsASNMaster.getAsnStatus(), "asnStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMaster.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMaster.getVersion(), "version", result);
        DdlPreparedPack.getStringLikerPack(wmsASNMaster.getSrc(), "src", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMaster.getPoNo(), "poNo", result);
        DdlPreparedPack.getStringRightLikerPack(wmsASNMaster.getContainerNo(), "containerNo", result);

        //  查询计划时间在指定范围的单号，查询这些单号的数据
        if (StringUtils.isNotBlank(wmsASNMaster.getPlanDateStart()) && StringUtils.isNotBlank(wmsASNMaster.getPlanDateEnd())) {
            DdlPreparedPack.getInPackList(wmsASNMaster.getOrderNoList(), "orderNo", result);
        }

        //按创建时间查询单据信息
        if (StringUtils.isNotBlank(wmsASNMaster.getCreateDateTimeStart())) {
            DdlPreparedPack.timeBuilder(wmsASNMaster.getCreateDateTimeStart(),
                    wmsASNMaster.getCreateDateTimeEnd(), "createDatetime", result, true);
        }

        getStringBuilderPack(wmsASNMaster, result);

        return result;
    }

    /**
     * 产品发运信息 查询条件封装
     *
     * @param wmsShipping
     * @return
     */
    public static DdlPackBean packHqlWmsShipping(WmsShipping wmsShipping) {
        DdlPackBean result = new DdlPackBean();

        //发运单号
        DdlPreparedPack.getStringLikerPack(wmsShipping.getOrderNo(), "orderNo", result);
        //客户编码
        DdlPreparedPack.getStringEqualPack(wmsShipping.getCustNo(), "custNo", result);
        //物料编码
        DdlPreparedPack.getStringEqualPack(wmsShipping.getPartNo(), "partNo", result);
        //条码
        DdlPreparedPack.getStringEqualPack(wmsShipping.getSn(), "sn", result);
        //发运状态
        DdlPreparedPack.getNumEqualPack(wmsShipping.getOrderStatus(), "orderStatus", result);
        //发运状态集合
        DdlPreparedPack.getInPackList(wmsShipping.getOrderStatusList(), "orderStatus", result);
        //特殊发货标志
        DdlPreparedPack.getStringEqualPack(wmsShipping.getShippingFlag(), "shippingFlag", result);
        //单据来源
        DdlPreparedPack.getStringEqualPack(wmsShipping.getSrc(), "src", result);
        getStringBuilderPack(wmsShipping, result);

        return result;
    }

    /**
     * 抽点记录信息 查询条件封装
     *
     * @param wmsCheckFactRecord
     * @return
     */
    public static DdlPackBean packHqlWmsCheckFactRecord(WmsCheckFactRecord wmsCheckFactRecord) {
        DdlPackBean result = new DdlPackBean();

        //采购单号
        DdlPreparedPack.getStringEqualPack(wmsCheckFactRecord.getPoNo(), "poNo", result);
        //ASN单号
        DdlPreparedPack.getStringEqualPack(wmsCheckFactRecord.getAsnNo(), "asnNo", result);
        //条码
        DdlPreparedPack.getStringEqualPack(wmsCheckFactRecord.getSn(), "getSn", result);
        //物料编码
        DdlPreparedPack.getStringEqualPack(wmsCheckFactRecord.getPartNo(), "partNo", result);
        //供应商编号
        DdlPreparedPack.getStringEqualPack(wmsCheckFactRecord.getVendorNo(), "vendorNo", result);
        //关联单号
        DdlPreparedPack.getStringLikerPack(wmsCheckFactRecord.getRefSrc(), "refSrc", result);
        //关联单单据类型
        DdlPreparedPack.getStringEqualPack(wmsCheckFactRecord.getRefType(), "refType", result);

        getStringBuilderPack(wmsCheckFactRecord, result);

        return result;
    }

    public static DdlPackBean packHqlWmsASNMasterDetails(WmsASNMasterDetails wmsASNMasterDetails) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsASNMasterDetails.getPartNameRdd(), "partNameRdd", result);
        DdlPreparedPack.getNumEqualPack(wmsASNMasterDetails.getQty(), "qty", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getPoItem(), "poItem", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getUnit(), "unit", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getPlanDate(), "planDate", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getPlanTime(), "planTime", result);
        DdlPreparedPack.getNumEqualPack(wmsASNMasterDetails.getItemStatus(), "itemStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getPackAge(), "packAge", result);
        DdlPreparedPack.getNumEqualPack(wmsASNMasterDetails.getIsFree(), "isFree", result);
        DdlPreparedPack.getStringLikerPack(wmsASNMasterDetails.getDock(), "dock", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getSnOneBarCode(), "snOneBarCode", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getSnTwoBarCode(), "snTwoBarCode", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getGroupNo(), "groupNo", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getErpAreaNo(), "erpAreaNo", result);
        DdlPreparedPack.getStringEqualPack(wmsASNMasterDetails.getVendorLotNo(), "vendorLotNo", result);

        getStringBuilderPack(wmsASNMasterDetails, result);

        DdlPreparedPack.getOrderByPack(new Object[]{1}, new String[]{"snOneBarCode"}, result);
        return result;
    }

    /**
     * 产品入库信息 条件封装
     *
     * @param wmsFGInStock
     * @return
     */
    public static DdlPackBean packHqlWmsFGInStock(WmsFGInStock wmsFGInStock) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getWoNo(), "woNo", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsFGInStock.getPartNameRdd(), "partNameRdd", result);
        DdlPreparedPack.getNumEqualPack(wmsFGInStock.getQty(), "qty", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getUnit(), "unit", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getSn(), "sn", result);
        DdlPreparedPack.getNumEqualPack(wmsFGInStock.getOrderStatus(), "orderStatus", result);
        DdlPreparedPack.getStringLikerPack(wmsFGInStock.getRemark(), "remark", result);
        DdlPreparedPack.getStringLikerPack(wmsFGInStock.getSrc(), "src", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getErpAreaNo(), "erpWhno", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getLineNo(), "lineNo", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringLikerPack(wmsFGInStock.getCustNo(), "custNo", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getShippingFlag(), "shippingFlag", result);
        DdlPreparedPack.getStringEqualPack(wmsFGInStock.getMfgLogNo(), "mfgLogNo", result);

        getStringBuilderPack(wmsFGInStock, result);

        return result;
    }

    /**
     * 作业任务信息条件封装
     *
     * @param wmsTaskInfo
     * @return
     */
    public static DdlPackBean packHqlWmsTaskInfo(WmsTaskInfo wmsTaskInfo) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsTaskInfo.getMoveNo(), "moveNo", result);
        DdlPreparedPack.getStringLikerPack(wmsTaskInfo.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringLikerPack(wmsTaskInfo.getUserNo(), "userNo", result);
        DdlPreparedPack.getStringLikerPack(wmsTaskInfo.getOpTypeCode(), "opTypeCode", result);
        DdlPreparedPack.getStringLikerPack(wmsTaskInfo.getRemark(), "remark", result);
        DdlPreparedPack.getNumEqualPack(wmsTaskInfo.getTaskStatus(), "taskStatus", result);

        getStringBuilderPack(wmsTaskInfo, result);

        return result;
    }

    /**
     * 根据条件查询打印机队列信息封装类
     *
     * @param wmsSnPrint 打印机队列信息
     * @return 打印机队列信息
     */
    public static DdlPackBean packHqlWmsSnPrint(WmsSnPrint wmsSnPrint) {
        DdlPackBean result = new DdlPackBean();

        // 来源单据类型
        DdlPreparedPack.getStringEqualPack(wmsSnPrint.getRefType(), "refType", result);
        // 来源单据号
        DdlPreparedPack.getStringLikerPack(wmsSnPrint.getRefNo(), "refNo", result);
        // 打印机
        DdlPreparedPack.getStringLikerPack(wmsSnPrint.getPrinter(), "printer", result);
        // 打印机状态
        DdlPreparedPack.getNumEqualPack(wmsSnPrint.getPrintStatus(), "printStatus", result);

        getStringBuilderPack(wmsSnPrint, result);

        return result;
    }

    /**
     * 盘点库位 条件封装
     *
     * @param wmsCSLocate
     * @return
     */
    public static DdlPackBean packHqlWmsCSLocate(WmsCSLocate wmsCSLocate) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsCSLocate.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSLocate.getLocateNo(), ";locateNo", result);

        getStringBuilderPack(wmsCSLocate, result);

        return result;
    }

    /**
     * 盘点物料 条件封装
     *
     * @param wmsCSPart
     * @return
     */
    public static DdlPackBean packHqlWmsCSPart(WmsCSPart wmsCSPart) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsCSPart.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSPart.getPartNo(), "partNo", result);
        DdlPreparedPack.getNumEqualPack(wmsCSPart.getIsAdjust(), "isAdjust", result);
        DdlPreparedPack.getStringLikerPack(wmsCSPart.getPartNameRdd(), "partNameRdd", result);

        getStringBuilderPack(wmsCSPart, result);

        return result;
    }

    /**
     * 盘点存储区 条件封装
     *
     * @param wmsCSZone
     * @return
     */
    public static DdlPackBean packHqlWmsCSZone(WmsCSZone wmsCSZone) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsCSZone.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSZone.getZoneNo(), "zoneNo", result);

        getStringBuilderPack(wmsCSZone, result);

        return result;
    }

    /**
     * 根据条件查询责任区分配信息封装类
     *
     * @param wmsAreaOwner 责任区分配信息
     * @return 责任区分配信息
     */
    public static DdlPackBean packHqlWmsAreaOwner(WmsAreaOwner wmsAreaOwner) {
        DdlPackBean result = new DdlPackBean();

        // 仓库代码
        DdlPreparedPack.getStringEqualPack(wmsAreaOwner.getWhNo(), "whNo", result);
        // 来源单据号
        DdlPreparedPack.getStringEqualPack(wmsAreaOwner.getZoneNo(), "zoneNo", result);
        // 供应商编码
        DdlPreparedPack.getStringEqualPack(wmsAreaOwner.getVendorNo(), "vendorNo", result);
        // 物料编码
        DdlPreparedPack.getStringEqualPack(wmsAreaOwner.getPartNo(), "partNo", result);
        // 负责人
        DdlPreparedPack.getStringEqualPack(wmsAreaOwner.getOwnerUserNo(), "ownerUserNo", result);
        // 是否预分配
        DdlPreparedPack.getNumEqualPack(wmsAreaOwner.getIsPreAssign(), "isPreAssign", result);

        getStringBuilderPack(wmsAreaOwner, result);

        return result;
    }

    /**
     * 根据条件查询单据锁定封装类
     *
     * @return 单据锁定信息
     */
    public static DdlPackBean packHqlWmsTempOrderLock(WmsTempOrderLock wmsTempOrderLock) {
        DdlPackBean result = new DdlPackBean();

        // 订单号
        DdlPreparedPack.getStringLikerPack(wmsTempOrderLock.getOrderNo(), "orderNo", result);
        // 业务类型
        DdlPreparedPack.getNumEqualPack(wmsTempOrderLock.getBizType(), "bizType", result);

        // 物料代码
        DdlPreparedPack.getStringEqualPack(wmsTempOrderLock.getPartNo(), "partNo", result);

        getStringBuilderPack(wmsTempOrderLock, result);

        return result;
    }

    /**
     * 业务：库存条码查询封装
     *
     * @param wmsStockSn
     * @return
     */
    public static DdlPackBean packWmsStockSn(WmsStockSn wmsStockSn) {
        DdlPackBean result = new DdlPackBean();
        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getSn(), "sn", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getRefSrc(), "refSrc", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getPrinted(), "printed", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnStatus(), "snStatus", result);
        DdlPreparedPack.getStringLikerPack(wmsStockSn.getPackageNo(), "packageNo", result);
        DdlPreparedPack.getStringLikerPack(wmsStockSn.getQualityDate(), "qualityDate", result);
        if (wmsStockSn.getSnStatus() == null) {
            DdlPreparedPack.getInPackArray(new Integer[]{
                    WmsEnumUtil.STOCK_SN_STATUS.QUALITY_CONTROL.getValue(), WmsEnumUtil.STOCK_SN_STATUS.PRE_INSTOCK.getValue(),
                    WmsEnumUtil.STOCK_SN_STATUS.INSTOCKED.getValue(), WmsEnumUtil.STOCK_SN_STATUS.PICKED.getValue(),
                    WmsEnumUtil.STOCK_SN_STATUS.COMMING.getValue()}, "snStatus", result);
        }
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getQcStatus(), "qcStatus", result);
        result.setWhereAppend(result.getWhereAppend() + " and qty > 0");

        getStringBuilderPack(wmsStockSn, result);

        return result;
    }

    /**
     * 业务：库存查询封装
     *
     * @param wmsStockQuan
     * @return
     */
    public static DdlPackBean packWmsStockQuan(WmsStockQuan wmsStockQuan) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getInPackList(wmsStockQuan.getZoneList(), "zoneNo", result);
        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getCustNo(), "custNo", result);
        getStringBuilderPack(wmsStockQuan, result);

        return result;
    }

    /**
     * 业务：库存交易条码查询封装(根据交易编码查询所有未删除的)
     *
     * @param tranNo
     * @return
     */
    public static DdlPackBean packWmsTransSn(String tranNo) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(tranNo, "transNo", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);

        return result;
    }

    /**
     * 业务：库存交易查询封装
     *
     * @param wmsTransQuan
     * @return
     */
    public static DdlPackBean packWmsTransQuan(WmsTransQuan wmsTransQuan) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getStringLikerPack(wmsTransQuan.getMoveNo(), "moveNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getTransTypeName(), "transTypeName", result);

        getStringBuilderPack(wmsTransQuan, result);

        return result;
    }

    /**
     * 业务：库存表报查询封装
     *
     * @param wmsStockQuan
     * @return
     */
    public static String packWmsStoreQuanForReport(WmsStockQuan wmsStockQuan) {

        StringBuffer findWhere = new StringBuffer();
        HqlPack.getStringEqualPack(wmsStockQuan.getWhNo(), "whNo", findWhere);
        HqlPack.getStringEqualPack(wmsStockQuan.getProdCfgTypeCode(), "prodCfgTypeCode", findWhere);
        HqlPack.getStringEqualPack(wmsStockQuan.getLocateNo(), "locateNo", findWhere);
        if (wmsStockQuan.getZoneNo() != null) {
            HqlPack.getInPack(StringUtils.join(new ArrayList<String>(Arrays.asList(wmsStockQuan.getZoneNo().split(","))), ","), "", findWhere);
            //DdlPreparedPack.getInPackArray(wmsStockQuan.getZoneNo().split(","), "zoneNo", result);
        }
        if (wmsStockQuan.getPartNo() != null) {
            HqlPack.getInPack(StringUtils.join(new ArrayList<String>(Arrays.asList(wmsStockQuan.getPartNo().split(","))), ","), "partNo", findWhere);
        }
        if (!wmsStockQuan.getIncludeZeroStock()) {
            //含0库存显示，默认为否
            //自定义条件，各汇总数量相加。为否时添加>0的条件判断
            findWhere.append("  and (qty + failQty + holdQty + qcQty + rinQty + freezeQty + consignQty + lockQty) > 0 ");
        }
        return findWhere.toString();
    }

    public static DdlPackBean packWmsStoreQuanForReport1(WmsStockQuan wmsStockQuan) {

        DdlPackBean result = new DdlPackBean();
        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getProdCfgTypeCode(), "prodCfgTypeCode", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getLocateNo(), "locateNo", result);

        if (wmsStockQuan.getZoneNo() != null) {
            DdlPreparedPack.getInPackList(Arrays.asList(wmsStockQuan.getZoneNo().split(",")), "zoneNo", result);
        }
        if (wmsStockQuan.getPartNo() != null) {
            DdlPreparedPack.getInPackList(Arrays.asList(wmsStockQuan.getPartNo().split(",")), "partNo", result);
        }
        if (!wmsStockQuan.getIncludeZeroStock()) {
            //含0库存显示，默认为否
            //自定义条件，各汇总数量相加。为否时添加>0的条件判断
            result.setWhereAppend(result.getWhereAppend() + " and (qty + failQty + holdQty + qcQty + rinQty + freezeQty + consignQty + lockQty) > 0 ");
        }

        getStringBuilderPack(wmsStockQuan, result);

        return result;
    }

    /**
     * 业务：物料包装查询封装
     *
     * @param wmsPackage
     * @return
     */
    public static DdlPackBean packWmsPackAge(WmsPackage wmsPackage) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsPackage.getPackageNo(), "packageNo", result);
        DdlPreparedPack.getStringLikerPack(wmsPackage.getParentPackageNo(), "parentPackageNo", result);
//        DdlPreparedPack.getNumEqualPack(wmsPackage.getPackTypeId(), "packTypeId", result);

        getStringBuilderPack(wmsPackage, result);

        return result;
    }

    /**
     * 内部单据：库存移动单主表唯一性查询
     *
     * @param wmsMoveMaster
     * @return
     */
    public static DdlPackBean packWmsMoveMasterUnique(WmsMoveMaster wmsMoveMaster) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsMoveMaster.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveMaster.getTransTypeCode(), "transTypeCode", result);
        DdlPreparedPack.getNumNOEqualPack(wmsMoveMaster.getId(), "id", result);
        DdlPreparedPack.getNumEqualPack(wmsMoveMaster.getOrderStatus(), "orderStatus", result);

        getStringBuilderPack(wmsMoveMaster, result);

        return result;
    }

    /**
     * 内部单据：库存移动单主表分页查询
     *
     * @param wmsMoveMaster
     * @return
     */
    public static DdlPackBean packHqlWmsMoveMaster(WmsMoveMaster wmsMoveMaster) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsMoveMaster.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getNumEqualPack(wmsMoveMaster.getOrderStatus(), "orderStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveMaster.getTransTypeCode(), "transTypeCode", result);
        DdlPreparedPack.getNumEqualPack(wmsMoveMaster.getBusiTypeCode(), "busiTypeCode", result);
        DdlPreparedPack.getStringLikerPack(wmsMoveMaster.getModifyUser(), "modifyUser", result);
        DdlPreparedPack.timeBuilder(wmsMoveMaster.getModifyDateTimeStart(),
                wmsMoveMaster.getModifyDateTimeEnd(), "modifyDatetime", result, true);
        getStringBuilderPack(wmsMoveMaster, result);

        return result;
    }

    /**
     * 内部单据：库存移动单明细表分页查询
     *
     * @param wmsMoveDetails
     * @return
     */
    public static DdlPackBean packHqlWmsMoveDetails(WmsMoveDetails wmsMoveDetails) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getOrderNo(), "orderNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getPartNo(), "partNo", packBean);
        DdlPreparedPack.getStringLikerPack(wmsMoveDetails.getPartNameRdd(), "partNameRdd", packBean);
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getVendorNo(), "vendorNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getCustNo(), "custNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getUnit(), "unit", packBean);
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getSrcWhNo(), "srcWhNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getDestWhNo(), "destWhNo", packBean);
        //实时库存待处理数据
        if (wmsMoveDetails.getSrcOrDestZoneno() != null && wmsMoveDetails.getSrcOrDestZoneno().intValue() == WmsEnumUtil.TRUE_OR_FALSE.TRUE.getValue() && !StringUtil.isEmpty(wmsMoveDetails.getZoneNo())) {
            List<String> columnNames = new ArrayList<>();
            columnNames.add("srcZoneNo");
            columnNames.add("destZoneNo");
            DdlPreparedPack.getMultOrPackString(wmsMoveDetails.getZoneNo(), columnNames, null, packBean);
            DdlPreparedPack.getNumEqualPack(WmsEnumUtil.MOVE_ORDER_STATUS.BE_HANDLE.getValue(), "itemStatus", packBean);
        } else {
            DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getSrcZoneNo(), "srcZoneNo", packBean);
            DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getDestZoneNo(), "destZoneNo", packBean);
            DdlPreparedPack.getNumEqualPack(wmsMoveDetails.getItemStatus(), "itemStatus", packBean);
        }
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getSrcLocateNo(), "srcLocateNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsMoveDetails.getDestLocateNo(), "destLocateNo", packBean);
        DdlPreparedPack.getNumEqualPack(wmsMoveDetails.getRefType(), "refType", packBean);
        DdlPreparedPack.getStringLikerPack(wmsMoveDetails.getRefSrc(), "refSrc", packBean);

        getStringBuilderPack(wmsMoveDetails, packBean);

        return packBean;
    }

    /**
     * 内部单据：库存移动单条码信息分页查询
     *
     * @param wmsMoveSn
     * @return
     */
    public static DdlPackBean packHqlWmsMoveSn(WmsMoveSn wmsMoveSn) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getNumEqualPack(wmsMoveSn.getItem(), "item", result);
        DdlPreparedPack.getNumEqualPack(wmsMoveSn.getItemStatus(), "itemStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getSn(), "sn", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsMoveSn.getPartNameRdd(), "partNameRdd", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getRemark(), "remark", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getDestLocateNo(), "destLocateNo", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getSrcLocateNo(), "srcLocateNo", result);
        getStringBuilderPack(wmsMoveSn, result);

        return result;
    }

    /**
     * 针对质检查询库存移动条码条件封装(特殊处理)
     *
     * @param sn
     * @return
     */
    public static DdlPackBean packHqlWmsMoveSnForQC(List<String> orderList, String sn, String organizeCode) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(sn, "sn", result);
        DdlPreparedPack.getInPackList(orderList, "orderNo", result);
        DdlPreparedPack.getStringNotNullPack("remark", result);

        // 判断工厂代码是否为空
        if (StringUtils.isNotBlank(organizeCode)) {
            DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", result);
        }

        // 封装有效状态和删除状态
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);
        return result;
    }

    /**
     * 质检单信息 查询条件封装
     *
     * @param wmsQCMaster
     * @return
     */
    public static DdlPackBean packHqlWmsQCMaster(WmsQCMaster wmsQCMaster) {
        DdlPackBean result = new DdlPackBean();

        //单号
        DdlPreparedPack.getStringLikerPack(wmsQCMaster.getOrderNo(), "orderNo", result);
        //业务类型
        DdlPreparedPack.getNumEqualPack(wmsQCMaster.getOrderType(), "orderType", result);
        //关联单据类型
        DdlPreparedPack.getStringEqualPack(wmsQCMaster.getRefType(), "refType", result);
        //关联单据号
        DdlPreparedPack.getStringLikerPack(wmsQCMaster.getRefSrc(), "refSrc", result);
        //单据状态
        DdlPreparedPack.getNumEqualPack(wmsQCMaster.getOrderStatus(), "orderStatus", result);

        getStringBuilderPack(wmsQCMaster, result);

        return result;
    }

    /**
     * 散件质检单信息 查询条件封装
     *
     * @param wmsQCMaster
     * @return
     */
    public static DdlPackBean packHqlWmsQCMasterPart(WmsQCMaster wmsQCMaster) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getInPackArray(new Object[]{WmsEnumUtil.QC_INFO_STATUS.CREATE.getValue(),
                WmsEnumUtil.QC_INFO_STATUS.FINISH.getValue()}, "orderStatus", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), "isPart", result);
        //单号
        DdlPreparedPack.getStringEqualPack(wmsQCMaster.getOrderNo(), "orderNo", result);
        getStringBuilderPack(wmsQCMaster, result);

        return result;
    }

    /**
     * 库存条码开窗 查询条件封装
     *
     * @param wmsStockSn
     * @return
     */
    public static DdlPackBean packHqlWmsStockSnDialog(WmsStockSn wmsStockSn) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNotInPack(String.join(",", WmsEnumUtil.STOCK_SN_STATUS.CREATE.getValue() + "",
                WmsEnumUtil.STOCK_SN_STATUS.QUALITY_CONTROL.getValue() + ""), "snStatus", result);
        //单号
        DdlPreparedPack.getStringLeftLikerPack(wmsStockSn.getSn(), "sn", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getDateCode(), "dateCode", result);
        getStringBuilderPack(wmsStockSn, result);

        return result;
    }

    /**
     * 条码状态查询报表查询条件
     *
     * @param wmsStockSn
     * @return
     */
    public static DdlPackBean packHqlWmsStockSnReportByPager(WmsStockSn wmsStockSn) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsStockSn.getRefSrc(), "refSrc", result);

        // 物料编码支持多选
        DdlPreparedPack.getInPackList(wmsStockSn.getPartNoList(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getInPackList(wmsStockSn.getErpZoneNoList(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnStatus(), "snStatus", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getQcStatus(), "qcStatus", result);
        DdlPreparedPack.getStringLikerPack(wmsStockSn.getSn(), "sn", result);
        DdlPreparedPack.getStringRightLikerPack(wmsStockSn.getCustSn(), "custSn", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getDateCode(), "dateCode", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getLeftCode(), "leftCode", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getLotNo(), "lotNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getPackageNo(), "packageNo", result);
        if (wmsStockSn.getCheckQyt() != null && wmsStockSn.getCheckQyt().intValue() == WmsEnumUtil.TRUE_OR_FALSE.TRUE.getValue()) {
            DdlPreparedPack.getNumberBiggerPackContainsZero(0.0, "qty", result);
        }
        if (StringUtil.isEmpty(wmsStockSn.getQualityDateTimeStart())) {
            wmsStockSn.setQualityDateTimeStart("");
        }
        if (StringUtil.isEmpty(wmsStockSn.getQualityDateTimeEnd())) {
            wmsStockSn.setQualityDateTimeEnd("");
        }
        DdlPreparedPack.timeBuilder(wmsStockSn.getQualityDateTimeStart()+","+ wmsStockSn.getQualityDateTimeEnd(),
                "qualityDate", result, false,false);
        if (wmsStockSn.getIsValid() != null) {
            DdlPreparedPack.getNumEqualPack(wmsStockSn.getIsValid(), "isValid", result);
        }
        getStringBuilderPack(wmsStockSn, result);

        return result;
    }

    public static DdlPackBean packHqlcheckSNInLocate(WmsStockQuan wmsStockQuan) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getLocateNo(), "locateNo", result);

        result.setWhereAppend(result.getWhereAppend() + " and qty  > 0 ");
        getStringBuilderPack(wmsStockQuan, result);

        return result;
    }

    /**
     * 质检单明细信息 查询条件封装
     *
     * @param wmsQCDetails
     * @return
     */
    public static DdlPackBean packHqlWmsQCDetails(WmsQCDetails wmsQCDetails) {
        DdlPackBean result = new DdlPackBean();

        //单号
        DdlPreparedPack.getStringEqualPack(wmsQCDetails.getOrderNo(), "orderNo", result);

        getStringBuilderPack(wmsQCDetails, result);

        return result;
    }

    /**
     * 质检单操作明细信息 查询条件封装
     *
     * @param wmsQCTrans
     * @return
     */
    public static DdlPackBean packHqlWmsQCTrans(WmsQCTrans wmsQCTrans) {
        DdlPackBean result = new DdlPackBean();
        //单号
        DdlPreparedPack.getStringEqualPack(wmsQCTrans.getOrderNo(), "orderNo", result);
        //物料
        DdlPreparedPack.getStringEqualPack(wmsQCTrans.getPartNo(), "partNo", result);

        getStringBuilderPack(wmsQCTrans, result);

        return result;
    }

    /**
     * 盘点单主表信息 分页查询
     *
     * @param wmsCSOrderMaster
     * @return
     */
    public static DdlPackBean packHqlWmsCSOrderMasters(WmsCSOrderMaster wmsCSOrderMaster) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsCSOrderMaster.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getNumEqualPack(wmsCSOrderMaster.getOrderType(), "orderType", result);
        DdlPreparedPack.getNumEqualPack(wmsCSOrderMaster.getOrderStatus(), "orderStatus", result);
        DdlPreparedPack.getNumEqualPack(wmsCSOrderMaster.getIsPart(), "isPart", result);
        DdlPreparedPack.timeBuilder(wmsCSOrderMaster.getCreateDateTimeStart(),
                wmsCSOrderMaster.getCreateDateTimeEnd(), "createDatetime", result, true);
        getStringBuilderPack(wmsCSOrderMaster, result);

        return result;
    }

    /**
     * 盘点单冻结表信息 分页查询
     *
     * @param wmsCSOrderDetails
     * @return
     */
    public static DdlPackBean packHqlWmsCSOrderDetails(WmsCSOrderDetails wmsCSOrderDetails) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsCSOrderDetails.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSOrderDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSOrderDetails.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getNumEqualPack(wmsCSOrderDetails.getTransStatus(), "transStatus", result);
        DdlPreparedPack.getInPackArray(wmsCSOrderDetails.getZoneNos(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSOrderDetails.getSn(), "sn", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);

        getStringBuilderPack(wmsCSOrderDetails, result);

        return result;
    }

    /**
     * 盘点实盘表信息 分页查询
     *
     * @param wmsCSFactTrans
     * @return
     */
    public static DdlPackBean packHqlWmsCSFactTrans(WmsCSFactTrans wmsCSFactTrans) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsCSFactTrans.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSFactTrans.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSFactTrans.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getInPackArray(wmsCSFactTrans.getZoneNos(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSFactTrans.getSn(), "sn", result);

        getStringBuilderPack(wmsCSFactTrans, result);

        return result;
    }

    /**
     * 作业步骤 查询
     *
     * @param wmsActionStepCall
     * @return
     */
    public static DdlPackBean packHqlWmsActionStepCall(WmsActionStepCall wmsActionStepCall) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(wmsActionStepCall.getAsId(), "asId", result);
        DdlPreparedPack.getNumEqualPack(wmsActionStepCall.getAmId(), "amId", result);
        DdlPreparedPack.getNumEqualPack(wmsActionStepCall.getAmType(), "amType", result);

        getStringBuilderPack(wmsActionStepCall, result);

        DdlPreparedPack.getOrderByPack(new Object[]{1}, new String[]{"seq"}, result);

        return result;
    }

    /**
     * 作业步骤类型表信息查询
     *
     * @param wmsActionStepType
     * @return
     */
    public static DdlPackBean packHqlWmsActionStepType(WmsActionStepType wmsActionStepType) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsActionStepType.getAtNameC(), "atNameC", result);
        DdlPreparedPack.getStringLikerPack(wmsActionStepType.getFunCallName(), "funCallName", result);
        DdlPreparedPack.getNumEqualPack(wmsActionStepType.getIsValid(), "isValid", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);

        return result;
    }

    /**
     * 作业步骤信息查询
     *
     * @param wmsActionStep
     * @return
     */
    public static DdlPackBean packHqlWmsActionStep(WmsActionStep wmsActionStep) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsActionStep.getAsNameC(), "asNameC", result);

        getStringBuilderPack(wmsActionStep, result);

        return result;
    }

    /**
     * 作业步骤处理组件查询条件封装
     *
     * @param wmsActionModuleParam
     * @return
     */
    public static DdlPackBean packHqlWmsActionModuleParam(WmsActionModuleParam wmsActionModuleParam) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(wmsActionModuleParam.getAmId(), "amId", result);
        DdlPreparedPack.getNumNOEqualPack(wmsActionModuleParam.getParamType(), "paramType", result);
        getStringBuilderPack(wmsActionModuleParam, result);
        return result;
    }

    /**
     * 作业步骤处理组件参数查询条件封装
     *
     * @param wmsActionModule
     * @return
     */
    public static DdlPackBean packHqlWmsActionModule(WmsActionModule wmsActionModule) {
        DdlPackBean result = new DdlPackBean();

        // 查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsActionModule.getAmName(), "amDesc", result);
        DdlPreparedPack.getNumEqualPack(wmsActionModule.getId(), "id", result);
        DdlPreparedPack.getNumEqualPack(wmsActionModule.getAmType(), "amType", result);
        DdlPreparedPack.getStringEqualPack(wmsActionModule.getOpTypeCode(), "opTypeCode", result);
        DdlPreparedPack.getNumEqualPack(wmsActionModule.getIsShowInfo(), "isShowInfo", result);
        DdlPreparedPack.getNumEqualPack(wmsActionModule.getIsValid(), "isValid", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);
        DdlPreparedPack.getNumEqualPack(wmsActionModule.getIsScriptModule(), "isScriptModule", result);

        return result;
    }

    /**
     * 作业流程分页查询
     *
     * @return
     */
    public static DdlPackBean packHqlWmsActionGroup(WmsActionGroup wmsActionGroup) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装 agDescC;agNameC
        DdlPreparedPack.getStringLikerPack(wmsActionGroup.getAgNameC(), "agNameC", result);
        DdlPreparedPack.getStringLikerPack(wmsActionGroup.getAgDescC(), "agDescC", result);
        getStringBuilderPack(wmsActionGroup, result);

        DdlPreparedPack.getOrderByPack(new Object[]{1}, new String[]{"createDatetime"}, result);

        return result;
    }

    /**
     * 作业流程明细分页查询
     *
     * @return
     */
    public static DdlPackBean packHqlWmsActionGroupDetails(WmsActionGroupDetails wmsActionGroupDetails) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(wmsActionGroupDetails.getAgId(), "agId", result);

        getStringBuilderPack(wmsActionGroupDetails, result);

        DdlPreparedPack.getOrderByPack(new Object[]{1}, new String[]{"seq"}, result);

        return result;
    }


    /**
     * 作业步骤调用参数信息 查询条件封装
     *
     * @param wmsActionStepCallParam
     * @return
     */
    public static DdlPackBean packHqlWmsActionStepCallParam(WmsActionStepCallParam wmsActionStepCallParam) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getNumEqualPack(wmsActionStepCallParam.getAgdId(), "agdId", result);
        DdlPreparedPack.getNumEqualPack(wmsActionStepCallParam.getAmId(), "amId", result);
        DdlPreparedPack.getNumEqualPack(wmsActionStepCallParam.getSeq(), "seq", result);
        getStringBuilderPack(wmsActionStepCallParam, result);

        return result;
    }

    /**
     * PO订单条码表 分页查询
     *
     * @param wmsPoSn
     * @return
     */
    public static DdlPackBean packHqlWmsPoSn(WmsPoSn wmsPoSn) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsPoSn.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsPoSn.getSn(), "snOneBarCode", result);
        DdlPreparedPack.getStringEqualPack(wmsPoSn.getPartNo(), "partNo", result);
        DdlPreparedPack.getNumEqualPack(wmsPoSn.getQcStatus(), "qcStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsPoSn.getItem(), "item", result);
        DdlPreparedPack.getStringLikerPack(wmsPoSn.getErpAreaNoAdd(), "erpAreaNoAdd", result);
        DdlPreparedPack.getStringEqualPack(wmsPoSn.getPartNameRdd(), "partNameRdd", result);

        getStringBuilderPack(wmsPoSn, result);

        return result;
    }

    /**
     * 根据条件查询库存条码信息
     *
     * @param wmsStockSn
     * @return
     */
    public static DdlPackBean packHqlWmsStockSn(WmsStockSn wmsStockSn) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(wmsStockSn.getSn(), "sn", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnStatus(), "snStatus", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getQcStatus(), "qcStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getRefSrc(), "refSrc", result);
        DdlPreparedPack.getNumNOEqualPack(wmsStockSn.getPrinted(), "printed", result);

        DdlPreparedPack.getInPackList(wmsStockSn.getErpZoneNoList(), "zoneNo", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnType(), "snType", result);
        DdlPreparedPack.getNumberBiggerPack(wmsStockSn.getQty(), "qty", result);
        result.setOrderByStr(wmsStockSn.orderBy());

        getStringBuilderPack(wmsStockSn, result);
        return result;
    }

	public static DdlPackBean packNewWmsStockSn(WmsStockSn wmsStockSn) {
		DdlPackBean result = new DdlPackBean();
		DdlPreparedPack.getStringLikerPack(wmsStockSn.getSn(), "sn", result);
		DdlPreparedPack.getStringEqualPack(wmsStockSn.getVendorNo(), "vendorNo", result);
		DdlPreparedPack.getStringEqualPack(wmsStockSn.getWhNo(), "whNo", result);
		DdlPreparedPack.getStringEqualPack(wmsStockSn.getZoneNo(), "zoneNo", result);
		DdlPreparedPack.getStringEqualPack(wmsStockSn.getPartNo(), "partNo", result);
		DdlPreparedPack.getStringEqualPack(wmsStockSn.getLocateNo(), "locateNo", result);
		DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnStatus(), "snStatus", result);
		DdlPreparedPack.getNumEqualPack(wmsStockSn.getQcStatus(), "qcStatus", result);
		DdlPreparedPack.getStringEqualPack(wmsStockSn.getRefSrc(), "refSrc", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getPackageNo(), "packageNo", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getPrinted(), "printed", result);

		DdlPreparedPack.getInPackList(wmsStockSn.getErpZoneNoList(), "zoneNo", result);
		DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnType(), "snType", result);
		DdlPreparedPack.getNumberBiggerPack(wmsStockSn.getQty(), "qty", result);
		result.setOrderByStr(wmsStockSn.orderBy());

		getStringBuilderPack(wmsStockSn, result);
		return result;
	}
    /**
     * 根据条件查询条码条码信息
     *
     * @param wmsSnPrintRcd
     * @return
     */
    public static DdlPackBean packHqlWmsSnPrintRcd(WmsSnPrintRcd wmsSnPrintRcd) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(wmsSnPrintRcd.getSn(), "sn", result);
        DdlPreparedPack.getStringEqualPack(wmsSnPrintRcd.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsSnPrintRcd.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsSnPrintRcd.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsSnPrintRcd.getLocateNo(), "locateNo", result);
        getStringBuilderPack(wmsSnPrintRcd, result);
        return result;
    }

    /**
     * 根据条件模糊查询库存条码信息
     *
     * @param wmsStockSn
     * @return
     */
    public static DdlPackBean packHqlWmsStockSnLike(WmsStockSn wmsStockSn) {
        DdlPackBean result = new DdlPackBean();
        //DdlPreparedPack.getStringNoEqualPack(wmsStockSn.getSn(), "sn", result);
        DdlPreparedPack.getStringRightLikerPack(wmsStockSn.getSn(), "sn", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getOrganizeCode(), "organizeCode", result);
        /*DdlPreparedPack.getOrderByPack(
                new Object[]{CommonEnumUtil.FALSE, CommonEnumUtil.FALSE},
                new String[]{"sn", "createDatetime"}, result);*/
//        result.setWhereAppend(result.getWhereAppend() + " and sn <> '"+wmsStockSn.getSn()+"'");

        return result;
    }

    /**
     * 根据条件查询库存信息
     *
     * @param wmsStockQuan
     * @return
     */
    public static DdlPackBean packHqlWmsStockQuan(WmsStockQuan wmsStockQuan) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getLocateNo(), "locateNo", result);
        getStringBuilderPack(wmsStockQuan, result);
        return result;
    }

    /**
     * 根据用户角色id列表查询数据权限信息
     *
     * @return
     */
    public static DdlPackBean packHqlWmsDataAuth(WmsDataAuth dataAuth, List<String> roleIds) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getNumEqualPack(dataAuth.getDataObj(), "dataObj", result);
        DdlPreparedPack.getInPackList(roleIds, "roleCode", result);
        getStringBuilderPack(dataAuth, result);
        return result;
    }

    /**
     * 根据权限数据拼查询任务详情sql
     *
     * @param groupDataAuth
     * @return
     */
    /*public static DdlPackBean packHqlWmsTaskDetail(Map<String, List<WmsDataAuth>> groupDataAuth, String refSrc, String organizeCode) {
        DdlPackBean result = new DdlPackBean();
        Set<Map.Entry<String, List<WmsDataAuth>>> entries = groupDataAuth.entrySet();
        //拼sql
        entries.stream().filter(o -> !Strings.isNullOrEmpty(o.getKey()));

        *//*for (Map.Entry<String, List<WmsDataAuth>> map : entries) {

            String key = map.getKey();
            List<WmsDataAuth> valueList = map.getValue();
            List<String> vList = valueList.stream().map(x -> x.getDataObjValue()).collect(Collectors.toList());
            String data = String.join(",", vList);

            if (StringUtils.isNotBlank(data)) {
                List<Map> mapList = JSONObject.parseArray(data, Map.class);
                if (StringUtils.equalsIgnoreCase(WmsEnumUtil.DATA_OBJ_TYPE.WAREHOUSE.getValue() + "", key)) {
                    DdlPreparedPack.getInPackList(cyclicTraversal(mapList,"WH_CODE"), "destWhNo", result);
                    packMutilConditionHql(mapList, "WH_CODE", "destWhNo", result);
                } else if (StringUtils.equalsIgnoreCase(WmsEnumUtil.DATA_OBJ_TYPE.LOCATE.getValue() + "", key)) {
                    DdlPreparedPack.getInPackList(cyclicTraversal(mapList,"LOCATE_NO"), "destLocateNo", result);
                    packMutilConditionHql(mapList, "LOCATE_NO", "destLocateNo", result);
                } else if (StringUtils.equalsIgnoreCase(WmsEnumUtil.DATA_OBJ_TYPE.ZONE.getValue() + "", key)) {
                    DdlPreparedPack.getInPackList(cyclicTraversal(mapList,"ZONE_CODE"), "destZoneNo", result);
                    packMutilConditionHql(mapList, "ZONE_CODE", "destZoneNo", result);
                } else if (StringUtils.equalsIgnoreCase(WmsEnumUtil.DATA_OBJ_TYPE.MATERIAL.getValue() + "", key)) {
                    DdlPreparedPack.getInPackList(cyclicTraversal(mapList,"PART_NO"), "partNo", result);
                    packMutilConditionHql(mapList, "PART_NO", "partNo", result);
                }
            }
        }*//*

        //转换封装后的hql
        *//*String packedHql = result.getPackedHql();
        if(packedHql.startsWith(" or")){
            packedHql = " and (" + packedHql.substring(3,packedHql.length()) + ") ";
            System.out.println(packedHql);
        }

        result.setWhereAppend(packedHql);*//*
        // 通用数据拼接
        WmsDataAuth wmsDataAuth = new WmsDataAuth();
        wmsDataAuth.setOrganizeCode(organizeCode);
        getStringBuilderPack(wmsDataAuth, result);
        return result;
    }*/



    /**
     * 把 List<Map> 中的一组数据重新封装到List<String>中
     *
     * @param mapList
     * @param keyName
     */
    private static List<String> cyclicTraversal(List<Map> mapList, String keyName) {
        List<String> list = new ArrayList<String>();
        for (int i = 0; i < mapList.size(); i++) {
            Map<String, String> map = mapList.get(i);
            list.add(map.get(keyName));
        }
        return list;
    }

    /**
     * 把 List<Map> 中的一组查询条件封装成 HQL
     *
     * @param mapList
     * @param keyName
     * @param columnName
     * @param packBean
     */
    private static void packMutilConditionHql(List<Map> mapList, String keyName, String columnName, DdlPackBean packBean) {
        int index = 1;
        String columnParam = null;
        for (Map item : mapList) {
            columnParam = columnName + String.valueOf(index);
            packBean.addColumnQuery(columnParam,
                    " or model." + columnName + " = :m_" + columnParam,
                    item.get(keyName).toString());

            index++;
        }
    }

    /**
     * 给定字段动态in sql
     *
     * @param columnName
     * @param orderList
     * @return
     */
    /*public static DdlPackBean packHqlAndIn(WmsTaskInfo bean, String columnName, List<String> orderList, Map<String, List<WmsDataAuth>> groupDataAuth) {
        DdlPackBean packBean = new DdlPackBean();
        Set<Map.Entry<String, List<WmsDataAuth>>> entries = groupDataAuth.entrySet();
        //拼sql
        entries.stream().filter(o -> !Strings.isNullOrEmpty(o.getKey()));
        for (Map.Entry<String, List<WmsDataAuth>> map : entries) {
            String key = map.getKey();
            List<WmsDataAuth> valueList = map.getValue();
            List<String> vList = valueList.stream().map(x -> x.getDataObjValue()).collect(Collectors.toList());
            String data = String.join(",", vList);
            if (StringUtils.isNotBlank(data)) {
                List<Map> mapList = JSONObject.parseArray(data, Map.class);
                if (StringUtils.equalsIgnoreCase(WmsEnumUtil.DATA_OBJ_TYPE.TRANS_TYPE.getValue() + "", key)) {
                    DdlPreparedPack.getInPackList(cyclicTraversal(mapList, "TRANS_TYPE_CODE"), "transTypeCode", packBean);
                    //packMutilConditionHql(mapList, "TRANS_TYPE_CODE", "transTypeCode", packBean);
                    break;
                }
            }
        }
        //转换封装后的hql
        *//*String packedHql = packBean.getPackedHql();
        if(packedHql.startsWith(" or")){
            packedHql = " and (" + packedHql.substring(3,packedHql.length()) + ") ";
            System.out.println(packedHql);
        }

        packBean.setWhereAppend(packedHql);*//*
        DdlPreparedPack.getInPackList(orderList, columnName, packBean);
        DdlPreparedPack.getStringRightLikerPack(bean.getOrderNo(), "orderNo", packBean);
        DdlPreparedPack.getNumNOEqualPack(bean.getTaskStatus(), "taskStatus", packBean);

        getStringBuilderPack(bean, packBean);

        DdlPreparedPack.getOrderByPack(new Object[]{2}, new String[]{"createDatetime"}, packBean);
        return packBean;
    }*/

    /**
     * 根据条件查询dataAuth
     *
     * @param wmsDataAuth
     * @return
     */
    public static DdlPackBean packHqlWmsDataAuthFind(WmsDataAuth wmsDataAuth) {
        DdlPackBean result = new DdlPackBean();
        if (!Strings.isNullOrEmpty(wmsDataAuth.getRoleCode())) {
            DdlPreparedPack.getStringEqualPack(wmsDataAuth.getRoleCode(), "roleCode", result);
        }
        if (wmsDataAuth.getDataObj() != null && wmsDataAuth.getDataObj().intValue() != 0) {
            DdlPreparedPack.getNumEqualPack(wmsDataAuth.getDataObj(), "dataObj", result);
        }
        if (!Strings.isNullOrEmpty(wmsDataAuth.getDataObjValue())) {
            DdlPreparedPack.getStringRightLikerPack(wmsDataAuth.getDataObjValue(), "dataObjValue", result);
        }
        getStringBuilderPack(wmsDataAuth, result);
        return result;
    }

    /**
     * 根据条件查询任务明细信息
     *
     * @param taskDetails
     * @return
     */
    public static DdlPackBean packHqlWmsTaskDetails(WmsTaskDetails taskDetails) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(taskDetails.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getInPackList(taskDetails.getOrganizeCodeList(), "organizeCode", result);
        getStringBuilderPack(taskDetails, result);
        return result;
    }

    /**
     * 根据条件查询任务生成日志
     *
     * @param wmsTaskCreateLog
     * @return
     */
    public static DdlPackBean packHqlWmsTaskCreateLog(WmsTaskCreateLog wmsTaskCreateLog) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(wmsTaskCreateLog.getTaskNo(), "taskNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTaskCreateLog.getOpTypeCode(), "opTypeCode", result);
        getStringBuilderPack(wmsTaskCreateLog, result);
        return result;
    }

    /**
     * 根据条件查询作业处理组件
     *
     * @param wmsTransModule
     * @return
     */
    public static DdlPackBean packHqlWmsTransModule(WmsTransModule wmsTransModule) {
        DdlPackBean packBean = new DdlPackBean();
        if (!Strings.isNullOrEmpty(wmsTransModule.getTmName())) {
            DdlPreparedPack.getStringLikerPack(wmsTransModule.getTmName(), "tmName", packBean);
        }
        if (!Strings.isNullOrEmpty(wmsTransModule.getCallClass())) {
            DdlPreparedPack.getStringLikerPack(wmsTransModule.getCallClass(), "callClass", packBean);
        }
        if (!Strings.isNullOrEmpty(wmsTransModule.getTmDesc())) {
            DdlPreparedPack.getStringLikerPack(wmsTransModule.getTmDesc(), "tmDesc", packBean);
        }
        if (wmsTransModule.getId() != null) {
            DdlPreparedPack.getNumEqualPack(wmsTransModule.getId(), "id", packBean);
        }
        if (StringUtils.isNotBlank(wmsTransModule.orderBy())) {
            packBean.setOrderByStr(wmsTransModule.orderBy());
        }
        getStringBuilderPack(wmsTransModule, packBean);
        return packBean;
    }

    /**
     * 根据条件查询系统配置信息
     *
     * @param wmsConfig
     * @return
     */
    public static DdlPackBean packHqlWmsConfig(WmsConfig wmsConfig) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsConfig.getConfigCode(), "configCode", result);
        DdlPreparedPack.getStringLikerPack(wmsConfig.getName(), "name", result);
        DdlPreparedPack.getNumEqualPack(wmsConfig.getConfigType(), "configType", result);
        DdlPreparedPack.getStringEqualPack(wmsConfig.getConfigValue(), "configValue", result);
        DdlPreparedPack.getNumEqualPack(wmsConfig.getConfigValueType(), "configValueType", result);

        getStringBuilderPack(wmsConfig, result);
        return result;
    }

    /**
     * 移库单订单条码表 分页查询
     *
     * @param wmsDocMovementSn
     * @return
     */
    public static DdlPackBean packHqlWmsDocMovementSn(WmsDocMovementSn wmsDocMovementSn) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(wmsDocMovementSn.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsDocMovementSn.getPartNo(), "partNo", result);
        if (!StringUtil.isEmpty(wmsDocMovementSn.getItem())) {
            DdlPreparedPack.getStringEqualPack(wmsDocMovementSn.getItem(), "item", result);
        }
        DdlPreparedPack.getNumEqualPack(wmsDocMovementSn.getSnType(), "snType", result);

        getStringBuilderPack(wmsDocMovementSn, result);

        return result;
    }


    /**
     * 移库单订单条码表 分页查询
     *
     * @param details
     * @return
     */
    public static DdlPackBean packHqlWmsDocMovementDetails(WmsDocMovementDetails details) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(details.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(details.getPartNo(), "partNo", result);

        getStringBuilderPack(details, result);

        return result;
    }

    /**
     * 查询脚本持久化 查询条件封装
     *
     * @return
     */
    public static DdlPackBean packEngineScriptPersistence(EngineScriptPersistence scriptPersistence) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(scriptPersistence.getScriptNo(), "scriptNo", packBean);
        DdlPreparedPack.getStringRightLikerPack(scriptPersistence.getScriptName(), "scriptName", packBean);
        DdlPreparedPack.getNumEqualPack(scriptPersistence.getScriptType(), "scriptType", packBean);
        DdlPreparedPack.getNumEqualPack(scriptPersistence.getLanguageType(), "languageType", packBean);

        getStringBuilderPack(scriptPersistence, packBean);

        DdlPreparedPack.getOrderByPack(new Object[]{2}, new String[]{"createDatetime"}, packBean);
        return packBean;
    }

    /**
     * 查询规则持久化 查询条件封装
     *
     * @return
     */
    public static DdlPackBean packEngineRulePersistence(EngineRulePersistence rulePersistence) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(rulePersistence.getRuleNo(), "ruleNo", packBean);
        DdlPreparedPack.getStringRightLikerPack(rulePersistence.getRuleName(), "ruleName", packBean);
        DdlPreparedPack.getNumEqualPack(rulePersistence.getRuleContent(), "ruleContent", packBean);

        getStringBuilderPack(rulePersistence, packBean);

        DdlPreparedPack.getOrderByPack(new Object[]{2}, new String[]{"createDatetime"}, packBean);
        return packBean;
    }


    /**
     * 盘点主表 分页查询(散件)
     *
     * @param wmsCSOrderMaster
     * @return
     */
    public static DdlPackBean packHqlWmsCSOrderMasterPart(WmsCSOrderMaster wmsCSOrderMaster) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getInPackArray(new Object[]{WmsEnumUtil.CS_ORDER_STATUS.STARTING_INVENTORY.getValue(),
                WmsEnumUtil.CS_ORDER_STATUS.IN_INVENTORY.getValue()}, "orderStatus", result);
        DdlPreparedPack.getNumEqualPack(wmsCSOrderMaster.getIsPart(), "isPart", result);
        DdlPreparedPack.getStringEqualPack(wmsCSOrderMaster.getOrderNo(), "orderNo", result);

        getStringBuilderPack(wmsCSOrderMaster, result);

        return result;
    }

    /**
     * 业务类型信息 分页查询
     *
     * @param wmsBusiType
     * @return
     */
    public static DdlPackBean packHqlWmsBusiType(WmsBusiType wmsBusiType) {
        //查询参数封装
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(wmsBusiType.getBusiTypeCode(), "busiTypeCode", result);
        DdlPreparedPack.getStringEqualPack(wmsBusiType.getBusiTypeName(), "busiTypeName", result);
        DdlPreparedPack.getNumEqualPack(wmsBusiType.getMoveType(), "moveType", result);

        getStringBuilderPack(wmsBusiType, result);

        return result;
    }

    /**
     * 组件 历史记录查询
     *
     * @param wmsMoveSn
     * @return
     */
    public static DdlPackBean packHqlWmsHistorical(WmsMoveSn wmsMoveSn) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsMoveSn.getOrganizeCode(), "organizeCode", result);
        DdlPreparedPack.getNumEqualPack(wmsMoveSn.getIsValid(), "isValid", result);
        DdlPreparedPack.getNumEqualPack(wmsMoveSn.getIsDeleted(), "isDeleted", result);

        return result;
    }

    /**
     * 库存条码 查询条件封装
     *
     * @param wmsStockSn
     * @return
     */
    public static DdlPackBean packHqlWmsStockSnReport(WmsStockSn wmsStockSn) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsStockSn.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getPartNo(), "partNo", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnStatus(), "snStatus", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getQcStatus(), "qcStatus", result);
        DdlPreparedPack.getStringLikerPack(wmsStockSn.getPackageNo(), "packageNo", result);
        DdlPreparedPack.getNumEqualPack(wmsStockSn.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringNotNullPack("locateNo", result);
        result.setWhereAppend(result.getWhereAppend() + " and locateNo != ''");

        getStringBuilderPack(wmsStockSn, result);

        return result;
    }

    public static DdlPackBean packWmsStoreQuanForLocateReport(WmsStockQuan wmsStockQuan) {

        DdlPackBean result = new DdlPackBean();
        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockQuan.getZoneNo(), "zoneNo", result);
        result.setWhereAppend(result.getWhereAppend() + " and (qty + failQty + holdQty + qcQty + rinQty + freezeQty + consignQty + lockQty) > 0 ");
        getStringBuilderPack(wmsStockQuan, result);

        return result;
    }


    /**
     * 线边库物料信息 分页查询
     *
     * @param wmsLineLocatePart
     * @return
     */
    public static DdlPackBean packHqlWmsLineLocatePart(WmsLineLocatePart wmsLineLocatePart) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsLineLocatePart.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringLikerPack(wmsLineLocatePart.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsLineLocatePart.getPartNameRdd(), "partNameRdd", result);
        getStringBuilderPack(wmsLineLocatePart, result);
        return result;
    }

    /**
     * 任务数据来源唯一校验
     *
     * @param wmsTaskSrc
     * @return
     */
    public static DdlPackBean packHqlWmsTaskSrcIsUniq(WmsTaskSrc wmsTaskSrc) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsTaskSrc.getOrganizeCode(), "organizeCode", result);
        DdlPreparedPack.getStringEqualPack(wmsTaskSrc.getOpTypeCode(), "opTypeCode", result);
        DdlPreparedPack.getStringEqualPack(wmsTaskSrc.getDataSrc(), "dataSrc", result);
        DdlPreparedPack.getNumEqualPack(wmsTaskSrc.getBusiType(), "busiType", result);
        DdlPreparedPack.getNumEqualPack(wmsTaskSrc.getPriority(), "priority", result);
        DdlPreparedPack.getNumEqualPack(wmsTaskSrc.getIsSn(), "isSn", result);
        DdlPreparedPack.getNumEqualPack(wmsTaskSrc.getIsOneStep(), "isOneStep", result);
        getStringBuilderPack(wmsTaskSrc, result);
        return result;
    }

    /**
     * 任务数据来源 分页查询
     *
     * @param wmsTaskSrc
     * @return
     */
    public static DdlPackBean packHqlWmsTaskSrc(WmsTaskSrc wmsTaskSrc) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsTaskSrc.getOpTypeCode(), "opTypeCode", result);
        getStringBuilderPack(wmsTaskSrc, result);
        return result;
    }

    /**
     * 供应商零件 分页查询
     *
     * @param wmsVendorPart
     * @return
     */
    public static DdlPackBean packHqlWmsVendorPart(WmsVendorPart wmsVendorPart) {
        DdlPackBean result = new DdlPackBean();
        //查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsVendorPart.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringLikerPack(wmsVendorPart.getPartNo(), "partNo", result);
        getStringBuilderPack(wmsVendorPart, result);
        return result;
    }

    /**
     * 主数据信息 分页查询
     *
     * @param wmsProdCfgType
     * @return
     */
    public static DdlPackBean packHqlWmsProdCfgType(WmsProdCfgType wmsProdCfgType) {
        DdlPackBean result = new DdlPackBean();
        //查询参数封装
        if (wmsProdCfgType != null) {
            DdlPreparedPack.getStringLikerPack(wmsProdCfgType.getProdCfgTypeName(), "prodCfgTypeName", result);
            DdlPreparedPack.getStringLikerPack(wmsProdCfgType.getProdCfgTypeCode(), "prodCfgTypeCode", result);
            DdlPreparedPack.getNumEqualPack(wmsProdCfgType.getIsValid(), "isValid", result);
        }
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);
//        getStringBuilderPack(wmsProdCfgType, result);
        return result;
    }

    /**
     * 盘点范围 条件封装
     *
     * @param wmsCSRange
     * @return
     */
    public static DdlPackBean packHqlWmsCSRange(WmsCSRange wmsCSRange) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsCSRange.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSRange.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsCSRange.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getInPackArray(wmsCSRange.getZoneNos(), "zoneNo", result);

        DdlPreparedPack.getOrderByPack(new Object[]{1}, new String[]{
                DdlPreparedPack.getOrderColConvertType("item", CommonEnumUtil.BASIS_TYPE.INT.getValue())}, result);
        getStringBuilderPack(wmsCSRange, result);

        return result;
    }

    /**
     * 物料 条件封装
     *
     * @param wmsPart
     * @return
     */
    public static DdlPackBean packHqlWmsPartByList(WmsPart wmsPart, String[] parts) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getInPackArray(parts, "partNo", packBean);
        DdlPreparedPack.getStringEqualPack(wmsPart.getOrganizeCode(), "organizeCode", packBean);
        getStringBuilderPack(wmsPart, packBean);

        return packBean;
    }

    /**
     * 物料扩展属性
     *
     * @param partExtend
     * @return
     */
    public static DdlPackBean packHqlWmsPartExtendByPart(WmsPartExtend partExtend) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(partExtend.getPartNo(), "partNo", packBean);
        getStringBuilderPack(partExtend, packBean);

        return packBean;
    }

    /**
     * 替代料 条件封装
     *
     * @param subPart
     * @return
     */
    public static DdlPackBean packHqlWmsSubPartByPart(WmsSubPart subPart) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(subPart.getPartNo(), "partNo", packBean);
        getStringBuilderPack(subPart, packBean);

        return packBean;
    }

    public static DdlPackBean packHqlWmsScriptHistory(EngineScriptPersistenceHistory history) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(history.getScriptNo(), "scriptNo", packBean);
        getStringBuilderPack(history, packBean);

        return packBean;
    }

    /**
     * 供应商窗口时间 条件封装
     *
     * @param vendorWindow
     * @return
     */
    public static DdlPackBean packHqlWmsVendorWindow(WmsVendorWindow vendorWindow) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(vendorWindow.getVendorNo(), "vendorNo", packBean);
        getStringBuilderPack(vendorWindow, packBean);

        return packBean;
    }

    /**
     * 供应商窗口时间 条件封装
     *
     * @param custWindow
     * @return
     */
    public static DdlPackBean packHqlWmsCustWindow(WmsCustWindow custWindow) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(custWindow.getCustNo(), "custNo", packBean);
        getStringBuilderPack(custWindow, packBean);

        return packBean;
    }

    /**
     * 客户物料发往地 条件封装
     *
     * @param shipping
     * @return
     */
    public static DdlPackBean packHqlWmsCustomerPartShipping(WmsCustomerPartShipping shipping) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(shipping.getCustomerCode(), "customerCode", packBean);
        getStringBuilderPack(shipping, packBean);

        return packBean;
    }

    /**
     * 供应商父子关系 条件封装
     *
     * @param vendorPlanner
     * @return
     */
    public static DdlPackBean packHqlWmsVendorPlanner(WmsVendorPlanner vendorPlanner) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(vendorPlanner.getVendorNo(), "vendorNo", packBean);
        getStringBuilderPack(vendorPlanner, packBean);

        return packBean;
    }

    /**
     * 供应商父子关系 条件封装
     *
     * @param vendorRelation
     * @return
     */
    public static DdlPackBean packHqlWmsVendorRelation(WmsVendorRelation vendorRelation) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(vendorRelation.getVendorNo(), "vendorNo", packBean);
        getStringBuilderPack(vendorRelation, packBean);

        return packBean;
    }

    /**
     * 单位定义
     *
     * @param wmsUnit
     * @return
     */
    public static DdlPackBean packHqlWmsUnit(WmsUnit wmsUnit) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsUnit.getOrganizeCode(), "organizeCode", result);
        DdlPreparedPack.getStringLikerPack(wmsUnit.getUnitCode(), "unitCode", result);
        DdlPreparedPack.getStringLikerPack(wmsUnit.getUnitName(), "unitName", result);
        DdlPreparedPack.getNumEqualPack(wmsUnit.getUnitPrecision(), "unitPrecision", result);
        getStringBuilderPack(wmsUnit, result);

        return result;
    }

    //库层交易报表packHqlWmsTransQuan


    public static DdlPackBean packHqlWmsTransQuan(WmsTransQuan wmsTransQuan) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getTransNo(), "transNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getZoneNo(), "zoneNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getPartNameRdd(), "partNameRdd", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getUnit(), "unit", result);
        DdlPreparedPack.getNumEqualPack(wmsTransQuan.getTransStatus(), "transStatus", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getRefSrc(), "refSrc", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getRefType(), "refType", result);
        DdlPreparedPack.getNumEqualPack(wmsTransQuan.getBusiType(), "busiType", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getTransCode(), "transCode", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getMoveNo(), "moveNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getVendorNo(), "vendorNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getCustNo(), "custNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getErrorMessage(), "errorMessage", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getQty().toString(), "qty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getFailQty().toString(), "failQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getHoldQty().toString(), "holdQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getQcQty().toString(), "qcQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getRinQty().toString(), "rinQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getFreezeQty().toString(), "freezeQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getConsignQty().toString(), "consignQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getLockQty().toString(), "lockQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getTransNo(), "scrapQty", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getScrapQty().toString(), "transTypeName", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getWarehouseName(), "warehouseName", result);
//        DdlPreparedPack.getStringEqualPack(wmsTransQuan.getZoneName(), "zoneName", result);
//

        getStringBuilderPack(wmsTransQuan, result);

        return result;
    }

    /**
     * 根据存储区编号集合、库位类型查询库位信息
     *
     * @param zoneNoList
     * @param wmsZones
     * @param locateType
     * @return
     */
    public static DdlPackBean packLocateNoByZoneNo(List<String> zoneNoList, WmsZones wmsZones, Integer locateType) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getInPackList(zoneNoList, "zoneNo", result);
        DdlPreparedPack.getNumEqualPack(locateType, "locateType", result);
        getStringBuilderPack(wmsZones, result);

        return result;
    }

    /**
     * 根据id集合查询生产报工明细表的数据
     *
     * @param ids
     * @return
     */
    public static DdlPackBean packHqlWmsDocFgDetail(List<Long> ids) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getInPackList(ids, "id", result);

        return result;
    }

    /**
     * 根据id集合查询生产报工明细表的数据
     *
     * @param statusList
     * @param organizeCode
     * @return
     */
    public static DdlPackBean packHqlWmsASNMasterByStatus(List<Integer> statusList, String organizeCode) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getInPackList(statusList, "asnStatus", result);
        DdlPreparedPack.getNumEqualPack(WmsEnumUtil.PRODUCT_INSTOCK_STATUS.CREATE.getValue(), "actionStatus", result);
        DdlPreparedPack.getNumEqualPack(WmsEnumUtil.ORDER_TYPE.AMP.getValue(), "asnType", result);
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), "isValid", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);

        return result;
    }

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

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

        getStringBuilderPack(wmsInterfaceDataMapper, result);

        return result;
    }

    /**
     * 库存条码管理查询条件
     *
     * @param wmsStockSn
     * @return
     */
    public static DdlPackBean packHqlWmsStockSnManageByPager(WmsStockSn wmsStockSn) {
        DdlPackBean result = new DdlPackBean();

        // 物料编码支持多选
        DdlPreparedPack.getInPackList(wmsStockSn.getPartNoList(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getLocateNo(), "locateNo", result);
        // 存储区
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getZoneNo(), "zoneNo", result);

        DdlPreparedPack.getStringEqualPack(wmsStockSn.getVendorNo(), "vendorNo", result);
        // 库位不为空
        DdlPreparedPack.getStringNotNullPack("locateNo", result);
        DdlPreparedPack.getStringNoEqualPack("", "locateNo", result);
        // 排除创建及出库状态条码
        if (wmsStockSn.getSnStatus() != null) {
            DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnStatus(), "snStatus", result);
        }
        DdlPreparedPack.getNumNOEqualPack(WmsEnumUtil.STOCK_SN_STATUS.CREATE.getValue(), "snStatus", result);
        DdlPreparedPack.getNumNOEqualPack(WmsEnumUtil.STOCK_SN_STATUS.OUT_STOCK.getValue(), "snStatus", result);

        DdlPreparedPack.getNumEqualPack(wmsStockSn.getSnType(), "snType", result);

        //数量大于0
        DdlPreparedPack.getNumberBiggerPackContainsZero(0d, "qty", result);
        DdlPreparedPack.getStringRightLikerPack(wmsStockSn.getSn(), "sn", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getDateCode(), "dateCode", result);
        DdlPreparedPack.getStringEqualPack(wmsStockSn.getLotNo(), "lotNo", result);
        DdlPreparedPack.getOrderByPack(new Object[]{2}, new String[]{"createDatetime"}, result);

        getStringBuilderPack(wmsStockSn, result);
        return result;
    }

    /******************************************作业记录日志HQLPACK开始************************************************/
    /**
     * 作业日志复杂查询
     *
     * @param actionLog
     * @return
     */
    public static DdlPackBean packHqlWmsActionLogByActionLog(WmsActionLog actionLog) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.timeBuilder(actionLog.getCreateDatetime(), "createDatetime", packBean, false, false);
//        DdlPreparedPack.getStringEqualPack(actionLog.getMoveNo(), "moveNo", packBean);
        DdlPreparedPack.getStringEqualPack(actionLog.getTransTypeCode(), "transTypeCode", packBean);
        DdlPreparedPack.getStringEqualPack(actionLog.getFixNo(), "fixNo", packBean);
        DdlPreparedPack.getNumEqualPack(actionLog.getAgId(), "agId", packBean);
        DdlPreparedPack.getNumEqualPack(actionLog.getActionStatus(), "actionStatus", packBean);
        DdlPreparedPack.getStringEqualPack(actionLog.getAgNameRdd(), "agNameRdd", packBean);
        DdlPreparedPack.getStringEqualPack(actionLog.getOrganizeCode(), "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(actionLog.getIsValid(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(actionLog.getIsDeleted(), "isDeleted", packBean);

        if ((actionLog.getStartTimeStart() != null && actionLog.getStartTimeStart() != "")
                || (actionLog.getStartTimeEnd() != null && actionLog.getStartTimeEnd() != "")) {
            DdlPreparedPack.timeBuilder(actionLog.getStartTimeStart(), actionLog.getStartTimeEnd(), "startTime", packBean, true);
        }

        if ((actionLog.getEndTimeStart() != null && actionLog.getEndTimeStart() != "")
                || (actionLog.getEndTimeEnd() != null && actionLog.getEndTimeEnd() != "")) {
            DdlPreparedPack.timeBuilder(actionLog.getEndTimeStart(), actionLog.getEndTimeEnd(), "endTime", packBean, true);
        }

        return packBean;
    }

    /**
     * 作业日志明细复杂查询
     *
     * @param actionLogDetails
     * @return
     */
    public static DdlPackBean packHqlWmsActionLogByActionLogDetails(WmsActionLogDetails actionLogDetails) {
        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getNumEqualPack(actionLogDetails.getAlId(), "alId", packBean);
        DdlPreparedPack.getStringEqualPack(actionLogDetails.getOrganizeCode(), "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(actionLogDetails.getValueType(), "valueType", packBean);
        DdlPreparedPack.getNumEqualPack(actionLogDetails.getSeq(), "seq", packBean);
        DdlPreparedPack.getNumEqualPack(actionLogDetails.getIsValid(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(actionLogDetails.getIsDeleted(), "isDeleted", packBean);
        return packBean;
    }

    /**
     * 调用组件日志复杂查询
     *
     * @param actionLogData
     * @return
     */
    public static DdlPackBean packHqlWmsActionLogByActionLogData(WmsActionLogData actionLogData) {
        DdlPackBean packBean = new DdlPackBean();
        //DdlPreparedPack.getNumEqualPack(actionLogData.getAldId(), "aldId", packBean);
        DdlPreparedPack.getStringEqualPack(actionLogData.getOrganizeCode(), "organizeCode", packBean);
        DdlPreparedPack.getNumEqualPack(actionLogData.getIsValid(), "isValid", packBean);
        DdlPreparedPack.getNumEqualPack(actionLogData.getIsDeleted(), "isDeleted", packBean);
        return packBean;
    }


    /******************************************作业记录日志HQLPACK结束************************************************/

    /**
     * 单位换算 分页查询
     *
     * @return
     */
    public static DdlPackBean packHqlWmsStockInitializeByPager(WmsStockInitialize wmsStockInitialize) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(wmsStockInitialize.getStatus(), "status", result);
        DdlPreparedPack.getStringEqualPack(wmsStockInitialize.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockInitialize.getLocateNo(), "locateNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockInitialize.getWhNo(), "whNo", result);
        DdlPreparedPack.getStringEqualPack(wmsStockInitialize.getZoneNo(), "zoneNo", result);

        getStringBuilderPack(wmsStockInitialize, result);

        return result;
    }


    /**
     * 业务：库存查询封装
     *
     * @param “wmsStockQuan”
     * @return
     */
    public static DdlPackBean packWmsRouting(WmsRouting wmsRouting) {
        DdlPackBean result = new DdlPackBean();


        DdlPreparedPack.getStringLikerPack(wmsRouting.getRoutingCode(), "routingCode", result);
        DdlPreparedPack.getStringLikerPack(wmsRouting.getRoutingName(), "routingName", result);
        DdlPreparedPack.getNumEqualPack(wmsRouting.getForProduct(), "forProduct", result);
        DdlPreparedPack.getNumEqualPack(wmsRouting.getForWareHouse(), "forWareHouse", result);
        DdlPreparedPack.getNumEqualPack(wmsRouting.getForProductClass(), "forProductClass", result);
        // DdlPreparedPack.getInPack(wmsRouting.getIsValid(), "isValid", result);
        DdlPreparedPack.getInPack(wmsRouting.getIsDeleted(), "isDeleted", result);
        getStringBuilderPack(wmsRouting, result);

        return result;
    }

    public static DdlPackBean packWmsRoutingRule(WmsRoutingRule wmsRoutingRule) {
        DdlPackBean result = new DdlPackBean();


        DdlPreparedPack.getNumEqualPack(wmsRoutingRule.getRuleType(), "ruleType", result);
        DdlPreparedPack.getStringEqualPack(wmsRoutingRule.getRoutingCode(), "routingCode", result);
        if (StringUtils.isNotBlank(wmsRoutingRule.getOrganizeCode())) {
            DdlPreparedPack.getStringEqualPack(wmsRoutingRule.getOrganizeCode(), "organizeCode", result);
        }
        DdlPreparedPack.getInPack(wmsRoutingRule.getIsValid(), "isValid", result);
        DdlPreparedPack.getInPack(wmsRoutingRule.getIsDeleted(), "isDeleted", result);
        getStringBuilderPack(wmsRoutingRule, result);

        return result;
    }

    /**
     * 物料关系查询条件封装
     *
     * @param wmsPartRelation
     * @return
     */
    public static DdlPackBean packHqlWmsPartRelation(WmsPartRelation wmsPartRelation) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringRightLikerPack(wmsPartRelation.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsPartRelation.getPartName(), "partName", result);
        DdlPreparedPack.getStringLikerPack(wmsPartRelation.getAssociateCode(), "associateCoded", result);
        DdlPreparedPack.getStringLikerPack(wmsPartRelation.getAssociateNameAdd(), "associateNameAdd", result);
        DdlPreparedPack.getNumEqualPack(wmsPartRelation.getAssociateType(), "associateType", result);

        getStringBuilderPack(wmsPartRelation, result);

        return result;
    }

    /**
     * 打印机管理信息分页查询条件
     *
     * @param wmsPrinterConfigure
     * @return
     */
    public static DdlPackBean packHqlWmsPrinterConfigure(WmsPrinterConfigure wmsPrinterConfigure) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsPrinterConfigure.getIp(), "ip", result);
        DdlPreparedPack.getStringLikerPack(wmsPrinterConfigure.getPrinterNo(), "printerNo", result);

        getStringBuilderPack(wmsPrinterConfigure, result);

        return result;
    }

    /**
     * 待打印队列信息分页查询条件
     *
     * @param wmsPrintingQueue
     * @return
     */
    public static DdlPackBean packHqlwmsPrintingQueueByPrintNo(WmsPrintingQueue wmsPrintingQueue) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsPrintingQueue.getPrintNo(), "printNo", result);
        DdlPreparedPack.getNumEqualPack(WmsEnumUtil.ETC_PRINT_STATUS.NOT_HIT.getValue(), "printStatus", result);
//        DdlPreparedPack.getNumEqualPack(WmsEnumUtil.PRINT_TYPE.SN.getValue(), "printType", result);

        getStringBuilderPack(wmsPrintingQueue, result);

        return result;
    }

    /**
     * 根据父物料查询子物料的bom信息
     *
     * @param wmsBom
     * @return
     */
    public static DdlPackBean packHqlWmsBomByItemPartNo(WmsBom wmsBom) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsBom.getPartNo(), "partNo", result);

        getStringBuilderPack(wmsBom, result);

        return result;
    }

    /**
     * 工位信息分页查询条件
     *
     * @param wmsTerminal
     * @return
     */
    public static DdlPackBean packHqlWmsTerminal(WmsTerminal wmsTerminal) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsTerminal.getPdlineNo(), "pdlineNo", result);
        DdlPreparedPack.getStringLikerPack(wmsTerminal.getTerminalNo(), "terminalNo", result);

        getStringBuilderPack(wmsTerminal, result);

        return result;
    }

    /**
     * 班次信息分页查询条件
     *
     * @param wmsShift
     * @return
     */
    public static DdlPackBean packHqlWmsShift(WmsShift wmsShift) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsShift.getShiftNo(), "shiftNo", result);
        DdlPreparedPack.getStringLikerPack(wmsShift.getShiftName(), "shiftName", result);
        if (wmsShift.isStartTimeAndEndTime() && !StringUtil.isEmpty(wmsShift.getStartTime())) {
            result.setWhereAppend(result.getWhereAppend() + " and model.startTime<='" + wmsShift.getStartTime() + "'");
            result.setWhereAppend(result.getWhereAppend() + " and model.endTime>='" + wmsShift.getStartTime() + "'");
        }
        getStringBuilderPack(wmsShift, result);

        return result;
    }

    /**
     * 班休信息分页查询条件
     *
     * @param wmsShiftRest
     * @return
     */
    public static DdlPackBean packHqlWmsShiftRest(WmsShiftRest wmsShiftRest) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsShiftRest.getShiftNo(), "shiftNo", result);
        DdlPreparedPack.getStringEqualPack(wmsShiftRest.getRestNo(), "restNo", result);
        DdlPreparedPack.getStringEqualPack(wmsShiftRest.getRestName(), "restName", result);

        getStringBuilderPack(wmsShiftRest, result);

        return result;
    }

    /**
     * 生产计划主表信息分页查询条件
     *
     * @param mesPpMaster
     * @return
     */
    public static DdlPackBean packHqlMesPpMaster(MesPpMaster mesPpMaster) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(mesPpMaster.getWoekorderNo(), "woekorderNo", result);
        DdlPreparedPack.getNumEqualPack(mesPpMaster.getOrderStatus(), "orderStatus", result);
        DdlPreparedPack.getStringEqualPack(mesPpMaster.getPdlineNo(), "pdlineNo", result);
        DdlPreparedPack.getStringBiggerPack(mesPpMaster.getStartProductTime(), "startProductTime", result);
        DdlPreparedPack.getStringSmallerPack(mesPpMaster.getEndProductTime(), "endProductTime", result);

        getStringBuilderPack(mesPpMaster, result);

        return result;
    }

    /**
     * 生产计划明细表信息分页查询条件
     *
     * @param mesPpDetails
     * @return
     */
    public static DdlPackBean packHqlMesPpDetails(MesPpDetails mesPpDetails) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(mesPpDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(mesPpDetails.getWoekorderNo(), "woekorderNo", result);

        getStringBuilderPack(mesPpDetails, result);

        return result;
    }

    /**
     * 拉动计划主表信息分页查询条件
     *
     * @param wmsPullTaskMaster
     * @return
     */
    public static DdlPackBean packHqlWmsPullTaskMaster(WmsPullTaskMaster wmsPullTaskMaster, String statusList) {
        DdlPackBean result = new DdlPackBean();
        List<String> stringList = null;
        List<Integer> integerList = null;
        //List<Integer> integers = Arrays.stream(statusList.split(",")).map(Integer::parseInt).collect(Collectors.toList());
        if (StringUtils.isNotBlank(statusList)) {
            stringList = Arrays.asList(statusList.split(","));
            integerList = new ArrayList<>();
            for (String sl : stringList) {
                integerList.add(Integer.valueOf(sl));
            }
        }

        DdlPreparedPack.getInPackList(integerList, "orderStatus", result);
        DdlPreparedPack.getStringLikerPack(wmsPullTaskMaster.getWoekorderNo(), "woekorderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsPullTaskMaster.getPdlineNo(), "pdlineNo", result);
        DdlPreparedPack.getStringBiggerPack(wmsPullTaskMaster.getStartProductTime(), "startProductTime", result);
        DdlPreparedPack.getStringSmallerPack(wmsPullTaskMaster.getEndProductTime(), "endProductTime", result);

        getStringBuilderPack(wmsPullTaskMaster, result);

        return result;
    }

    /**
     * 拉动计划明细表信息分页查询条件
     *
     * @param wmsPullTaskDetails
     * @return
     */
    public static DdlPackBean packHqlWmsPullTaskDetails(WmsPullTaskDetails wmsPullTaskDetails) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(wmsPullTaskDetails.getWoekorderNo(), "woekorderNo", result);
        DdlPreparedPack.getStringLikerPack(wmsPullTaskDetails.getPartNo(), "partNo", result);

        getStringBuilderPack(wmsPullTaskDetails, result);

        return result;
    }

    /**
     * 库区物料信息分页查询条件
     *
     * @param wmsZonePart
     * @return
     */
    public static DdlPackBean packHqlWmsZonePart(WmsZonePart wmsZonePart) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsZonePart.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringLikerPack(wmsZonePart.getZoneNo(), "zoneNo", result);

        getStringBuilderPack(wmsZonePart, result);

        return result;
    }

    /**
     * 库区物料信息分页查询条件
     *
     * @param itemCheck
     * @return
     */
    public static DdlPackBean packHqlWmsPartItemCheck(WmsPartItemCheck itemCheck) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(itemCheck.getPartNo(), "partNo", result);

        getStringBuilderPack(itemCheck, result);

        return result;
    }

    /**
     * BH子检测项分页查询条件
     *
     * @param item
     * @return
     */
    public static DdlPackBean packHqlWmsBhChildDetectionItem(WmsBhChildDetectionItem item) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(item.getItemCheckCode(), "itemCheckCode", result);
        DdlPreparedPack.getStringLikerPack(item.getItemCheckName(), "itemCheckName", result);
        DdlPreparedPack.getStringEqualPack(item.getCheckTypeCode(), "checkTypeCode", result);

        getStringBuilderPack(item, result);

        return result;
    }

    /**
     * 根据条件查询dataAuth
     *
     * @param wmsSnOperateRecord
     * @return
     */
    public static DdlPackBean packHqlWmsSnOperateRecord(WmsSnOperateRecord wmsSnOperateRecord) {
        DdlPackBean result = new DdlPackBean();
        if (!Strings.isNullOrEmpty(wmsSnOperateRecord.getSn())) {
            DdlPreparedPack.getStringEqualPack(wmsSnOperateRecord.getSn(), "sn", result);
        }
        getStringBuilderPack(wmsSnOperateRecord, result);
        return result;
    }

    /**
     * 数据迁移配置信息分页查询条件
     *
     * @param wmsDataMigrationConfig
     * @return
     */
    public static DdlPackBean packHqlWmsDataMigrationConfig(WmsDataMigrationConfig wmsDataMigrationConfig) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsDataMigrationConfig.getMigName(), "migName", result);
        DdlPreparedPack.getStringLikerPack(wmsDataMigrationConfig.getRemark(), "remark", result);
        DdlPreparedPack.getStringLikerPack(wmsDataMigrationConfig.getSrcTableName(), "srcTableName", result);
        DdlPreparedPack.getNumEqualPack(wmsDataMigrationConfig.getIsPhysicalDelete(), "isPhysicalDelete", result);
        DdlPreparedPack.getStringBiggerPack(wmsDataMigrationConfig.getMcStartTime(), "nextExecutionTime", result);
        DdlPreparedPack.getStringSmallerPack(wmsDataMigrationConfig.getMcEndTime(), "nextExecutionTime", result);

        getStringBuilderPack(wmsDataMigrationConfig, result);

        return result;
    }

    /**
     * WMS实体字段信息分页查询条件
     *
     * @param wmsFieldInfo
     * @return
     */
    public static DdlPackBean packHqlWmsFieldInfo(WmsFieldInfo wmsFieldInfo) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(wmsFieldInfo.getFieldName(), "fieldName", result);
        DdlPreparedPack.getStringEqualPack(wmsFieldInfo.getEntityName(), "entityName", result);
        getStringBuilderPack(wmsFieldInfo, result);
        return result;
    }

    /**
     * WMS搜索记录查询条件
     *
     * @param searchElementFunction
     * @return
     */
    public static DdlPackBean packHqlWmsSearchElementRecord(WmsSearchElementFunction searchElementFunction) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getNumEqualPack(searchElementFunction.getFunctionId(), "functionId", result);
        DdlPreparedPack.getStringEqualPack(searchElementFunction.getUserCode(), "userCode", result);
        DdlPreparedPack.getNumEqualPackOr(searchElementFunction.getIsShare(), "isShare", result);
        getStringBuilderPack(searchElementFunction, result);
        return result;
    }

    /**
     * 物料组信息分页查询条件
     *
     * @param wmsPartGroup
     * @return
     */
    public static DdlPackBean packHqlWmsPartGroup(WmsPartGroup wmsPartGroup) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsPartGroup.getPartGroupNo(), "partGroupNo", result);
        DdlPreparedPack.getStringLikerPack(wmsPartGroup.getPartGroupName(), "partGroupName", result);

        getStringBuilderPack(wmsPartGroup, result);

        return result;
    }

    /**
     * 物料组物流路线信息分页查询条件
     *
     * @param wmsPartGroupRoute
     * @return
     */
    public static DdlPackBean packHqlWmsPartGroupRoute(WmsPartGroupRoute wmsPartGroupRoute) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsPartGroupRoute.getPartGroupNo(), "partGroupNo", result);

        getStringBuilderPack(wmsPartGroupRoute, result);

        return result;
    }

    /**
     * 物料组物流路线信息分页查询条件
     *
     * @param wmsPartGroupDetails
     * @return
     */
    public static DdlPackBean packHqlWmsPartGroupDetails(WmsPartGroupDetails wmsPartGroupDetails) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringEqualPack(wmsPartGroupDetails.getPartGroupNo(), "partGroupNo", result);

        getStringBuilderPack(wmsPartGroupDetails, result);

        return result;
    }

    /**
     * 插件信息分页查询条件
     * @param plugin
     * @return
     */
    public static DdlPackBean packHqlBasPlugin(BasPlugin plugin) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(plugin.getPluginName(), "pluginName", result);
        DdlPreparedPack.getStringLikerPack(plugin.getAuthor(), "author", result);
        DdlPreparedPack.getNumEqualPack(plugin.getPluginStatus(), "pluginStatus", result);
        getStringBuilderPack(plugin, result);
        return result;
    }

    /**
     * 插件信息分页查询条件
     * @param rule
     * @return
     */
    public static DdlPackBean packHqlWmsWaveRule(WmsWaveRule rule) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(rule.getRuleCode(), "ruleCode", result);
        DdlPreparedPack.getStringEqualPack(rule.getRuleDesc(), "ruleDesc", result);
        DdlPreparedPack.getStringBiggerPack(rule.getStartEffectDate(), "startEffectDate", result);
        DdlPreparedPack.getStringSmallerPack(rule.getEndEffectDate(), "endEffectDate", result);
        getStringBuilderPack(rule, result);
        return result;
    }

    /**
     * 运输规则分页查询条件
     * @param wmsTransportRule
     * @return
     */
    public static DdlPackBean packHqlBasPlugin(WmsTransportRule wmsTransportRule) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getNumEqualPack(wmsTransportRule.getBusiType(), "busiType", result);
        DdlPreparedPack.getStringLikerPack(wmsTransportRule.getCustNo(), "custNo", result);
        DdlPreparedPack.getStringLikerPack(wmsTransportRule.getPartNo(), "partNo", result);
        getStringBuilderPack(wmsTransportRule, result);
        return result;
    }

    /**
     * 获取 DdlPackBean(三个基础)
     *
     * @param organizeCode
     * @return
     */
    public static DdlPackBean packHqlWms(String organizeCode) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(organizeCode, "organizeCode", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.IS_VAILD.VAILD.getValue(), "isValid", result);
        DdlPreparedPack.getNumEqualPack(CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), "isDeleted", result);
        return result;
    }

    /**
     * SO订单主表信息 分页查询
     *
     * @param wmsDocSoMaster
     * @return
     */
    public static DdlPackBean packHqlWmsDocSoMaster(WmsDocSoMaster wmsDocSoMaster) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringRightLikerPack(wmsDocSoMaster.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsDocSoMaster.getCustCode(), "custCode", result);
        DdlPreparedPack.getStringEqualPack(wmsDocSoMaster.getCustDeliveryCode(), "custDeliveryCode", result);
        DdlPreparedPack.getNumEqualPack(wmsDocSoMaster.getOrderStatus(), "orderStatus", result);
        getStringBuilderPack(wmsDocSoMaster, result);

        return result;
    }

    /**
     * SO订单明细表 分页查询
     *
     * @param wmsDocSoDetails
     * @return
     */
    public static DdlPackBean packHqlWmsDocSoDetails(WmsDocSoDetails wmsDocSoDetails) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsDocSoDetails.getOrderNo(), "orderNo", result);
        DdlPreparedPack.getStringEqualPack(wmsDocSoDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsDocSoDetails.getPartNameRdd(), "partNameRdd", result);

        getStringBuilderPack(wmsDocSoDetails, result);

        return result;
    }

    /**
     * 导入模板信息分页查询条件
     * @param template
     * @return
     */
    public static DdlPackBean packHqlBasImportTemplate(BasImportTemplate template) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringLikerPack(template.getTemplateName(), "templateName", result);
        DdlPreparedPack.getStringLikerPack(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;
    }

    /**
     * 检测结果汇总表 分页查询
     *
     * @param wmsTestResultSummary
     * @return
     */
    public static DdlPackBean packHqWmsTestResultSummary(WmsTestResultSummary wmsTestResultSummary) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsTestResultSummary.getWorkCenterCode(), "workCenterCode", result);
        DdlPreparedPack.getStringEqualPack(wmsTestResultSummary.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTestResultSummary.getFlagNo(), "flagNo", result);
        DdlPreparedPack.getNumEqualPack(wmsTestResultSummary.getReworkStatus(), "reworkStatus", result);
        if (wmsTestResultSummary.getIsQualified() != null) {
            DdlPreparedPack.getNumEqualPack(wmsTestResultSummary.getIsQualified(), "isQualified", result);
        }

        DdlPreparedPack.getStringEqualPack(wmsTestResultSummary.getBhCode(), "bhCode", result);
        DdlPreparedPack.getNumEqualPack(wmsTestResultSummary.getPickStatus(), "pickStatus", result);
        if (StringUtils.isNotBlank(wmsTestResultSummary.getCreateDateTimeStart())) {
            DdlPreparedPack.timeBuilder(wmsTestResultSummary.getCreateDateTimeStart(),
                    wmsTestResultSummary.getCreateDateTimeEnd(), "createDatetime", result, true);
        }

        if (StringUtils.isNotBlank(wmsTestResultSummary.getModifyDateTimeStart())) {
            DdlPreparedPack.timeBuilder(wmsTestResultSummary.getModifyDateTimeStart(),
                    wmsTestResultSummary.getModifyDateTimeEnd(), "modifyDateTime", result, true);
        }
        getStringBuilderPack(wmsTestResultSummary, result);

        return result;
    }

    /**
     * 检测结果明细表 分页查询
     *
     * @param wmsTestResultDetails
     * @return
     */
    public static DdlPackBean packHqWmsTestResultDetails(WmsTestResultDetails wmsTestResultDetails) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsTestResultDetails.getBhCode(), "bhCode", result);
        DdlPreparedPack.getStringEqualPack(wmsTestResultDetails.getWorkCenterCode(), "workCenterCode", result);
        DdlPreparedPack.getNumEqualPack(wmsTestResultDetails.getCheckTypeCode(), "checkTypeCode", result);
        DdlPreparedPack.getStringEqualPack(wmsTestResultDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(wmsTestResultDetails.getQrCode(), "qrCode", result);
        if (StringUtils.isNotBlank(wmsTestResultDetails.getCreateDateTimeStart())) {
            DdlPreparedPack.timeBuilder(wmsTestResultDetails.getCreateDateTimeStart(),
                    wmsTestResultDetails.getCreateDateTimeEnd(), "createDatetime", result, true);
        }

        if (StringUtils.isNotBlank(wmsTestResultDetails.getModifyDateTimeStart())) {
            DdlPreparedPack.timeBuilder(wmsTestResultDetails.getModifyDateTimeStart(),
                    wmsTestResultDetails.getModifyDateTimeEnd(), "modifyDateTime", result, true);
        }


        getStringBuilderPack(wmsTestResultDetails, result);

        return result;
    }

    /**
     * 根据条件分页查询物料检测大类
     *
     * @param checkType
     * @return
     */
    public static DdlPackBean packHqlWmsPartCheckType(WmsPartCheckType checkType) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(checkType.getWorkCenterCode(), "workCenterCode", result);
        DdlPreparedPack.getStringEqualPack(checkType.getPartNo(), "partNo", result);
        DdlPreparedPack.getStringEqualPack(checkType.getCheckTypeCode(), "checkTypeCode", result);
        getStringBuilderPack(checkType, result);
        return result;
    }

    /**
     * 模板信息分页查询条件
     * @param thymeleaf
     * @return
     */
    public static DdlPackBean packHqlWmsThymeleaf(WmsThymeleaf thymeleaf) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(thymeleaf.getTlCode(), "tlCode", result);
        DdlPreparedPack.getStringLikerPack(thymeleaf.getTlDesc(), "tlDesc", result);
        getStringBuilderPack(thymeleaf, result);
        return result;
    }

    /**
     * 仓库健康指标信息分页查询条件
     * @param healthIndicator
     * @return
     */
    public static DdlPackBean packHqlWmsHealthIndicator(WmsHealthIndicator healthIndicator) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(healthIndicator.getIndicatorCode(), "indicatorCode", result);
        DdlPreparedPack.getStringLikerPack(healthIndicator.getIndicatorName(), "indicatorName", result);
        DdlPreparedPack.getStringLikerPack(healthIndicator.getGroupName(), "groupName", result);
        getStringBuilderPack(healthIndicator, result);
        return result;
    }

    /**
     * 仓库健康指标分级信息分页查询条件
     * @param healthIndicatorLevel
     * @return
     */
    public static DdlPackBean packHqlWmsHealthIndicatorLevel(WmsHealthIndicatorLevel healthIndicatorLevel) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(healthIndicatorLevel.getIndicatorCode(), "indicatorCode", result);
        getStringBuilderPack(healthIndicatorLevel, result);
        return result;
    }

    /**
     * 仓库健康指标分级信息分页查询条件
     * @param wmsHealthVariable
     * @return
     */
    public static DdlPackBean packHqlWmsHealthVariable(WmsHealthVariable wmsHealthVariable) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(wmsHealthVariable.getVariableCode(), "variableCode", result);
        DdlPreparedPack.getStringLikerPack(wmsHealthVariable.getVariableName(), "variableName", result);
        getStringBuilderPack(wmsHealthVariable, result);
        return result;
    }

    /**
     * 仓库健康指标测算结果信息查询条件
     * @param healthIndicatorResult
     * @return
     */
    public static DdlPackBean packHqlWmsHealthIndicatorResult(WmsHealthIndicatorResult healthIndicatorResult) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(healthIndicatorResult.getIndicatorCode(), "indicatorCode", result);
        DdlPreparedPack.getStringEqualPack(healthIndicatorResult.getCreateDatetime(), "createDatetime", result);
        getStringBuilderPack(healthIndicatorResult, result);
        return result;
    }

    /**
     * 仓库健康指标变量测算结果信息查询条件
     * @param healthVariableResult
     * @return
     */
    public static DdlPackBean packHqlWmsHealthVariableResult(WmsHealthVariableResult healthVariableResult) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(healthVariableResult.getVariableCode(), "variableCode", result);
        getStringBuilderPack(healthVariableResult, result);
        return result;
    }

    /**
     * 物流运费记录明细查询条件
     *
     * @param logisticExpenseRecordsDetails 物流运费记录明细
     * @return
     */
    public static DdlPackBean packHqlLogisticExpenseRecordsDetails(WmsLogisticExpenseRecordsDetails logisticExpenseRecordsDetails) {
        DdlPackBean result = WmsHqlPack.packHqlWms(logisticExpenseRecordsDetails.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(logisticExpenseRecordsDetails.getPartNo(), "partNo", result);
        DdlPreparedPack.getNumEqualPack(logisticExpenseRecordsDetails.getPartName(), "partName", result);
        DdlPreparedPack.getStringEqualPack(logisticExpenseRecordsDetails.getOrderNo(), "orderNo", result);
        getStringBuilderPack(logisticExpenseRecordsDetails, result);
        return result;
    }

    /**
     * 物流运费记录查询条件
     *
     * @param logisticExpenseRecords 物流运费记录
     * @return
     */
    public static DdlPackBean packHqlLogisticExpenseRecords(WmsLogisticExpenseRecords logisticExpenseRecords) {
        DdlPackBean result = WmsHqlPack.packHqlWms(logisticExpenseRecords.getOrganizeCode());
        DdlPreparedPack.getStringEqualPack(logisticExpenseRecords.getLogisticsVendorNo(), "logisticsVendorNo", result);
        DdlPreparedPack.getNumEqualPack(logisticExpenseRecords.getTransportType(), "transportType", result);
        DdlPreparedPack.getNumEqualPack(logisticExpenseRecords.getBusiType(), "busiType", result);
        DdlPreparedPack.getStringEqualPack(logisticExpenseRecords.getShippingFlag(), "shippingFlag", result);
        DdlPreparedPack.getStringEqualPack(logisticExpenseRecords.getOrderNo(), "orderNo", result);
        getStringBuilderPack(logisticExpenseRecords, result);
        return result;
    }



    /**
     * 产品条码事务查询条件
     *
     * @param wmsSerialSnTrans
     * @return
     */
    public static DdlPackBean packHqlWmsSerialSnTrans(WmsSerialSnTrans wmsSerialSnTrans) {

        DdlPackBean packBean = new DdlPackBean();
        DdlPreparedPack.getStringEqualPack(wmsSerialSnTrans.getBatchNo(), "batchNo", packBean);
        DdlPreparedPack.getInPackList(wmsSerialSnTrans.getTransTypeLst(), "transType", packBean);
        getStringBuilderPack(wmsSerialSnTrans, packBean);
        return packBean;
    }

    /**
     * 装车单 传输类
     *
     * @param model
     * @return
     */
    public static DdlPackBean packHqlTmsShip(WmsTmsShipDto model) {

        DdlPackBean packBean = WmsHqlPack.packHqlWms(model.getOrganizeCode());
        DdlPreparedPack.getNumEqualPack(model.getOrderStatus(), "orderStatus", packBean);
        DdlPreparedPack.getStringEqualPack(model.getMoveNo(), "moveNo", packBean);
        DdlPreparedPack.getOrderByPack(
                new Object[]{CommonEnumUtil.FALSE},
                new String[]{"createDatetime"}, packBean);
        return packBean;
    }

    /**
     * BH检测大类表查询条件
     *
     * @param qmsStockSnExtBh
     * @return
     */
    public static DdlPackBean packHqlQmsStockSnExtBh(QmsStockSnExtBh qmsStockSnExtBh) {

        DdlPackBean packBean = new DdlPackBean();
/*        DdlPreparedPack.getStringEqualPack(qmsStockSnExtBh.getBatchNo(), "batchNo", packBean);
        DdlPreparedPack.getInPackList(wmsSerialSnTrans.getTransTypeLst(),"transType",packBean);
        getStringBuilderPack(wmsSerialSnTrans, packBean);*/
        return packBean;
    }

    /**
     * 自动化策略主表 分页查询
     *
     * @param wmsAutoStrategyMaster
     * @return
     */
    public static DdlPackBean packHqlWmsAutoStrategyMaster(WmsAutoStrategyMaster wmsAutoStrategyMaster) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsAutoStrategyMaster.getStrategyNo(), "strategyNo", result);
        DdlPreparedPack.getStringLikerPack(wmsAutoStrategyMaster.getStrategyName(), "strategyName", result);
        DdlPreparedPack.getNumEqualPack(wmsAutoStrategyMaster.getStrategyType(), "strategyType", result);
        DdlPreparedPack.getStringEqualPack(wmsAutoStrategyMaster.getRoutingCode(), "routingCode", result);
        if (StringUtils.isNotBlank(wmsAutoStrategyMaster.getStartEffectDate()) && StringUtils.isNotBlank(wmsAutoStrategyMaster.getEndEffectDate())) {
            result.setWhereAppend(result.getWhereAppend() + " and (startEffectDate >= '"+wmsAutoStrategyMaster.getStartEffectDate()+"' and  endEffectDate <= '"+wmsAutoStrategyMaster.getEndEffectDate()+"' )");
        }

        getStringBuilderPack(wmsAutoStrategyMaster, result);

        return result;
    }

    /**
     * 自动化策略明细表 分页查询
     *
     * @param wmsAutoStrategyDetail
     * @return
     */
    public static DdlPackBean packHqlWmsAutoStrategyDetail(WmsAutoStrategyDetail wmsAutoStrategyDetail) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringLikerPack(wmsAutoStrategyDetail.getAutoStrategyNo(), "autoStrategyNo", result);
        DdlPreparedPack.getStringLikerPack(wmsAutoStrategyDetail.getStrategyItemNo(), "strategyItemNo", result);

        getStringBuilderPack(wmsAutoStrategyDetail, result);

        return result;
    }

    /**
     * 自动化策略方法 分页查询
     *
     * @param WmsAutoStrategyMethod
     * @return
     */
    public static DdlPackBean packHqlWmsAutoStrategyMethod(WmsAutoStrategyMethod WmsAutoStrategyMethod) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getNumEqualPack(WmsAutoStrategyMethod.getStrategyAction(), "strategyAction", result);
        DdlPreparedPack.getStringLikerPack(WmsAutoStrategyMethod.getStrategyMethod(), "strategyMethod", result);
        DdlPreparedPack.getStringLikerPack(WmsAutoStrategyMethod.getStrategySpec(), "strategySpec", result);

        getStringBuilderPack(WmsAutoStrategyMethod, result);

        return result;
    }

    /**
     * 字典查询
     *
     * @param wmsEnum
     * @return
     */
    public static DdlPackBean packHqlWmsEnum(WmsEnum wmsEnum) {
        DdlPackBean result = new DdlPackBean();

        //查询参数封装
        DdlPreparedPack.getStringEqualPack(wmsEnum.getOrganizeCode(), "organizeCode", result);
        DdlPreparedPack.getStringEqualPack(wmsEnum.getEnumType(), "enumType", result);
        DdlPreparedPack.getStringEqualPack(wmsEnum.getEnumValue(), "enumValue", result);

        getStringBuilderPack(wmsEnum, result);

        return result;
    }


    /**
     * 领料时长分区分页查询条件
     *
     * @param wmsPickingWindowTime
     * @return
     */
    public static DdlPackBean packHqlWmsPickingWindowTime(WmsPickingWindowTime wmsPickingWindowTime) {
        DdlPackBean result = new DdlPackBean();

        DdlPreparedPack.getStringLikerPack(wmsPickingWindowTime.getShiftNo(), "shiftNo", result);

        getStringBuilderPack(wmsPickingWindowTime, result);

        return result;
    }
    public static DdlPackBean packHqlWmsDock(WmsDock wmsDock) {
        DdlPackBean result = new DdlPackBean();
        DdlPreparedPack.getStringRightLikerPack(wmsDock.getDockCode(), "dockCode", result);
        getStringBuilderPack(wmsDock, result);
        return result;
    }
}
