code: public <S> S queryOne(Class<S> type, String sql, Object[] params) {
          Connection conn = getConn();
          try {
              Query query = conn.createQuery(sql)
                      .withParams(params)
                      .setAutoDeriveColumnNames(true)
                      .throwOnMappingFailure(false);
  
              return ifReturn(AnimaUtils.isBasicType(type),
                      () -> query.executeScalar(type),
                      () -> query.executeAndFetchFirst(type));
          } finally {
              this.closeConn(conn);
              this.clean(null);
          }
      }
docs: Querying a model
  
  @param type   model type
  @param sql    sql statement
  @param params params
  @param <S>
  @return S