-
Notifications
You must be signed in to change notification settings - Fork 20
[ISTE-71] - Modified water search query for reindexing #808
Conversation
WalkthroughThe recent changes in the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- municipal-services/ws-services/src/main/java/org/egov/waterconnection/repository/builder/WsQueryBuilder.java (2 hunks)
@@ -59,7 +59,7 @@ public class WsQueryBuilder { | |||
+ " conn.locality, conn.isoldapplication, conn.roadtype, document.id as doc_Id, document.documenttype, document.filestoreid, document.active as doc_active, plumber.id as plumber_id," | |||
+ " plumber.name as plumber_name, plumber.licenseno, roadcuttingInfo.id as roadcutting_id, roadcuttingInfo.roadtype as roadcutting_roadtype, roadcuttingInfo.roadcuttingarea as roadcutting_roadcuttingarea, roadcuttingInfo.roadcuttingarea as roadcutting_roadcuttingarea," | |||
+ " roadcuttingInfo.active as roadcutting_active, plumber.mobilenumber as plumber_mobileNumber, plumber.gender as plumber_gender, plumber.fatherorhusbandname, plumber.correspondenceaddress," | |||
+ " plumber.relationship, " + "{holderSelectValues}, " + "{pendingAmountValue}," + "{taxamount}, "+ "{lastDemandDate}" | |||
+ " plumber.relationship, " + "{holderSelectValues}, " + "{pendingAmountValue}," + "(select sum(dd.taxamount) as taxamount from egbs_demand_v1 d join egbs_demanddetail_v1 dd on d.id=dd.demandid group by d.consumercode,d.status having d.status ='ACTIVE' and d.consumercode=conn.connectionno ) as taxamount, "+ "{lastDemandDate}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensure the SQL query is correctly formatted and optimized.
The SQL query for calculating taxamount
is complex and involves multiple joins and a subquery. Consider optimizing this query to improve performance, especially if the database is large. Additionally, ensure that the fields used in the query (taxamount
, demandid
, consumercode
, etc.) are indexed to speed up the query execution.
// finalQuery=finalQuery.replace("{taxamount}", | ||
// "(select sum(dd.taxamount) as taxamount from egbs_demand_v1 d join egbs_demanddetail_v1 dd on d.id=dd.demandid group by d.consumercode,d.status having d.status ='ACTIVE' and d.consumercode=conn.connectionno ) as taxamount"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review the commented-out code for potential removal or reintegration.
The section calculating taxamount
has been commented out. If this code is no longer needed, it should be removed to keep the codebase clean. If it might be needed in the future, consider adding a detailed comment explaining why it is commented out and under what conditions it should be reintegrated.
Summary by CodeRabbit
taxamount
andpendingAmountValue
calculations in the water connection service.