<?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.zbf.system.mapper.TMiStockBakMapper">

    <resultMap type="TMiStockBak" id="TMiStockBakResult">
            <result property="id"    column="id"    />
            <result property="storageId"    column="storage_id"    />
            <result property="storageAreaId"    column="storage_area_id"    />
            <result property="locationId"    column="location_id"    />
            <result property="goodsId"    column="goods_id"    />
            <result property="shelvesNum"    column="shelves_num"    />
            <result property="remark"    column="remark"    />
            <result property="version"    column="version"    />
            <result property="storageMode"    column="storage_mode"    />
            <result property="providerId"    column="provider_id"    />
            <result property="productionDate"    column="production_date"    />
            <result property="wareDate"    column="ware_date"    />
            <result property="doctNumber"    column="doct_number"    />
            <result property="goodsVolume"    column="goods_volume"    />
            <result property="occupyNum"    column="occupy_num"    />
            <result property="noticeId"    column="notice_id"    />
            <result property="oriBill"    column="ori_bill"    />
            <result property="ctl"    column="ctl"    />
            <result property="barcode"    column="barcode"    />
            <result property="wgh"    column="wgh"    />
            <result property="high"    column="high"    />
            <result property="goodsName"    column="goods_name"    />
            <result property="status"    column="status"    />
            <result property="customerId"    column="customer_id"    />
            <result property="batchNo"    column="batch_no"    />
            <result property="dueDate"    column="due_date"    />
            <result property="checkDate"    column="check_date"    />
            <result property="standard"    column="standard"    />
            <result property="flag"    column="flag"    />
            <result property="mark"    column="mark"    />
            <result property="orderNum"    column="order_num"    />
            <result property="problem"    column="problem"    />
            <result property="price"    column="price"    />
            <result property="packingNum"    column="packing_num"    />
            <result property="boxType"    column="box_type"    />
            <result property="scaleUnit"    column="scale_unit"    />
            <result property="goodsSku"    column="goods_sku"    />
            <result property="factoryId"    column="factory_id"    />
            <result property="salesOrderNo"    column="sales_order_no"    />
            <result property="salesOrderNumber"    column="sales_order_number"    />
            <result property="supplier"    column="supplier"    />
            <result property="onOrder"    column="on_order"    />
            <result property="recordPerson"    column="record_person"    />
            <result property="lotId"    column="lot_id"    />
            <result property="decid"    column="decid"    />
            <result property="unit"    column="unit"    />
            <result property="specification"    column="specification"    />
            <result property="goodsAge"    column="goods_age"    />
            <result property="arraMount"    column="arra_mount"    />
            <result property="recoil"    column="recoil"    />
            <result property="operatorId"    column="operator_id"    />
            <result property="operateDate"    column="operate_date"    />
            <result property="purchaseId"    column="purchase_id"    />
            <result property="applicant"    column="applicant"    />
            <result property="respDept"    column="resp_dept"    />
            <result property="planDate"    column="plan_date"    />
            <result property="planTime"    column="plan_time"    />
            <result property="needCycle"    column="need_cycle"    />
            <result property="needType"    column="need_type"    />
            <result property="goodsTypeId"    column="goods_type_id"    />
            <result property="brand"    column="brand"    />
            <result property="totalMoney"    column="total_money"    />
            <result property="expiryDate"    column="expiry_date"    />
            <result property="providerName"    column="provider_name"    />
            <result property="receiver"    column="receiver"    />
            <result property="needDept"    column="need_dept"    />
            <result property="purchaseDept"    column="purchase_dept"    />
            <result property="produclotId"    column="produclot_id"    />
            <result property="receiverDept"    column="receiver_dept"    />
            <result property="receivingArea"    column="receiving_area"    />
            <result property="packageId"    column="package_id"    />
            <result property="useType"    column="use_type"    />
            <result property="telephone"    column="telephone"    />
            <result property="totalVolume"    column="total_volume"    />
            <result property="totalRoughWeight"    column="total_rough_weight"    />
            <result property="totalNetWeigh"    column="total_net_weigh"    />
            <result property="createTime"    column="create_time"    />
            <result property="updateTime"    column="update_time"    />
            <result property="createBy"    column="create_by"    />
            <result property="updateBy"    column="update_by"    />
            <result property="defaultStorageAreaId"    column="default_storage_area_id"    />
            <result property="qualityInspecStatus"    column="quality_inspec_status"    />
            <result property="periodUnit"    column="period_unit"    />
            <result property="period"    column="period"    />
            <result property="reportTime"    column="report_time"    />
            <result property="consignment"    column="consignment"    />
            <result property="deptId"    column="dept_id"    />
            <result property="abc"    column="abc"    />
            <result property="levelType"    column="level_type"    />
           <result property="isFreeze"    column="is_freeze"    />
           <result property="storageShortName"    column="storage_short_name"    />
    </resultMap>

    <sql id="selectTMiStockBakVo">
        select id,
               storage_id,
               storage_area_id,
               location_id,
               goods_id,
               shelves_num,
               remark,
               version,
               storage_mode,
               provider_id,
               production_date,
               ware_date,
               doct_number,
               goods_volume,
               occupy_num,
               notice_id,
               ori_bill,
               ctl,
               barcode,
               wgh,
               high,
               goods_name,
               status,
               customer_id,
               batch_no,
               due_date,
               check_date,
               standard,
               flag,
               mark,
               order_num,
               problem,
               price,
               packing_num,
               box_type,
               scale_unit,
               goods_sku,
               factory_id,
               sales_order_no,
               sales_order_number,
               supplier,
               on_order,
               record_person,
               lot_id,
               decid,
               unit,
               specification,
               goods_age,
               arra_mount,
               recoil,
               operator_id,
               operate_date,
               purchase_id,
               applicant,
               resp_dept,
               plan_date,
               plan_time,
               need_cycle,
               need_type,
               goods_type_id,
               brand,
               total_money,
               expiry_date,
               provider_name,
               receiver,
               need_dept,
               purchase_dept,
               produclot_id,
               receiver_dept,
               receiving_area,
               package_id,
               use_type,
               telephone,
               total_volume,
               total_rough_weight,
               total_net_weigh,
               create_time,
               update_time,
               create_by,
               update_by,
               default_storage_area_id,
               quality_inspec_status,
               period_unit,
               period,
               report_time,
               consignment,
               dept_id,
               abc,
               level_type,
               is_freeze,
               storage_short_name
        from t_mi_stock_bak
    </sql>

    <select id="selectTMiStockBakList" parameterType="TMiStockBak" resultMap="TMiStockBakResult">
        <include refid="selectTMiStockBakVo"/>
        <where>
            <if test="storageAreaId != null  and storageAreaId != ''"> and storage_area_id = #{storageAreaId}</if>
            <if test="locationId != null  and locationId != ''"> and location_id = #{locationId}</if>
            <if test="goodsId != null  and goodsId != ''"> and goods_id = #{goodsId}</if>
            <if test="storageMode != null  and storageMode != ''"> and storage_mode = #{storageMode}</if>
            <if test="doctNumber != null  and doctNumber != ''"> and doct_number = #{doctNumber}</if>
            <if test="noticeId != null  and noticeId != ''"> and notice_id = #{noticeId}</if>
            <if test="goodsName != null  and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="batchNo != null  and batchNo != ''"> and batch_no = #{batchNo}</if>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="abc != null  and abc != ''">and abc = #{abc}</if>
            <if test="levelType != null  and levelType != ''">and level_type = #{levelType}</if>
            <if test="isFreeze != null and isFreeze != ''">
                and is_freeze  = #{isFreeze}
            </if>
            <choose>
                <when test="storageList != null  and storageList.size > 0">
                    and storage_id in
                    <foreach item="storageId" collection="storageList" open="(" separator="," close=")">
                        #{storageId}
                    </foreach>
                </when>
                <when test="storageId != null  and storageId != ''">and storage_id = #{storageId}</when>
            </choose>
        </where>
    </select>

    <select id="selectTMiStockBakById" parameterType="Long" resultMap="TMiStockBakResult">
            <include refid="selectTMiStockBakVo"/>
            where id = #{id}
    </select>

    <insert id="insertTMiStockBak" parameterType="TMiStockBak">
        insert into t_mi_stock_bak
        <trim prefix="(" suffix=")" suffixOverrides=",">
                    <if test="id != null">id,</if>
                    <if test="storageId != null">storage_id,</if>
                    <if test="storageAreaId != null">storage_area_id,</if>
                    <if test="locationId != null">location_id,</if>
                    <if test="goodsId != null">goods_id,</if>
                    <if test="shelvesNum != null">shelves_num,</if>
                    <if test="remark != null">remark,</if>
                    <if test="version != null">version,</if>
                    <if test="storageMode != null">storage_mode,</if>
                    <if test="providerId != null">provider_id,</if>
                    <if test="productionDate != null">production_date,</if>
                    <if test="wareDate != null">ware_date,</if>
                    <if test="doctNumber != null">doct_number,</if>
                    <if test="goodsVolume != null">goods_volume,</if>
                    <if test="occupyNum != null">occupy_num,</if>
                    <if test="noticeId != null">notice_id,</if>
                    <if test="oriBill != null">ori_bill,</if>
                    <if test="ctl != null">ctl,</if>
                    <if test="barcode != null">barcode,</if>
                    <if test="wgh != null">wgh,</if>
                    <if test="high != null">high,</if>
                    <if test="goodsName != null">goods_name,</if>
                    <if test="status != null">status,</if>
                    <if test="customerId != null">customer_id,</if>
                    <if test="batchNo != null">batch_no,</if>
                    <if test="dueDate != null">due_date,</if>
                    <if test="checkDate != null">check_date,</if>
                    <if test="standard != null">standard,</if>
                    <if test="flag != null">flag,</if>
                    <if test="mark != null">mark,</if>
                    <if test="orderNum != null">order_num,</if>
                    <if test="problem != null">problem,</if>
                    <if test="price != null">price,</if>
                    <if test="packingNum != null">packing_num,</if>
                    <if test="boxType != null">box_type,</if>
                    <if test="scaleUnit != null">scale_unit,</if>
                    <if test="goodsSku != null">goods_sku,</if>
                    <if test="factoryId != null">factory_id,</if>
                    <if test="salesOrderNo != null">sales_order_no,</if>
                    <if test="salesOrderNumber != null">sales_order_number,</if>
                    <if test="supplier != null">supplier,</if>
                    <if test="onOrder != null">on_order,</if>
                    <if test="recordPerson != null">record_person,</if>
                    <if test="lotId != null">lot_id,</if>
                    <if test="decid != null">decid,</if>
                    <if test="unit != null">unit,</if>
                    <if test="specification != null">specification,</if>
                    <if test="goodsAge != null">goods_age,</if>
                    <if test="arraMount != null">arra_mount,</if>
                    <if test="recoil != null">recoil,</if>
                    <if test="operatorId != null">operator_id,</if>
                    <if test="operateDate != null">operate_date,</if>
                    <if test="purchaseId != null">purchase_id,</if>
                    <if test="applicant != null">applicant,</if>
                    <if test="respDept != null">resp_dept,</if>
                    <if test="planDate != null">plan_date,</if>
                    <if test="planTime != null">plan_time,</if>
                    <if test="needCycle != null">need_cycle,</if>
                    <if test="needType != null">need_type,</if>
                    <if test="goodsTypeId != null">goods_type_id,</if>
                    <if test="brand != null">brand,</if>
                    <if test="totalMoney != null">total_money,</if>
                    <if test="expiryDate != null">expiry_date,</if>
                    <if test="providerName != null">provider_name,</if>
                    <if test="receiver != null">receiver,</if>
                    <if test="needDept != null">need_dept,</if>
                    <if test="purchaseDept != null">purchase_dept,</if>
                    <if test="produclotId != null">produclot_id,</if>
                    <if test="receiverDept != null">receiver_dept,</if>
                    <if test="receivingArea != null">receiving_area,</if>
                    <if test="packageId != null">package_id,</if>
                    <if test="useType != null">use_type,</if>
                    <if test="telephone != null">telephone,</if>
                    <if test="totalVolume != null">total_volume,</if>
                    <if test="totalRoughWeight != null">total_rough_weight,</if>
                    <if test="totalNetWeigh != null">total_net_weigh,</if>
                    <if test="createTime != null">create_time,</if>
                    <if test="updateTime != null">update_time,</if>
                    <if test="createBy != null">create_by,</if>
                    <if test="updateBy != null">update_by,</if>
                    <if test="defaultStorageAreaId != null">default_storage_area_id,</if>
                    <if test="qualityInspecStatus != null">quality_inspec_status,</if>
                    <if test="periodUnit != null">period_unit,</if>
                    <if test="period != null">period,</if>
                    <if test="reportTime != null">report_time,</if>
                    <if test="consignment != null">consignment,</if>
                    <if test="deptId != null">dept_id,</if>
                    <if test="abc != null">abc,</if>
                    <if test="levelType != null">level_type,</if>
                   <if test="isFreeze != null">is_freeze,</if>
                   <if test="storageShortName != null">storage_short_name,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
                    <if test="id != null">#{id},</if>
                    <if test="storageId != null">#{storageId},</if>
                    <if test="storageAreaId != null">#{storageAreaId},</if>
                    <if test="locationId != null">#{locationId},</if>
                    <if test="goodsId != null">#{goodsId},</if>
                    <if test="shelvesNum != null">#{shelvesNum},</if>
                    <if test="remark != null">#{remark},</if>
                    <if test="version != null">#{version},</if>
                    <if test="storageMode != null">#{storageMode},</if>
                    <if test="providerId != null">#{providerId},</if>
                    <if test="productionDate != null">#{productionDate},</if>
                    <if test="wareDate != null">#{wareDate},</if>
                    <if test="doctNumber != null">#{doctNumber},</if>
                    <if test="goodsVolume != null">#{goodsVolume},</if>
                    <if test="occupyNum != null">#{occupyNum},</if>
                    <if test="noticeId != null">#{noticeId},</if>
                    <if test="oriBill != null">#{oriBill},</if>
                    <if test="ctl != null">#{ctl},</if>
                    <if test="barcode != null">#{barcode},</if>
                    <if test="wgh != null">#{wgh},</if>
                    <if test="high != null">#{high},</if>
                    <if test="goodsName != null">#{goodsName},</if>
                    <if test="status != null">#{status},</if>
                    <if test="customerId != null">#{customerId},</if>
                    <if test="batchNo != null">#{batchNo},</if>
                    <if test="dueDate != null">#{dueDate},</if>
                    <if test="checkDate != null">#{checkDate},</if>
                    <if test="standard != null">#{standard},</if>
                    <if test="flag != null">#{flag},</if>
                    <if test="mark != null">#{mark},</if>
                    <if test="orderNum != null">#{orderNum},</if>
                    <if test="problem != null">#{problem},</if>
                    <if test="price != null">#{price},</if>
                    <if test="packingNum != null">#{packingNum},</if>
                    <if test="boxType != null">#{boxType},</if>
                    <if test="scaleUnit != null">#{scaleUnit},</if>
                    <if test="goodsSku != null">#{goodsSku},</if>
                    <if test="factoryId != null">#{factoryId},</if>
                    <if test="salesOrderNo != null">#{salesOrderNo},</if>
                    <if test="salesOrderNumber != null">#{salesOrderNumber},</if>
                    <if test="supplier != null">#{supplier},</if>
                    <if test="onOrder != null">#{onOrder},</if>
                    <if test="recordPerson != null">#{recordPerson},</if>
                    <if test="lotId != null">#{lotId},</if>
                    <if test="decid != null">#{decid},</if>
                    <if test="unit != null">#{unit},</if>
                    <if test="specification != null">#{specification},</if>
                    <if test="goodsAge != null">#{goodsAge},</if>
                    <if test="arraMount != null">#{arraMount},</if>
                    <if test="recoil != null">#{recoil},</if>
                    <if test="operatorId != null">#{operatorId},</if>
                    <if test="operateDate != null">#{operateDate},</if>
                    <if test="purchaseId != null">#{purchaseId},</if>
                    <if test="applicant != null">#{applicant},</if>
                    <if test="respDept != null">#{respDept},</if>
                    <if test="planDate != null">#{planDate},</if>
                    <if test="planTime != null">#{planTime},</if>
                    <if test="needCycle != null">#{needCycle},</if>
                    <if test="needType != null">#{needType},</if>
                    <if test="goodsTypeId != null">#{goodsTypeId},</if>
                    <if test="brand != null">#{brand},</if>
                    <if test="totalMoney != null">#{totalMoney},</if>
                    <if test="expiryDate != null">#{expiryDate},</if>
                    <if test="providerName != null">#{providerName},</if>
                    <if test="receiver != null">#{receiver},</if>
                    <if test="needDept != null">#{needDept},</if>
                    <if test="purchaseDept != null">#{purchaseDept},</if>
                    <if test="produclotId != null">#{produclotId},</if>
                    <if test="receiverDept != null">#{receiverDept},</if>
                    <if test="receivingArea != null">#{receivingArea},</if>
                    <if test="packageId != null">#{packageId},</if>
                    <if test="useType != null">#{useType},</if>
                    <if test="telephone != null">#{telephone},</if>
                    <if test="totalVolume != null">#{totalVolume},</if>
                    <if test="totalRoughWeight != null">#{totalRoughWeight},</if>
                    <if test="totalNetWeigh != null">#{totalNetWeigh},</if>
                    <if test="createTime != null">#{createTime},</if>
                    <if test="updateTime != null">#{updateTime},</if>
                    <if test="createBy != null">#{createBy},</if>
                    <if test="updateBy != null">#{updateBy},</if>
                    <if test="defaultStorageAreaId != null">#{defaultStorageAreaId},</if>
                    <if test="qualityInspecStatus != null">#{qualityInspecStatus},</if>
                    <if test="periodUnit != null">#{periodUnit},</if>
                    <if test="period != null">#{period},</if>
                    <if test="reportTime != null">#{reportTime},</if>
                    <if test="consignment != null">#{consignment},</if>
                    <if test="deptId != null">#{deptId},</if>
                    <if test="abc != null">#{abc},</if>
                    <if test="levelType != null">#{levelType},</if>
                    <if test="isFreeze != null">#{isFreeze},</if>
                    <if test="storageShortName != null">#{storageShortName},</if>
        </trim>
    </insert>

    <update id="updateTMiStockBak" parameterType="TMiStockBak">
        update t_mi_stock_bak
        <trim prefix="SET" suffixOverrides=",">
                    <if test="storageId != null">storage_id = #{storageId},</if>
                    <if test="storageAreaId != null">storage_area_id = #{storageAreaId},</if>
                    <if test="locationId != null">location_id = #{locationId},</if>
                    <if test="goodsId != null">goods_id = #{goodsId},</if>
                    <if test="shelvesNum != null">shelves_num = #{shelvesNum},</if>
                    <if test="remark != null">remark = #{remark},</if>
                    <if test="version != null">version = #{version},</if>
                    <if test="storageMode != null">storage_mode = #{storageMode},</if>
                    <if test="providerId != null">provider_id = #{providerId},</if>
                    <if test="productionDate != null">production_date = #{productionDate},</if>
                    <if test="wareDate != null">ware_date = #{wareDate},</if>
                    <if test="doctNumber != null">doct_number = #{doctNumber},</if>
                    <if test="goodsVolume != null">goods_volume = #{goodsVolume},</if>
                    <if test="occupyNum != null">occupy_num = #{occupyNum},</if>
                    <if test="noticeId != null">notice_id = #{noticeId},</if>
                    <if test="oriBill != null">ori_bill = #{oriBill},</if>
                    <if test="ctl != null">ctl = #{ctl},</if>
                    <if test="barcode != null">barcode = #{barcode},</if>
                    <if test="wgh != null">wgh = #{wgh},</if>
                    <if test="high != null">high = #{high},</if>
                    <if test="goodsName != null">goods_name = #{goodsName},</if>
                    <if test="status != null">status = #{status},</if>
                    <if test="customerId != null">customer_id = #{customerId},</if>
                    <if test="batchNo != null">batch_no = #{batchNo},</if>
                    <if test="dueDate != null">due_date = #{dueDate},</if>
                    <if test="checkDate != null">check_date = #{checkDate},</if>
                    <if test="standard != null">standard = #{standard},</if>
                    <if test="flag != null">flag = #{flag},</if>
                    <if test="mark != null">mark = #{mark},</if>
                    <if test="orderNum != null">order_num = #{orderNum},</if>
                    <if test="problem != null">problem = #{problem},</if>
                    <if test="price != null">price = #{price},</if>
                    <if test="packingNum != null">packing_num = #{packingNum},</if>
                    <if test="boxType != null">box_type = #{boxType},</if>
                    <if test="scaleUnit != null">scale_unit = #{scaleUnit},</if>
                    <if test="goodsSku != null">goods_sku = #{goodsSku},</if>
                    <if test="factoryId != null">factory_id = #{factoryId},</if>
                    <if test="salesOrderNo != null">sales_order_no = #{salesOrderNo},</if>
                    <if test="salesOrderNumber != null">sales_order_number = #{salesOrderNumber},</if>
                    <if test="supplier != null">supplier = #{supplier},</if>
                    <if test="onOrder != null">on_order = #{onOrder},</if>
                    <if test="recordPerson != null">record_person = #{recordPerson},</if>
                    <if test="lotId != null">lot_id = #{lotId},</if>
                    <if test="decid != null">decid = #{decid},</if>
                    <if test="unit != null">unit = #{unit},</if>
                    <if test="specification != null">specification = #{specification},</if>
                    <if test="goodsAge != null">goods_age = #{goodsAge},</if>
                    <if test="arraMount != null">arra_mount = #{arraMount},</if>
                    <if test="recoil != null">recoil = #{recoil},</if>
                    <if test="operatorId != null">operator_id = #{operatorId},</if>
                    <if test="operateDate != null">operate_date = #{operateDate},</if>
                    <if test="purchaseId != null">purchase_id = #{purchaseId},</if>
                    <if test="applicant != null">applicant = #{applicant},</if>
                    <if test="respDept != null">resp_dept = #{respDept},</if>
                    <if test="planDate != null">plan_date = #{planDate},</if>
                    <if test="planTime != null">plan_time = #{planTime},</if>
                    <if test="needCycle != null">need_cycle = #{needCycle},</if>
                    <if test="needType != null">need_type = #{needType},</if>
                    <if test="goodsTypeId != null">goods_type_id = #{goodsTypeId},</if>
                    <if test="brand != null">brand = #{brand},</if>
                    <if test="totalMoney != null">total_money = #{totalMoney},</if>
                    <if test="expiryDate != null">expiry_date = #{expiryDate},</if>
                    <if test="providerName != null">provider_name = #{providerName},</if>
                    <if test="receiver != null">receiver = #{receiver},</if>
                    <if test="needDept != null">need_dept = #{needDept},</if>
                    <if test="purchaseDept != null">purchase_dept = #{purchaseDept},</if>
                    <if test="produclotId != null">produclot_id = #{produclotId},</if>
                    <if test="receiverDept != null">receiver_dept = #{receiverDept},</if>
                    <if test="receivingArea != null">receiving_area = #{receivingArea},</if>
                    <if test="packageId != null">package_id = #{packageId},</if>
                    <if test="useType != null">use_type = #{useType},</if>
                    <if test="telephone != null">telephone = #{telephone},</if>
                    <if test="totalVolume != null">total_volume = #{totalVolume},</if>
                    <if test="totalRoughWeight != null">total_rough_weight = #{totalRoughWeight},</if>
                    <if test="totalNetWeigh != null">total_net_weigh = #{totalNetWeigh},</if>
                    <if test="createTime != null">create_time = #{createTime},</if>
                    <if test="updateTime != null">update_time = #{updateTime},</if>
                    <if test="createBy != null">create_by = #{createBy},</if>
                    <if test="updateBy != null">update_by = #{updateBy},</if>
                    <if test="defaultStorageAreaId != null">default_storage_area_id = #{defaultStorageAreaId},</if>
                    <if test="qualityInspecStatus != null">quality_inspec_status = #{qualityInspecStatus},</if>
                    <if test="periodUnit != null">period_unit = #{periodUnit},</if>
                    <if test="period != null">period = #{period},</if>
                    <if test="reportTime != null">report_time = #{reportTime},</if>
                    <if test="consignment != null">consignment = #{consignment},</if>
                    <if test="deptId != null">dept_id = #{deptId},</if>
                    <if test="abc != null">abc = #{abc},</if>
                    <if test="levelType != null">level_type = #{levelType},</if>
                    <if test="isFreeze != null">is_freeze = #{isFreeze},</if>
                    <if test="storageShortName != null">storage_short_name = #{storageShortName},</if>
        </trim>
        where id = #{id}
    </update>

    <update id="enableTMiStockBakByIds" parameterType="String">
        update t_mi_stock_bak set status=0 where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>
    <update id="disabledTMiStockBakByIds" parameterType="String">
        update t_mi_stock_bak set status=1 where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </update>

    <delete id="deleteTMiStockBakById" parameterType="Long">
        delete from t_mi_stock_bak  where id = #{id}
    </delete>

    <delete id="deleteTMiStockBakByIds" parameterType="String">
        delete from t_mi_stock_bak where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
