Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LaMartin-Webomagic
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Deep Dey
LaMartin-Webomagic
Commits
bbdfe897
Commit
bbdfe897
authored
Jul 03, 2025
by
Deep Dey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add session year for backend apis along with additional filters
parent
47d06eac
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
18 deletions
+96
-18
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
...aMartin/admission/controller/AdmissionFormController.java
+31
-6
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
.../admission/dao/controller/AdmissionFormDAOController.java
+18
-6
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/repository/AdmissionFormDataRepository.java
...admission/dao/repository/AdmissionFormDataRepository.java
+44
-6
lamartinBackend/src/main/java/com/example/LaMartin/admission/model/AdmissionFormData.java
...m/example/LaMartin/admission/model/AdmissionFormData.java
+3
-0
No files found.
lamartinBackend/src/main/java/com/example/LaMartin/admission/controller/AdmissionFormController.java
View file @
bbdfe897
...
@@ -281,7 +281,10 @@ public class AdmissionFormController {
...
@@ -281,7 +281,10 @@ public class AdmissionFormController {
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
className
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
className
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
interactionDate
,
// 2022-01-01
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
interactionDate
,
// 2022-01-01
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
interactionTime
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
interactionTime
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
correspondenceEmail
// 10:00 AM
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
correspondenceEmail
,
// 10:00 AM
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
category
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
religion
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
sessionYear
)
throws
Exception
{
)
throws
Exception
{
// TODO: validation of api key using redis
// TODO: validation of api key using redis
...
@@ -295,7 +298,10 @@ public class AdmissionFormController {
...
@@ -295,7 +298,10 @@ public class AdmissionFormController {
className
,
className
,
interactionDate
,
interactionDate
,
interactionTime
,
interactionTime
,
correspondenceEmail
correspondenceEmail
,
category
,
religion
,
sessionYear
)
)
),
),
HttpStatus
.
OK
);
HttpStatus
.
OK
);
...
@@ -406,6 +412,9 @@ public class AdmissionFormController {
...
@@ -406,6 +412,9 @@ public class AdmissionFormController {
interactionDate
,
interactionDate
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
null
);
);
...
@@ -448,6 +457,9 @@ public class AdmissionFormController {
...
@@ -448,6 +457,9 @@ public class AdmissionFormController {
interactionDate
,
interactionDate
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
null
);
);
...
@@ -490,6 +502,9 @@ public class AdmissionFormController {
...
@@ -490,6 +502,9 @@ public class AdmissionFormController {
interactionDate
,
interactionDate
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
null
);
);
...
@@ -532,6 +547,9 @@ public class AdmissionFormController {
...
@@ -532,6 +547,9 @@ public class AdmissionFormController {
interactionDate
,
interactionDate
,
null
,
null
,
null
,
null
,
null
,
null
,
null
,
null
null
);
);
...
@@ -582,7 +600,10 @@ public class AdmissionFormController {
...
@@ -582,7 +600,10 @@ public class AdmissionFormController {
null
,
null
,
null
,
null
,
null
,
null
,
admissionDate
admissionDate
,
null
,
null
,
null
);
);
if
(
admissionFormDataList
.
isEmpty
())
{
if
(
admissionFormDataList
.
isEmpty
())
{
...
@@ -627,7 +648,10 @@ public class AdmissionFormController {
...
@@ -627,7 +648,10 @@ public class AdmissionFormController {
null
,
null
,
null
,
null
,
null
,
null
,
admissionDate
admissionDate
,
null
,
null
,
null
);
);
if
(
admissionFormDataList
.
isEmpty
())
{
if
(
admissionFormDataList
.
isEmpty
())
{
...
@@ -664,7 +688,8 @@ public class AdmissionFormController {
...
@@ -664,7 +688,8 @@ public class AdmissionFormController {
@ApiOperation
(
value
=
""
)
@ApiOperation
(
value
=
""
)
public
Object
getAdmissionFormsCount
(
public
Object
getAdmissionFormsCount
(
HttpServletRequest
request
,
HttpServletRequest
request
,
@RequestHeader
(
"apikey"
)
String
apiKey
@RequestHeader
(
"apikey"
)
String
apiKey
,
@RequestParam
(
required
=
false
,
defaultValue
=
""
)
String
sessionYear
)
throws
Exception
{
)
throws
Exception
{
// TODO: validation of api key using redis
// TODO: validation of api key using redis
...
@@ -673,7 +698,7 @@ public class AdmissionFormController {
...
@@ -673,7 +698,7 @@ public class AdmissionFormController {
true
,
true
,
AppConstants
.
RESPONSE_SUCCESS_STATUS_CODE
,
AppConstants
.
RESPONSE_SUCCESS_STATUS_CODE
,
"Data Fetched Successfully"
,
"Data Fetched Successfully"
,
this
.
admissionFormDAOController
.
getAdmissionFormCount
()
this
.
admissionFormDAOController
.
getAdmissionFormCount
(
sessionYear
)
),
),
HttpStatus
.
OK
);
HttpStatus
.
OK
);
}
}
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/controller/AdmissionFormDAOController.java
View file @
bbdfe897
...
@@ -104,7 +104,10 @@ public class AdmissionFormDAOController {
...
@@ -104,7 +104,10 @@ public class AdmissionFormDAOController {
String
interactionDate
,
String
interactionDate
,
String
interactionTime
,
String
interactionTime
,
String
correspondenceEmail
,
String
correspondenceEmail
,
String
admissionDate
String
admissionDate
,
String
category
,
String
religion
,
String
sessionYear
)
{
)
{
return
admissionFormDataRepository
.
getAdmissionFormDataList
(
return
admissionFormDataRepository
.
getAdmissionFormDataList
(
schoolName
,
schoolName
,
...
@@ -112,7 +115,10 @@ public class AdmissionFormDAOController {
...
@@ -112,7 +115,10 @@ public class AdmissionFormDAOController {
interactionDate
,
interactionDate
,
interactionTime
,
interactionTime
,
correspondenceEmail
,
correspondenceEmail
,
admissionDate
admissionDate
,
category
,
religion
,
sessionYear
);
);
}
}
...
@@ -121,14 +127,20 @@ public class AdmissionFormDAOController {
...
@@ -121,14 +127,20 @@ public class AdmissionFormDAOController {
String
className
,
String
className
,
String
interactionDate
,
String
interactionDate
,
String
interactionTime
,
String
interactionTime
,
String
correspondenceEmail
String
correspondenceEmail
,
String
category
,
String
religion
,
String
sessionYear
)
{
)
{
return
admissionFormDataRepository
.
getAdmissionFormDataListPreview
(
return
admissionFormDataRepository
.
getAdmissionFormDataListPreview
(
schoolName
,
schoolName
,
className
,
className
,
interactionDate
,
interactionDate
,
interactionTime
,
interactionTime
,
correspondenceEmail
correspondenceEmail
,
category
,
religion
,
sessionYear
);
);
}
}
...
@@ -236,8 +248,8 @@ public class AdmissionFormDAOController {
...
@@ -236,8 +248,8 @@ public class AdmissionFormDAOController {
return
updated
;
return
updated
;
}
}
public
AdmissionFormCount
getAdmissionFormCount
()
{
public
AdmissionFormCount
getAdmissionFormCount
(
String
sessionYear
)
{
return
admissionFormDataRepository
.
getAdmissionFormCount
();
return
admissionFormDataRepository
.
getAdmissionFormCount
(
sessionYear
);
}
}
public
byte
[]
convertAdmissionFormToExcel
(
List
<
AdmissionFormData
>
admissionFormDataList
,
boolean
showAdmission
)
throws
Exception
{
public
byte
[]
convertAdmissionFormToExcel
(
List
<
AdmissionFormData
>
admissionFormDataList
,
boolean
showAdmission
)
throws
Exception
{
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/dao/repository/AdmissionFormDataRepository.java
View file @
bbdfe897
...
@@ -56,7 +56,7 @@ public class AdmissionFormDataRepository {
...
@@ -56,7 +56,7 @@ public class AdmissionFormDataRepository {
"father_image_name, "
+
"father_image_name, "
+
"filled_by_admin, "
+
"filled_by_admin, "
+
"existing, "
+
"existing, "
+
"mother_image_name) "
+
"mother_image_name
, session_year
) "
+
"VALUES (:school, :category, :fullName, :admissionClass, "
+
"VALUES (:school, :category, :fullName, :admissionClass, "
+
":dateOfBirth, :nationality, :religion, :motherTongue, :community, "
+
":dateOfBirth, :nationality, :religion, :motherTongue, :community, "
+
":otherChildren, :maritalStatus, "
+
":otherChildren, :maritalStatus, "
+
...
@@ -85,7 +85,7 @@ public class AdmissionFormDataRepository {
...
@@ -85,7 +85,7 @@ public class AdmissionFormDataRepository {
":fatherImageName, "
+
":fatherImageName, "
+
":filledByAdmin, "
+
":filledByAdmin, "
+
":existing, "
+
":existing, "
+
":motherImageName)"
;
":motherImageName
, :sessionYear
)"
;
try
{
try
{
MapSqlParameterSource
params
=
new
MapSqlParameterSource
();
MapSqlParameterSource
params
=
new
MapSqlParameterSource
();
...
@@ -147,6 +147,7 @@ public class AdmissionFormDataRepository {
...
@@ -147,6 +147,7 @@ public class AdmissionFormDataRepository {
params
.
addValue
(
"motherImageName"
,
formData
.
getMotherImageName
());
params
.
addValue
(
"motherImageName"
,
formData
.
getMotherImageName
());
params
.
addValue
(
"filledByAdmin"
,
formData
.
isFilledByAdmin
());
params
.
addValue
(
"filledByAdmin"
,
formData
.
isFilledByAdmin
());
params
.
addValue
(
"existing"
,
formData
.
isExisting
());
params
.
addValue
(
"existing"
,
formData
.
isExisting
());
params
.
addValue
(
"sessionYear"
,
formData
.
getSessionYear
());
KeyHolder
keyHolder
=
new
GeneratedKeyHolder
();
KeyHolder
keyHolder
=
new
GeneratedKeyHolder
();
int
cnt
=
namedParameterJdbcTemplate
.
update
(
sql
,
params
,
keyHolder
);
int
cnt
=
namedParameterJdbcTemplate
.
update
(
sql
,
params
,
keyHolder
);
...
@@ -169,7 +170,10 @@ public class AdmissionFormDataRepository {
...
@@ -169,7 +170,10 @@ public class AdmissionFormDataRepository {
String
className
,
String
className
,
String
interactionDate
,
String
interactionDate
,
String
interactionTime
,
String
interactionTime
,
String
correspondenceEmail
String
correspondenceEmail
,
String
category
,
String
religion
,
String
sessionYear
)
{
)
{
StringBuilder
sql
=
new
StringBuilder
(
StringBuilder
sql
=
new
StringBuilder
(
"""
"""
...
@@ -207,6 +211,19 @@ public class AdmissionFormDataRepository {
...
@@ -207,6 +211,19 @@ public class AdmissionFormDataRepository {
parameters
.
addValue
(
"correspondenceEmail"
,
correspondenceEmail
);
parameters
.
addValue
(
"correspondenceEmail"
,
correspondenceEmail
);
}
}
if
(
category
!=
null
&&
!
category
.
isEmpty
())
{
sql
.
append
(
" AND afd.category = :category"
);
parameters
.
addValue
(
"category"
,
category
);
}
if
(
religion
!=
null
&&
!
religion
.
isEmpty
())
{
sql
.
append
(
" AND afd.religion = :religion"
);
parameters
.
addValue
(
"religion"
,
religion
);
}
if
(
sessionYear
!=
null
&&
!
sessionYear
.
isEmpty
())
{
sql
.
append
(
" AND afd.session_year = :sessionYear"
);
parameters
.
addValue
(
"sessionYear"
,
sessionYear
);
}
sql
.
append
(
" ORDER BY afd.id ASC"
);
sql
.
append
(
" ORDER BY afd.id ASC"
);
return
namedParameterJdbcTemplate
return
namedParameterJdbcTemplate
...
@@ -219,7 +236,10 @@ public class AdmissionFormDataRepository {
...
@@ -219,7 +236,10 @@ public class AdmissionFormDataRepository {
String
interactionDate
,
String
interactionDate
,
String
interactionTime
,
String
interactionTime
,
String
correspondenceEmail
,
String
correspondenceEmail
,
String
admissionDate
String
admissionDate
,
String
category
,
String
religion
,
String
sessionYear
)
{
)
{
StringBuilder
sql
=
new
StringBuilder
(
StringBuilder
sql
=
new
StringBuilder
(
"""
"""
...
@@ -261,6 +281,19 @@ public class AdmissionFormDataRepository {
...
@@ -261,6 +281,19 @@ public class AdmissionFormDataRepository {
parameters
.
addValue
(
"admissionDate"
,
admissionDate
);
parameters
.
addValue
(
"admissionDate"
,
admissionDate
);
}
}
if
(
category
!=
null
&&
!
category
.
isEmpty
())
{
sql
.
append
(
" AND afd.category = :category"
);
parameters
.
addValue
(
"category"
,
category
);
}
if
(
religion
!=
null
&&
!
religion
.
isEmpty
())
{
sql
.
append
(
" AND afd.religion = :religion"
);
parameters
.
addValue
(
"religion"
,
religion
);
}
if
(
sessionYear
!=
null
&&
!
sessionYear
.
isEmpty
())
{
sql
.
append
(
" AND afd.session_year = :sessionYear"
);
parameters
.
addValue
(
"sessionYear"
,
sessionYear
);
}
sql
.
append
(
" ORDER BY afd.id DESC"
);
sql
.
append
(
" ORDER BY afd.id DESC"
);
return
namedParameterJdbcTemplate
return
namedParameterJdbcTemplate
.
query
(
sql
.
toString
(),
parameters
,
new
AdmissionFormMapper
());
.
query
(
sql
.
toString
(),
parameters
,
new
AdmissionFormMapper
());
...
@@ -330,15 +363,20 @@ public class AdmissionFormDataRepository {
...
@@ -330,15 +363,20 @@ public class AdmissionFormDataRepository {
return
rowsAffected
>
0
;
return
rowsAffected
>
0
;
}
}
public
AdmissionFormCount
getAdmissionFormCount
()
{
public
AdmissionFormCount
getAdmissionFormCount
(
String
sessionYear
)
{
String
sql
=
"""
String
sql
=
"""
SELECT
SELECT
COUNT(CASE WHEN school = 'La Martiniere for Boys' THEN 1 END) AS LMBCount,
COUNT(CASE WHEN school = 'La Martiniere for Boys' THEN 1 END) AS LMBCount,
COUNT(CASE WHEN school = 'La Martiniere for Girls' THEN 1 END) AS LMGCount
COUNT(CASE WHEN school = 'La Martiniere for Girls' THEN 1 END) AS LMGCount
FROM admission_form_data
FROM admission_form_data
where 1=1
"""
;
"""
;
MapSqlParameterSource
parameters
=
new
MapSqlParameterSource
();
MapSqlParameterSource
parameters
=
new
MapSqlParameterSource
();
if
(
sessionYear
!=
null
&&
!
sessionYear
.
isEmpty
())
{
sql
+=
" AND session_year = :sessionYear"
;
parameters
.
addValue
(
"sessionYear"
,
sessionYear
);
}
return
namedParameterJdbcTemplate
return
namedParameterJdbcTemplate
.
queryForObject
(
sql
,
parameters
,
new
AdmissionFormCountMapper
());
.
queryForObject
(
sql
,
parameters
,
new
AdmissionFormCountMapper
());
}
}
...
...
lamartinBackend/src/main/java/com/example/LaMartin/admission/model/AdmissionFormData.java
View file @
bbdfe897
...
@@ -110,4 +110,7 @@ public class AdmissionFormData {
...
@@ -110,4 +110,7 @@ public class AdmissionFormData {
private
boolean
filledByAdmin
;
private
boolean
filledByAdmin
;
private
boolean
existing
;
private
boolean
existing
;
private
boolean
provisional
;
private
boolean
provisional
;
@NotEmpty
(
message
=
"Session Year cannot be empty"
)
private
String
sessionYear
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment