@Select注解编写动态sql失效

今天在写一个ssm项目按楼层查询房间的业务,加上一段动态sql,代码失效了,代码如下:
@Select({
        "<script>",
        "select count(1) from tb_hotel ",
            "<where>",
                      "houseState=0",
                "<if test='#{i}!=0'>",
                    "AND houseId Like concat(#{i},'%')",
                "</if>",
            "</where>",
            "</script>"
})

int selectHX(int i);

<if test='#{i}!=0'> 这行有问题,修改为 <if test='i != 0'>