@Test public void all_input_test() { final ServiceChargeQueryBuilder serviceChargeQueryBuilder = new ServiceChargeQueryBuilder(); final ServiceChargeGetRequest serviceChargeGetRequest = new ServiceChargeGetRequest(); final Map<String, Object> preparedStatementValues = new HashMap<>(); serviceChargeGetRequest.setIds(Arrays.asList(2L, 3L)); serviceChargeGetRequest.setServiceType("No Due Certificate"); serviceChargeGetRequest.setServiceChargeType("slab"); serviceChargeGetRequest.setOutsideUlb(false); serviceChargeGetRequest.setSortBy("serviceChargeType"); serviceChargeGetRequest.setSortOrder("desc"); serviceChargeGetRequest.setTenantId("default"); assertEquals("Select sc.id as sc_id,sc.code as sc_code,sc.servicetype " + "as sc_servicetype,sc.servicechargeapplicable as sc_servicechargeapplicable," + "sc.servicechargetype as sc_servicechargetype,sc.description as sc_description," + "sc.active as sc_active,sc.effectivefrom as sc_effectivefrom,sc.effectiveto" + " as sc_effectiveto,sc.outsideulb as sc_outsideulb,sc.tenantid as sc_tenantid," + "sc.createdby as sc_createdby,sc.createddate as sc_createddate,sc.lastmodifiedby" + " as sc_lastmodifiedby,sc.lastmodifieddate as sc_lastmodifieddate from" + " egwtr_servicecharge sc WHERE sc.id IN (:ids) AND sc.tenantid = :tenantId" + " AND sc.servicetype = :serviceType AND sc.servicechargetype = :serviceChargeType" + " AND sc.outsideulb = :outsideUlb ORDER BY sc.serviceChargeType desc", serviceChargeQueryBuilder.getQuery(serviceChargeGetRequest, preparedStatementValues)); }
public String getQuery(final ServiceChargeGetRequest serviceChargeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(serviceChargeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(serviceChargeGetRequest, selectQuery); return selectQuery.toString(); }
ServiceChargeQueryBuilder { public String getQuery(final ServiceChargeGetRequest serviceChargeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(serviceChargeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(serviceChargeGetRequest, selectQuery); return selectQuery.toString(); } }
ServiceChargeQueryBuilder { public String getQuery(final ServiceChargeGetRequest serviceChargeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(serviceChargeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(serviceChargeGetRequest, selectQuery); return selectQuery.toString(); }  }
ServiceChargeQueryBuilder { public String getQuery(final ServiceChargeGetRequest serviceChargeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(serviceChargeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(serviceChargeGetRequest, selectQuery); return selectQuery.toString(); }  String getServiceChargeDetailsQuery(); String getQuery(final ServiceChargeGetRequest serviceChargeGetRequest,
            final Map<String, Object> preparedStatementValues); String insertServiceChargeData(); String insertServiceChargeDetailsData(); String updateServiceChargeData(); String deleteServiceChargeDetailsData(); }
ServiceChargeQueryBuilder { public String getQuery(final ServiceChargeGetRequest serviceChargeGetRequest, final Map<String, Object> preparedStatementValues) { final StringBuilder selectQuery = new StringBuilder(BASE_QUERY); addWhereClause(serviceChargeGetRequest, preparedStatementValues, selectQuery); addOrderByClause(serviceChargeGetRequest, selectQuery); return selectQuery.toString(); }  String getServiceChargeDetailsQuery(); String getQuery(final ServiceChargeGetRequest serviceChargeGetRequest,
            final Map<String, Object> preparedStatementValues); String insertServiceChargeData(); String insertServiceChargeDetailsData(); String updateServiceChargeData(); String deleteServiceChargeDetailsData(); static final String BASE_QUERY; }