单独or或者and相信大家不在话下,一起的话让我苦恼了一下

select b.bin_name, l.* from bas_location l inner join bas_bin b on l.bin_code = b.bin_code
        <where>
            <if test="record.binCode != null and record.binCode != ''
             or record.locName != null and record.locName != ''">
                (
                <trim prefixOverrides="AND |OR">
                    <if test="record.binCode != null and record.binCode != '' ">
                        AND l.bin_code = '${record.binCode}'
                    </if>
                    <if test="record.locName != null and record.locName != '' ">
                        OR l.loc_name = '${record.locName}'
                    </if>
                </trim>
                )
            </if>
            <include refid="Lable_Page_Where_Clause"/>
        </where>
        order by l.create_time desc