IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29092


Ignore:
Timestamp:
Sep 1, 2010, 12:33:21 PM (16 years ago)
Author:
rhenders
Message:

Simplified batch getting methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm

    r29087 r29092  
    1515#
    1616###########################################################################
    17 sub getListOfBatchesOnDatastore {
     17sub getBatches {
    1818    my ($self, $batches, $fromTime, $toTime) = @_;
    1919
    2020    my $query = $self->{_db}->prepare(<<SQL);
    21     SELECT created, exp_id, batch_id, survey_id, deleted
     21    SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged
    2222        FROM batches
    23         WHERE processed = 1
    24         AND on_datastore = 1
    25         AND created >= '$fromTime'
     23        WHERE created >= '$fromTime'
    2624        AND created <= '$toTime';
    2725SQL
     
    4139#
    4240###########################################################################
    43 sub getSingleBatch{
     41sub getBatch{
    4442    my ($self, $batch_id, $batches) = @_;
    4543
    4644    my $query = $self->{_db}->prepare(<<SQL);
    47     SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db
     45    SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged
    4846        FROM batches
    4947        WHERE batch_id = $batch_id
    50 SQL
    51  
    52     $query->execute;
    53     ${$batches} = $query->fetchall_arrayref();
    54     my $count = scalar @{${$batches}};
    55 
    56    printf( "* Found %d batch%s\n", $count, ($count==1) ? "" : "es");
    57    return $count;
    58 }
    59 
    60 ###########################################################################
    61 #
    62 # Returns a info about one particular batch on the datastore
    63 #
    64 ###########################################################################
    65 sub getSingleBatchOnDatastore{
    66     my ($self, $batch_id, $batches) = @_;
    67 
    68     my $query = $self->{_db}->prepare(<<SQL);
    69     SELECT created, exp_id, batch_id, survey_id, deleted
    70         FROM batches
    71         WHERE batch_id = $batch_id
    72         AND processed = 1
    73         AND on_datastore = 1;
    7448SQL
    7549 
Note: See TracChangeset for help on using the changeset viewer.