|
| 1 | +const [rows] = await connection.execute(` |
| 2 | + SELECT |
| 3 | + forms.id AS form_id, |
| 4 | + forms.farmer_name as name, |
| 5 | + forms.age, |
| 6 | + forms.mobile, |
| 7 | + forms.district, |
| 8 | + forms.block, |
| 9 | + forms.panchayat, |
| 10 | + forms.hamlet, |
| 11 | + forms.id_type as idCardType, |
| 12 | + forms.id_number as IdCardNumber, |
| 13 | + forms.gender, |
| 14 | + forms.spouse as fatherSpouse, |
| 15 | + forms.type_of_households as householdType, |
| 16 | + forms.h_members as hhcombined, |
| 17 | + forms.hh_occupation as occupationCombined, |
| 18 | + forms.special_catog as specialCategoryNumber, |
| 19 | + forms.caste, |
| 20 | + forms.house_owner as houseOwnership, |
| 21 | + forms.type_of_house as houseType, |
| 22 | + forms.drinking_water as drinkingWaterCombined, |
| 23 | + forms.potability as potabilityCombined, |
| 24 | + forms.domestic_water as domesticWaterCombined, |
| 25 | + forms.toilet_avail as toiletAvailability, |
| 26 | + forms.toilet_cond as toiletCondition, |
| 27 | + forms.household_education as education |
| 28 | + FROM forms |
| 29 | + WHERE id = ? |
| 30 | + `, [1]); |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + const [rows] = await connection.execute(` |
| 36 | + SELECT |
| 37 | + form_lands.ownership AS landOwnershipType, |
| 38 | + form_lands.well_irrigation AS hasWell, |
| 39 | + form_lands.area_irrigated AS areaIrrigated, |
| 40 | + form_lands.irrigated_lands AS irrigatedLandCombined, |
| 41 | + form_lands.patta AS pattaNumber, |
| 42 | + form_lands.total_area AS totalArea, |
| 43 | + form_lands.taluk, |
| 44 | + form_lands.firka, |
| 45 | + form_lands.revenue AS revenueVillage, |
| 46 | + form_lands.crop_season AS cropSeasonCombined, |
| 47 | + form_lands.livestocks AS livestockCombined |
| 48 | + FROM form_lands |
| 49 | + WHERE id = ? |
| 50 | + `, [1]); |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +const [rows] = await connection.execute(` |
| 56 | + SELECT |
| 57 | + bank_details.account_holder_name AS accountHolderName, |
| 58 | + bank_details.account_number AS accountNumber, |
| 59 | + bank_details.bank_name AS bankName, |
| 60 | + bank_details.branch, |
| 61 | + bank_details.ifsc_code AS ifscCode, |
| 62 | + bank_details.farmer_ack AS farmerAgreed |
| 63 | + FROM bank_details |
| 64 | + WHERE id = ? |
| 65 | + `, [1]); |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + const [rows] = await connection.execute(` |
| 71 | + SELECT |
| 72 | + forms.created_at AS date, |
| 73 | + forms.lat AS latitude, |
| 74 | + forms.lon AS longitude, |
| 75 | + form_lands.sf_number AS sfNumber, |
| 76 | + form_lands.soil_type AS soilTypeCombined, |
| 77 | + form_lands.land_to_benefit AS landBenefit, |
| 78 | + form_lands.area_benefited AS proposalArea, |
| 79 | + form_lands.type_of_work AS workType, |
| 80 | + form_lands.any_other_works AS otherWorks, |
| 81 | + form_lands.p_contribution AS pradanContribution, |
| 82 | + form_lands.f_contribution AS farmerContribution, |
| 83 | + form_lands.total_est AS totalEstimate |
| 84 | + FROM forms |
| 85 | + INNER JOIN form_lands ON forms.id = form_lands.form_id |
| 86 | + WHERE forms.id = ? AND forms.form_type = ? |
| 87 | + `, [1, 1]); |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | +const [rows] = await connection.execute(` |
| 93 | + SELECT |
| 94 | + forms.created_at AS date, |
| 95 | + forms.lat AS latitude, |
| 96 | + forms.lon AS longitude, |
| 97 | + farm_pond_details.sf_number AS sfNumber, |
| 98 | + farm_pond_details.soil_type AS soilTypeCombined, |
| 99 | + farm_pond_details.land_to_benefit AS landBenefit, |
| 100 | + farm_pond_details.area_benefited AS proposalArea, |
| 101 | + farm_pond_details.length, |
| 102 | + farm_pond_details.breadth, |
| 103 | + farm_pond_details.depth, |
| 104 | + farm_pond_details.volume, |
| 105 | + farm_pond_details.p_contribution AS pradanContribution, |
| 106 | + farm_pond_details.f_contribution AS farmerContribution, |
| 107 | + farm_pond_details.total_est AS totalEstimate |
| 108 | + FROM forms |
| 109 | + INNER JOIN farm_pond_details ON forms.id = farm_pond_details.form_id |
| 110 | + WHERE forms.id = ? AND forms.form_type = ? |
| 111 | + `, [2, 2]); |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + const [rows] = await connection.execute(` |
| 118 | + SELECT |
| 119 | + forms.created_at AS date, |
| 120 | + forms.lat AS latitude, |
| 121 | + forms.lon AS longitude, |
| 122 | + plantation_details.sf_number AS sfNumber, |
| 123 | + plantation_details.soil_type AS soilTypeCombined, |
| 124 | + plantation_details.land_to_benefit AS landBenefit, |
| 125 | + plantation_details.area_benefited_by_proposal AS proposalArea, |
| 126 | + plantation_details.plantaions AS workType2, |
| 127 | + plantation_details.any_other_works AS otherWorks, |
| 128 | + plantation_details.p_contribution AS pradanContribution, |
| 129 | + plantation_details.f_contribution AS farmerContribution, |
| 130 | + plantation_details.total_est AS totalEstimate |
| 131 | + FROM forms |
| 132 | + INNER JOIN plantation_details ON forms.id = plantation_details.form_id |
| 133 | + WHERE forms.id = ? AND forms.form_type = ? |
| 134 | + `, [3, 3]); |
0 commit comments