select material_base_info_id, organization_id, organization_name, top_organization_id, shipper_id, shipper_name, material_code, material_name, bar_code, material_classify_code,
material_classify_name, material_type, material_type_name, pack_id, pack_code, pack_name, unit_code, unit_name, brand_id, brand_code, brand_name, shelf_life, weight_limit,
volume_limit, material_shape, material_shape_name, material_size, material_length, material_width, material_height, remark, nullify, create_time, create_by, create_by_name,
update_time, update_by, update_by_name, del_flag, common,material_model,material_unit,machine_code
from material_base_info
and organization_id = #{organizationId}
and organization_name like concat('%', #{organizationName}, '%')
and top_organization_id = #{topOrganizationId}
and shipper_id = #{shipperId}
and shipper_name like concat('%', #{shipperName}, '%')
and material_code = #{materialCode}
and material_name like concat('%', #{materialName}, '%')
and bar_code = #{barCode}
and material_classify_code = #{materialClassifyCode}
and material_classify_name like concat('%', #{materialClassifyName}, '%')
and material_type = #{materialType}
and material_type_name like concat('%', #{materialTypeName}, '%')
and unit_code = #{unitCode}
and unit_name like concat('%', #{unitName}, '%')
and pack_id = #{packId}
and pack_code = #{packCode}
and pack_name like concat('%', #{packName}, '%')
and brand_id = #{brandId}
and brand_code = #{brandCode}
and brand_name like concat('%', #{brandName}, '%')
and shelf_life = #{shelfLife}
and weight_limit = #{weightLimit}
and volume_limit = #{volumeLimit}
and material_shape = #{materialShape}
and material_shape_name like concat('%', #{materialShapeName}, '%')
and material_size = #{materialSize}
and material_length = #{materialLength}
and material_width = #{materialWidth}
and material_height = #{materialHeight}
and nullify = #{nullify}
and create_by_name like concat('%', #{createByName}, '%')
and update_by_name like concat('%', #{updateByName}, '%')
and common = #{common} and (
1 = 1
or common = 1 ) and del_flag = #{delFlag} and del_flag = 1
and material_base_info_id in (SELECT
DISTINCT material_base_info_id
FROM ngwl_test_wms.material_inventory
WHERE
allocation_quantity > 0
AND del_flag = 1)
and organization_id = #{organizationId}
and organization_name like concat('%', #{organizationName}, '%')
and top_organization_id = #{topOrganizationId}
and shipper_id = #{shipperId}
and shipper_name like concat('%', #{shipperName}, '%')
and material_code = #{materialCode}
and material_name like concat('%', #{materialName}, '%')
and bar_code = #{barCode}
and material_classify_code = #{materialClassifyCode}
and material_classify_name like concat('%', #{materialClassifyName}, '%')
and material_type = #{materialType}
and material_type_name like concat('%', #{materialTypeName}, '%')
and unit_code = #{unitCode}
and unit_name like concat('%', #{unitName}, '%')
and pack_id = #{packId}
and pack_code = #{packCode}
and pack_name like concat('%', #{packName}, '%')
and brand_id = #{brandId}
and brand_code = #{brandCode}
and brand_name like concat('%', #{brandName}, '%')
and shelf_life = #{shelfLife}
and weight_limit = #{weightLimit}
and volume_limit = #{volumeLimit}
and material_shape = #{materialShape}
and material_shape_name like concat('%', #{materialShapeName}, '%')
and material_size = #{materialSize}
and material_length = #{materialLength}
and material_width = #{materialWidth}
and material_height = #{materialHeight}
and nullify = #{nullify}
and create_by_name like concat('%', #{createByName}, '%')
and update_by_name like concat('%', #{updateByName}, '%')
and common = #{common} and (
1 = 1
or common = 1 ) and del_flag = #{delFlag} and del_flag = 1