@@ -0,0 +1,2517 @@
+package selling.sunshine.handler.mybatis.withdraw;%0A%0Aimport org.apache.ibatis.type.BaseTypeHandler;%0Aimport org.apache.ibatis.type.JdbcType;%0Aimport selling.sunshine.model.WithdrawStatus;%0A%0Aimport java.sql.CallableStatement;%0Aimport java.sql.PreparedStatement;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0A%0A/**%0A * Created by sunshine on 6/6/16.%0A */%0Apublic class WithdrawStatusHandler extends BaseTypeHandler%3CWithdrawStatus%3E %7B%0A    private Class%3CWithdrawStatus%3E type;%0A    private final WithdrawStatus%5B%5D enums;%0A%0A    public WithdrawStatusHandler(Class%3CWithdrawStatus%3E type) %7B%0A        if (type == null) %7B%0A            throw new IllegalArgumentException(%22Type argument cannot be null%22);%0A        %7D%0A        this.type = type;%0A        this.enums = type.getEnumConstants();%0A        if (this.enums == null) %7B%0A            throw new IllegalArgumentException(type.getSimpleName()%0A                    + %22 does not represent an enum type.%22);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public void setNonNullParameter(PreparedStatement preparedStatement, int i, WithdrawStatus billStatus, JdbcType jdbcType) throws SQLException %7B%0A        preparedStatement.setInt(i, billStatus.getCode());%0A    %7D%0A%0A    @Override%0A    public WithdrawStatus getNullableResult(ResultSet resultSet, String s) throws SQLException %7B%0A        int i = resultSet.getInt(s);%0A%0A        if (resultSet.wasNull()) %7B%0A            return null;%0A        %7D else %7B%0A            // %E6%A0%B9%E6%8D%AE%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%AD%E7%9A%84code%E5%80%BC%EF%BC%8C%E5%AE%9A%E4%BD%8DEnumStatus%E5%AD%90%E7%B1%BB%0A            return locateEnumStatus(i);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public WithdrawStatus getNullableResult(ResultSet resultSet, int i) throws SQLException %7B%0A        int index = resultSet.getInt(i);%0A        if (resultSet.wasNull()) %7B%0A            return null;%0A        %7D else %7B%0A            // %E6%A0%B9%E6%8D%AE%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%AD%E7%9A%84code%E5%80%BC%EF%BC%8C%E5%AE%9A%E4%BD%8DEnumStatus%E5%AD%90%E7%B1%BB%0A            return locateEnumStatus(index);%0A        %7D%0A    %7D%0A%0A    @Override%0A    public WithdrawStatus getNullableResult(CallableStatement callableStatement, int i) throws SQLException %7B%0A        int index = callableStatement.getInt(i);%0A        if (callableStatement.wasNull()) %7B%0A            return null;%0A        %7D else %7B%0A            // %E6%A0%B9%E6%8D%AE%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%AD%E7%9A%84code%E5%80%BC%EF%BC%8C%E5%AE%9A%E4%BD%8DEnumStatus%E5%AD%90%E7%B1%BB%0A            return locateEnumStatus(index);%0A        %7D%0A    %7D%0A%0A    private WithdrawStatus locateEnumStatus(int code) %7B%0A        for (WithdrawStatus status : enums) %7B%0A            if (status.getCode() == (Integer.valueOf(code))) %7B%0A                return status;%0A            %7D%0A        %7D%0A        throw new IllegalArgumentException(%22%E6%9C%AA%E7%9F%A5%E7%9A%84%E6%9E%9A%E4%B8%BE%E7%B1%BB%E5%9E%8B%EF%BC%9A%22 + code + %22,%E8%AF%B7%E6%A0%B8%E5%AF%B9%22 + type.getSimpleName());%0A    %7D%0A%7D%0A

add withdraw status handler