LoanState.xml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.oqpo.api.mapper.loanmng.LoanStateMapper">
  4. <select id="selectLoanStateGridList" resultType="com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity">
  5. /* LoanStateMapper.selectLoanStateGridList */
  6. SELECT A.loan_mgnt_unq_no, A.store_id, FN_STORE_NM(A.brand_id, A.store_id) AS store_nm,
  7. A.brand_id, FN_BRAND_NM(A.brand_id) AS brand_nm, A.acct_cd, A.acct_no, A.acct_bal,
  8. A.loan_dvsn, FN_CODE_NM('LOAN_DVSN', A.loan_dvsn) AS loan_dvsn_nm, A.credt_limit_amt,
  9. A.chrge_limit_amt, A.credt_limit_use_yn, A.use_amt_total, A.tmp_rcv_acct_total,
  10. A.use_yn, FN_CODE_NM('USE_YN', A.use_yn) AS use_yn_nm,
  11. DATE_FORMAT(A.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') AS sys_chg_dttm, A.sys_chg_id, FN_USER_NM(A.sys_chg_id) AS sys_chg_nm
  12. FROM loan_mgnt_base_info A
  13. WHERE 1 = 1
  14. <if test="sBrandId != null and sBrandId != ''">
  15. AND A.brand_id = #{sBrandId}
  16. </if>
  17. <if test="sStoreId != null and sStoreId != ''">
  18. AND A.store_id = #{sStoreId}
  19. </if>
  20. <if test="sLoanDvsn != null and sLoanDvsn != ''">
  21. AND A.loan_dvsn = #{sLoanDvsn}
  22. </if>
  23. <if test="sUseYn != null and sUseYn != ''">
  24. AND A.use_yn = #{sUseYn}
  25. </if>
  26. <choose>
  27. <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
  28. <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
  29. <if test="gridRequest.sord == 'asc'.toString()">
  30. ORDER BY A.loan_mgnt_unq_no ASC
  31. </if>
  32. <if test="gridRequest.sord == 'desc'.toString()">
  33. ORDER BY A.loan_mgnt_unq_no DESC
  34. </if>
  35. </if>
  36. </when>
  37. <otherwise>
  38. ORDER BY A.loan_mgnt_unq_no ASC
  39. </otherwise>
  40. </choose>
  41. <if test="gridRequest.pagingYn == true">
  42. limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
  43. </if>
  44. </select>
  45. <select id="selectLoanStateGridCnt" resultType="int">
  46. /* LoanStateMapper.selectLoanStateGridCnt */
  47. SELECT COUNT(*)
  48. FROM loan_mgnt_base_info A
  49. WHERE 1 = 1
  50. <if test="sBrandId != null and sBrandId != ''">
  51. AND A.brand_id = #{sBrandId}
  52. </if>
  53. <if test="sStoreId != null and sStoreId != ''">
  54. AND A.store_id = #{sStoreId}
  55. </if>
  56. <if test="sLoanDvsn != null and sLoanDvsn != ''">
  57. AND A.loan_dvsn = #{sLoanDvsn}
  58. </if>
  59. <if test="sUseYn != null and sUseYn != ''">
  60. AND A.use_yn = #{sUseYn}
  61. </if>
  62. </select>
  63. <select id="selectLoanMgntBaseInfo" resultType="com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity">
  64. /* LoanStateMapper.selectLoanMgntBaseInfo */
  65. SELECT A.loan_mgnt_unq_no,
  66. A.store_id, FN_STORE_NM(A.brand_id, A.store_id) AS store_nm,
  67. A.brand_id, FN_BRAND_NM(A.brand_id) AS brand_nm,
  68. A.acct_cd, A.acct_no, A.acct_bal, A.loan_dvsn, FN_CODE_NM('LOAN_DVSN', A.loan_dvsn) AS loan_dvsn_nm,
  69. A.credt_limit_amt, A.chrge_limit_amt, A.credt_limit_use_yn, A.use_amt_total, A.tmp_rcv_acct_total,
  70. A.use_yn, FN_CODE_NM('USE_YN', A.use_yn) AS use_yn_nm, A.loan_desc,
  71. DATE_FORMAT(A.sys_reg_dttm,'%Y.%m.%d %H:%i:%s') AS sys_reg_dttm, A.sys_reg_id,
  72. DATE_FORMAT(A.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') AS sys_chg_dttm, A.sys_chg_id, FN_USER_NM(A.sys_chg_id) AS sys_chg_nm
  73. FROM loan_mgnt_base_info A
  74. WHERE A.loan_mgnt_unq_no = #{loanMgntUnqNo}
  75. </select>
  76. <select id="selectLoanHistGridList" resultType="com.oqpo.api.entity.loanmng.LoanMgntDtlHstEntity">
  77. /* LoanStateMapper.selectLoanHistGridList */
  78. SELECT A.loan_mgnt_unq_no,
  79. DATE_FORMAT(A.loan_reg_dt, '%Y.%m.%d') AS loan_reg_dt, TIME_FORMAT(A.loan_reg_tm, '%H:%i:%s') AS loan_reg_tm,
  80. A.dpst_pay_dvsn, FN_CODE_NM('DPST_PAY_DVSN', A.dpst_pay_dvsn) AS dpst_pay_dvsn_nm, A.trsc_amt, A.trsc_bf_bal,
  81. A.trsc_af_bal, A.media_dvsn, FN_CODE_NM('MEDIA_DVSN', A.media_dvsn) AS media_dvsn_nm,
  82. A.rcv_acct_no, A.paym_acct_no, A.dpst_dt, A.dpst_nm, A.dpst_bnk_cd, A.dspt_mgnt_no, A.loan_desc
  83. FROM loan_mgnt_dtl_hst A
  84. WHERE A.loan_mgnt_unq_no = #{sLoanMgntUnqNo}
  85. <if test="sDpstPayDvsn != null and sDpstPayDvsn != ''">
  86. AND A.dpst_pay_dvsn = #{sDpstPayDvsn}
  87. </if>
  88. <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
  89. AND A.loan_reg_dt BETWEEN #{fromDt} AND #{toDt}
  90. </if>
  91. <choose>
  92. <when test="gridRequest.sidx != null and gridRequest.sidx != ''">
  93. <if test="gridRequest.sidx == 'VIEW_NUM'.toString()">
  94. <if test="gridRequest.sord == 'asc'.toString()">
  95. ORDER BY A.loan_reg_dt ASC, A.loan_reg_tm ASC
  96. </if>
  97. <if test="gridRequest.sord == 'desc'.toString()">
  98. ORDER BY A.loan_reg_dt DESC, A.loan_reg_tm DESC
  99. </if>
  100. </if>
  101. </when>
  102. <otherwise>
  103. ORDER BY A.loan_reg_dt ASC, A.loan_reg_tm ASC
  104. </otherwise>
  105. </choose>
  106. <if test="gridRequest.pagingYn == true">
  107. limit #{gridRequest.gridFirst}, #{gridRequest.gridSize}
  108. </if>
  109. </select>
  110. <select id="selectLoanHistGridCnt" resultType="int">
  111. /* LoanStateMapper.selectLoanHistGridCnt */
  112. SELECT COUNT(*)
  113. FROM loan_mgnt_dtl_hst A
  114. WHERE A.loan_mgnt_unq_no = #{sLoanMgntUnqNo}
  115. <if test="sDpstPayDvsn != null and sDpstPayDvsn != ''">
  116. AND A.dpst_pay_dvsn = #{sDpstPayDvsn}
  117. </if>
  118. <if test="fromDt != null and fromDt != '' and toDt != null and toDt != '' ">
  119. AND A.loan_reg_dt BETWEEN #{fromDt} AND #{toDt}
  120. </if>
  121. </select>
  122. </mapper>