select f_id,
               parent_id,
               ancestors,
               order_num,
               f_no,
               f_is_bonded,
               f_name,
               f_addr,
               f_totalgross,
               f_contacts,
               f_tel,
               f_charg,
               f_status,
               del_flag,
               create_by,
               create_time,
               update_by,
               update_time,
               remark,
               f_location,
               f_warehouse_information
        from t_warehouse
    
    
    
    
    
    
        insert into t_warehouse
        
            parent_id,
            ancestors,
            order_num,
            f_no,
            f_is_bonded,
            f_name,
            f_addr,
            f_totalgross,
            f_contacts,
            f_tel,
            f_charg,
            f_status,
            del_flag,
            create_by,
            create_time,
            update_by,
            update_time,
            remark,
            f_location,
            f_warehouse_information,
        
        
            #{parentId},
            #{ancestors},
            #{orderNum},
            #{fNo},
            #{fIsBonded},
            #{fName},
            #{fAddr},
            #{fTotalgross},
            #{fContacts},
            #{fTel},
            #{fCharg},
            #{fStatus},
            #{delFlag},
            #{createBy},
            #{createTime},
            #{updateBy},
            #{updateTime},
            #{remark},
            #{fLocation},
            #{fWarehouseInformation},
        
    
    
        update t_warehouse
        
            parent_id = #{parentId},
            ancestors = #{ancestors},
            order_num = #{orderNum},
            f_no = #{fNo},
            f_is_bonded = #{fIsBonded},
            f_name = #{fName},
            f_addr = #{fAddr},
            f_totalgross = #{fTotalgross},
            f_contacts = #{fContacts},
            f_tel = #{fTel},
            f_charg = #{fCharg},
            f_status = #{fStatus},
            del_flag = #{delFlag},
            create_by = #{createBy},
            create_time = #{createTime},
            update_by = #{updateBy},
            update_time = #{updateTime},
            remark = #{remark},
            f_location = #{fLocation},
            f_warehouse_information = #{fWarehouseInformation},
        
        where f_id = #{fId}
    
    
        delete
        from t_warehouse
        where f_id = #{fId}
    
    
        delete from t_warehouse where f_id in
        
            #{fId}
        
    
    
    
    
    
    
    
    
        update t_warehouse set ancestors =
        
            when #{item.fId} then #{item.ancestors}
        
        where f_id in
        
            #{item.fId}
        
    
    
        update t_warehouse
        
            f_status = #{fStatus},
            update_by = #{updateBy},
            update_time = sysdate()
        
        where f_id in (${ancestors})
    
    
        update t_warehouse
        
            f_totalgross = #{fTotalgross},
            update_time = sysdate()
        
        where f_id = #{fId}