@@ -4,6 +4,7 @@ |
* |
* @author SrinivasReddy kontham |
* @ update Rumpal Sidhu |
+ * @ update Sandeep Kasavaraju |
*/ |
import csip.ModelDataService; |
import static csip.ModelDataService.EXEC_OK; |
@@ -67,73 +68,60 @@ |
int psurf_trap_techn_score = 0; |
|
for (Input ip : components) { |
- String query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern ='Nitrogen in Ground Water';"; |
+ String query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id = "+ip.plan_techn_id+" AND wqm_concern ='Nitrogen in Ground Water';"; |
ResultSet resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int techn_score = resultset.getInt("nut_tech_score"); |
nleach_techn_score += techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id= " + ip.plan_techn_id |
- + " AND wqm_concern = 'Nitrogen in Ground Water' AND mode_of_action = 'Avoid';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id="+ip.plan_techn_id+" AND wqm_concern = 'Nitrogen in Ground Water' AND mode_of_action = 'Avoid';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int avoid_techn_score = resultset.getInt("nut_tech_score"); |
nleach_avoid_techn_score += avoid_techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Nitrogen in Ground Water' AND mode_of_action = 'Control';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id ="+ip.plan_techn_id+" AND wqm_concern = 'Nitrogen in Ground Water' AND mode_of_action = 'Control';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int control_techn_score = resultset.getInt("nut_tech_score"); |
nleach_control_techn_score += control_techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Nitrogen in Ground Water' AND mode_of_action = 'Trap';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id ="+ ip.plan_techn_id+" AND wqm_concern = 'Nitrogen in Ground Water' AND mode_of_action = 'Trap';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int trap_techn_score = resultset.getInt("nut_tech_score"); |
- nleach_trap_techn_score += trap_techn_score; |
+ //previously |
+ //nleach_trap_techn_score += trap_techn_score; |
+ //new |
+ nleach_trap_techn_score = nleach_avoid_techn_score+trap_techn_score; |
} |
|
// #Compute nutrient technique mitigation scores for Nitrogen in Surface Water concern and increment total scores |
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Nitrogen in Surface Water';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id ="+ip.plan_techn_id+" AND wqm_concern = 'Nitrogen in Surface Water';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int techn_score = resultset.getInt("nut_tech_score"); |
nsurf_techn_score += techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Nitrogen in Surface Water' AND mode_of_action = 'Avoid';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id ="+ip.plan_techn_id+" AND wqm_concern = 'Nitrogen in Surface Water' AND mode_of_action = 'Avoid';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int avoid_techn_score = resultset.getInt("nut_tech_score"); |
nsurf_avoid_techn_score += avoid_techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Nitrogen in Surface Water' AND mode_of_action = 'Control';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id ="+ ip.plan_techn_id+" AND wqm_concern = 'Nitrogen in Surface Water' AND mode_of_action= 'Control';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int control_techn_score = resultset.getInt("nut_tech_score"); |
nsurf_control_techn_score += control_techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Nitrogen in Surface Water' AND mode_of_action = 'Trap';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id = " + ip.plan_techn_id+ " AND wqm_concern= 'Nitrogen in Surface Water' AND mode_of_action= 'Trap';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int trap_techn_score = resultset.getInt("nut_tech_score"); |
@@ -141,38 +129,28 @@ |
} |
|
//#Compute nutrient technique mitigation scores for Phosphorus in Surface Water concern and increment total scores |
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Phosphorous in Surface Water'" |
- + " AND tech_discrim_type ='" + ip.plan_techn_discrim_type |
- + "' AND tech_discrim = '" + ip.plan_techn_discrim + "';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id ="+ ip.plan_techn_id+" AND wqm_concern = 'Phosphorous in Surface Water'"+ " AND tech_discrim_type =" + ip.plan_techn_discrim_type+" AND tech_discrim =" + ip.plan_techn_discrim + ";"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int techn_score = resultset.getInt("nut_tech_score"); |
psurf_techn_score += techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Phosphorus in Surface Water' AND mode_of_action = 'Avoid';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id = " + ip.plan_techn_id+" AND wqm_concern = 'Phosphorus in Surface Water' AND mode_of_action = 'Avoid';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int avoid_techn_score = resultset.getInt("nut_tech_score"); |
psurf_avoid_techn_score += avoid_techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + "AND wqm_concern = 'Phosphorus in Surface Water' AND mode_of_action = 'Control';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id ="+ ip.plan_techn_id+" AND wqm_concern ='Phosphorus in Surface Water' AND mode_of_action ='Control';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int control_techn_score = resultset.getInt("nut_tech_score"); |
psurf_control_techn_score += control_techn_score; |
} |
|
- query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores " |
- + "WHERE nutrient_technique_id = " + ip.plan_techn_id |
- + " AND wqm_concern = 'Phosphorus in Surface Water' AND mode_of_action = 'Trap';"; |
+ query = "SELECT nut_tech_score FROM wqm_nutrient_technique_scores WHERE nutrient_technique_id =" + ip.plan_techn_id+" AND wqm_concern ='Phosphorus in Surface Water' AND mode_of_action ='Trap';"; |
resultset = statement.executeQuery(query); |
while (resultset.next()) { |
int trap_techn_score = resultset.getInt("nut_tech_score"); |
@@ -26,116 +26,6 @@ |
"value": "", |
"Description": "value of the discriminator: HIGH,MEDIUM, LOW, NO SOIL TEST" |
} |
- ], |
- [ |
- { |
- "name": "AoAid", |
- "value": 1, |
- "Description": "Area of Analysis Identifier" |
- }, |
- { |
- "name": "plan_techn_id", |
- "value": 5, |
- "Description": "nutrient management technique identifier corresponding to nutrient_technique_score_id value in WQM data mart" |
- }, |
- { |
- "name": "plan_techn_discrim_type", |
- "value": "", |
- "Description": "type of discriminator for varying nutrient management technique scores; value is “soil test result” otherwise NULL" |
- }, |
- { |
- "name": "plan_techn_discrim", |
- "value": "", |
- "Description": "value of the discriminator: HIGH,MEDIUM, LOW, NO SOIL TEST" |
- } |
- ], |
- [ |
- { |
- "name": "AoAid", |
- "value": 1, |
- "Description": "Area of Analysis Identifier" |
- }, |
- { |
- "name": "plan_techn_id", |
- "value": 8, |
- "Description": "nutrient management technique identifier corresponding to nutrient_technique_score_id value in WQM data mart" |
- }, |
- { |
- "name": "plan_techn_discrim_type", |
- "value": "Soil test result", |
- "Description": "type of discriminator for varying nutrient management technique scores; value is “soil test result” otherwise NULL" |
- }, |
- { |
- "name": "plan_techn_discrim", |
- "value": "Medium", |
- "Description": "value of the discriminator: HIGH,MEDIUM, LOW, NO SOIL TEST" |
- } |
- ], |
- [ |
- { |
- "name": "AoAid", |
- "value": 1, |
- "Description": "Area of Analysis Identifier" |
- }, |
- { |
- "name": "plan_techn_id", |
- "value": 14, |
- "Description": "nutrient management technique identifier corresponding to nutrient_technique_score_id value in WQM data mart" |
- }, |
- { |
- "name": "plan_techn_discrim_type", |
- "value": "", |
- "Description": "type of discriminator for varying nutrient management technique scores; value is “soil test result” otherwise NULL" |
- }, |
- { |
- "name": "plan_techn_discrim", |
- "value": "", |
- "Description": "value of the discriminator: HIGH,MEDIUM, LOW, NO SOIL TEST" |
- } |
- ], |
- [ |
- { |
- "name": "AoAid", |
- "value": 1, |
- "Description": "Area of Analysis Identifier" |
- }, |
- { |
- "name": "plan_techn_id", |
- "value": 2, |
- "Description": "nutrient management technique identifier corresponding to nutrient_technique_score_id value in WQM data mart" |
- }, |
- { |
- "name": "plan_techn_discrim_type", |
- "value": "", |
- "Description": "type of discriminator for varying nutrient management technique scores; value is “soil test result” otherwise NULL" |
- }, |
- { |
- "name": "plan_techn_discrim", |
- "value": "", |
- "Description": "value of the discriminator: HIGH,MEDIUM, LOW, NO SOIL TEST" |
- } |
- ], |
- [ |
- { |
- "name": "AoAid", |
- "value": 1, |
- "Description": "Area of Analysis Identifier" |
- }, |
- { |
- "name": "plan_techn_id", |
- "value": 9, |
- "Description": "nutrient management technique identifier corresponding to nutrient_technique_score_id value in WQM data mart" |
- }, |
- { |
- "name": "plan_techn_discrim_type", |
- "value": "", |
- "Description": "type of discriminator for varying nutrient management technique scores; value is “soil test result” otherwise NULL" |
- }, |
- { |
- "name": "plan_techn_discrim", |
- "value": "", |
- "Description": "value of the discriminator: HIGH,MEDIUM, LOW, NO SOIL TEST" |
- } |
] |
] |
} |