Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- SES.EXP_SAL_ID,
- SES.EXP_SAL_DSC,
- SES.EXP_SAL_PRD_ID,
- SES.EXP_SAL_SUM,
- SES.CLS_EXP_SAL_TP_ID,
- SES.RG_NUM,
- SES.CLS_PRD_ID,
- SES.ACC_ID,
- SES.EXP_SAL_ORG_NAME,
- SES.CLS_INS_CD_ID,
- SES.CNV_STMT_ID,
- SES.OP_UNI,
- SES.ACC_TS,
- SES.BSN_TS_BEG,
- SES.BSN_TS_END
- from SPU_EXP_SAL SES
- join SPU_ACC SA on SA.ACC_ID=SES.ACC_ID
- join SPU_CLS_PRD PRD on SES.EXP_SAL_PRD_ID=PRD.ID
- left outer join SPU_ORG ORG on SES.RG_NUM=ORG.RG_NUM
- inner join SPU_CLS_EXP_SAL_TP as SALTP
- on SES.CLS_EXP_SAL_TP_ID=SALTP.ID
- <if test="salaryTypeCodes != null">
- <foreach collection="salaryTypeCodes" item="salaryTypeCode" open=" and SALTP.CD in (" close=")" separator=",">#{salaryTypeCode, jdbcType=VARCHAR}</foreach>
- </if>
- where SA.ACC_ID = #{currentSnils, jdbcType=BIGINT}
- <if test="periods != null">
- <foreach item="periodYear" collection="periods" open=" and PRD.YEAR in (" separator="," close=")">#{periodYear}</foreach>
- </if>
- and PRD.PFR_MON > 0
- and upper(case when SES.RG_NUM is null then SES.EXP_SAL_ORG_NAME else ORG.NAME_JUR end) like #{currentOrganizationName}
- order by PRD.PFR_MON, PRD.YEAR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement