Advertisement
Guest User

Untitled

a guest
May 27th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. select
  2. SES.EXP_SAL_ID,
  3. SES.EXP_SAL_DSC,
  4. SES.EXP_SAL_PRD_ID,
  5. SES.EXP_SAL_SUM,
  6. SES.CLS_EXP_SAL_TP_ID,
  7. SES.RG_NUM,
  8. SES.CLS_PRD_ID,
  9. SES.ACC_ID,
  10. SES.EXP_SAL_ORG_NAME,
  11. SES.CLS_INS_CD_ID,
  12. SES.CNV_STMT_ID,
  13. SES.OP_UNI,
  14. SES.ACC_TS,
  15. SES.BSN_TS_BEG,
  16. SES.BSN_TS_END
  17. from SPU_EXP_SAL SES
  18. join SPU_ACC SA on SA.ACC_ID=SES.ACC_ID
  19. join SPU_CLS_PRD PRD on SES.EXP_SAL_PRD_ID=PRD.ID
  20. left outer join SPU_ORG ORG on SES.RG_NUM=ORG.RG_NUM
  21. inner join SPU_CLS_EXP_SAL_TP as SALTP
  22. on SES.CLS_EXP_SAL_TP_ID=SALTP.ID
  23. <if test="salaryTypeCodes != null">
  24. <foreach collection="salaryTypeCodes" item="salaryTypeCode" open=" and SALTP.CD in (" close=")" separator=",">#{salaryTypeCode, jdbcType=VARCHAR}</foreach>
  25. </if>
  26. where SA.ACC_ID = #{currentSnils, jdbcType=BIGINT}
  27. <if test="periods != null">
  28. <foreach item="periodYear" collection="periods" open=" and PRD.YEAR in (" separator="," close=")">#{periodYear}</foreach>
  29. </if>
  30. and PRD.PFR_MON > 0
  31. and upper(case when SES.RG_NUM is null then SES.EXP_SAL_ORG_NAME else ORG.NAME_JUR end) like #{currentOrganizationName}
  32. order by PRD.PFR_MON, PRD.YEAR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement