<select id="checkLogin" resultMap="BaseResultMap"> SELECT <include refid="sql"/> FROM user where password = #{password} <if test="name!=null and name!=‘‘"> and name = #{name} </if> <if test="name!=null and name!=‘‘"> or tel = #{name} </if> <if test="name!=null and name!=‘‘"> or identify = #{name} </if> </select>