<?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.saledeliver.dao.impl.VU9cSaledeliverDetailsDaoImpl">

    <resultMap id="get-VU9cSaledeliverDetailsEntity-result" type="com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity" >
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="rowId" column="row_id" jdbcType="VARCHAR"/>
        <result property="mainId" column="main_id" jdbcType="VARCHAR"/>
        <result property="invCode" column="inv_code" jdbcType="VARCHAR"/>
        <result property="invName" column="inv_name" jdbcType="VARCHAR"/>
        <result property="spec" column="spec" jdbcType="VARCHAR"/>
        <result property="num" column="num" jdbcType="VARCHAR"/>
        <result property="unitCode" column="unit_code" jdbcType="VARCHAR"/>
        <result property="unitName" column="unit_name" jdbcType="VARCHAR"/>
        <result property="pricNum" column="pric_num" jdbcType="VARCHAR"/>
        <result property="measCode" column="meas_code" jdbcType="VARCHAR"/>
        <result property="measName" column="meas_name" jdbcType="VARCHAR"/>
        <result property="finalPrice" column="final_price" jdbcType="VARCHAR"/>
        <result property="untaxedAmount" column="untaxed_amount" jdbcType="VARCHAR"/>
        <result property="taxAmount" column="tax_amount" jdbcType="VARCHAR"/>
        <result property="totalPrice" column="total_price" jdbcType="VARCHAR"/>
        <result property="taxCombinationCode" column="tax_combination_code" jdbcType="VARCHAR"/>
        <result property="taxCombinationName" column="tax_combination_name" jdbcType="VARCHAR"/>
        <result property="storageLocationCode" column="storage_location_code" jdbcType="VARCHAR"/>
        <result property="storageLocationName" column="storage_location_name" jdbcType="VARCHAR"/>
        <result property="batch" column="batch" jdbcType="VARCHAR"/>
        <result property="period" column="period" jdbcType="VARCHAR"/>
        <result property="expiration" column="expiration" jdbcType="VARCHAR"/>
        <result property="updateTime" column="update_time" jdbcType="VARCHAR"/>
        <result property="costAmount" column="cost_amount" jdbcType="VARCHAR"/>
        <result property="warehouseKeeperCode" column="warehouse_keeper_code" jdbcType="VARCHAR"/>
        <result property="warehouseKeeperName" column="warehouse_keeper_name" jdbcType="VARCHAR"/>
        <result property="wmsLocationCode" column="wms_location_code" jdbcType="VARCHAR"/>
        <result property="wmsLocationName" column="wms_location_name" jdbcType="VARCHAR"/>
        <result property="deptCode" column="dept_code" jdbcType="VARCHAR"/>
        <result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
        <result property="salesOrderProductId" column="sales_order_product_id" jdbcType="VARCHAR"/>
        <result property="crmProId" column="crm_pro_id" jdbcType="VARCHAR"/>
        <result property="ShipConfirmDate" column="ShipConfirmDate" jdbcType="VARCHAR"/>
        <result property="TotalNetMoneyTC" column="TotalNetMoneyTC" jdbcType="VARCHAR"/>
        <result property="TotalMoneyTC" column="TotalMoneyTC" jdbcType="VARCHAR"/>
        <result property="salesOrderId" column="sales_order_id" jdbcType="VARCHAR"/>
        <result property="TotalMoneyTCNEW" column="TotalMoneyTCNEW" jdbcType="VARCHAR"/>
        <result property="OrderByQtyTU" column="OrderByQtyTU" jdbcType="VARCHAR"/>
        <result property="sales_order_id" column="salesOrderId" jdbcType="VARCHAR"/>
    </resultMap>
    <!-- 查询的字段-->
    <sql id = "VU9cSaledeliverDetailsEntity_Base_Column_List">
        row_id,
        id,
        sales_order_id,
        ShipConfirmDate
       ,ROUND(TotalMoneyTC, 2)as TotalMoneyTC
       ,TotalMoneyTCNEW
       ,OrderByQtyTU
       ,main_id
        ,inv_code 
        ,inv_name 
        ,spec 
        ,num 
        ,unit_code 
        ,unit_name 
        ,pric_num 
        ,meas_code 
        ,crm_pro_id
        ,meas_name
        ,final_price 
        ,untaxed_amount 
        ,tax_amount 
        ,total_price 
        ,tax_combination_code 
        ,tax_combination_name 
        ,storage_location_code 
        ,storage_location_name 
        ,batch 
        ,period 
        ,expiration 
        ,update_time 
        ,cost_amount 
        ,warehouse_keeper_code 
        ,warehouse_keeper_name 
        ,wms_location_code 
        ,sales_order_product_id
        ,wms_location_name
        ,dept_code 
        ,dept_name 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="VU9cSaledeliverDetailsEntity_list_base" resultMap="get-VU9cSaledeliverDetailsEntity-result" parameterType = "com.hzya.frame.u9c.saledeliver.entity.VU9cSaledeliverDetailsEntity">
    select
    <include refid="VU9cSaledeliverDetailsEntity_Base_Column_List" />
    from v_u9c_saledeliver_details
    <trim prefix="where" prefixOverrides="and"> 
        <if test="rowId != null and rowId != ''"> and row_id = #{rowId} </if>
        <if test="salesOrderId != null and salesOrderId != ''"> and so_id = #{salesOrderId} </if>
        <if test="mainId != null and mainId != ''"> and main_id = #{mainId} </if>
        <if test="invCode != null and invCode != ''"> and inv_code = #{invCode} </if>
        <if test="invName != null and invName != ''"> and inv_name = #{invName} </if>
        <if test="spec != null and spec != ''"> and spec = #{spec} </if>
        <if test="num != null and num != ''"> and num = #{num} </if>
        <if test="unitCode != null and unitCode != ''"> and unit_code = #{unitCode} </if>
        <if test="unitName != null and unitName != ''"> and unit_name = #{unitName} </if>
        <if test="pricNum != null and pricNum != ''"> and pric_num = #{pricNum} </if>
        <if test="measCode != null and measCode != ''"> and meas_code = #{measCode} </if>
        <if test="measName != null and measName != ''"> and meas_name = #{measName} </if>
        <if test="finalPrice != null and finalPrice != ''"> and final_price = #{finalPrice} </if>
        <if test="untaxedAmount != null and untaxedAmount != ''"> and untaxed_amount = #{untaxedAmount} </if>
        <if test="taxAmount != null and taxAmount != ''"> and tax_amount = #{taxAmount} </if>
        <if test="totalPrice != null and totalPrice != ''"> and total_price = #{totalPrice} </if>
        <if test="taxCombinationCode != null and taxCombinationCode != ''"> and tax_combination_code = #{taxCombinationCode} </if>
        <if test="taxCombinationName != null and taxCombinationName != ''"> and tax_combination_name = #{taxCombinationName} </if>
        <if test="storageLocationCode != null and storageLocationCode != ''"> and storage_location_code = #{storageLocationCode} </if>
        <if test="storageLocationName != null and storageLocationName != ''"> and storage_location_name = #{storageLocationName} </if>
        <if test="batch != null and batch != ''"> and batch = #{batch} </if>
        <if test="period != null and period != ''"> and period = #{period} </if>
        <if test="expiration != null and expiration != ''"> and expiration = #{expiration} </if>
        <if test="updateTime != null and updateTime != ''"> and update_time = #{updateTime} </if>
        <if test="costAmount != null and costAmount != ''"> and cost_amount = #{costAmount} </if>
        <if test="warehouseKeeperCode != null and warehouseKeeperCode != ''"> and warehouse_keeper_code = #{warehouseKeeperCode} </if>
        <if test="warehouseKeeperName != null and warehouseKeeperName != ''"> and warehouse_keeper_name = #{warehouseKeeperName} </if>
        <if test="wmsLocationCode != null and wmsLocationCode != ''"> and wms_location_code = #{wmsLocationCode} </if>
        <if test="wmsLocationName != null and wmsLocationName != ''"> and wms_location_name = #{wmsLocationName} </if>
        <if test="deptCode != null and deptCode != ''"> and dept_code = #{deptCode} </if>
        <if test="deptName != null and deptName != ''"> and dept_name = #{deptName} </if>

    </trim>

</select>


</mapper>

