Skip to content

Commit 8b285f2

Browse files
Merge pull request pradanvirudhunagar#44 from Churchill427/main
update query for postfunding
2 parents e3cf9b4 + b3bc063 commit 8b285f2

File tree

3 files changed

+168
-0
lines changed

3 files changed

+168
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//form_lands
2+
3+
4+
5+
const updateQuery = `
6+
UPDATE form_lands
7+
LEFT JOIN forms ON form_lands.form_id = forms.id
8+
LEFT JOIN files ON forms.id = files.form_id
9+
SET
10+
form_lands.p_contribution = ?,
11+
form_lands.f_contribution = ?,
12+
form_lands.total_est = ?,
13+
form_lands.measured_by = ?,
14+
form_lands.total_area = ?,
15+
files.passbook_postfunding = ?
16+
WHERE
17+
form_lands.form_id = ?
18+
AND forms.form_type = 1
19+
`;
20+
21+
//farm_pond_details
22+
23+
const updateQuery = `
24+
UPDATE farm_pond_details
25+
LEFT JOIN forms ON farm_pond_details.form_id = forms.id
26+
LEFT JOIN files ON forms.id = files.form_id
27+
SET
28+
farm_pond_details.p_contribution = ?,
29+
farm_pond_details.f_contribution = ?,
30+
farm_pond_details.total_est = ?,
31+
farm_pond_details.measured_by = ?,
32+
farm_pond_details.len_pf = ?,
33+
farm_pond_details.bre_pf = ?,
34+
farm_pond_details.dep_pf = ?,
35+
farm_pond_details.vol_pf = ?,
36+
files.passbook_postfunding = ?
37+
WHERE
38+
farm_pond_details.form_id = ?
39+
AND forms.form_type = 2
40+
`;
41+
42+
43+
//plantation_form
44+
45+
46+
const updateQuery = `
47+
UPDATE plantation_details
48+
LEFT JOIN forms ON plantation_details.form_id = forms.id
49+
LEFT JOIN files ON forms.id = files.form_id
50+
SET
51+
plantation_details.p_contribution = ?,
52+
plantation_details.f_contribution = ?,
53+
plantation_details.total_est = ?,
54+
plantation_details.plantaions = ?,
55+
plantation_details.nos = ?,
56+
plantation_details.price = ?,
57+
plantation_details.other_exp = ?,
58+
plantation_details.tot_nos = ?,
59+
plantation_details.tot_price = ?,
60+
plantation_details.measured_by = ?,
61+
plantation_details.total_area = ?,
62+
files.passbook_postfunding = ?
63+
WHERE
64+
plantation_details.form_id = ?
65+
AND forms.form_type = 3
66+
`;
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
//land form
2+
3+
4+
const selectQuery = `
5+
SELECT
6+
forms.farmer_name,
7+
forms.spouse,
8+
forms.mcode,
9+
forms.hamlet,
10+
forms.panchayat,
11+
forms.district,
12+
forms.block,
13+
form_lands.revenue,
14+
form_lands.p_contribution,
15+
form_lands.f_contribution,
16+
form_lands.total_area,
17+
form_lands.measured_by,
18+
form_lands.verified_by,
19+
form_lands.total_est
20+
FROM
21+
forms
22+
LEFT JOIN
23+
form_lands ON forms.id = form_lands.form_id
24+
WHERE
25+
forms.id = ?
26+
AND forms.form_type = 1
27+
`;
28+
29+
30+
31+
//pond form
32+
33+
const selectQuery1 = `
34+
SELECT
35+
forms.farmer_name,
36+
forms.spouse,
37+
forms.mcode,
38+
forms.hamlet,
39+
forms.panchayat,
40+
forms.district,
41+
forms.block,
42+
farm_pond_details.revenue,
43+
farm_pond_details.p_contribution,
44+
farm_pond_details.f_contribution,
45+
farm_pond_details.length,
46+
farm_pond_details.breadth,
47+
farm_pond_details.depth,
48+
farm_pond_details.volume,
49+
farm_pond_details.measured_by,
50+
farm_pond_details.verified_by,
51+
farm_pond_details.total_est
52+
FROM
53+
forms
54+
LEFT JOIN
55+
farm_pond_details ON forms.id = farm_pond_details.form_id
56+
WHERE
57+
forms.id = ?
58+
AND forms.form_type = 2
59+
`;
60+
61+
62+
63+
64+
//plantations
65+
66+
67+
68+
const selectQuery2 = `
69+
SELECT
70+
forms.farmer_name,
71+
forms.spouse,
72+
forms.mcode,
73+
forms.hamlet,
74+
forms.panchayat,
75+
forms.district,
76+
forms.block,
77+
plantation_details.revenue,
78+
plantation_details.total_area,
79+
plantation_details.plantaions,
80+
plantation_details.nos,
81+
plantation_details.price,
82+
plantation_details.other_exp,
83+
plantation_details.tot_nos,
84+
plantation_details.tot_price,
85+
plantation_details.p_contribution,
86+
plantation_details.f_contribution,
87+
plantation_details.measured_by,
88+
plantation_details.verified_by,
89+
plantation_details.total_est
90+
FROM
91+
forms
92+
LEFT JOIN
93+
plantation_details ON forms.id = plantation_details.form_id
94+
WHERE
95+
forms.id = ?
96+
AND forms.form_type = 3
97+
`;

sql_queries/status_updation.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const updateQuery = `
2+
UPDATE forms
3+
SET status = ?
4+
WHERE id = ?
5+
`;

0 commit comments

Comments
 (0)