<?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="cn.ezhizao.project.business.mapper.BizCompanyProductPackageMapper">

    <resultMap type="cn.ezhizao.project.business.domain.BizCompanyProductPackage" id="BizCompanyProductPackageResult">
        <id column="id" property="id"/>
    </resultMap>


    <select id="getList" parameterType="BizCompanyProductPackage" resultMap="BizCompanyProductPackageResult">
        SELECT * FROM biz_company_product_package
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            deleted = 0
            <if test="productId != null "> AND product_id = #{productId}</if>
            <if test="companyId != null "> AND company_id = #{companyId}</if>
            <if test="productCode != null  and productCode != ''"> AND product_code = #{productCode}</if>
            <if test="companyCode != null  and companyCode != ''"> AND company_code = #{companyCode}</if>
            <if test="packageTypeCode != null  and packageTypeCode != ''"> AND package_type_code = #{packageTypeCode}</if>
            <if test="productDescription != null  and productDescription != ''"> AND product_description = #{productDescription}</if>
            <if test="mnemonicCode != null  and mnemonicCode != ''"> AND mnemonic_code = #{mnemonicCode}</if>
            <if test="companyAlias != null  and companyAlias != ''"> AND company_alias = #{companyAlias}</if>
            <if test="packageCode != null  and packageCode != ''"> AND package_code like concat('%',#{packageCode},'%')</if>
            <if test="packageNo != null  and packageNo != ''"> AND package_no = #{packageNo}</if>
            <if test="packageStandard != null  and packageStandard != ''"> AND package_standard = #{packageStandard}</if>
            <if test="packageLength != null  and packageLength != ''"> AND package_length = #{packageLength}</if>
            <if test="packageWidth != null  and packageWidth != ''"> AND package_width = #{packageWidth}</if>
            <if test="packageHeight != null  and packageHeight != ''"> AND package_height = #{packageHeight}</if>
            <if test="singleGrossWeight != null "> AND single_gross_weight = #{singleGrossWeight}</if>
            <if test="singleNumber != null "> AND single_number = #{singleNumber}</if>
            <if test="perNumber != null "> AND per_number = #{perNumber}</if>
            <if test="minNumber != null "> AND min_number = #{minNumber}</if>
            <if test="maxNumber != null "> AND max_number = #{maxNumber}</if>
            <if test="maxBranchNumber != null "> AND max_branch_number = #{maxBranchNumber}</if>
            <if test="palletStandard != null  and palletStandard != ''"> AND pallet_standard = #{palletStandard}</if>
            <if test="palletType != null  and palletType != ''"> AND pallet_type = #{palletType}</if>
            <if test="areaType != null  and areaType != ''"> AND area_type = #{areaType}</if>
            <if test="unit != null  and unit != ''"> AND unit = #{unit}</if>
            <if test="deliveryStatus != null  and deliveryStatus != ''"> AND delivery_status = #{deliveryStatus}</if>
            <if test="outboxHeight != null "> AND outbox_height = #{outboxHeight}</if>
        </trim>
    </select>

    <delete id="physicalDelete">
        DELETE FROM biz_company_product_package
        <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
            <if test="id != null">
                id = #{id} AND
            </if>
       <!-- 删除条件为其他外键可以在这里加 -->
        </trim>
    </delete>
</mapper>
