<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzya.frame.u9c.itemmaster.dao.impl.VU9cItemmasterDaoImpl">

    <resultMap id="get-VU9cItemmasterEntity-result" type="com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
       <result property="code" column="CODE" jdbcType="VARCHAR"/>
           <result property="name" column="NAME" jdbcType="VARCHAR"/>
           <result property="categoryId" column="category_id" jdbcType="VARCHAR"/>
           <result property="classificationCode" column="classification_code" jdbcType="VARCHAR"/>
           <result property="classificationName" column="classification_name" jdbcType="VARCHAR"/>
           <result property="crmCategoryId" column="crmCategoryId" jdbcType="VARCHAR"/>
           <result property="crmId" column="crmId" jdbcType="VARCHAR"/>
           <result property="operatorsId" column="operatorsId" jdbcType="VARCHAR"/>
           <result property="unitCode" column="unitCode" jdbcType="VARCHAR"/>
           <result property="dataId" column="dataId" jdbcType="VARCHAR"/>
           <result property="unitName" column="unitName" jdbcType="VARCHAR"/>
           <result property="specs" column="specs" jdbcType="VARCHAR"/>
           <result property="sukCode" column="suk_code" jdbcType="VARCHAR"/>
           <result property="referenceCode" column="reference_code" jdbcType="VARCHAR"/>
           <result property="materialForm" column="material_form" jdbcType="VARCHAR"/>
           <result property="inventoryTransactions" column="inventory_transactions" jdbcType="VARCHAR"/>
           <result property="procure" column="procure" jdbcType="VARCHAR"/>
           <result property="sale" column="sale" jdbcType="VARCHAR"/>
           <result property="produce" column="produce" jdbcType="VARCHAR"/>
           <result property="mrp" column="mrp" jdbcType="VARCHAR"/>
           <result property="bom" column="bom" jdbcType="VARCHAR"/>
           <result property="doubleUnit" column="double_unit" jdbcType="VARCHAR"/>
           <result property="multiUnit" column="multi_unit" jdbcType="VARCHAR"/>
           <result property="conversionRate" column="conversion_rate" jdbcType="VARCHAR"/>
           <result property="reserved" column="reserved" jdbcType="VARCHAR"/>
           <result property="batchNumber" column="batch_number" jdbcType="VARCHAR"/>
           <result property="pricingSource" column="pricing_source" jdbcType="VARCHAR"/>
           <result property="receivingProcedure" column="receiving_procedure" jdbcType="VARCHAR"/>
           <result property="inventoryMasterUnit" column="inventory_master_unit" jdbcType="VARCHAR"/>
           <result property="inventoryMasterUnitCode" column="inventory_master_unit_code" jdbcType="VARCHAR"/>
           <result property="inventoryMasterUnitZhl" column="inventory_master_unit_zhl" jdbcType="VARCHAR"/>
           <result property="inventoryUnit" column="inventory_unit" jdbcType="VARCHAR"/>
           <result property="inventoryUnitCode" column="inventory_unit_code" jdbcType="VARCHAR"/>
           <result property="inventoryUnitZhl" column="inventory_unit_zhl" jdbcType="VARCHAR"/>
           <result property="purchasingUnit" column="purchasing_unit" jdbcType="VARCHAR"/>
           <result property="saleUnit" column="sale_unit" jdbcType="VARCHAR"/>
           <result property="productionUnit" column="production_unit" jdbcType="VARCHAR"/>
           <result property="materialRequisitionUnit" column="material_requisition_unit" jdbcType="VARCHAR"/>
           <result property="pricingUnit" column="pricing_unit" jdbcType="VARCHAR"/>
           <result property="weightUnit" column="weight_unit" jdbcType="VARCHAR"/>
           <result property="volumeUnit" column="volume_unit" jdbcType="VARCHAR"/>
           <result property="costUnit" column="cost_unit" jdbcType="VARCHAR"/>
           <result property="sale_price" column="sale_price" jdbcType="VARCHAR"/>
           <result property="cost_price" column="cost_price" jdbcType="VARCHAR"/>
           <result property="cost_price_spr" column="cost_price_spr" jdbcType="VARCHAR"/>
           <result property="has_sale_item" column="has_sale_item" jdbcType="VARCHAR"/>
           <result property="has_weigh_item" column="has_weigh_item" jdbcType="VARCHAR"/>
           <result property="updatetime" column="update_time" jdbcType="VARCHAR"/>
           <result property="LotValidDate" column="LotValidDate" jdbcType="VARCHAR"/>
           <result property="standardPrice" column="standard_price" jdbcType="VARCHAR"/>
           <result property="orgName" column="org_name" jdbcType="VARCHAR"/>
           <result property="nameOrg" column="name_org" jdbcType="VARCHAR"/>
           <result property="crmCostPrice" column="crm_cost_price" jdbcType="VARCHAR"/>
           <result property="CRMSalesRate" column="CRMSalesRate" jdbcType="VARCHAR"/>
           <result property="Effective_IsEffective" column="Effective_IsEffective" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "VU9cItemmasterEntity_Base_Column_List">
        CODE
        LotValidDate
       ,NAME
        ,category_id
        ,classification_code
        ,standard_price
        ,classification_name
        ,crmCategoryId
        ,crmId
        ,operatorsId
        ,unitCode
        ,dataId
        ,unitName
        ,specs
        ,suk_code
        ,reference_code
        ,material_form
        ,inventory_transactions
        ,procure
        ,sale
        ,produce
        ,mrp
        ,bom
        ,double_unit
        ,multi_unit
        ,conversion_rate
        ,reserved
        ,batch_number
        ,pricing_source
        ,receiving_procedure
        ,inventory_master_unit
        ,inventory_master_unit_code
        ,inventory_master_unit_zhl
        ,inventory_unit
        ,inventory_unit_code
        ,inventory_unit_zhl
        ,purchasing_unit
        ,sale_unit
        ,production_unit
        ,material_requisition_unit
        ,pricing_unit
        ,weight_unit
        ,volume_unit
        ,cost_unit
        ,sale_price
        ,cost_price
        ,cost_price_spr
        ,has_sale_item
        ,has_weigh_item
        ,update_time
     </sql>


    <!--睿本云专用-->
    <resultMap id="get-VU9cItemmasterEntity-result_reabam" type="com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
        <result property="code" column="CODE" jdbcType="VARCHAR"/>
        <result property="name" column="NAME" jdbcType="VARCHAR"/>
        <result property="categoryId" column="category_id" jdbcType="VARCHAR"/>
        <result property="classificationCode" column="classification_code" jdbcType="VARCHAR"/>
        <result property="classificationName" column="classification_name" jdbcType="VARCHAR"/>
        <result property="crmCategoryId" column="crmCategoryId" jdbcType="VARCHAR"/>
        <result property="crmId" column="crmId" jdbcType="VARCHAR"/>
        <result property="costType" column="costType" jdbcType="VARCHAR"/>
        <result property="operatorsId" column="operatorsId" jdbcType="VARCHAR"/>
        <result property="unitCode" column="unitCode" jdbcType="VARCHAR"/>
        <result property="dataId" column="dataId" jdbcType="VARCHAR"/>
        <result property="unitName" column="unitName" jdbcType="VARCHAR"/>
        <result property="specs" column="specs" jdbcType="VARCHAR"/>
        <result property="sukCode" column="suk_code" jdbcType="VARCHAR"/>
        <result property="referenceCode" column="reference_code" jdbcType="VARCHAR"/>
        <result property="materialForm" column="material_form" jdbcType="VARCHAR"/>
        <result property="inventoryTransactions" column="inventory_transactions" jdbcType="VARCHAR"/>
        <result property="procure" column="procure" jdbcType="VARCHAR"/>
        <result property="sale" column="sale" jdbcType="VARCHAR"/>
        <result property="produce" column="produce" jdbcType="VARCHAR"/>
        <result property="mrp" column="mrp" jdbcType="VARCHAR"/>
        <result property="bom" column="bom" jdbcType="VARCHAR"/>
        <result property="doubleUnit" column="double_unit" jdbcType="VARCHAR"/>
        <result property="multiUnit" column="multi_unit" jdbcType="VARCHAR"/>
        <result property="conversionRate" column="conversion_rate" jdbcType="VARCHAR"/>
        <result property="reserved" column="reserved" jdbcType="VARCHAR"/>
        <result property="batchNumber" column="batch_number" jdbcType="VARCHAR"/>
        <result property="pricingSource" column="pricing_source" jdbcType="VARCHAR"/>
        <result property="receivingProcedure" column="receiving_procedure" jdbcType="VARCHAR"/>
        <result property="inventoryMasterUnit" column="inventory_master_unit" jdbcType="VARCHAR"/>
        <result property="inventoryMasterUnitCode" column="inventory_master_unit_code" jdbcType="VARCHAR"/>
        <result property="inventoryMasterUnitZhl" column="inventory_master_unit_zhl" jdbcType="VARCHAR"/>
        <result property="inventoryUnit" column="inventory_unit" jdbcType="VARCHAR"/>
        <result property="inventoryUnitCode" column="inventory_unit_code" jdbcType="VARCHAR"/>
        <result property="inventoryUnitZhl" column="inventory_unit_zhl" jdbcType="VARCHAR"/>
        <result property="purchasingUnit" column="purchasing_unit" jdbcType="VARCHAR"/>
        <result property="inventoryPurchasingUnitZhl" column="inventory_purchasing_unit_zhl" jdbcType="VARCHAR"/>
        <result property="saleUnit" column="sale_unit" jdbcType="VARCHAR"/>
        <result property="saleUnitCode" column="sale_unit_code" jdbcType="VARCHAR"/>
        <result property="inventorySaleUnitZhl" column="inventory_sale_unit_zhl" jdbcType="VARCHAR"/>
        <result property="productionUnit" column="production_unit" jdbcType="VARCHAR"/>
        <result property="materialRequisitionUnit" column="material_requisition_unit" jdbcType="VARCHAR"/>
        <result property="pricingUnit" column="pricing_unit" jdbcType="VARCHAR"/>
        <result property="purchasingUnitCode" column="purchasing_unit_code" jdbcType="VARCHAR"/>
        <result property="weightUnit" column="weight_unit" jdbcType="VARCHAR"/>
        <result property="volumeUnit" column="volume_unit" jdbcType="VARCHAR"/>
        <result property="costUnit" column="cost_unit" jdbcType="VARCHAR"/>
        <result property="sale_price" column="sale_price" jdbcType="VARCHAR"/>
        <result property="cost_price" column="cost_price" jdbcType="VARCHAR"/>
        <result property="cost_price_spr" column="cost_price_spr" jdbcType="VARCHAR"/>
        <result property="has_sale_item" column="has_sale_item" jdbcType="VARCHAR"/>
        <result property="has_weigh_item" column="has_weigh_item" jdbcType="VARCHAR"/>
        <result property="updatetime" column="update_time" jdbcType="VARCHAR"/>
        <result property="LotValidDate" column="LotValidDate" jdbcType="VARCHAR"/>
        <result property="standardPrice" column="standard_price" jdbcType="VARCHAR"/>
        <result property="orgName" column="org_name" jdbcType="VARCHAR"/>
        <result property="nameOrg" column="name_org" jdbcType="VARCHAR"/>
        <result property="crmCostPrice" column="crm_cost_price" jdbcType="VARCHAR"/>
        <result property="CRMSalesRate" column="CRMSalesRate" jdbcType="VARCHAR"/>
        <result property="Effective_IsEffective" column="Effective_IsEffective" jdbcType="VARCHAR"/>
    </resultMap>
    <!--睿本云专用-->
    <!-- 查询的字段-->
    <sql id = "VU9cItemmasterEntity_Base_Column_List_reabam">
        CODE,
        LotValidDate
       ,NAME
        ,category_id
        ,classification_code
        ,classification_name
        ,crmCategoryId
        ,crmId
        ,costType
        ,operatorsId
        ,unitCode
        ,dataId
        ,unitName
        ,specs
        ,suk_code
        ,reference_code
        ,material_form
        ,inventory_transactions
        ,procure
        ,sale
        ,produce
        ,mrp
        ,bom
        ,double_unit
        ,multi_unit
        ,conversion_rate
        ,reserved
        ,batch_number
        ,pricing_source
        ,receiving_procedure
        ,inventory_master_unit
        ,inventory_master_unit_code
        ,inventory_master_unit_zhl
        ,inventory_unit
        ,inventory_unit_code
        ,inventory_unit_zhl
        ,purchasing_unit
        ,inventory_purchasing_unit_zhl
        ,sale_unit
        ,sale_unit_code
        ,inventory_sale_unit_zhl
        ,production_unit
        ,purchasing_unit_code
        ,material_requisition_unit
        ,pricing_unit
        ,weight_unit
        ,volume_unit
        ,cost_unit
        ,sale_price
        ,cost_price
        ,cost_price_spr
        ,has_sale_item
        ,has_weigh_item
        ,update_time
    </sql>

 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
    select
    <include refid="VU9cItemmasterEntity_Base_Column_List" />
    from v_u9c_itemmaster
    <trim prefix="where" prefixOverrides="and">
        <if test="code != null and code != ''"> and CODE = #{code} </if>
            <if test="name != null and name != ''"> and NAME = #{name} </if>
            <if test="categoryId != null and categoryId != ''"> and category_id = #{categoryId} </if>
            <if test="classificationCode != null and classificationCode != ''"> and classification_code = #{classificationCode} </if>
            <if test="classificationName != null and classificationName != ''"> and classification_name = #{classificationName} </if>
            <if test="crmCategoryId != null and crmCategoryId != ''"> and crmCategoryId = #{crmCategoryId} </if>
            <if test="crmId != null and crmId != ''"> and crmId = #{crmId} </if>
            <if test="operatorsId != null and operatorsId != ''"> and operatorsId = #{operatorsId} </if>
            <if test="unitCode != null and unitCode != ''"> and unitCode = #{unitCode} </if>
            <if test="dataId != null and dataId != ''"> and dataId = #{dataId} </if>
            <if test="unitName != null and unitName != ''"> and unitName = #{unitName} </if>
            <if test="specs != null and specs != ''"> and specs = #{specs} </if>
            <if test="sukCode != null and sukCode != ''"> and suk_code = #{sukCode} </if>
            <if test="referenceCode != null and referenceCode != ''"> and reference_code = #{referenceCode} </if>
            <if test="materialForm != null and materialForm != ''"> and material_form = #{materialForm} </if>
            <if test="inventoryTransactions != null and inventoryTransactions != ''"> and inventory_transactions = #{inventoryTransactions} </if>
            <if test="procure != null and procure != ''"> and procure = #{procure} </if>
            <if test="sale != null and sale != ''"> and sale = #{sale} </if>
            <if test="produce != null and produce != ''"> and produce = #{produce} </if>
            <if test="mrp != null and mrp != ''"> and mrp = #{mrp} </if>
            <if test="bom != null and bom != ''"> and bom = #{bom} </if>
            <if test="doubleUnit != null and doubleUnit != ''"> and double_unit = #{doubleUnit} </if>
            <if test="multiUnit != null and multiUnit != ''"> and multi_unit = #{multiUnit} </if>
            <if test="conversionRate != null and conversionRate != ''"> and conversion_rate = #{conversionRate} </if>
            <if test="reserved != null and reserved != ''"> and reserved = #{reserved} </if>
            <if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber} </if>
            <if test="pricingSource != null and pricingSource != ''"> and pricing_source = #{pricingSource} </if>
            <if test="receivingProcedure != null and receivingProcedure != ''"> and receiving_procedure = #{receivingProcedure} </if>
            <if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> and inventory_master_unit = #{inventoryMasterUnit} </if>
            <if test="inventoryUnit != null and inventoryUnit != ''"> and inventory_unit = #{inventoryUnit} </if>
            <if test="purchasingUnit != null and purchasingUnit != ''"> and purchasing_unit = #{purchasingUnit} </if>
            <if test="saleUnit != null and saleUnit != ''"> and sale_unit = #{saleUnit} </if>
            <if test="productionUnit != null and productionUnit != ''"> and production_unit = #{productionUnit} </if>
            <if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> and material_requisition_unit = #{materialRequisitionUnit} </if>
            <if test="pricingUnit != null and pricingUnit != ''"> and pricing_unit = #{pricingUnit} </if>
            <if test="weightUnit != null and weightUnit != ''"> and weight_unit = #{weightUnit} </if>
            <if test="volumeUnit != null and volumeUnit != ''"> and volume_unit = #{volumeUnit} </if>
            <if test="costUnit != null and costUnit != ''"> and cost_unit = #{costUnit} </if>
            <if test="updatetime != null and updatetime != ''"> and update_time = #{updatetime} </if>
            <if test="proType != null and proType != ''"> and proType = #{proType} </if>

    </trim>

</select>

<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
        select  count(1)   from v_u9c_itemmaster
    <trim prefix="where" prefixOverrides="and">
        <if test="code != null and code != ''"> and CODE = #{code} </if>
            <if test="name != null and name != ''"> and NAME = #{name} </if>
            <if test="categoryId != null and categoryId != ''"> and category_id = #{categoryId} </if>
            <if test="classificationCode != null and classificationCode != ''"> and classification_code = #{classificationCode} </if>
            <if test="classificationName != null and classificationName != ''"> and classification_name = #{classificationName} </if>
            <if test="crmCategoryId != null and crmCategoryId != ''"> and crmCategoryId = #{crmCategoryId} </if>
            <if test="crmId != null and crmId != ''"> and crmId = #{crmId} </if>
            <if test="operatorsId != null and operatorsId != ''"> and operatorsId = #{operatorsId} </if>
            <if test="unitCode != null and unitCode != ''"> and unitCode = #{unitCode} </if>
            <if test="dataId != null and dataId != ''"> and dataId = #{dataId} </if>
            <if test="unitName != null and unitName != ''"> and unitName = #{unitName} </if>
            <if test="specs != null and specs != ''"> and specs = #{specs} </if>
            <if test="sukCode != null and sukCode != ''"> and suk_code = #{sukCode} </if>
            <if test="referenceCode != null and referenceCode != ''"> and reference_code = #{referenceCode} </if>
            <if test="materialForm != null and materialForm != ''"> and material_form = #{materialForm} </if>
            <if test="inventoryTransactions != null and inventoryTransactions != ''"> and inventory_transactions = #{inventoryTransactions} </if>
            <if test="procure != null and procure != ''"> and procure = #{procure} </if>
            <if test="sale != null and sale != ''"> and sale = #{sale} </if>
            <if test="produce != null and produce != ''"> and produce = #{produce} </if>
            <if test="mrp != null and mrp != ''"> and mrp = #{mrp} </if>
            <if test="bom != null and bom != ''"> and bom = #{bom} </if>
            <if test="doubleUnit != null and doubleUnit != ''"> and double_unit = #{doubleUnit} </if>
            <if test="multiUnit != null and multiUnit != ''"> and multi_unit = #{multiUnit} </if>
            <if test="conversionRate != null and conversionRate != ''"> and conversion_rate = #{conversionRate} </if>
            <if test="reserved != null and reserved != ''"> and reserved = #{reserved} </if>
            <if test="batchNumber != null and batchNumber != ''"> and batch_number = #{batchNumber} </if>
            <if test="pricingSource != null and pricingSource != ''"> and pricing_source = #{pricingSource} </if>
            <if test="receivingProcedure != null and receivingProcedure != ''"> and receiving_procedure = #{receivingProcedure} </if>
            <if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> and inventory_master_unit = #{inventoryMasterUnit} </if>
            <if test="inventoryUnit != null and inventoryUnit != ''"> and inventory_unit = #{inventoryUnit} </if>
            <if test="purchasingUnit != null and purchasingUnit != ''"> and purchasing_unit = #{purchasingUnit} </if>
            <if test="saleUnit != null and saleUnit != ''"> and sale_unit = #{saleUnit} </if>
            <if test="productionUnit != null and productionUnit != ''"> and production_unit = #{productionUnit} </if>
            <if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> and material_requisition_unit = #{materialRequisitionUnit} </if>
            <if test="pricingUnit != null and pricingUnit != ''"> and pricing_unit = #{pricingUnit} </if>
            <if test="weightUnit != null and weightUnit != ''"> and weight_unit = #{weightUnit} </if>
            <if test="volumeUnit != null and volumeUnit != ''"> and volume_unit = #{volumeUnit} </if>
            <if test="costUnit != null and costUnit != ''"> and cost_unit = #{costUnit} </if>
            <if test="updatetime != null and updatetime != ''"> and update_time = #{updatetime} </if>

    </trim>

    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
    select
    <include refid="VU9cItemmasterEntity_Base_Column_List" />
    from v_u9c_itemmaster
    <trim prefix="where" prefixOverrides="and">
        <if test="code != null and code != ''"> and CODE like concat('%',#{code},'%') </if>
            <if test="name != null and name != ''"> and NAME like concat('%',#{name},'%') </if>
            <if test="categoryId != null and categoryId != ''"> and category_id like concat('%',#{categoryId},'%') </if>
            <if test="classificationCode != null and classificationCode != ''"> and classification_code like concat('%',#{classificationCode},'%') </if>
            <if test="classificationName != null and classificationName != ''"> and classification_name like concat('%',#{classificationName},'%') </if>
            <if test="crmCategoryId != null and crmCategoryId != ''"> and crmCategoryId like concat('%',#{crmCategoryId},'%') </if>
            <if test="crmId != null and crmId != ''"> and crmId like concat('%',#{crmId},'%') </if>
            <if test="operatorsId != null and operatorsId != ''"> and operatorsId like concat('%',#{operatorsId},'%') </if>
            <if test="unitCode != null and unitCode != ''"> and unitCode like concat('%',#{unitCode},'%') </if>
            <if test="dataId != null and dataId != ''"> and dataId like concat('%',#{dataId},'%') </if>
            <if test="unitName != null and unitName != ''"> and unitName like concat('%',#{unitName},'%') </if>
            <if test="specs != null and specs != ''"> and specs like concat('%',#{specs},'%') </if>
            <if test="sukCode != null and sukCode != ''"> and suk_code like concat('%',#{sukCode},'%') </if>
            <if test="referenceCode != null and referenceCode != ''"> and reference_code like concat('%',#{referenceCode},'%') </if>
            <if test="materialForm != null and materialForm != ''"> and material_form like concat('%',#{materialForm},'%') </if>
            <if test="inventoryTransactions != null and inventoryTransactions != ''"> and inventory_transactions like concat('%',#{inventoryTransactions},'%') </if>
            <if test="procure != null and procure != ''"> and procure like concat('%',#{procure},'%') </if>
            <if test="sale != null and sale != ''"> and sale like concat('%',#{sale},'%') </if>
            <if test="produce != null and produce != ''"> and produce like concat('%',#{produce},'%') </if>
            <if test="mrp != null and mrp != ''"> and mrp like concat('%',#{mrp},'%') </if>
            <if test="bom != null and bom != ''"> and bom like concat('%',#{bom},'%') </if>
            <if test="doubleUnit != null and doubleUnit != ''"> and double_unit like concat('%',#{doubleUnit},'%') </if>
            <if test="multiUnit != null and multiUnit != ''"> and multi_unit like concat('%',#{multiUnit},'%') </if>
            <if test="conversionRate != null and conversionRate != ''"> and conversion_rate like concat('%',#{conversionRate},'%') </if>
            <if test="reserved != null and reserved != ''"> and reserved like concat('%',#{reserved},'%') </if>
            <if test="batchNumber != null and batchNumber != ''"> and batch_number like concat('%',#{batchNumber},'%') </if>
            <if test="pricingSource != null and pricingSource != ''"> and pricing_source like concat('%',#{pricingSource},'%') </if>
            <if test="receivingProcedure != null and receivingProcedure != ''"> and receiving_procedure like concat('%',#{receivingProcedure},'%') </if>
            <if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> and inventory_master_unit like concat('%',#{inventoryMasterUnit},'%') </if>
            <if test="inventoryUnit != null and inventoryUnit != ''"> and inventory_unit like concat('%',#{inventoryUnit},'%') </if>
            <if test="purchasingUnit != null and purchasingUnit != ''"> and purchasing_unit like concat('%',#{purchasingUnit},'%') </if>
            <if test="saleUnit != null and saleUnit != ''"> and sale_unit like concat('%',#{saleUnit},'%') </if>
            <if test="productionUnit != null and productionUnit != ''"> and production_unit like concat('%',#{productionUnit},'%') </if>
            <if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> and material_requisition_unit like concat('%',#{materialRequisitionUnit},'%') </if>
            <if test="pricingUnit != null and pricingUnit != ''"> and pricing_unit like concat('%',#{pricingUnit},'%') </if>
            <if test="weightUnit != null and weightUnit != ''"> and weight_unit like concat('%',#{weightUnit},'%') </if>
            <if test="volumeUnit != null and volumeUnit != ''"> and volume_unit like concat('%',#{volumeUnit},'%') </if>
            <if test="costUnit != null and costUnit != ''"> and cost_unit like concat('%',#{costUnit},'%') </if>
            <if test="updatetime != null and updatetime != ''"> and update_time like concat('%',#{updatetime},'%') </if>

    </trim>

</select>

<!-- 查询列表 字段采用or格式 -->
<select id="VU9cItemmasterentity_list_or" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
    select
    <include refid="VU9cItemmasterEntity_Base_Column_List" />
    from v_u9c_itemmaster
    <trim prefix="where" prefixOverrides="and">
         <if test="code != null and code != ''"> or CODE = #{code} </if>
             <if test="name != null and name != ''"> or NAME = #{name} </if>
             <if test="categoryId != null and categoryId != ''"> or category_id = #{categoryId} </if>
             <if test="classificationCode != null and classificationCode != ''"> or classification_code = #{classificationCode} </if>
             <if test="classificationName != null and classificationName != ''"> or classification_name = #{classificationName} </if>
             <if test="crmCategoryId != null and crmCategoryId != ''"> or crmCategoryId = #{crmCategoryId} </if>
             <if test="crmId != null and crmId != ''"> or crmId = #{crmId} </if>
             <if test="operatorsId != null and operatorsId != ''"> or operatorsId = #{operatorsId} </if>
             <if test="unitCode != null and unitCode != ''"> or unitCode = #{unitCode} </if>
             <if test="dataId != null and dataId != ''"> or dataId = #{dataId} </if>
             <if test="unitName != null and unitName != ''"> or unitName = #{unitName} </if>
             <if test="specs != null and specs != ''"> or specs = #{specs} </if>
             <if test="sukCode != null and sukCode != ''"> or suk_code = #{sukCode} </if>
             <if test="referenceCode != null and referenceCode != ''"> or reference_code = #{referenceCode} </if>
             <if test="materialForm != null and materialForm != ''"> or material_form = #{materialForm} </if>
             <if test="inventoryTransactions != null and inventoryTransactions != ''"> or inventory_transactions = #{inventoryTransactions} </if>
             <if test="procure != null and procure != ''"> or procure = #{procure} </if>
             <if test="sale != null and sale != ''"> or sale = #{sale} </if>
             <if test="produce != null and produce != ''"> or produce = #{produce} </if>
             <if test="mrp != null and mrp != ''"> or mrp = #{mrp} </if>
             <if test="bom != null and bom != ''"> or bom = #{bom} </if>
             <if test="doubleUnit != null and doubleUnit != ''"> or double_unit = #{doubleUnit} </if>
             <if test="multiUnit != null and multiUnit != ''"> or multi_unit = #{multiUnit} </if>
             <if test="conversionRate != null and conversionRate != ''"> or conversion_rate = #{conversionRate} </if>
             <if test="reserved != null and reserved != ''"> or reserved = #{reserved} </if>
             <if test="batchNumber != null and batchNumber != ''"> or batch_number = #{batchNumber} </if>
             <if test="pricingSource != null and pricingSource != ''"> or pricing_source = #{pricingSource} </if>
             <if test="receivingProcedure != null and receivingProcedure != ''"> or receiving_procedure = #{receivingProcedure} </if>
             <if test="inventoryMasterUnit != null and inventoryMasterUnit != ''"> or inventory_master_unit = #{inventoryMasterUnit} </if>
             <if test="inventoryUnit != null and inventoryUnit != ''"> or inventory_unit = #{inventoryUnit} </if>
             <if test="purchasingUnit != null and purchasingUnit != ''"> or purchasing_unit = #{purchasingUnit} </if>
             <if test="saleUnit != null and saleUnit != ''"> or sale_unit = #{saleUnit} </if>
             <if test="productionUnit != null and productionUnit != ''"> or production_unit = #{productionUnit} </if>
             <if test="materialRequisitionUnit != null and materialRequisitionUnit != ''"> or material_requisition_unit = #{materialRequisitionUnit} </if>
             <if test="pricingUnit != null and pricingUnit != ''"> or pricing_unit = #{pricingUnit} </if>
             <if test="weightUnit != null and weightUnit != ''"> or weight_unit = #{weightUnit} </if>
             <if test="volumeUnit != null and volumeUnit != ''"> or volume_unit = #{volumeUnit} </if>
             <if test="costUnit != null and costUnit != ''"> or cost_unit = #{costUnit} </if>
             <if test="updatetime != null and updatetime != ''"> or update_time = #{updatetime} </if>

    </trim>

</select>


    <!-- 查询 采用==查询 -->
    <select id="entity_list_base_item_master" resultMap="get-VU9cItemmasterEntity-result" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">

    select  * from v_u9c_itemmaster_org_crm where update_time > #{updatetime}

</select>
<!--通过主键修改方法-->
    <update id="entity_update_item_master" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity" >
        update CBO_ItemMaster  set
        DescFlexField_PrivateDescSeg1 = DescFlexField_PrivateDescSeg1+#{dataId}
        where  id= #{id}
    </update>
    <!-- 查询物料，推送睿本云专用 -->
    <select id="VU9cItemmasterEntity_entity_list_base_reabam" resultMap="get-VU9cItemmasterEntity-result_reabam" parameterType = "com.hzya.frame.u9c.itemmaster.entity.VU9cItemmasterEntity">
        select
        <include refid="VU9cItemmasterEntity_Base_Column_List_reabam" />
        from v_u9c_itemmaster
        <trim prefix="where" prefixOverrides="and">
            <if test="code != null and code != ''"> and CODE = #{code} </if>
            <if test="name != null and name != ''"> and NAME = #{name} </if>
            <if test="updatetime != null and updatetime != ''"> and update_time >= #{updatetime} </if>
        </trim>
    </select>

</mapper>

