mybatis date参数
    在Mybatis中,我们可以使用Java的Date或者Calendar类型来传递日期参数。例如:
    ```
    public interface UserMapper {
    List<User> selectByBirthday(Date birthday);
    }
    ```
    在l中,可以使用#{}来表示参数占位符,例如:
    ```
    <select id='selectByBirthday' resultType='User'>
    select * from user where birthday = #{birthday}
    </select>
    ```
    当我们调用selectByBirthday方法时,可以传递一个Date类型的参数,Mybatis会自动将其转换成数据库所需要的日期格式。例如:
    ```
    Date birthday = new Date();
    List<User> users = userMapper.selectByBirthday(birthday);
    ```
    以上代码会查询出所有生日为今天的用户。java时间日期格式转换
    需要注意的是,Mybatis中默认的日期格式为yyyy-MM-dd HH:mm:ss,如果需要使用其他格式,可以通过在Mybatis配置文件中设置typeHandler的方式来实现。例如:
    ```
    <typeHandlers>
    <typeHandler jdbcType='DATE' javaType='java.util.Date' handler='ample.MyDateTypeHandler'/>
    </typeHandlers>
    ```
    此处我们自定义了一个MyDateTypeHandler,用于将日期类型转换成指定的格式。例如:
    ```
    public class MyDateTypeHandler extends BaseTypeHandler<Date> {
    private SimpleDateFormat sdf = new SimpleDateFormat('yyyy/MM/dd');
    @Override
    public void setNonNullParameter(PreparedStatement ps, int i, Date parameter, JdbcType jdbcType) throws SQLException {
    ps.setString(i, sdf.format(parameter));
    }
    @Override
    public Date getNullableResult(ResultSet rs, String columnName) throws SQLException {
    String str = rs.getString(columnName);
    return str == null ? null : new Date(str);
    }
    @Override
    public Date getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
    String str = rs.getString(columnIndex);
    return str == null ? null : new Date(str);
    }
    @Override
    public Date getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
    String str = cs.getString(columnIndex);
    return str == null ? null : new Date(str);
    }
    }
    ```
    以上是一个简单的自定义TypeHandler的例子,其中setNonNullParameter用于将Java类型转换成数据库类型,getNullableResult用于将数据库类型转换成Java类型。这里我们自定义了日期格式为yyyy/MM/dd。