diff --git a/configs/egov-searcher/bill-genie.yml b/configs/egov-searcher/bill-genie.yml index 6986cab4..905565a9 100644 --- a/configs/egov-searcher/bill-genie.yml +++ b/configs/egov-searcher/bill-genie.yml @@ -95,7 +95,7 @@ SearchDefinitions: rowMapperKey: billsearch query: baseQuery: with bill_data as ( - SELECT conn.status as conn_status,conn.property_id as pid,conn.oldConnectionNo as oldpid,conn.additionaldetails as conn_add,b.id AS b_id, b.mobilenumber, + SELECT conn.status as conn_status,conn.property_id as pid,conn.oldConnectionNo as oldpid,conn.additionaldetails as conn_add,b.id AS b_id, b.mobilenumber, b.tenantid AS b_tenantid, b.payername AS b_payername, b.payeraddress AS b_payeraddress, b.payeremail AS b_payeremail, b.isactive AS b_isactive, b.iscancelled AS b_iscancelled, @@ -131,7 +131,7 @@ SearchDefinitions: INNER JOIN eg_pt_address ptadd ON ptadd.propertyid = pt.id INNER JOIN eg_pt_owner ptown ON ptown.propertyid = pt.id $where ) - select * from bill_data inner join (select max(b_createddate) as maxcreateddate, bd_consumercode from bill_data group by bd_consumercode) as max ON max.maxcreateddate=b_createddate + select * from bill_data inner join (select max(b_createddate) as maxcreateddate, bd_consumercode from bill_data group by bd_consumercode) as max ON max.maxcreateddate=b_createddate searchParams: condition: AND params: @@ -166,6 +166,10 @@ SearchDefinitions: - name: b.status isMandatory: false jsonPath: $.searchCriteria.billActive + - name: conn.property_id + isMandatory: false + jsonPath: $.searchCriteria.propertyId + output: jsonFormat: {"ResponseInfo": {},"Bills": []} @@ -180,7 +184,7 @@ SearchDefinitions: rowMapperKey: billsearch query: baseQuery: with bill_data as ( - SELECT conn.status as conn_status,conn.property_id as pid,conn.oldConnectionNo as oldpid,conn.additionaldetails as conn_add,b.id AS b_id, b.mobilenumber, + SELECT conn.status as conn_status,conn.property_id as pid,conn.oldConnectionNo as oldpid,conn.additionaldetails as conn_add,b.id AS b_id, b.mobilenumber, b.tenantid AS b_tenantid, b.payername AS b_payername, b.payeraddress AS b_payeraddress, b.payeremail AS b_payeremail, b.isactive AS b_isactive, b.iscancelled AS b_iscancelled, @@ -216,7 +220,7 @@ SearchDefinitions: INNER JOIN eg_pt_address ptadd ON ptadd.propertyid = pt.id INNER JOIN eg_pt_owner ptown ON ptown.propertyid = pt.id $where ) - select * from bill_data inner join (select max(b_createddate) as maxcreateddate, bd_consumercode from bill_data group by bd_consumercode) as max ON max.maxcreateddate=b_createddate + select * from bill_data inner join (select max(b_createddate) as maxcreateddate, bd_consumercode from bill_data group by bd_consumercode) as max ON max.maxcreateddate=b_createddate searchParams: condition: AND params: @@ -251,18 +255,21 @@ SearchDefinitions: - name: b.status isMandatory: false jsonPath: $.searchCriteria.billActive + - name: conn.property_id + isMandatory: false + jsonPath: $.searchCriteria.propertyId output: jsonFormat: {"ResponseInfo": {},"Bills": []} outJsonPath: $.Bills responseInfoPath: $.ResponseInfo - - - name: mcollectbills + + - name: integratedbills isCustomerRowMapEnabled: true rowMapperKey: billsearch query: baseQuery: with bill_data as ( - SELECT b.id AS b_id, b.mobilenumber, + SELECT conn.status as conn_status,conn.property_id as pid,conn.oldConnectionNo as oldpid,conn.additionaldetails as conn_add,b.id AS b_id, b.mobilenumber, b.tenantid AS b_tenantid, b.payername AS b_payername, b.payeraddress AS b_payeraddress, b.payeremail AS b_payeremail, b.isactive AS b_isactive, b.iscancelled AS b_iscancelled, @@ -287,16 +294,18 @@ SearchDefinitions: ad.taxheadcode AS ad_taxheadcode, ad.demanddetailid, ad.isactualdemand AS ad_isactualdemand, ad.purpose AS ad_purpose, ad.additionaldetails as ad_additionaldetails, - challanadd.doorNo as ptadd_doorNo, challanadd.landmark as ptadd_landmark, - challanadd.city as ptadd_city, challanadd.pincode as ptadd_pincode, - challanadd.locality as ptadd_locality, challan.accountid as ptown_userid , challan.createdtime + ptadd.doorNo as ptadd_doorNo, ptadd.landmark as ptadd_landmark, + ptadd.city as ptadd_city, ptadd.pincode as ptadd_pincode, + ptadd.locality as ptadd_locality, ptown.userid as ptown_userid - FROM egbs_bill_v1 b INNER JOIN egbs_billdetail_v1 bd ON b.id = bd.billid AND b.tenantid = bd.tenantid and bd.totalamount > 0 + FROM egbs_bill_v1 b INNER JOIN egbs_billdetail_v1 bd ON b.id = bd.billid AND b.tenantid = bd.tenantid AND b.status='ACTIVE' INNER JOIN egbs_billaccountdetail_v1 ad ON bd.id = ad.billdetail AND bd.tenantid = ad.tenantid - INNER JOIN eg_echallan challan ON bd.consumercode = challan.challanno AND b.status!='CANCELLED' - INNER JOIN eg_challan_address challanadd ON challanadd.eChallanId = challan.id $where ) + INNER JOIN eg_ws_connection conn ON bd.consumercode = conn.connectionno + INNER JOIN eg_pt_property pt ON conn.property_id = pt.propertyid + INNER JOIN eg_pt_address ptadd ON ptadd.propertyid = pt.id + INNER JOIN eg_pt_owner ptown ON ptown.propertyid = pt.id $where AND bd.businessservice IN ('WS', 'SW') order by conn.property_id asc) - select * from bill_data inner join (select max(b_createddate) as maxcreateddate, bd_consumercode from bill_data group by bd_consumercode) as max ON max.maxcreateddate=b_createddate + select * from bill_data inner join (select max(b_createddate) as maxcreateddate,bd_businessservice as business from bill_data group by bd_businessservice) as max ON max.business=bd_businessservice searchParams: condition: AND params: @@ -307,15 +316,11 @@ SearchDefinitions: isMandatory: false jsonPath: $.searchCriteria.consumerCode operator: ILIKE - - name: bd.businessservice - isMandatory: false - jsonPath: $.searchCriteria.businesService - name: b.mobilenumber isMandatory: false jsonPath: $.searchCriteria.mobileNumber - name: bd.billno isMandatory: false - operator: ILIKE jsonPath: $.searchCriteria.billNo - name: ptadd.locality isMandatory: false @@ -337,12 +342,12 @@ SearchDefinitions: outJsonPath: $.Bills responseInfoPath: $.ResponseInfo - - name: integratedbills + - name: mcollectbills isCustomerRowMapEnabled: true rowMapperKey: billsearch query: baseQuery: with bill_data as ( - SELECT conn.status as conn_status,conn.property_id as pid,conn.oldConnectionNo as oldpid,conn.additionaldetails as conn_add,b.id AS b_id, b.mobilenumber, + SELECT b.id AS b_id, b.mobilenumber, b.tenantid AS b_tenantid, b.payername AS b_payername, b.payeraddress AS b_payeraddress, b.payeremail AS b_payeremail, b.isactive AS b_isactive, b.iscancelled AS b_iscancelled, @@ -367,18 +372,16 @@ SearchDefinitions: ad.taxheadcode AS ad_taxheadcode, ad.demanddetailid, ad.isactualdemand AS ad_isactualdemand, ad.purpose AS ad_purpose, ad.additionaldetails as ad_additionaldetails, - ptadd.doorNo as ptadd_doorNo, ptadd.landmark as ptadd_landmark, - ptadd.city as ptadd_city, ptadd.pincode as ptadd_pincode, - ptadd.locality as ptadd_locality, ptown.userid as ptown_userid + challanadd.doorNo as ptadd_doorNo, challanadd.landmark as ptadd_landmark, + challanadd.city as ptadd_city, challanadd.pincode as ptadd_pincode, + challanadd.locality as ptadd_locality, challan.accountid as ptown_userid , challan.createdtime - FROM egbs_bill_v1 b INNER JOIN egbs_billdetail_v1 bd ON b.id = bd.billid AND b.tenantid = bd.tenantid AND b.status='ACTIVE' + FROM egbs_bill_v1 b INNER JOIN egbs_billdetail_v1 bd ON b.id = bd.billid AND b.tenantid = bd.tenantid and bd.totalamount > 0 INNER JOIN egbs_billaccountdetail_v1 ad ON bd.id = ad.billdetail AND bd.tenantid = ad.tenantid - INNER JOIN eg_ws_connection conn ON bd.consumercode = conn.connectionno - INNER JOIN eg_pt_property pt ON conn.property_id = pt.propertyid - INNER JOIN eg_pt_address ptadd ON ptadd.propertyid = pt.id - INNER JOIN eg_pt_owner ptown ON ptown.propertyid = pt.id $where AND bd.businessservice IN ('WS', 'SW') order by conn.property_id asc) + INNER JOIN eg_echallan challan ON bd.consumercode = challan.challanno AND b.status!='CANCELLED' + INNER JOIN eg_challan_address challanadd ON challanadd.eChallanId = challan.id $where ) - select * from bill_data inner join (select max(b_createddate) as maxcreateddate,bd_businessservice as business from bill_data group by bd_businessservice) as max ON max.business=bd_businessservice + select * from bill_data inner join (select max(b_createddate) as maxcreateddate, bd_consumercode from bill_data group by bd_consumercode) as max ON max.maxcreateddate=b_createddate searchParams: condition: AND params: @@ -389,13 +392,17 @@ SearchDefinitions: isMandatory: false jsonPath: $.searchCriteria.consumerCode operator: ILIKE + - name: bd.businessservice + isMandatory: false + jsonPath: $.searchCriteria.businesService - name: b.mobilenumber isMandatory: false jsonPath: $.searchCriteria.mobileNumber - name: bd.billno isMandatory: false + operator: ILIKE jsonPath: $.searchCriteria.billNo - - name: ptadd.locality + - name: challanadd.locality isMandatory: false jsonPath: $.searchCriteria.locality - name: fromperiod