| 1 |
pjm2 |
1.1 |
//---PACKAGE DECLARATION--- |
| 2 |
|
|
|
| 3 |
|
|
//---IMPORTS--- |
| 4 |
|
|
import java.sql.*; |
| 5 |
|
|
|
| 6 |
|
|
/** |
| 7 |
|
|
* packet.processes.total report |
| 8 |
|
|
* |
| 9 |
|
|
* @author $Author: $ |
| 10 |
|
|
* @version $Id: $ |
| 11 |
|
|
*/ |
| 12 |
|
|
public class LoadLoad5__Report extends Report { |
| 13 |
|
|
|
| 14 |
|
|
//---FINAL ATTRIBUTES--- |
| 15 |
|
|
|
| 16 |
|
|
/** |
| 17 |
|
|
* The current CVS revision of this class |
| 18 |
|
|
*/ |
| 19 |
|
|
public final String REVISION = "$ Revision: $"; |
| 20 |
|
|
|
| 21 |
|
|
|
| 22 |
|
|
//---STATIC METHODS--- |
| 23 |
|
|
|
| 24 |
|
|
//---CONSTRUCTORS--- |
| 25 |
|
|
|
| 26 |
|
|
//---PUBLIC METHODS--- |
| 27 |
|
|
|
| 28 |
|
|
|
| 29 |
|
|
/** |
| 30 |
|
|
* This method overrides the superclass. It should be used to provide |
| 31 |
|
|
* special functionality for the report. |
| 32 |
|
|
*/ |
| 33 |
|
|
public String createReport(String directory, Statement stmt, String machine_name, long startDate, long endDate, int type){ |
| 34 |
|
|
|
| 35 |
|
|
// Use this key value from the parameter table for the report data. |
| 36 |
|
|
_reportField = "packet.load.load5"; |
| 37 |
|
|
|
| 38 |
|
|
_friendlyName = "Load 5"; |
| 39 |
|
|
|
| 40 |
|
|
// Use this select query. |
| 41 |
|
|
_sql = "SELECT receipt_date, value FROM "+DBParameters.PACKET_TABLE+" pkt, "+DBParameters.PARAMETER_TABLE+" param WHERE pkt.id=param.packet_id AND pkt.machine_name='"+ machine_name+"' AND pkt.receipt_date >= "+startDate+" AND pkt.receipt_date <= "+endDate+" AND param.name='"+_reportField+"' ORDER BY pkt.receipt_date;"; |
| 42 |
|
|
|
| 43 |
|
|
// Perform special custom functions here. |
| 44 |
|
|
// ..... |
| 45 |
|
|
|
| 46 |
|
|
// Or carry on with the normal method for creating reports. |
| 47 |
|
|
return super.createReport(directory, stmt, machine_name, startDate, endDate, type); |
| 48 |
|
|
} |
| 49 |
|
|
|
| 50 |
|
|
|
| 51 |
|
|
/** |
| 52 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
| 53 |
|
|
* method to provide clean logging (every class should have this). |
| 54 |
|
|
* |
| 55 |
|
|
* @return the name of this class and its CVS revision |
| 56 |
|
|
*/ |
| 57 |
|
|
public String toString() { |
| 58 |
|
|
return this.getClass().getName() + "(" + REVISION.substring(11, REVISION.length() - 2) + ")"; |
| 59 |
|
|
} |
| 60 |
|
|
|
| 61 |
|
|
//---PRIVATE METHODS--- |
| 62 |
|
|
|
| 63 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
| 64 |
|
|
|
| 65 |
|
|
//---ATTRIBUTES--- |
| 66 |
|
|
|
| 67 |
|
|
//---STATIC ATTRIBUTES--- |
| 68 |
|
|
|
| 69 |
|
|
} |