Changeset 29186
- Timestamp:
- Sep 21, 2010, 4:38:03 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm
r29092 r29186 9 9 our @ISA = qw(ippToPsps::MySQLDb); # inherits from MySQLDb 10 10 11 12 11 ########################################################################### 13 12 # … … 19 18 20 19 my $query = $self->{_db}->prepare(<<SQL); 21 SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged20 SELECT created, batch_type, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged 22 21 FROM batches 23 22 WHERE created >= '$fromTime' 24 AND created <= '$toTime' ;23 AND created <= '$toTime' 25 24 SQL 26 25 … … 30 29 my $count = scalar @{${$batches}}; 31 30 32 printf( "* Found %d batch%s\n", $count, ($count==1) ? "" : "es");33 31 return $count; 34 32 } … … 43 41 44 42 my $query = $self->{_db}->prepare(<<SQL); 45 SELECT created, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged43 SELECT created, batch_type, exp_id, batch_id, survey_id, deleted, dvo_db, processed, on_datastore, loaded_to_ODM, merge_worthy, merged 46 44 FROM batches 47 45 WHERE batch_id = $batch_id … … 52 50 my $count = scalar @{${$batches}}; 53 51 54 printf( "* Found %d batch%s\n", $count, ($count==1) ? "" : "es");55 52 return $count; 56 53 } … … 103 100 # 104 101 ######################################################################################## 105 sub updateBatch{106 my ($self, $batchId, $expId, $ processed, $published, $totalDetections, $minObjId, $maxObjId) = @_;102 sub setAsProcessed { 103 my ($self, $batchId, $expId, $totalDetections, $minObjId, $maxObjId) = @_; 107 104 108 105 if (!$minObjId) {$minObjId = -1;} … … 114 111 UPDATE batches 115 112 SET 116 processed = $processed, 117 on_datastore = $published, 113 processed = 1, 118 114 total_detections = $totalDetections, 119 115 min_obj_id = $minObjId, … … 128 124 ####################################################################################### 129 125 # 126 # Sets published state of a batch 127 # 128 ######################################################################################## 129 sub setPublished { 130 my ($self, $batchId, $expId, $published) = @_; 131 132 my $query = $self->{_db}->prepare(<<SQL); 133 UPDATE batches 134 SET on_datastore = $published 135 WHERE batch_id = $batchId 136 AND exp_id = $expId; 137 SQL 138 139 $query->execute; # TODO check response of this 140 } 141 142 ####################################################################################### 143 # 130 144 # Checks whether we have successfully processed this exposure 131 145 # … … 138 152 FROM batches 139 153 WHERE exp_id = $expId 140 AND created > '2010-08-12'141 154 AND processed = 1; 142 155 SQL … … 179 192 $query->execute; 180 193 181 print "* New batch '$batchId' for exposure ID = $expIdand survey = '$surveyType'\n";194 print "* New batch '$batchId' for exposure ID = '$expId' and survey = '$surveyType'\n"; 182 195 183 196 return $batchId;
Note:
See TracChangeset
for help on using the changeset viewer.
