<?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.ofs.dao.impl.TocofsReturngoodsDaoImpl">

    <resultMap id="get-TocofsReturngoodsEntity-result" type="com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
       <result property="id" column="id" jdbcType="VARCHAR"/>
           <result property="clientcode" column="clientCode" jdbcType="VARCHAR"/>
           <result property="companycode" column="companyCode" jdbcType="VARCHAR"/>
           <result property="storecode" column="storeCode" jdbcType="VARCHAR"/>
           <result property="facilitycode" column="facilityCode" jdbcType="VARCHAR"/>
           <result property="code" column="code" jdbcType="VARCHAR"/>
           <result property="internalinstructiontype" column="internalInstructionType" jdbcType="VARCHAR"/>
           <result property="bizchannel" column="bizChannel" jdbcType="VARCHAR"/>
           <result property="reforderid" column="refOrderId" jdbcType="VARCHAR"/>
           <result property="refordercode" column="refOrderCode" jdbcType="VARCHAR"/>
           <result property="refordertype" column="refOrderType" jdbcType="VARCHAR"/>
           <result property="closed" column="closed" jdbcType="VARCHAR"/>
           <result property="closedby" column="closedBy" jdbcType="VARCHAR"/>
           <result property="status" column="status" jdbcType="VARCHAR"/>
           <result property="allowoverreceive" column="allowOverReceive" jdbcType="VARCHAR"/>
           <result property="shipfromattentionto" column="shipFromAttentionTo" jdbcType="VARCHAR"/>
           <result property="shipfromaddress" column="shipFromAddress" jdbcType="VARCHAR"/>
           <result property="shipfromcountry" column="shipFromCountry" jdbcType="VARCHAR"/>
           <result property="shipfromstate" column="shipFromState" jdbcType="VARCHAR"/>
           <result property="shipfromcity" column="shipFromCity" jdbcType="VARCHAR"/>
           <result property="shipfromdistrict" column="shipFromDistrict" jdbcType="VARCHAR"/>
           <result property="shipfrompostalcode" column="shipFromPostalCode" jdbcType="VARCHAR"/>
           <result property="shipfrommobile" column="shipFromMobile" jdbcType="VARCHAR"/>
           <result property="shipfromemail" column="shipFromEmail" jdbcType="VARCHAR"/>
           <result property="totallines" column="totalLines" jdbcType="VARCHAR"/>
           <result property="totalqty" column="totalQty" jdbcType="VARCHAR"/>
           <result property="totalamount" column="totalAmount" jdbcType="VARCHAR"/>
           <result property="totalweight" column="totalWeight" jdbcType="VARCHAR"/>
           <result property="totalvolume" column="totalVolume" jdbcType="VARCHAR"/>
           <result property="totalvolumeweight" column="totalVolumeWeight" jdbcType="VARCHAR"/>
           <result property="totalfulfillamount" column="totalFulfillAmount" jdbcType="VARCHAR"/>
           <result property="totalfulfillweight" column="totalFulfillWeight" jdbcType="VARCHAR"/>
           <result property="totalfulfillvolume" column="totalFulfillVolume" jdbcType="VARCHAR"/>
           <result property="totalfulfillvolumeweight" column="totalFulfillVolumeWeight" jdbcType="VARCHAR"/>
           <result property="totalfulfillqty" column="totalFulfillQty" jdbcType="VARCHAR"/>
           <result property="totalcases" column="totalCases" jdbcType="VARCHAR"/>
           <result property="totalcontainers" column="totalContainers" jdbcType="VARCHAR"/>
           <result property="closeatqty" column="closeAtQty" jdbcType="VARCHAR"/>
           <result property="quantityum" column="quantityUM" jdbcType="VARCHAR"/>
           <result property="weightum" column="weightUM" jdbcType="VARCHAR"/>
           <result property="volumeum" column="volumeUM" jdbcType="VARCHAR"/>
           <result property="checkinfrom" column="checkInFrom" jdbcType="VARCHAR"/>
           <result property="checkinto" column="checkInTo" jdbcType="VARCHAR"/>
           <result property="closedat" column="closedAt" jdbcType="VARCHAR"/>
           <result property="sourceplatformcode" column="sourcePlatformCode" jdbcType="VARCHAR"/>
           <result property="sourceordercode" column="sourceOrderCode" jdbcType="VARCHAR"/>
           <result property="created" column="created" jdbcType="VARCHAR"/>
           <result property="createdby" column="createdBy" jdbcType="VARCHAR"/>
           <result property="lastupdated" column="lastUpdated" jdbcType="VARCHAR"/>
           <result property="lastupdatedby" column="lastUpdatedBy" jdbcType="VARCHAR"/>
           <result property="returnwaybillcode" column="returnWaybillCode" jdbcType="VARCHAR"/>
           <result property="returncarrier" column="returnCarrier" jdbcType="VARCHAR"/>
           <result property="refundedat" column="refundedAt" jdbcType="VARCHAR"/>
           <result property="refundstatus" column="refundStatus" jdbcType="VARCHAR"/>
        </resultMap>

    <!-- 查询的字段-->
    <sql id = "TocofsReturngoodsEntity_Base_Column_List">
        id
       ,clientCode 
        ,companyCode 
        ,storeCode 
        ,facilityCode 
        ,code 
        ,internalInstructionType 
        ,bizChannel 
        ,refOrderId 
        ,refOrderCode 
        ,refOrderType 
        ,closed 
        ,closedBy 
        ,status 
        ,allowOverReceive 
        ,shipFromAttentionTo 
        ,shipFromAddress 
        ,shipFromCountry 
        ,shipFromState 
        ,shipFromCity 
        ,shipFromDistrict 
        ,shipFromPostalCode 
        ,shipFromMobile 
        ,shipFromEmail 
        ,totalLines 
        ,totalQty 
        ,totalAmount 
        ,totalWeight 
        ,totalVolume 
        ,totalVolumeWeight 
        ,totalFulfillAmount 
        ,totalFulfillWeight 
        ,totalFulfillVolume 
        ,totalFulfillVolumeWeight 
        ,totalFulfillQty 
        ,totalCases 
        ,totalContainers 
        ,closeAtQty 
        ,quantityUM 
        ,weightUM 
        ,volumeUM 
        ,checkInFrom 
        ,checkInTo 
        ,closedAt 
        ,sourcePlatformCode 
        ,sourceOrderCode 
        ,created 
        ,createdBy 
        ,lastUpdated 
        ,lastUpdatedBy 
        ,returnWaybillCode 
        ,returnCarrier 
        ,refundedAt 
        ,refundStatus 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-TocofsReturngoodsEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity">
    select
    <include refid="TocofsReturngoodsEntity_Base_Column_List" />
    from tocofs_returngoods
    <trim prefix="where" prefixOverrides="and"> 
        <if test="id != null and id != ''"> and id = #{id} </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="code != null and code != ''"> and code = #{code} </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
            <if test="closed != null and closed != ''"> and closed = #{closed} </if>
            <if test="closedby != null and closedby != ''"> and closedBy = #{closedby} </if>
            <if test="status != null and status != ''"> and status = #{status} </if>
            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive = #{allowoverreceive} </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
            <if test="totallines != null and totallines != ''"> and totalLines = #{totallines} </if>
            <if test="totalqty != null and totalqty != ''"> and totalQty = #{totalqty} </if>
            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount = #{totalfulfillamount} </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
            <if test="totalcases != null and totalcases != ''"> and totalCases = #{totalcases} </if>
            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers = #{totalcontainers} </if>
            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty = #{closeatqty} </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom = #{checkinfrom} </if>
            <if test="checkinto != null and checkinto != ''"> and checkInTo = #{checkinto} </if>
            <if test="closedat != null and closedat != ''"> and closedAt = #{closedat} </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="created != null and created != ''"> and created = #{created} </if>
            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode = #{returnwaybillcode} </if>
            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier = #{returncarrier} </if>
            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
            <if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </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.ofs.entity.TocofsReturngoodsEntity">
        select  count(1)   from tocofs_returngoods
    <trim prefix="where" prefixOverrides="and"> 
        <if test="id != null and id != ''"> and id = #{id} </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="code != null and code != ''"> and code = #{code} </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
            <if test="closed != null and closed != ''"> and closed = #{closed} </if>
            <if test="closedby != null and closedby != ''"> and closedBy = #{closedby} </if>
            <if test="status != null and status != ''"> and status = #{status} </if>
            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive = #{allowoverreceive} </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
            <if test="totallines != null and totallines != ''"> and totalLines = #{totallines} </if>
            <if test="totalqty != null and totalqty != ''"> and totalQty = #{totalqty} </if>
            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount = #{totalfulfillamount} </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
            <if test="totalcases != null and totalcases != ''"> and totalCases = #{totalcases} </if>
            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers = #{totalcontainers} </if>
            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty = #{closeatqty} </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom = #{checkinfrom} </if>
            <if test="checkinto != null and checkinto != ''"> and checkInTo = #{checkinto} </if>
            <if test="closedat != null and closedat != ''"> and closedAt = #{closedat} </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="created != null and created != ''"> and created = #{created} </if>
            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode = #{returnwaybillcode} </if>
            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier = #{returncarrier} </if>
            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
            <if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </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-TocofsReturngoodsEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity">
    select
    <include refid="TocofsReturngoodsEntity_Base_Column_List" />
    from tocofs_returngoods
    <trim prefix="where" prefixOverrides="and"> 
        <if test="id != null and id != ''"> and id like concat('%',#{id},'%') </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode like concat('%',#{clientcode},'%') </if>
            <if test="companycode != null and companycode != ''"> and companyCode like concat('%',#{companycode},'%') </if>
            <if test="storecode != null and storecode != ''"> and storeCode like concat('%',#{storecode},'%') </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode like concat('%',#{facilitycode},'%') </if>
            <if test="code != null and code != ''"> and code like concat('%',#{code},'%') </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType like concat('%',#{internalinstructiontype},'%') </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel like concat('%',#{bizchannel},'%') </if>
            <if test="reforderid != null and reforderid != ''"> and refOrderId like concat('%',#{reforderid},'%') </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode like concat('%',#{refordercode},'%') </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType like concat('%',#{refordertype},'%') </if>
            <if test="closed != null and closed != ''"> and closed like concat('%',#{closed},'%') </if>
            <if test="closedby != null and closedby != ''"> and closedBy like concat('%',#{closedby},'%') </if>
            <if test="status != null and status != ''"> and status like concat('%',#{status},'%') </if>
            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive like concat('%',#{allowoverreceive},'%') </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo like concat('%',#{shipfromattentionto},'%') </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress like concat('%',#{shipfromaddress},'%') </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry like concat('%',#{shipfromcountry},'%') </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState like concat('%',#{shipfromstate},'%') </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity like concat('%',#{shipfromcity},'%') </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict like concat('%',#{shipfromdistrict},'%') </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode like concat('%',#{shipfrompostalcode},'%') </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile like concat('%',#{shipfrommobile},'%') </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail like concat('%',#{shipfromemail},'%') </if>
            <if test="totallines != null and totallines != ''"> and totalLines like concat('%',#{totallines},'%') </if>
            <if test="totalqty != null and totalqty != ''"> and totalQty like concat('%',#{totalqty},'%') </if>
            <if test="totalamount != null and totalamount != ''"> and totalAmount like concat('%',#{totalamount},'%') </if>
            <if test="totalweight != null and totalweight != ''"> and totalWeight like concat('%',#{totalweight},'%') </if>
            <if test="totalvolume != null and totalvolume != ''"> and totalVolume like concat('%',#{totalvolume},'%') </if>
            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight like concat('%',#{totalvolumeweight},'%') </if>
            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount like concat('%',#{totalfulfillamount},'%') </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight like concat('%',#{totalfulfillweight},'%') </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume like concat('%',#{totalfulfillvolume},'%') </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight like concat('%',#{totalfulfillvolumeweight},'%') </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty like concat('%',#{totalfulfillqty},'%') </if>
            <if test="totalcases != null and totalcases != ''"> and totalCases like concat('%',#{totalcases},'%') </if>
            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers like concat('%',#{totalcontainers},'%') </if>
            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty like concat('%',#{closeatqty},'%') </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM like concat('%',#{quantityum},'%') </if>
            <if test="weightum != null and weightum != ''"> and weightUM like concat('%',#{weightum},'%') </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM like concat('%',#{volumeum},'%') </if>
            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom like concat('%',#{checkinfrom},'%') </if>
            <if test="checkinto != null and checkinto != ''"> and checkInTo like concat('%',#{checkinto},'%') </if>
            <if test="closedat != null and closedat != ''"> and closedAt like concat('%',#{closedat},'%') </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode like concat('%',#{sourceplatformcode},'%') </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode like concat('%',#{sourceordercode},'%') </if>
            <if test="created != null and created != ''"> and created like concat('%',#{created},'%') </if>
            <if test="createdby != null and createdby != ''"> and createdBy like concat('%',#{createdby},'%') </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated like concat('%',#{lastupdated},'%') </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy like concat('%',#{lastupdatedby},'%') </if>
            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode like concat('%',#{returnwaybillcode},'%') </if>
            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier like concat('%',#{returncarrier},'%') </if>
            <if test="refundedat != null and refundedat != ''"> and refundedAt like concat('%',#{refundedat},'%') </if>
            <if test="refundstatus != null and refundstatus != ''"> and refundStatus like concat('%',#{refundstatus},'%') </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="TocofsReturngoodsentity_list_or" resultMap="get-TocofsReturngoodsEntity-result" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity">
    select
    <include refid="TocofsReturngoodsEntity_Base_Column_List" />
    from tocofs_returngoods
    <trim prefix="where" prefixOverrides="and"> 
         <if test="id != null and id != ''"> or id = #{id} </if>
             <if test="clientcode != null and clientcode != ''"> or clientCode = #{clientcode} </if>
             <if test="companycode != null and companycode != ''"> or companyCode = #{companycode} </if>
             <if test="storecode != null and storecode != ''"> or storeCode = #{storecode} </if>
             <if test="facilitycode != null and facilitycode != ''"> or facilityCode = #{facilitycode} </if>
             <if test="code != null and code != ''"> or code = #{code} </if>
             <if test="internalinstructiontype != null and internalinstructiontype != ''"> or internalInstructionType = #{internalinstructiontype} </if>
             <if test="bizchannel != null and bizchannel != ''"> or bizChannel = #{bizchannel} </if>
             <if test="reforderid != null and reforderid != ''"> or refOrderId = #{reforderid} </if>
             <if test="refordercode != null and refordercode != ''"> or refOrderCode = #{refordercode} </if>
             <if test="refordertype != null and refordertype != ''"> or refOrderType = #{refordertype} </if>
             <if test="closed != null and closed != ''"> or closed = #{closed} </if>
             <if test="closedby != null and closedby != ''"> or closedBy = #{closedby} </if>
             <if test="status != null and status != ''"> or status = #{status} </if>
             <if test="allowoverreceive != null and allowoverreceive != ''"> or allowOverReceive = #{allowoverreceive} </if>
             <if test="shipfromattentionto != null and shipfromattentionto != ''"> or shipFromAttentionTo = #{shipfromattentionto} </if>
             <if test="shipfromaddress != null and shipfromaddress != ''"> or shipFromAddress = #{shipfromaddress} </if>
             <if test="shipfromcountry != null and shipfromcountry != ''"> or shipFromCountry = #{shipfromcountry} </if>
             <if test="shipfromstate != null and shipfromstate != ''"> or shipFromState = #{shipfromstate} </if>
             <if test="shipfromcity != null and shipfromcity != ''"> or shipFromCity = #{shipfromcity} </if>
             <if test="shipfromdistrict != null and shipfromdistrict != ''"> or shipFromDistrict = #{shipfromdistrict} </if>
             <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> or shipFromPostalCode = #{shipfrompostalcode} </if>
             <if test="shipfrommobile != null and shipfrommobile != ''"> or shipFromMobile = #{shipfrommobile} </if>
             <if test="shipfromemail != null and shipfromemail != ''"> or shipFromEmail = #{shipfromemail} </if>
             <if test="totallines != null and totallines != ''"> or totalLines = #{totallines} </if>
             <if test="totalqty != null and totalqty != ''"> or totalQty = #{totalqty} </if>
             <if test="totalamount != null and totalamount != ''"> or totalAmount = #{totalamount} </if>
             <if test="totalweight != null and totalweight != ''"> or totalWeight = #{totalweight} </if>
             <if test="totalvolume != null and totalvolume != ''"> or totalVolume = #{totalvolume} </if>
             <if test="totalvolumeweight != null and totalvolumeweight != ''"> or totalVolumeWeight = #{totalvolumeweight} </if>
             <if test="totalfulfillamount != null and totalfulfillamount != ''"> or totalFulfillAmount = #{totalfulfillamount} </if>
             <if test="totalfulfillweight != null and totalfulfillweight != ''"> or totalFulfillWeight = #{totalfulfillweight} </if>
             <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> or totalFulfillVolume = #{totalfulfillvolume} </if>
             <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> or totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
             <if test="totalfulfillqty != null and totalfulfillqty != ''"> or totalFulfillQty = #{totalfulfillqty} </if>
             <if test="totalcases != null and totalcases != ''"> or totalCases = #{totalcases} </if>
             <if test="totalcontainers != null and totalcontainers != ''"> or totalContainers = #{totalcontainers} </if>
             <if test="closeatqty != null and closeatqty != ''"> or closeAtQty = #{closeatqty} </if>
             <if test="quantityum != null and quantityum != ''"> or quantityUM = #{quantityum} </if>
             <if test="weightum != null and weightum != ''"> or weightUM = #{weightum} </if>
             <if test="volumeum != null and volumeum != ''"> or volumeUM = #{volumeum} </if>
             <if test="checkinfrom != null and checkinfrom != ''"> or checkInFrom = #{checkinfrom} </if>
             <if test="checkinto != null and checkinto != ''"> or checkInTo = #{checkinto} </if>
             <if test="closedat != null and closedat != ''"> or closedAt = #{closedat} </if>
             <if test="sourceplatformcode != null and sourceplatformcode != ''"> or sourcePlatformCode = #{sourceplatformcode} </if>
             <if test="sourceordercode != null and sourceordercode != ''"> or sourceOrderCode = #{sourceordercode} </if>
             <if test="created != null and created != ''"> or created = #{created} </if>
             <if test="createdby != null and createdby != ''"> or createdBy = #{createdby} </if>
             <if test="lastupdated != null and lastupdated != ''"> or lastUpdated = #{lastupdated} </if>
             <if test="lastupdatedby != null and lastupdatedby != ''"> or lastUpdatedBy = #{lastupdatedby} </if>
             <if test="returnwaybillcode != null and returnwaybillcode != ''"> or returnWaybillCode = #{returnwaybillcode} </if>
             <if test="returncarrier != null and returncarrier != ''"> or returnCarrier = #{returncarrier} </if>
             <if test="refundedat != null and refundedat != ''"> or refundedAt = #{refundedat} </if>
             <if test="refundstatus != null and refundstatus != ''"> or refundStatus = #{refundstatus} </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.ofs.entity.TocofsReturngoodsEntity" keyProperty="id" useGeneratedKeys="true">
    insert into tocofs_returngoods(
  <trim suffix="" suffixOverrides=",">
       <if test="id != null and id != ''"> id , </if>
            <if test="clientcode != null and clientcode != ''"> clientCode , </if>
            <if test="companycode != null and companycode != ''"> companyCode , </if>
            <if test="storecode != null and storecode != ''"> storeCode , </if>
            <if test="facilitycode != null and facilitycode != ''"> facilityCode , </if>
            <if test="code != null and code != ''"> code , </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> internalInstructionType , </if>
            <if test="bizchannel != null and bizchannel != ''"> bizChannel , </if>
            <if test="reforderid != null and reforderid != ''"> refOrderId , </if>
            <if test="refordercode != null and refordercode != ''"> refOrderCode , </if>
            <if test="refordertype != null and refordertype != ''"> refOrderType , </if>
            <if test="closed != null and closed != ''"> closed , </if>
            <if test="closedby != null and closedby != ''"> closedBy , </if>
            <if test="status != null and status != ''"> status , </if>
            <if test="allowoverreceive != null and allowoverreceive != ''"> allowOverReceive , </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> shipFromAttentionTo , </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> shipFromAddress , </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> shipFromCountry , </if>
            <if test="shipfromstate != null and shipfromstate != ''"> shipFromState , </if>
            <if test="shipfromcity != null and shipfromcity != ''"> shipFromCity , </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> shipFromDistrict , </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> shipFromPostalCode , </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> shipFromMobile , </if>
            <if test="shipfromemail != null and shipfromemail != ''"> shipFromEmail , </if>
            <if test="totallines != null and totallines != ''"> totalLines , </if>
            <if test="totalqty != null and totalqty != ''"> totalQty , </if>
            <if test="totalamount != null and totalamount != ''"> totalAmount , </if>
            <if test="totalweight != null and totalweight != ''"> totalWeight , </if>
            <if test="totalvolume != null and totalvolume != ''"> totalVolume , </if>
            <if test="totalvolumeweight != null and totalvolumeweight != ''"> totalVolumeWeight , </if>
            <if test="totalfulfillamount != null and totalfulfillamount != ''"> totalFulfillAmount , </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> totalFulfillWeight , </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> totalFulfillVolume , </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> totalFulfillVolumeWeight , </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> totalFulfillQty , </if>
            <if test="totalcases != null and totalcases != ''"> totalCases , </if>
            <if test="totalcontainers != null and totalcontainers != ''"> totalContainers , </if>
            <if test="closeatqty != null and closeatqty != ''"> closeAtQty , </if>
            <if test="quantityum != null and quantityum != ''"> quantityUM , </if>
            <if test="weightum != null and weightum != ''"> weightUM , </if>
            <if test="volumeum != null and volumeum != ''"> volumeUM , </if>
            <if test="checkinfrom != null and checkinfrom != ''"> checkInFrom , </if>
            <if test="checkinto != null and checkinto != ''"> checkInTo , </if>
            <if test="closedat != null and closedat != ''"> closedAt , </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> sourcePlatformCode , </if>
            <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode , </if>
            <if test="created != null and created != ''"> created , </if>
            <if test="createdby != null and createdby != ''"> createdBy , </if>
            <if test="lastupdated != null and lastupdated != ''"> lastUpdated , </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy , </if>
            <if test="returnwaybillcode != null and returnwaybillcode != ''"> returnWaybillCode , </if>
            <if test="returncarrier != null and returncarrier != ''"> returnCarrier , </if>
            <if test="refundedat != null and refundedat != ''"> refundedAt , </if>
            <if test="refundstatus != null and refundstatus != ''"> refundStatus , </if>
            <if test="sorts == null ">sorts,</if>
    <if test="sts == null ">sts,</if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="id != null and id != ''"> #{id} ,</if>
            <if test="clientcode != null and clientcode != ''"> #{clientcode} ,</if>
            <if test="companycode != null and companycode != ''"> #{companycode} ,</if>
            <if test="storecode != null and storecode != ''"> #{storecode} ,</if>
            <if test="facilitycode != null and facilitycode != ''"> #{facilitycode} ,</if>
            <if test="code != null and code != ''"> #{code} ,</if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> #{internalinstructiontype} ,</if>
            <if test="bizchannel != null and bizchannel != ''"> #{bizchannel} ,</if>
            <if test="reforderid != null and reforderid != ''"> #{reforderid} ,</if>
            <if test="refordercode != null and refordercode != ''"> #{refordercode} ,</if>
            <if test="refordertype != null and refordertype != ''"> #{refordertype} ,</if>
            <if test="closed != null and closed != ''"> #{closed} ,</if>
            <if test="closedby != null and closedby != ''"> #{closedby} ,</if>
            <if test="status != null and status != ''"> #{status} ,</if>
            <if test="allowoverreceive != null and allowoverreceive != ''"> #{allowoverreceive} ,</if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> #{shipfromattentionto} ,</if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> #{shipfromaddress} ,</if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> #{shipfromcountry} ,</if>
            <if test="shipfromstate != null and shipfromstate != ''"> #{shipfromstate} ,</if>
            <if test="shipfromcity != null and shipfromcity != ''"> #{shipfromcity} ,</if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> #{shipfromdistrict} ,</if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> #{shipfrompostalcode} ,</if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> #{shipfrommobile} ,</if>
            <if test="shipfromemail != null and shipfromemail != ''"> #{shipfromemail} ,</if>
            <if test="totallines != null and totallines != ''"> #{totallines} ,</if>
            <if test="totalqty != null and totalqty != ''"> #{totalqty} ,</if>
            <if test="totalamount != null and totalamount != ''"> #{totalamount} ,</if>
            <if test="totalweight != null and totalweight != ''"> #{totalweight} ,</if>
            <if test="totalvolume != null and totalvolume != ''"> #{totalvolume} ,</if>
            <if test="totalvolumeweight != null and totalvolumeweight != ''"> #{totalvolumeweight} ,</if>
            <if test="totalfulfillamount != null and totalfulfillamount != ''"> #{totalfulfillamount} ,</if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> #{totalfulfillweight} ,</if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> #{totalfulfillvolume} ,</if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> #{totalfulfillvolumeweight} ,</if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> #{totalfulfillqty} ,</if>
            <if test="totalcases != null and totalcases != ''"> #{totalcases} ,</if>
            <if test="totalcontainers != null and totalcontainers != ''"> #{totalcontainers} ,</if>
            <if test="closeatqty != null and closeatqty != ''"> #{closeatqty} ,</if>
            <if test="quantityum != null and quantityum != ''"> #{quantityum} ,</if>
            <if test="weightum != null and weightum != ''"> #{weightum} ,</if>
            <if test="volumeum != null and volumeum != ''"> #{volumeum} ,</if>
            <if test="checkinfrom != null and checkinfrom != ''"> #{checkinfrom} ,</if>
            <if test="checkinto != null and checkinto != ''"> #{checkinto} ,</if>
            <if test="closedat != null and closedat != ''"> #{closedat} ,</if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> #{sourceplatformcode} ,</if>
            <if test="sourceordercode != null and sourceordercode != ''"> #{sourceordercode} ,</if>
            <if test="created != null and created != ''"> #{created} ,</if>
            <if test="createdby != null and createdby != ''"> #{createdby} ,</if>
            <if test="lastupdated != null and lastupdated != ''"> #{lastupdated} ,</if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> #{lastupdatedby} ,</if>
            <if test="returnwaybillcode != null and returnwaybillcode != ''"> #{returnwaybillcode} ,</if>
            <if test="returncarrier != null and returncarrier != ''"> #{returncarrier} ,</if>
            <if test="refundedat != null and refundedat != ''"> #{refundedat} ,</if>
            <if test="refundstatus != null and refundstatus != ''"> #{refundstatus} ,</if>
            <if test="sorts == null ">(select (max(IFNULL( a.sorts, 0 )) + 1) as sort from tocofs_returngoods a WHERE a.sts = 'Y' ),</if>
    <if test="sts == null ">'Y',</if>
  </trim>
  )  
</insert>

<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="id" useGeneratedKeys="true">
  insert into tocofs_returngoods(clientCode, companyCode, storeCode, facilityCode, code, internalInstructionType, bizChannel, refOrderId, refOrderCode, refOrderType, closed, closedBy, status, allowOverReceive, shipFromAttentionTo, shipFromAddress, shipFromCountry, shipFromState, shipFromCity, shipFromDistrict, shipFromPostalCode, shipFromMobile, shipFromEmail, totalLines, totalQty, totalAmount, totalWeight, totalVolume, totalVolumeWeight, totalFulfillAmount, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, totalFulfillQty, totalCases, totalContainers, closeAtQty, quantityUM, weightUM, volumeUM, checkInFrom, checkInTo, closedAt, sourcePlatformCode, sourceOrderCode, created, createdBy, lastUpdated, lastUpdatedBy, returnWaybillCode, returnCarrier, refundedAt, refundStatus,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.closed},#{entity.closedby},#{entity.status},#{entity.allowoverreceive},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromcountry},#{entity.shipfromstate},#{entity.shipfromcity},#{entity.shipfromdistrict},#{entity.shipfrompostalcode},#{entity.shipfrommobile},#{entity.shipfromemail},#{entity.totallines},#{entity.totalqty},#{entity.totalamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalfulfillamount},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.totalfulfillqty},#{entity.totalcases},#{entity.totalcontainers},#{entity.closeatqty},#{entity.quantityum},#{entity.weightum},#{entity.volumeum},#{entity.checkinfrom},#{entity.checkinto},#{entity.closedat},#{entity.sourceplatformcode},#{entity.sourceordercode},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.returnwaybillcode},#{entity.returncarrier},#{entity.refundedat},#{entity.refundstatus}, 'Y')
    </foreach>
</insert>

<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
    insert into tocofs_returngoods(id,clientCode, companyCode, storeCode, facilityCode, code, internalInstructionType, bizChannel, refOrderId, refOrderCode, refOrderType, closed, closedBy, status, allowOverReceive, shipFromAttentionTo, shipFromAddress, shipFromCountry, shipFromState, shipFromCity, shipFromDistrict, shipFromPostalCode, shipFromMobile, shipFromEmail, totalLines, totalQty, totalAmount, totalWeight, totalVolume, totalVolumeWeight, totalFulfillAmount, totalFulfillWeight, totalFulfillVolume, totalFulfillVolumeWeight, totalFulfillQty, totalCases, totalContainers, closeAtQty, quantityUM, weightUM, volumeUM, checkInFrom, checkInTo, closedAt, sourcePlatformCode, sourceOrderCode, created, createdBy, lastUpdated, lastUpdatedBy, returnWaybillCode, returnCarrier, refundedAt, refundStatus)
    values
    <foreach collection="list" item="entity" separator=",">
    (#{entity.id},#{entity.clientcode},#{entity.companycode},#{entity.storecode},#{entity.facilitycode},#{entity.code},#{entity.internalinstructiontype},#{entity.bizchannel},#{entity.reforderid},#{entity.refordercode},#{entity.refordertype},#{entity.closed},#{entity.closedby},#{entity.status},#{entity.allowoverreceive},#{entity.shipfromattentionto},#{entity.shipfromaddress},#{entity.shipfromcountry},#{entity.shipfromstate},#{entity.shipfromcity},#{entity.shipfromdistrict},#{entity.shipfrompostalcode},#{entity.shipfrommobile},#{entity.shipfromemail},#{entity.totallines},#{entity.totalqty},#{entity.totalamount},#{entity.totalweight},#{entity.totalvolume},#{entity.totalvolumeweight},#{entity.totalfulfillamount},#{entity.totalfulfillweight},#{entity.totalfulfillvolume},#{entity.totalfulfillvolumeweight},#{entity.totalfulfillqty},#{entity.totalcases},#{entity.totalcontainers},#{entity.closeatqty},#{entity.quantityum},#{entity.weightum},#{entity.volumeum},#{entity.checkinfrom},#{entity.checkinto},#{entity.closedat},#{entity.sourceplatformcode},#{entity.sourceordercode},#{entity.created},#{entity.createdby},#{entity.lastupdated},#{entity.lastupdatedby},#{entity.returnwaybillcode},#{entity.returncarrier},#{entity.refundedat},#{entity.refundstatus})
    </foreach>
    on duplicate key update
    id = values(id),
    clientCode = values(clientCode),
    companyCode = values(companyCode),
    storeCode = values(storeCode),
    facilityCode = values(facilityCode),
    code = values(code),
    internalInstructionType = values(internalInstructionType),
    bizChannel = values(bizChannel),
    refOrderId = values(refOrderId),
    refOrderCode = values(refOrderCode),
    refOrderType = values(refOrderType),
    closed = values(closed),
    closedBy = values(closedBy),
    status = values(status),
    allowOverReceive = values(allowOverReceive),
    shipFromAttentionTo = values(shipFromAttentionTo),
    shipFromAddress = values(shipFromAddress),
    shipFromCountry = values(shipFromCountry),
    shipFromState = values(shipFromState),
    shipFromCity = values(shipFromCity),
    shipFromDistrict = values(shipFromDistrict),
    shipFromPostalCode = values(shipFromPostalCode),
    shipFromMobile = values(shipFromMobile),
    shipFromEmail = values(shipFromEmail),
    totalLines = values(totalLines),
    totalQty = values(totalQty),
    totalAmount = values(totalAmount),
    totalWeight = values(totalWeight),
    totalVolume = values(totalVolume),
    totalVolumeWeight = values(totalVolumeWeight),
    totalFulfillAmount = values(totalFulfillAmount),
    totalFulfillWeight = values(totalFulfillWeight),
    totalFulfillVolume = values(totalFulfillVolume),
    totalFulfillVolumeWeight = values(totalFulfillVolumeWeight),
    totalFulfillQty = values(totalFulfillQty),
    totalCases = values(totalCases),
    totalContainers = values(totalContainers),
    closeAtQty = values(closeAtQty),
    quantityUM = values(quantityUM),
    weightUM = values(weightUM),
    volumeUM = values(volumeUM),
    checkInFrom = values(checkInFrom),
    checkInTo = values(checkInTo),
    closedAt = values(closedAt),
    sourcePlatformCode = values(sourcePlatformCode),
    sourceOrderCode = values(sourceOrderCode),
    created = values(created),
    createdBy = values(createdBy),
    lastUpdated = values(lastUpdated),
    lastUpdatedBy = values(lastUpdatedBy),
    returnWaybillCode = values(returnWaybillCode),
    returnCarrier = values(returnCarrier),
    refundedAt = values(refundedAt),
    refundStatus = values(refundStatus)
</insert>

<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
update tocofs_returngoods  set
<trim suffix="" suffixOverrides=",">
  <if test="clientcode != null and clientcode != ''"> clientCode = #{clientcode},</if>
  <if test="companycode != null and companycode != ''"> companyCode = #{companycode},</if>
  <if test="storecode != null and storecode != ''"> storeCode = #{storecode},</if>
  <if test="facilitycode != null and facilitycode != ''"> facilityCode = #{facilitycode},</if>
  <if test="code != null and code != ''"> code = #{code},</if>
  <if test="internalinstructiontype != null and internalinstructiontype != ''"> internalInstructionType = #{internalinstructiontype},</if>
  <if test="bizchannel != null and bizchannel != ''"> bizChannel = #{bizchannel},</if>
  <if test="reforderid != null and reforderid != ''"> refOrderId = #{reforderid},</if>
  <if test="refordercode != null and refordercode != ''"> refOrderCode = #{refordercode},</if>
  <if test="refordertype != null and refordertype != ''"> refOrderType = #{refordertype},</if>
  <if test="closed != null and closed != ''"> closed = #{closed},</if>
  <if test="closedby != null and closedby != ''"> closedBy = #{closedby},</if>
  <if test="status != null and status != ''"> status = #{status},</if>
  <if test="allowoverreceive != null and allowoverreceive != ''"> allowOverReceive = #{allowoverreceive},</if>
  <if test="shipfromattentionto != null and shipfromattentionto != ''"> shipFromAttentionTo = #{shipfromattentionto},</if>
  <if test="shipfromaddress != null and shipfromaddress != ''"> shipFromAddress = #{shipfromaddress},</if>
  <if test="shipfromcountry != null and shipfromcountry != ''"> shipFromCountry = #{shipfromcountry},</if>
  <if test="shipfromstate != null and shipfromstate != ''"> shipFromState = #{shipfromstate},</if>
  <if test="shipfromcity != null and shipfromcity != ''"> shipFromCity = #{shipfromcity},</if>
  <if test="shipfromdistrict != null and shipfromdistrict != ''"> shipFromDistrict = #{shipfromdistrict},</if>
  <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> shipFromPostalCode = #{shipfrompostalcode},</if>
  <if test="shipfrommobile != null and shipfrommobile != ''"> shipFromMobile = #{shipfrommobile},</if>
  <if test="shipfromemail != null and shipfromemail != ''"> shipFromEmail = #{shipfromemail},</if>
  <if test="totallines != null and totallines != ''"> totalLines = #{totallines},</if>
  <if test="totalqty != null and totalqty != ''"> totalQty = #{totalqty},</if>
  <if test="totalamount != null and totalamount != ''"> totalAmount = #{totalamount},</if>
  <if test="totalweight != null and totalweight != ''"> totalWeight = #{totalweight},</if>
  <if test="totalvolume != null and totalvolume != ''"> totalVolume = #{totalvolume},</if>
  <if test="totalvolumeweight != null and totalvolumeweight != ''"> totalVolumeWeight = #{totalvolumeweight},</if>
  <if test="totalfulfillamount != null and totalfulfillamount != ''"> totalFulfillAmount = #{totalfulfillamount},</if>
  <if test="totalfulfillweight != null and totalfulfillweight != ''"> totalFulfillWeight = #{totalfulfillweight},</if>
  <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> totalFulfillVolume = #{totalfulfillvolume},</if>
  <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> totalFulfillVolumeWeight = #{totalfulfillvolumeweight},</if>
  <if test="totalfulfillqty != null and totalfulfillqty != ''"> totalFulfillQty = #{totalfulfillqty},</if>
  <if test="totalcases != null and totalcases != ''"> totalCases = #{totalcases},</if>
  <if test="totalcontainers != null and totalcontainers != ''"> totalContainers = #{totalcontainers},</if>
  <if test="closeatqty != null and closeatqty != ''"> closeAtQty = #{closeatqty},</if>
  <if test="quantityum != null and quantityum != ''"> quantityUM = #{quantityum},</if>
  <if test="weightum != null and weightum != ''"> weightUM = #{weightum},</if>
  <if test="volumeum != null and volumeum != ''"> volumeUM = #{volumeum},</if>
  <if test="checkinfrom != null and checkinfrom != ''"> checkInFrom = #{checkinfrom},</if>
  <if test="checkinto != null and checkinto != ''"> checkInTo = #{checkinto},</if>
  <if test="closedat != null and closedat != ''"> closedAt = #{closedat},</if>
  <if test="sourceplatformcode != null and sourceplatformcode != ''"> sourcePlatformCode = #{sourceplatformcode},</if>
  <if test="sourceordercode != null and sourceordercode != ''"> sourceOrderCode = #{sourceordercode},</if>
  <if test="created != null and created != ''"> created = #{created},</if>
  <if test="createdby != null and createdby != ''"> createdBy = #{createdby},</if>
  <if test="lastupdated != null and lastupdated != ''"> lastUpdated = #{lastupdated},</if>
  <if test="lastupdatedby != null and lastupdatedby != ''"> lastUpdatedBy = #{lastupdatedby},</if>
  <if test="returnwaybillcode != null and returnwaybillcode != ''"> returnWaybillCode = #{returnwaybillcode},</if>
  <if test="returncarrier != null and returncarrier != ''"> returnCarrier = #{returncarrier},</if>
  <if test="refundedat != null and refundedat != ''"> refundedAt = #{refundedat},</if>
  <if test="refundstatus != null and refundstatus != ''"> refundStatus = #{refundstatus},</if>
</trim>
where id = #{id}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.plugin.lets.ofs.entity.TocofsReturngoodsEntity" >
update tocofs_returngoods  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.ofs.entity.TocofsReturngoodsEntity" >
update tocofs_returngoods  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="id != null and id != ''"> and id = #{id} </if>
            <if test="clientcode != null and clientcode != ''"> and clientCode = #{clientcode} </if>
            <if test="companycode != null and companycode != ''"> and companyCode = #{companycode} </if>
            <if test="storecode != null and storecode != ''"> and storeCode = #{storecode} </if>
            <if test="facilitycode != null and facilitycode != ''"> and facilityCode = #{facilitycode} </if>
            <if test="code != null and code != ''"> and code = #{code} </if>
            <if test="internalinstructiontype != null and internalinstructiontype != ''"> and internalInstructionType = #{internalinstructiontype} </if>
            <if test="bizchannel != null and bizchannel != ''"> and bizChannel = #{bizchannel} </if>
            <if test="reforderid != null and reforderid != ''"> and refOrderId = #{reforderid} </if>
            <if test="refordercode != null and refordercode != ''"> and refOrderCode = #{refordercode} </if>
            <if test="refordertype != null and refordertype != ''"> and refOrderType = #{refordertype} </if>
            <if test="closed != null and closed != ''"> and closed = #{closed} </if>
            <if test="closedby != null and closedby != ''"> and closedBy = #{closedby} </if>
            <if test="status != null and status != ''"> and status = #{status} </if>
            <if test="allowoverreceive != null and allowoverreceive != ''"> and allowOverReceive = #{allowoverreceive} </if>
            <if test="shipfromattentionto != null and shipfromattentionto != ''"> and shipFromAttentionTo = #{shipfromattentionto} </if>
            <if test="shipfromaddress != null and shipfromaddress != ''"> and shipFromAddress = #{shipfromaddress} </if>
            <if test="shipfromcountry != null and shipfromcountry != ''"> and shipFromCountry = #{shipfromcountry} </if>
            <if test="shipfromstate != null and shipfromstate != ''"> and shipFromState = #{shipfromstate} </if>
            <if test="shipfromcity != null and shipfromcity != ''"> and shipFromCity = #{shipfromcity} </if>
            <if test="shipfromdistrict != null and shipfromdistrict != ''"> and shipFromDistrict = #{shipfromdistrict} </if>
            <if test="shipfrompostalcode != null and shipfrompostalcode != ''"> and shipFromPostalCode = #{shipfrompostalcode} </if>
            <if test="shipfrommobile != null and shipfrommobile != ''"> and shipFromMobile = #{shipfrommobile} </if>
            <if test="shipfromemail != null and shipfromemail != ''"> and shipFromEmail = #{shipfromemail} </if>
            <if test="totallines != null and totallines != ''"> and totalLines = #{totallines} </if>
            <if test="totalqty != null and totalqty != ''"> and totalQty = #{totalqty} </if>
            <if test="totalamount != null and totalamount != ''"> and totalAmount = #{totalamount} </if>
            <if test="totalweight != null and totalweight != ''"> and totalWeight = #{totalweight} </if>
            <if test="totalvolume != null and totalvolume != ''"> and totalVolume = #{totalvolume} </if>
            <if test="totalvolumeweight != null and totalvolumeweight != ''"> and totalVolumeWeight = #{totalvolumeweight} </if>
            <if test="totalfulfillamount != null and totalfulfillamount != ''"> and totalFulfillAmount = #{totalfulfillamount} </if>
            <if test="totalfulfillweight != null and totalfulfillweight != ''"> and totalFulfillWeight = #{totalfulfillweight} </if>
            <if test="totalfulfillvolume != null and totalfulfillvolume != ''"> and totalFulfillVolume = #{totalfulfillvolume} </if>
            <if test="totalfulfillvolumeweight != null and totalfulfillvolumeweight != ''"> and totalFulfillVolumeWeight = #{totalfulfillvolumeweight} </if>
            <if test="totalfulfillqty != null and totalfulfillqty != ''"> and totalFulfillQty = #{totalfulfillqty} </if>
            <if test="totalcases != null and totalcases != ''"> and totalCases = #{totalcases} </if>
            <if test="totalcontainers != null and totalcontainers != ''"> and totalContainers = #{totalcontainers} </if>
            <if test="closeatqty != null and closeatqty != ''"> and closeAtQty = #{closeatqty} </if>
            <if test="quantityum != null and quantityum != ''"> and quantityUM = #{quantityum} </if>
            <if test="weightum != null and weightum != ''"> and weightUM = #{weightum} </if>
            <if test="volumeum != null and volumeum != ''"> and volumeUM = #{volumeum} </if>
            <if test="checkinfrom != null and checkinfrom != ''"> and checkInFrom = #{checkinfrom} </if>
            <if test="checkinto != null and checkinto != ''"> and checkInTo = #{checkinto} </if>
            <if test="closedat != null and closedat != ''"> and closedAt = #{closedat} </if>
            <if test="sourceplatformcode != null and sourceplatformcode != ''"> and sourcePlatformCode = #{sourceplatformcode} </if>
            <if test="sourceordercode != null and sourceordercode != ''"> and sourceOrderCode = #{sourceordercode} </if>
            <if test="created != null and created != ''"> and created = #{created} </if>
            <if test="createdby != null and createdby != ''"> and createdBy = #{createdby} </if>
            <if test="lastupdated != null and lastupdated != ''"> and lastUpdated = #{lastupdated} </if>
            <if test="lastupdatedby != null and lastupdatedby != ''"> and lastUpdatedBy = #{lastupdatedby} </if>
            <if test="returnwaybillcode != null and returnwaybillcode != ''"> and returnWaybillCode = #{returnwaybillcode} </if>
            <if test="returncarrier != null and returncarrier != ''"> and returnCarrier = #{returncarrier} </if>
            <if test="refundedat != null and refundedat != ''"> and refundedAt = #{refundedat} </if>
            <if test="refundstatus != null and refundstatus != ''"> and refundStatus = #{refundstatus} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from tocofs_returngoods where id = #{id}
</delete>

</mapper>

