<where>标签会自动去除首个查询条件中的and语句

<select id="selectPersonByCondition" parameterType="person" resultMap="personResultMap">  
    select <include refid="columns"/> from person
    <where>
        <if test="name!=null">
            name like '%${name}%'
        </if>
        <if test="gender!=null">
            and gender=#{gender}
        </if>
        <if test="personAddr!=null">
            and person_addr like '%${personAddr}%'
        </if>
        <if test="birthday!=null">
            <![CDATA[
            and birthday < #{birthday}
            ]]>
        </if>
    </where>
</select>  

测试

@Test
public void testSelectPersonByCondition(){  
    SqlSession session = sessionFactory.openSession();
    Person p = new Person();
//        p.setName("满");
    p.setGender(1);
//        p.setPersonAddr("魏");
//        p.setBirthday(new Date());
    try {
        List<Person> list = session.selectList("com.itbto.mapper.PersonMapper.selectPersonByCondition", p);
        for(Person p1 : list){
            System.out.println(p1);
        }
    } catch (Exception e) {
        e.printStackTrace();
    } finally{
        session.close();
    }
}