You are on page 1of 3

PayDeductionsBalances Service

Model: PayDeductionsBalances.java
Repository: PayDeductionsBalancesRepository.java
Service: PayDeductionsBalancesServiceImpl.java (interface PayDeductionsBalancesService.java)
Controller: PayDeductionsBalancesController.java
Example URLs:
http://javadev1.yrcw.com:5069/api/v1/paydeductionsbalances/emplid/0001000

Database table: PSFT88.PS_DEDUCTION_BAL number of columns: 14


View: PSFT88. YRC_DEDUCT_BAL _SERVICE
Public Synonym: YRC_DEDUCT_BAL_SERVICE

Note: This is an inquiry only service.

Service Data items:


Java name Database column
Id ID
emplid EMPLID
Company COMPANY
balanceYear BALANCE_YEAR
balanceQtr BALANCE_QTR
balancePeriod BALANCE_PERIOD
planType PLAN_TYPE
benefitPlan BENEFIT_PLAN
dedCd DEDCD
dedClass DED_CLASS
dedYtd DED_YTD
dedQtd DED_QTD
dedMtd DED_MTD
benefitRcdNbr BENEFIT_RCD_NBR
dedcdDesc select PLAN_TYPE, DEDCD, EFFDT, DESCR
from PSFT88.PS_DEDUCTION_TBL pdt
where pdt.EFFDT = (select max(effdt)
from PSFT88.PS_DEDUCTION_TBL y
where y.plan_type = pdt.plan_type
and y.dedcd = pdt.dedcd)
planTypeDesc PSFT88.PS_PLAN_TYPE_VW.DESCR
benefitPlanDesc select PLAN_TYPE, BENEFIT_PLAN, DESCR
from PSFT88.PS_BENEF_PLAN_TBL bpt
where bpt.EFFDT = (select max(effdt)
from PSFT88.PS_BENEF_PLAN_TBL x
where x.plan_type = bpt.plan_type
and x.BENEFIT_PLAN = bpt.BENEFIT_PLAN)
dedClassDesc select trim(i.fieldvalue) as fieldvalue,trim(i.xlatlongname) as descr
from PSFT88.PSXLATITEM i
where eff_status = 'A'
PayDeductionsBalances Service

and trim(FIELDNAME) = 'DED_CLASS'


and effdt = (select max(effdt)
from PSFT88.PSXLATITEM si
where si.eff_status = 'A'
and trim(si.FIELDNAME) = 'DED_CLASS'
and si.fieldvalue = i.fieldvalue)

SQL for returning data from table:


select rowidtochar(db.rowid) as ID, EMPLID
,COMPANY
,BALANCE_YEAR,BALANCE_QTR,BALANCE_PERIOD
,PLAN_TYPE,BENEFIT_PLAN
,DEDCD,DED_CLASS
,DED_YTD,DED_QTD,DED_MTD
,BENEFIT_RCD_NBR
from PSFT88.PS_DEDUCTION_BAL

SQL for returning data from table with translations:


select rowidtochar(db.rowid) as ID, trim(EMPLID) as EMPLID
,trim(COMPANY) as COMPANY
,trim(BALANCE_YEAR) as BALANCE_YEAR
,trim(BALANCE_QTR) as BALANCE_QTR
,trim(BALANCE_PERIOD) as BALANCE_PERIOD
,db.PLAN_TYPE,db.BENEFIT_PLAN
,db.DEDCD,db.DED_CLASS
,DED_YTD,DED_QTD,DED_MTD
,BENEFIT_RCD_NBR
,trim(dt.descr)as dedcdDesc
,trim(pt.descr) as planTypeDesc
,trim(bp.descr) as benefitPlanDesc
,trim(dc.descr) as dedClassDesc
from PSFT88.PS_DEDUCTION_BAL db
left outer join (select PLAN_TYPE, DEDCD, EFFDT, DESCR
from PSFT88.PS_DEDUCTION_TBL pdt
where pdt.EFFDT = (select max(effdt)
from PSFT88.PS_DEDUCTION_TBL y
where y.plan_type = pdt.plan_type
and y.dedcd = pdt.dedcd)
)dt
on db.PLAN_TYPE = dt.PLAN_TYPE
and db.DEDCD = dt.DEDCD
left outer join PSFT88.PS_PLAN_TYPE_VW pt
on db.PLAN_TYPE = pt.PLAN_TYPE
left outer join (select PLAN_TYPE, BENEFIT_PLAN, DESCR
from PSFT88.PS_BENEF_PLAN_TBL bpt
where bpt.EFFDT = (select max(effdt)
from PSFT88.PS_BENEF_PLAN_TBL x
where x.plan_type = bpt.plan_type
PayDeductionsBalances Service

and x.BENEFIT_PLAN = bpt.BENEFIT_PLAN)


)bp
on db.PLAN_TYPE = bp.PLAN_TYPE
and db.BENEFIT_PLAN = bp.BENEFIT_PLAN
Left outer join (
select trim(i.fieldvalue) as fieldvalue,trim(i.xlatlongname) as descr
from PSFT88.PSXLATITEM i
where eff_status = 'A'
and trim(FIELDNAME) = 'DED_CLASS'
and effdt = (select max(effdt)
from PSFT88.PSXLATITEM si
where si.eff_status = 'A'
and trim(si.FIELDNAME) = 'DED_CLASS'
and si.fieldvalue = i.fieldvalue)

) dc
on trim(db.DED_CLASS) = dc.fieldvalue
where balance_year = '2017' and trim(emplid) = '100437887'

You might also like