MyBatis动态SQL:<if test="">中如果有两个参数而且还要比较大小应该怎么设置?

Max和Min是我写的一个实体类的成员,我查询时传的参数是类,test里面如果对Min和Max比较大小应该怎么办,

 <if test="">
    AND nkill BETWEEN #{Min} AND #{Max}
  </if>


 <resultMap id="BaseResultMap" type="com.vivi.model.Role" >
    <id column="MIN" property="Min" jdbcType="DECIMAL" />
    <result column="MAX" property="Max" jdbcType="DECIMAL" />
  </resultMap>
    <insert id="insertSelective" parameterType="com.vivi.model.Role" >

      <if test="Min < Max" >
           AND nkill BETWEEN #{Min} AND #{Max}
      </if>
      <if test="Min > Max" >
           AND nkill BETWEEN #{Max} AND #{Min}
      </if>
 <if test="Min < Max">