<?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.plugin.lets.dao.impl.BusidataTocsalesDetailDaoImpl">

    <resultMap id="get-BusidataTocsalesDetailEntity-result" type="com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity" >
       <result property="barcode" column="barcode" jdbcType="VARCHAR"/>
           <result property="brandName" column="brand_name" jdbcType="VARCHAR"/>
           <result property="brandNo" column="brand_no" jdbcType="VARCHAR"/>
           <result property="costPrice" column="cost_price" jdbcType="VARCHAR"/>
           <result property="createdDate" column="created_date" jdbcType="VARCHAR"/>
           <result property="discount" column="discount" jdbcType="VARCHAR"/>
           <result property="fromMask" column="from_mask" jdbcType="VARCHAR"/>
           <result property="giftType" column="gift_type" jdbcType="VARCHAR"/>
           <result property="goodProp1" column="good_prop1" jdbcType="VARCHAR"/>
           <result property="goodProp2" column="good_prop2" jdbcType="VARCHAR"/>
           <result property="goodProp3" column="good_prop3" jdbcType="VARCHAR"/>
           <result property="goodProp4" column="good_prop4" jdbcType="VARCHAR"/>
           <result property="goodProp5" column="good_prop5" jdbcType="VARCHAR"/>
           <result property="goodProp6" column="good_prop6" jdbcType="VARCHAR"/>
           <result property="goodsAmount" column="goods_amount" jdbcType="VARCHAR"/>
           <result property="goodsCount" column="goods_count" jdbcType="VARCHAR"/>
           <result property="goodsId" column="goods_id" jdbcType="VARCHAR"/>
           <result property="goodsName" column="goods_name" jdbcType="VARCHAR"/>
           <result property="goodsNo" column="goods_no" jdbcType="VARCHAR"/>
           <result property="goodsType" column="goods_type" jdbcType="VARCHAR"/>
           <result property="isPackage" column="is_package" jdbcType="VARCHAR"/>
           <result property="marketPrice" column="market_price" jdbcType="VARCHAR"/>
           <result property="modifiedDate" column="modified_date" jdbcType="VARCHAR"/>
           <result property="paid" column="paid" jdbcType="VARCHAR"/>
           <result property="platformId" column="platform_id" jdbcType="VARCHAR"/>
           <result property="prop1" column="prop1" jdbcType="VARCHAR"/>
           <result property="prop2" column="prop2" jdbcType="VARCHAR"/>
           <result property="prop3" column="prop3" jdbcType="VARCHAR"/>
           <result property="prop4" column="prop4" jdbcType="VARCHAR"/>
           <result property="prop5" column="prop5" jdbcType="VARCHAR"/>
           <result property="prop6" column="prop6" jdbcType="VARCHAR"/>
           <result property="recId" column="rec_id" jdbcType="VARCHAR"/>
           <result property="refundStatus" column="refund_status" jdbcType="VARCHAR"/>
           <result property="remark" column="remark" jdbcType="VARCHAR"/>
           <result property="saleOrderId" column="sale_order_id" jdbcType="VARCHAR"/>
           <result property="sellPrice" column="sell_price" jdbcType="VARCHAR"/>
           <result property="shareAmount" column="share_amount" jdbcType="VARCHAR"/>
           <result property="sharePostAmount" column="share_post_amount" jdbcType="VARCHAR"/>
           <result property="sharePrice" column="share_price" jdbcType="VARCHAR"/>
           <result property="specCode" column="spec_code" jdbcType="VARCHAR"/>
           <result property="specId" column="spec_id" jdbcType="VARCHAR"/>
           <result property="specName" column="spec_name" jdbcType="VARCHAR"/>
           <result property="specNo" column="spec_no" jdbcType="VARCHAR"/>
           <result property="srcOid" column="src_oid" jdbcType="VARCHAR"/>
           <result property="srcOrderDetailId" column="src_order_detail_id" jdbcType="VARCHAR"/>
           <result property="srcTid" column="src_tid" jdbcType="VARCHAR"/>
           <result property="stockoutId" column="stockout_id" jdbcType="VARCHAR"/>
           <result property="suiteNo" column="suite_no" jdbcType="VARCHAR"/>
           <result property="taxRate" column="tax_rate" jdbcType="VARCHAR"/>
           <result property="totalAmount" column="total_amount" jdbcType="VARCHAR"/>
           <result property="weight" column="weight" jdbcType="VARCHAR"/>
           <result property="id" column="id" jdbcType="INTEGER"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "BusidataTocsalesDetailEntity_Base_Column_List">
        barcode
       ,brand_name 
        ,brand_no 
        ,cost_price 
        ,created_date 
        ,discount 
        ,from_mask 
        ,gift_type 
        ,good_prop1 
        ,good_prop2 
        ,good_prop3 
        ,good_prop4 
        ,good_prop5 
        ,good_prop6 
        ,goods_amount 
        ,goods_count 
        ,goods_id 
        ,goods_name 
        ,goods_no 
        ,goods_type 
        ,is_package 
        ,market_price 
        ,modified_date 
        ,paid 
        ,platform_id 
        ,prop1 
        ,prop2 
        ,prop3 
        ,prop4 
        ,prop5 
        ,prop6 
        ,rec_id 
        ,refund_status 
        ,remark 
        ,sale_order_id 
        ,sell_price 
        ,share_amount 
        ,share_post_amount 
        ,share_price 
        ,spec_code 
        ,spec_id 
        ,spec_name 
        ,spec_no 
        ,src_oid 
        ,src_order_detail_id 
        ,src_tid 
        ,stockout_id 
        ,suite_no 
        ,tax_rate 
        ,total_amount 
        ,weight 
        ,id 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-BusidataTocsalesDetailEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity">
    select
    <include refid="BusidataTocsalesDetailEntity_Base_Column_List" />
    from busidata_tocsales_detail
    <trim prefix="where" prefixOverrides="and"> 
        <if test="barcode != null and barcode != ''"> and barcode = #{barcode} </if>
            <if test="brandName != null and brandName != ''"> and brand_name = #{brandName} </if>
            <if test="brandNo != null and brandNo != ''"> and brand_no = #{brandNo} </if>
            <if test="costPrice != null and costPrice != ''"> and cost_price = #{costPrice} </if>
            <if test="createdDate != null and createdDate != ''"> and created_date = #{createdDate} </if>
            <if test="discount != null and discount != ''"> and discount = #{discount} </if>
            <if test="fromMask != null and fromMask != ''"> and from_mask = #{fromMask} </if>
            <if test="giftType != null and giftType != ''"> and gift_type = #{giftType} </if>
            <if test="goodProp1 != null and goodProp1 != ''"> and good_prop1 = #{goodProp1} </if>
            <if test="goodProp2 != null and goodProp2 != ''"> and good_prop2 = #{goodProp2} </if>
            <if test="goodProp3 != null and goodProp3 != ''"> and good_prop3 = #{goodProp3} </if>
            <if test="goodProp4 != null and goodProp4 != ''"> and good_prop4 = #{goodProp4} </if>
            <if test="goodProp5 != null and goodProp5 != ''"> and good_prop5 = #{goodProp5} </if>
            <if test="goodProp6 != null and goodProp6 != ''"> and good_prop6 = #{goodProp6} </if>
            <if test="goodsAmount != null and goodsAmount != ''"> and goods_amount = #{goodsAmount} </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count = #{goodsCount} </if>
            <if test="goodsId != null and goodsId != ''"> and goods_id = #{goodsId} </if>
            <if test="goodsName != null and goodsName != ''"> and goods_name = #{goodsName} </if>
            <if test="goodsNo != null and goodsNo != ''"> and goods_no = #{goodsNo} </if>
            <if test="goodsType != null and goodsType != ''"> and goods_type = #{goodsType} </if>
            <if test="isPackage != null and isPackage != ''"> and is_package = #{isPackage} </if>
            <if test="marketPrice != null and marketPrice != ''"> and market_price = #{marketPrice} </if>
            <if test="modifiedDate != null and modifiedDate != ''"> and modified_date = #{modifiedDate} </if>
            <if test="paid != null and paid != ''"> and paid = #{paid} </if>
            <if test="platformId != null and platformId != ''"> and platform_id = #{platformId} </if>
            <if test="prop1 != null and prop1 != ''"> and prop1 = #{prop1} </if>
            <if test="prop2 != null and prop2 != ''"> and prop2 = #{prop2} </if>
            <if test="prop3 != null and prop3 != ''"> and prop3 = #{prop3} </if>
            <if test="prop4 != null and prop4 != ''"> and prop4 = #{prop4} </if>
            <if test="prop5 != null and prop5 != ''"> and prop5 = #{prop5} </if>
            <if test="prop6 != null and prop6 != ''"> and prop6 = #{prop6} </if>
            <if test="recId != null and recId != ''"> and rec_id = #{recId} </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status = #{refundStatus} </if>
            <if test="remark != null and remark != ''"> and remark = #{remark} </if>
            <if test="saleOrderId != null and saleOrderId != ''"> and sale_order_id = #{saleOrderId} </if>
            <if test="sellPrice != null and sellPrice != ''"> and sell_price = #{sellPrice} </if>
            <if test="shareAmount != null and shareAmount != ''"> and share_amount = #{shareAmount} </if>
            <if test="sharePostAmount != null and sharePostAmount != ''"> and share_post_amount = #{sharePostAmount} </if>
            <if test="sharePrice != null and sharePrice != ''"> and share_price = #{sharePrice} </if>
            <if test="specCode != null and specCode != ''"> and spec_code = #{specCode} </if>
            <if test="specId != null and specId != ''"> and spec_id = #{specId} </if>
            <if test="specName != null and specName != ''"> and spec_name = #{specName} </if>
            <if test="specNo != null and specNo != ''"> and spec_no = #{specNo} </if>
            <if test="srcOid != null and srcOid != ''"> and src_oid = #{srcOid} </if>
            <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> and src_order_detail_id = #{srcOrderDetailId} </if>
            <if test="srcTid != null and srcTid != ''"> and src_tid = #{srcTid} </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId} </if>
            <if test="suiteNo != null and suiteNo != ''"> and suite_no = #{suiteNo} </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate = #{taxRate} </if>
            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
            <if test="weight != null and weight != ''"> and weight = #{weight} </if>
            <if test="id != null"> and id = #{id} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity">
        select  count(1)   from busidata_tocsales_detail
    <trim prefix="where" prefixOverrides="and"> 
        <if test="barcode != null and barcode != ''"> and barcode = #{barcode} </if>
            <if test="brandName != null and brandName != ''"> and brand_name = #{brandName} </if>
            <if test="brandNo != null and brandNo != ''"> and brand_no = #{brandNo} </if>
            <if test="costPrice != null and costPrice != ''"> and cost_price = #{costPrice} </if>
            <if test="createdDate != null and createdDate != ''"> and created_date = #{createdDate} </if>
            <if test="discount != null and discount != ''"> and discount = #{discount} </if>
            <if test="fromMask != null and fromMask != ''"> and from_mask = #{fromMask} </if>
            <if test="giftType != null and giftType != ''"> and gift_type = #{giftType} </if>
            <if test="goodProp1 != null and goodProp1 != ''"> and good_prop1 = #{goodProp1} </if>
            <if test="goodProp2 != null and goodProp2 != ''"> and good_prop2 = #{goodProp2} </if>
            <if test="goodProp3 != null and goodProp3 != ''"> and good_prop3 = #{goodProp3} </if>
            <if test="goodProp4 != null and goodProp4 != ''"> and good_prop4 = #{goodProp4} </if>
            <if test="goodProp5 != null and goodProp5 != ''"> and good_prop5 = #{goodProp5} </if>
            <if test="goodProp6 != null and goodProp6 != ''"> and good_prop6 = #{goodProp6} </if>
            <if test="goodsAmount != null and goodsAmount != ''"> and goods_amount = #{goodsAmount} </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count = #{goodsCount} </if>
            <if test="goodsId != null and goodsId != ''"> and goods_id = #{goodsId} </if>
            <if test="goodsName != null and goodsName != ''"> and goods_name = #{goodsName} </if>
            <if test="goodsNo != null and goodsNo != ''"> and goods_no = #{goodsNo} </if>
            <if test="goodsType != null and goodsType != ''"> and goods_type = #{goodsType} </if>
            <if test="isPackage != null and isPackage != ''"> and is_package = #{isPackage} </if>
            <if test="marketPrice != null and marketPrice != ''"> and market_price = #{marketPrice} </if>
            <if test="modifiedDate != null and modifiedDate != ''"> and modified_date = #{modifiedDate} </if>
            <if test="paid != null and paid != ''"> and paid = #{paid} </if>
            <if test="platformId != null and platformId != ''"> and platform_id = #{platformId} </if>
            <if test="prop1 != null and prop1 != ''"> and prop1 = #{prop1} </if>
            <if test="prop2 != null and prop2 != ''"> and prop2 = #{prop2} </if>
            <if test="prop3 != null and prop3 != ''"> and prop3 = #{prop3} </if>
            <if test="prop4 != null and prop4 != ''"> and prop4 = #{prop4} </if>
            <if test="prop5 != null and prop5 != ''"> and prop5 = #{prop5} </if>
            <if test="prop6 != null and prop6 != ''"> and prop6 = #{prop6} </if>
            <if test="recId != null and recId != ''"> and rec_id = #{recId} </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status = #{refundStatus} </if>
            <if test="remark != null and remark != ''"> and remark = #{remark} </if>
            <if test="saleOrderId != null and saleOrderId != ''"> and sale_order_id = #{saleOrderId} </if>
            <if test="sellPrice != null and sellPrice != ''"> and sell_price = #{sellPrice} </if>
            <if test="shareAmount != null and shareAmount != ''"> and share_amount = #{shareAmount} </if>
            <if test="sharePostAmount != null and sharePostAmount != ''"> and share_post_amount = #{sharePostAmount} </if>
            <if test="sharePrice != null and sharePrice != ''"> and share_price = #{sharePrice} </if>
            <if test="specCode != null and specCode != ''"> and spec_code = #{specCode} </if>
            <if test="specId != null and specId != ''"> and spec_id = #{specId} </if>
            <if test="specName != null and specName != ''"> and spec_name = #{specName} </if>
            <if test="specNo != null and specNo != ''"> and spec_no = #{specNo} </if>
            <if test="srcOid != null and srcOid != ''"> and src_oid = #{srcOid} </if>
            <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> and src_order_detail_id = #{srcOrderDetailId} </if>
            <if test="srcTid != null and srcTid != ''"> and src_tid = #{srcTid} </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId} </if>
            <if test="suiteNo != null and suiteNo != ''"> and suite_no = #{suiteNo} </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate = #{taxRate} </if>
            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
            <if test="weight != null and weight != ''"> and weight = #{weight} </if>
            <if test="id != null"> and id = #{id} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null "> order by ${sort} ${order}</if>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-BusidataTocsalesDetailEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity">
    select
    <include refid="BusidataTocsalesDetailEntity_Base_Column_List" />
    from busidata_tocsales_detail
    <trim prefix="where" prefixOverrides="and"> 
        <if test="barcode != null and barcode != ''"> and barcode like concat('%',#{barcode},'%') </if>
            <if test="brandName != null and brandName != ''"> and brand_name like concat('%',#{brandName},'%') </if>
            <if test="brandNo != null and brandNo != ''"> and brand_no like concat('%',#{brandNo},'%') </if>
            <if test="costPrice != null and costPrice != ''"> and cost_price like concat('%',#{costPrice},'%') </if>
            <if test="createdDate != null and createdDate != ''"> and created_date like concat('%',#{createdDate},'%') </if>
            <if test="discount != null and discount != ''"> and discount like concat('%',#{discount},'%') </if>
            <if test="fromMask != null and fromMask != ''"> and from_mask like concat('%',#{fromMask},'%') </if>
            <if test="giftType != null and giftType != ''"> and gift_type like concat('%',#{giftType},'%') </if>
            <if test="goodProp1 != null and goodProp1 != ''"> and good_prop1 like concat('%',#{goodProp1},'%') </if>
            <if test="goodProp2 != null and goodProp2 != ''"> and good_prop2 like concat('%',#{goodProp2},'%') </if>
            <if test="goodProp3 != null and goodProp3 != ''"> and good_prop3 like concat('%',#{goodProp3},'%') </if>
            <if test="goodProp4 != null and goodProp4 != ''"> and good_prop4 like concat('%',#{goodProp4},'%') </if>
            <if test="goodProp5 != null and goodProp5 != ''"> and good_prop5 like concat('%',#{goodProp5},'%') </if>
            <if test="goodProp6 != null and goodProp6 != ''"> and good_prop6 like concat('%',#{goodProp6},'%') </if>
            <if test="goodsAmount != null and goodsAmount != ''"> and goods_amount like concat('%',#{goodsAmount},'%') </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count like concat('%',#{goodsCount},'%') </if>
            <if test="goodsId != null and goodsId != ''"> and goods_id like concat('%',#{goodsId},'%') </if>
            <if test="goodsName != null and goodsName != ''"> and goods_name like concat('%',#{goodsName},'%') </if>
            <if test="goodsNo != null and goodsNo != ''"> and goods_no like concat('%',#{goodsNo},'%') </if>
            <if test="goodsType != null and goodsType != ''"> and goods_type like concat('%',#{goodsType},'%') </if>
            <if test="isPackage != null and isPackage != ''"> and is_package like concat('%',#{isPackage},'%') </if>
            <if test="marketPrice != null and marketPrice != ''"> and market_price like concat('%',#{marketPrice},'%') </if>
            <if test="modifiedDate != null and modifiedDate != ''"> and modified_date like concat('%',#{modifiedDate},'%') </if>
            <if test="paid != null and paid != ''"> and paid like concat('%',#{paid},'%') </if>
            <if test="platformId != null and platformId != ''"> and platform_id like concat('%',#{platformId},'%') </if>
            <if test="prop1 != null and prop1 != ''"> and prop1 like concat('%',#{prop1},'%') </if>
            <if test="prop2 != null and prop2 != ''"> and prop2 like concat('%',#{prop2},'%') </if>
            <if test="prop3 != null and prop3 != ''"> and prop3 like concat('%',#{prop3},'%') </if>
            <if test="prop4 != null and prop4 != ''"> and prop4 like concat('%',#{prop4},'%') </if>
            <if test="prop5 != null and prop5 != ''"> and prop5 like concat('%',#{prop5},'%') </if>
            <if test="prop6 != null and prop6 != ''"> and prop6 like concat('%',#{prop6},'%') </if>
            <if test="recId != null and recId != ''"> and rec_id like concat('%',#{recId},'%') </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status like concat('%',#{refundStatus},'%') </if>
            <if test="remark != null and remark != ''"> and remark like concat('%',#{remark},'%') </if>
            <if test="saleOrderId != null and saleOrderId != ''"> and sale_order_id like concat('%',#{saleOrderId},'%') </if>
            <if test="sellPrice != null and sellPrice != ''"> and sell_price like concat('%',#{sellPrice},'%') </if>
            <if test="shareAmount != null and shareAmount != ''"> and share_amount like concat('%',#{shareAmount},'%') </if>
            <if test="sharePostAmount != null and sharePostAmount != ''"> and share_post_amount like concat('%',#{sharePostAmount},'%') </if>
            <if test="sharePrice != null and sharePrice != ''"> and share_price like concat('%',#{sharePrice},'%') </if>
            <if test="specCode != null and specCode != ''"> and spec_code like concat('%',#{specCode},'%') </if>
            <if test="specId != null and specId != ''"> and spec_id like concat('%',#{specId},'%') </if>
            <if test="specName != null and specName != ''"> and spec_name like concat('%',#{specName},'%') </if>
            <if test="specNo != null and specNo != ''"> and spec_no like concat('%',#{specNo},'%') </if>
            <if test="srcOid != null and srcOid != ''"> and src_oid like concat('%',#{srcOid},'%') </if>
            <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> and src_order_detail_id like concat('%',#{srcOrderDetailId},'%') </if>
            <if test="srcTid != null and srcTid != ''"> and src_tid like concat('%',#{srcTid},'%') </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id like concat('%',#{stockoutId},'%') </if>
            <if test="suiteNo != null and suiteNo != ''"> and suite_no like concat('%',#{suiteNo},'%') </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate like concat('%',#{taxRate},'%') </if>
            <if test="totalAmount != null and totalAmount != ''"> and total_amount like concat('%',#{totalAmount},'%') </if>
            <if test="weight != null and weight != ''"> and weight like concat('%',#{weight},'%') </if>
            <if test="id != null"> and id like concat('%',#{id},'%') </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString() "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="BusidataTocsalesDetailentity_list_or" resultMap="get-BusidataTocsalesDetailEntity-result" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity">
    select
    <include refid="BusidataTocsalesDetailEntity_Base_Column_List" />
    from busidata_tocsales_detail
    <trim prefix="where" prefixOverrides="and"> 
         <if test="barcode != null and barcode != ''"> or barcode = #{barcode} </if>
             <if test="brandName != null and brandName != ''"> or brand_name = #{brandName} </if>
             <if test="brandNo != null and brandNo != ''"> or brand_no = #{brandNo} </if>
             <if test="costPrice != null and costPrice != ''"> or cost_price = #{costPrice} </if>
             <if test="createdDate != null and createdDate != ''"> or created_date = #{createdDate} </if>
             <if test="discount != null and discount != ''"> or discount = #{discount} </if>
             <if test="fromMask != null and fromMask != ''"> or from_mask = #{fromMask} </if>
             <if test="giftType != null and giftType != ''"> or gift_type = #{giftType} </if>
             <if test="goodProp1 != null and goodProp1 != ''"> or good_prop1 = #{goodProp1} </if>
             <if test="goodProp2 != null and goodProp2 != ''"> or good_prop2 = #{goodProp2} </if>
             <if test="goodProp3 != null and goodProp3 != ''"> or good_prop3 = #{goodProp3} </if>
             <if test="goodProp4 != null and goodProp4 != ''"> or good_prop4 = #{goodProp4} </if>
             <if test="goodProp5 != null and goodProp5 != ''"> or good_prop5 = #{goodProp5} </if>
             <if test="goodProp6 != null and goodProp6 != ''"> or good_prop6 = #{goodProp6} </if>
             <if test="goodsAmount != null and goodsAmount != ''"> or goods_amount = #{goodsAmount} </if>
             <if test="goodsCount != null and goodsCount != ''"> or goods_count = #{goodsCount} </if>
             <if test="goodsId != null and goodsId != ''"> or goods_id = #{goodsId} </if>
             <if test="goodsName != null and goodsName != ''"> or goods_name = #{goodsName} </if>
             <if test="goodsNo != null and goodsNo != ''"> or goods_no = #{goodsNo} </if>
             <if test="goodsType != null and goodsType != ''"> or goods_type = #{goodsType} </if>
             <if test="isPackage != null and isPackage != ''"> or is_package = #{isPackage} </if>
             <if test="marketPrice != null and marketPrice != ''"> or market_price = #{marketPrice} </if>
             <if test="modifiedDate != null and modifiedDate != ''"> or modified_date = #{modifiedDate} </if>
             <if test="paid != null and paid != ''"> or paid = #{paid} </if>
             <if test="platformId != null and platformId != ''"> or platform_id = #{platformId} </if>
             <if test="prop1 != null and prop1 != ''"> or prop1 = #{prop1} </if>
             <if test="prop2 != null and prop2 != ''"> or prop2 = #{prop2} </if>
             <if test="prop3 != null and prop3 != ''"> or prop3 = #{prop3} </if>
             <if test="prop4 != null and prop4 != ''"> or prop4 = #{prop4} </if>
             <if test="prop5 != null and prop5 != ''"> or prop5 = #{prop5} </if>
             <if test="prop6 != null and prop6 != ''"> or prop6 = #{prop6} </if>
             <if test="recId != null and recId != ''"> or rec_id = #{recId} </if>
             <if test="refundStatus != null and refundStatus != ''"> or refund_status = #{refundStatus} </if>
             <if test="remark != null and remark != ''"> or remark = #{remark} </if>
             <if test="saleOrderId != null and saleOrderId != ''"> or sale_order_id = #{saleOrderId} </if>
             <if test="sellPrice != null and sellPrice != ''"> or sell_price = #{sellPrice} </if>
             <if test="shareAmount != null and shareAmount != ''"> or share_amount = #{shareAmount} </if>
             <if test="sharePostAmount != null and sharePostAmount != ''"> or share_post_amount = #{sharePostAmount} </if>
             <if test="sharePrice != null and sharePrice != ''"> or share_price = #{sharePrice} </if>
             <if test="specCode != null and specCode != ''"> or spec_code = #{specCode} </if>
             <if test="specId != null and specId != ''"> or spec_id = #{specId} </if>
             <if test="specName != null and specName != ''"> or spec_name = #{specName} </if>
             <if test="specNo != null and specNo != ''"> or spec_no = #{specNo} </if>
             <if test="srcOid != null and srcOid != ''"> or src_oid = #{srcOid} </if>
             <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> or src_order_detail_id = #{srcOrderDetailId} </if>
             <if test="srcTid != null and srcTid != ''"> or src_tid = #{srcTid} </if>
             <if test="stockoutId != null and stockoutId != ''"> or stockout_id = #{stockoutId} </if>
             <if test="suiteNo != null and suiteNo != ''"> or suite_no = #{suiteNo} </if>
             <if test="taxRate != null and taxRate != ''"> or tax_rate = #{taxRate} </if>
             <if test="totalAmount != null and totalAmount != ''"> or total_amount = #{totalAmount} </if>
             <if test="weight != null and weight != ''"> or weight = #{weight} </if>
             <if test="id != null"> or id = #{id} </if>
            and sts='Y'
    </trim>
    <if test=" sort == null or sort == ''.toString()  "> order by sorts asc</if>
    <if test=" sort !='' and sort!=null and order !='' and order!=null ">order by ${sort} ${order}</if>
</select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity" keyProperty="id" useGeneratedKeys="true">
    insert into busidata_tocsales_detail(
  <trim suffix="" suffixOverrides=",">
       <if test="barcode != null and barcode != ''"> barcode , </if>
            <if test="brandName != null and brandName != ''"> brand_name , </if>
            <if test="brandNo != null and brandNo != ''"> brand_no , </if>
            <if test="costPrice != null and costPrice != ''"> cost_price , </if>
            <if test="createdDate != null and createdDate != ''"> created_date , </if>
            <if test="discount != null and discount != ''"> discount , </if>
            <if test="fromMask != null and fromMask != ''"> from_mask , </if>
            <if test="giftType != null and giftType != ''"> gift_type , </if>
            <if test="goodProp1 != null and goodProp1 != ''"> good_prop1 , </if>
            <if test="goodProp2 != null and goodProp2 != ''"> good_prop2 , </if>
            <if test="goodProp3 != null and goodProp3 != ''"> good_prop3 , </if>
            <if test="goodProp4 != null and goodProp4 != ''"> good_prop4 , </if>
            <if test="goodProp5 != null and goodProp5 != ''"> good_prop5 , </if>
            <if test="goodProp6 != null and goodProp6 != ''"> good_prop6 , </if>
            <if test="goodsAmount != null and goodsAmount != ''"> goods_amount , </if>
            <if test="goodsCount != null and goodsCount != ''"> goods_count , </if>
            <if test="goodsId != null and goodsId != ''"> goods_id , </if>
            <if test="goodsName != null and goodsName != ''"> goods_name , </if>
            <if test="goodsNo != null and goodsNo != ''"> goods_no , </if>
            <if test="goodsType != null and goodsType != ''"> goods_type , </if>
            <if test="isPackage != null and isPackage != ''"> is_package , </if>
            <if test="marketPrice != null and marketPrice != ''"> market_price , </if>
            <if test="modifiedDate != null and modifiedDate != ''"> modified_date , </if>
            <if test="paid != null and paid != ''"> paid , </if>
            <if test="platformId != null and platformId != ''"> platform_id , </if>
            <if test="prop1 != null and prop1 != ''"> prop1 , </if>
            <if test="prop2 != null and prop2 != ''"> prop2 , </if>
            <if test="prop3 != null and prop3 != ''"> prop3 , </if>
            <if test="prop4 != null and prop4 != ''"> prop4 , </if>
            <if test="prop5 != null and prop5 != ''"> prop5 , </if>
            <if test="prop6 != null and prop6 != ''"> prop6 , </if>
            <if test="recId != null and recId != ''"> rec_id , </if>
            <if test="refundStatus != null and refundStatus != ''"> refund_status , </if>
            <if test="remark != null and remark != ''"> remark , </if>
            <if test="saleOrderId != null and saleOrderId != ''"> sale_order_id , </if>
            <if test="sellPrice != null and sellPrice != ''"> sell_price , </if>
            <if test="shareAmount != null and shareAmount != ''"> share_amount , </if>
            <if test="sharePostAmount != null and sharePostAmount != ''"> share_post_amount , </if>
            <if test="sharePrice != null and sharePrice != ''"> share_price , </if>
            <if test="specCode != null and specCode != ''"> spec_code , </if>
            <if test="specId != null and specId != ''"> spec_id , </if>
            <if test="specName != null and specName != ''"> spec_name , </if>
            <if test="specNo != null and specNo != ''"> spec_no , </if>
            <if test="srcOid != null and srcOid != ''"> src_oid , </if>
            <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> src_order_detail_id , </if>
            <if test="srcTid != null and srcTid != ''"> src_tid , </if>
            <if test="stockoutId != null and stockoutId != ''"> stockout_id , </if>
            <if test="suiteNo != null and suiteNo != ''"> suite_no , </if>
            <if test="taxRate != null and taxRate != ''"> tax_rate , </if>
            <if test="totalAmount != null and totalAmount != ''"> total_amount , </if>
            <if test="weight != null and weight != ''"> weight , </if>
            <if test="id != null"> id , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="barcode != null and barcode != ''"> #{barcode} ,</if>
            <if test="brandName != null and brandName != ''"> #{brandName} ,</if>
            <if test="brandNo != null and brandNo != ''"> #{brandNo} ,</if>
            <if test="costPrice != null and costPrice != ''"> #{costPrice} ,</if>
            <if test="createdDate != null and createdDate != ''"> #{createdDate} ,</if>
            <if test="discount != null and discount != ''"> #{discount} ,</if>
            <if test="fromMask != null and fromMask != ''"> #{fromMask} ,</if>
            <if test="giftType != null and giftType != ''"> #{giftType} ,</if>
            <if test="goodProp1 != null and goodProp1 != ''"> #{goodProp1} ,</if>
            <if test="goodProp2 != null and goodProp2 != ''"> #{goodProp2} ,</if>
            <if test="goodProp3 != null and goodProp3 != ''"> #{goodProp3} ,</if>
            <if test="goodProp4 != null and goodProp4 != ''"> #{goodProp4} ,</if>
            <if test="goodProp5 != null and goodProp5 != ''"> #{goodProp5} ,</if>
            <if test="goodProp6 != null and goodProp6 != ''"> #{goodProp6} ,</if>
            <if test="goodsAmount != null and goodsAmount != ''"> #{goodsAmount} ,</if>
            <if test="goodsCount != null and goodsCount != ''"> #{goodsCount} ,</if>
            <if test="goodsId != null and goodsId != ''"> #{goodsId} ,</if>
            <if test="goodsName != null and goodsName != ''"> #{goodsName} ,</if>
            <if test="goodsNo != null and goodsNo != ''"> #{goodsNo} ,</if>
            <if test="goodsType != null and goodsType != ''"> #{goodsType} ,</if>
            <if test="isPackage != null and isPackage != ''"> #{isPackage} ,</if>
            <if test="marketPrice != null and marketPrice != ''"> #{marketPrice} ,</if>
            <if test="modifiedDate != null and modifiedDate != ''"> #{modifiedDate} ,</if>
            <if test="paid != null and paid != ''"> #{paid} ,</if>
            <if test="platformId != null and platformId != ''"> #{platformId} ,</if>
            <if test="prop1 != null and prop1 != ''"> #{prop1} ,</if>
            <if test="prop2 != null and prop2 != ''"> #{prop2} ,</if>
            <if test="prop3 != null and prop3 != ''"> #{prop3} ,</if>
            <if test="prop4 != null and prop4 != ''"> #{prop4} ,</if>
            <if test="prop5 != null and prop5 != ''"> #{prop5} ,</if>
            <if test="prop6 != null and prop6 != ''"> #{prop6} ,</if>
            <if test="recId != null and recId != ''"> #{recId} ,</if>
            <if test="refundStatus != null and refundStatus != ''"> #{refundStatus} ,</if>
            <if test="remark != null and remark != ''"> #{remark} ,</if>
            <if test="saleOrderId != null and saleOrderId != ''"> #{saleOrderId} ,</if>
            <if test="sellPrice != null and sellPrice != ''"> #{sellPrice} ,</if>
            <if test="shareAmount != null and shareAmount != ''"> #{shareAmount} ,</if>
            <if test="sharePostAmount != null and sharePostAmount != ''"> #{sharePostAmount} ,</if>
            <if test="sharePrice != null and sharePrice != ''"> #{sharePrice} ,</if>
            <if test="specCode != null and specCode != ''"> #{specCode} ,</if>
            <if test="specId != null and specId != ''"> #{specId} ,</if>
            <if test="specName != null and specName != ''"> #{specName} ,</if>
            <if test="specNo != null and specNo != ''"> #{specNo} ,</if>
            <if test="srcOid != null and srcOid != ''"> #{srcOid} ,</if>
            <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> #{srcOrderDetailId} ,</if>
            <if test="srcTid != null and srcTid != ''"> #{srcTid} ,</if>
            <if test="stockoutId != null and stockoutId != ''"> #{stockoutId} ,</if>
            <if test="suiteNo != null and suiteNo != ''"> #{suiteNo} ,</if>
            <if test="taxRate != null and taxRate != ''"> #{taxRate} ,</if>
            <if test="totalAmount != null and totalAmount != ''"> #{totalAmount} ,</if>
            <if test="weight != null and weight != ''"> #{weight} ,</if>
            <if test="id != null"> #{id} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from busidata_tocsales_detail a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
  insert IGNORE into busidata_tocsales_detail(barcode, brand_name, brand_no, cost_price, created_date, discount, from_mask, gift_type, good_prop1, good_prop2, good_prop3, good_prop4, good_prop5, good_prop6, goods_amount, goods_count, goods_id, goods_name, goods_no, goods_type, is_package, market_price, modified_date, paid, platform_id, prop1, prop2, prop3, prop4, prop5, prop6, rec_id, refund_status, remark, sale_order_id, sell_price, share_amount, share_post_amount, share_price, spec_code, spec_id, spec_name, spec_no, src_oid, src_order_detail_id, src_tid, stockout_id, suite_no, tax_rate, total_amount, weight)
    values
    <foreach collection="list" item="entity" separator=",">
    (#{entity.barcode},#{entity.brandName},#{entity.brandNo},#{entity.costPrice},#{entity.createdDate},#{entity.discount},#{entity.fromMask},#{entity.giftType},#{entity.goodProp1},#{entity.goodProp2},#{entity.goodProp3},#{entity.goodProp4},#{entity.goodProp5},#{entity.goodProp6},#{entity.goodsAmount},#{entity.goodsCount},#{entity.goodsId},#{entity.goodsName},#{entity.goodsNo},#{entity.goodsType},#{entity.isPackage},#{entity.marketPrice},#{entity.modifiedDate},#{entity.paid},#{entity.platformId},#{entity.prop1},#{entity.prop2},#{entity.prop3},#{entity.prop4},#{entity.prop5},#{entity.prop6},#{entity.recId},#{entity.refundStatus},#{entity.remark},#{entity.saleOrderId},#{entity.sellPrice},#{entity.shareAmount},#{entity.sharePostAmount},#{entity.sharePrice},#{entity.specCode},#{entity.specId},#{entity.specName},#{entity.specNo},#{entity.srcOid},#{entity.srcOrderDetailId},#{entity.srcTid},#{entity.stockoutId},#{entity.suiteNo},#{entity.taxRate},#{entity.totalAmount},#{entity.weight})
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
    insert into busidata_tocsales_detail(barcode, brand_name, brand_no, cost_price, created_date, discount, from_mask, gift_type, good_prop1, good_prop2, good_prop3, good_prop4, good_prop5, good_prop6, goods_amount, goods_count, goods_id, goods_name, goods_no, goods_type, is_package, market_price, modified_date, paid, platform_id, prop1, prop2, prop3, prop4, prop5, prop6, rec_id, refund_status, remark, sale_order_id, sell_price, share_amount, share_post_amount, share_price, spec_code, spec_id, spec_name, spec_no, src_oid, src_order_detail_id, src_tid, stockout_id, suite_no, tax_rate, total_amount, weight)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.barcode},#{entity.brandName},#{entity.brandNo},#{entity.costPrice},#{entity.createdDate},#{entity.discount},#{entity.fromMask},#{entity.giftType},#{entity.goodProp1},#{entity.goodProp2},#{entity.goodProp3},#{entity.goodProp4},#{entity.goodProp5},#{entity.goodProp6},#{entity.goodsAmount},#{entity.goodsCount},#{entity.goodsId},#{entity.goodsName},#{entity.goodsNo},#{entity.goodsType},#{entity.isPackage},#{entity.marketPrice},#{entity.modifiedDate},#{entity.paid},#{entity.platformId},#{entity.prop1},#{entity.prop2},#{entity.prop3},#{entity.prop4},#{entity.prop5},#{entity.prop6},#{entity.recId},#{entity.refundStatus},#{entity.remark},#{entity.saleOrderId},#{entity.sellPrice},#{entity.shareAmount},#{entity.sharePostAmount},#{entity.sharePrice},#{entity.specCode},#{entity.specId},#{entity.specName},#{entity.specNo},#{entity.srcOid},#{entity.srcOrderDetailId},#{entity.srcTid},#{entity.stockoutId},#{entity.suiteNo},#{entity.taxRate},#{entity.totalAmount},#{entity.weight})
    </foreach>
    on duplicate key update
    barcode = values(barcode),
    brand_name = values(brand_name),
    brand_no = values(brand_no),
    cost_price = values(cost_price),
    created_date = values(created_date),
    discount = values(discount),
    from_mask = values(from_mask),
    gift_type = values(gift_type),
    good_prop1 = values(good_prop1),
    good_prop2 = values(good_prop2),
    good_prop3 = values(good_prop3),
    good_prop4 = values(good_prop4),
    good_prop5 = values(good_prop5),
    good_prop6 = values(good_prop6),
    goods_amount = values(goods_amount),
    goods_count = values(goods_count),
    goods_id = values(goods_id),
    goods_name = values(goods_name),
    goods_no = values(goods_no),
    goods_type = values(goods_type),
    is_package = values(is_package),
    market_price = values(market_price),
    modified_date = values(modified_date),
    paid = values(paid),
    platform_id = values(platform_id),
    prop1 = values(prop1),
    prop2 = values(prop2),
    prop3 = values(prop3),
    prop4 = values(prop4),
    prop5 = values(prop5),
    prop6 = values(prop6),
    rec_id = values(rec_id),
    refund_status = values(refund_status),
    remark = values(remark),
    sale_order_id = values(sale_order_id),
    sell_price = values(sell_price),
    share_amount = values(share_amount),
    share_post_amount = values(share_post_amount),
    share_price = values(share_price),
    spec_code = values(spec_code),
    spec_id = values(spec_id),
    spec_name = values(spec_name),
    spec_no = values(spec_no),
    src_oid = values(src_oid),
    src_order_detail_id = values(src_order_detail_id),
    src_tid = values(src_tid),
    stockout_id = values(stockout_id),
    suite_no = values(suite_no),
    tax_rate = values(tax_rate),
    total_amount = values(total_amount),
    weight = values(weight)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity" >
update busidata_tocsales_detail  set
<trim suffix="" suffixOverrides=",">
  <if test="barcode != null and barcode != ''"> barcode = #{barcode},</if>
  <if test="brandName != null and brandName != ''"> brand_name = #{brandName},</if>
  <if test="brandNo != null and brandNo != ''"> brand_no = #{brandNo},</if>
  <if test="costPrice != null and costPrice != ''"> cost_price = #{costPrice},</if>
  <if test="createdDate != null and createdDate != ''"> created_date = #{createdDate},</if>
  <if test="discount != null and discount != ''"> discount = #{discount},</if>
  <if test="fromMask != null and fromMask != ''"> from_mask = #{fromMask},</if>
  <if test="giftType != null and giftType != ''"> gift_type = #{giftType},</if>
  <if test="goodProp1 != null and goodProp1 != ''"> good_prop1 = #{goodProp1},</if>
  <if test="goodProp2 != null and goodProp2 != ''"> good_prop2 = #{goodProp2},</if>
  <if test="goodProp3 != null and goodProp3 != ''"> good_prop3 = #{goodProp3},</if>
  <if test="goodProp4 != null and goodProp4 != ''"> good_prop4 = #{goodProp4},</if>
  <if test="goodProp5 != null and goodProp5 != ''"> good_prop5 = #{goodProp5},</if>
  <if test="goodProp6 != null and goodProp6 != ''"> good_prop6 = #{goodProp6},</if>
  <if test="goodsAmount != null and goodsAmount != ''"> goods_amount = #{goodsAmount},</if>
  <if test="goodsCount != null and goodsCount != ''"> goods_count = #{goodsCount},</if>
  <if test="goodsId != null and goodsId != ''"> goods_id = #{goodsId},</if>
  <if test="goodsName != null and goodsName != ''"> goods_name = #{goodsName},</if>
  <if test="goodsNo != null and goodsNo != ''"> goods_no = #{goodsNo},</if>
  <if test="goodsType != null and goodsType != ''"> goods_type = #{goodsType},</if>
  <if test="isPackage != null and isPackage != ''"> is_package = #{isPackage},</if>
  <if test="marketPrice != null and marketPrice != ''"> market_price = #{marketPrice},</if>
  <if test="modifiedDate != null and modifiedDate != ''"> modified_date = #{modifiedDate},</if>
  <if test="paid != null and paid != ''"> paid = #{paid},</if>
  <if test="platformId != null and platformId != ''"> platform_id = #{platformId},</if>
  <if test="prop1 != null and prop1 != ''"> prop1 = #{prop1},</if>
  <if test="prop2 != null and prop2 != ''"> prop2 = #{prop2},</if>
  <if test="prop3 != null and prop3 != ''"> prop3 = #{prop3},</if>
  <if test="prop4 != null and prop4 != ''"> prop4 = #{prop4},</if>
  <if test="prop5 != null and prop5 != ''"> prop5 = #{prop5},</if>
  <if test="prop6 != null and prop6 != ''"> prop6 = #{prop6},</if>
  <if test="recId != null and recId != ''"> rec_id = #{recId},</if>
  <if test="refundStatus != null and refundStatus != ''"> refund_status = #{refundStatus},</if>
  <if test="remark != null and remark != ''"> remark = #{remark},</if>
  <if test="saleOrderId != null and saleOrderId != ''"> sale_order_id = #{saleOrderId},</if>
  <if test="sellPrice != null and sellPrice != ''"> sell_price = #{sellPrice},</if>
  <if test="shareAmount != null and shareAmount != ''"> share_amount = #{shareAmount},</if>
  <if test="sharePostAmount != null and sharePostAmount != ''"> share_post_amount = #{sharePostAmount},</if>
  <if test="sharePrice != null and sharePrice != ''"> share_price = #{sharePrice},</if>
  <if test="specCode != null and specCode != ''"> spec_code = #{specCode},</if>
  <if test="specId != null and specId != ''"> spec_id = #{specId},</if>
  <if test="specName != null and specName != ''"> spec_name = #{specName},</if>
  <if test="specNo != null and specNo != ''"> spec_no = #{specNo},</if>
  <if test="srcOid != null and srcOid != ''"> src_oid = #{srcOid},</if>
  <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> src_order_detail_id = #{srcOrderDetailId},</if>
  <if test="srcTid != null and srcTid != ''"> src_tid = #{srcTid},</if>
  <if test="stockoutId != null and stockoutId != ''"> stockout_id = #{stockoutId},</if>
  <if test="suiteNo != null and suiteNo != ''"> suite_no = #{suiteNo},</if>
  <if test="taxRate != null and taxRate != ''"> tax_rate = #{taxRate},</if>
  <if test="totalAmount != null and totalAmount != ''"> total_amount = #{totalAmount},</if>
  <if test="weight != null and weight != ''"> weight = #{weight},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity" >
update busidata_tocsales_detail  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where id = #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.plugin.lets.entity.BusidataTocsalesDetailEntity" >
update busidata_tocsales_detail  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="barcode != null and barcode != ''"> and barcode = #{barcode} </if>
            <if test="brandName != null and brandName != ''"> and brand_name = #{brandName} </if>
            <if test="brandNo != null and brandNo != ''"> and brand_no = #{brandNo} </if>
            <if test="costPrice != null and costPrice != ''"> and cost_price = #{costPrice} </if>
            <if test="createdDate != null and createdDate != ''"> and created_date = #{createdDate} </if>
            <if test="discount != null and discount != ''"> and discount = #{discount} </if>
            <if test="fromMask != null and fromMask != ''"> and from_mask = #{fromMask} </if>
            <if test="giftType != null and giftType != ''"> and gift_type = #{giftType} </if>
            <if test="goodProp1 != null and goodProp1 != ''"> and good_prop1 = #{goodProp1} </if>
            <if test="goodProp2 != null and goodProp2 != ''"> and good_prop2 = #{goodProp2} </if>
            <if test="goodProp3 != null and goodProp3 != ''"> and good_prop3 = #{goodProp3} </if>
            <if test="goodProp4 != null and goodProp4 != ''"> and good_prop4 = #{goodProp4} </if>
            <if test="goodProp5 != null and goodProp5 != ''"> and good_prop5 = #{goodProp5} </if>
            <if test="goodProp6 != null and goodProp6 != ''"> and good_prop6 = #{goodProp6} </if>
            <if test="goodsAmount != null and goodsAmount != ''"> and goods_amount = #{goodsAmount} </if>
            <if test="goodsCount != null and goodsCount != ''"> and goods_count = #{goodsCount} </if>
            <if test="goodsId != null and goodsId != ''"> and goods_id = #{goodsId} </if>
            <if test="goodsName != null and goodsName != ''"> and goods_name = #{goodsName} </if>
            <if test="goodsNo != null and goodsNo != ''"> and goods_no = #{goodsNo} </if>
            <if test="goodsType != null and goodsType != ''"> and goods_type = #{goodsType} </if>
            <if test="isPackage != null and isPackage != ''"> and is_package = #{isPackage} </if>
            <if test="marketPrice != null and marketPrice != ''"> and market_price = #{marketPrice} </if>
            <if test="modifiedDate != null and modifiedDate != ''"> and modified_date = #{modifiedDate} </if>
            <if test="paid != null and paid != ''"> and paid = #{paid} </if>
            <if test="platformId != null and platformId != ''"> and platform_id = #{platformId} </if>
            <if test="prop1 != null and prop1 != ''"> and prop1 = #{prop1} </if>
            <if test="prop2 != null and prop2 != ''"> and prop2 = #{prop2} </if>
            <if test="prop3 != null and prop3 != ''"> and prop3 = #{prop3} </if>
            <if test="prop4 != null and prop4 != ''"> and prop4 = #{prop4} </if>
            <if test="prop5 != null and prop5 != ''"> and prop5 = #{prop5} </if>
            <if test="prop6 != null and prop6 != ''"> and prop6 = #{prop6} </if>
            <if test="recId != null and recId != ''"> and rec_id = #{recId} </if>
            <if test="refundStatus != null and refundStatus != ''"> and refund_status = #{refundStatus} </if>
            <if test="remark != null and remark != ''"> and remark = #{remark} </if>
            <if test="saleOrderId != null and saleOrderId != ''"> and sale_order_id = #{saleOrderId} </if>
            <if test="sellPrice != null and sellPrice != ''"> and sell_price = #{sellPrice} </if>
            <if test="shareAmount != null and shareAmount != ''"> and share_amount = #{shareAmount} </if>
            <if test="sharePostAmount != null and sharePostAmount != ''"> and share_post_amount = #{sharePostAmount} </if>
            <if test="sharePrice != null and sharePrice != ''"> and share_price = #{sharePrice} </if>
            <if test="specCode != null and specCode != ''"> and spec_code = #{specCode} </if>
            <if test="specId != null and specId != ''"> and spec_id = #{specId} </if>
            <if test="specName != null and specName != ''"> and spec_name = #{specName} </if>
            <if test="specNo != null and specNo != ''"> and spec_no = #{specNo} </if>
            <if test="srcOid != null and srcOid != ''"> and src_oid = #{srcOid} </if>
            <if test="srcOrderDetailId != null and srcOrderDetailId != ''"> and src_order_detail_id = #{srcOrderDetailId} </if>
            <if test="srcTid != null and srcTid != ''"> and src_tid = #{srcTid} </if>
            <if test="stockoutId != null and stockoutId != ''"> and stockout_id = #{stockoutId} </if>
            <if test="suiteNo != null and suiteNo != ''"> and suite_no = #{suiteNo} </if>
            <if test="taxRate != null and taxRate != ''"> and tax_rate = #{taxRate} </if>
            <if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount} </if>
            <if test="weight != null and weight != ''"> and weight = #{weight} </if>
            <if test="id != null"> and id = #{id} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from busidata_tocsales_detail where id = #{id}
</delete>

</mapper>

