SysUserAccountMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ydtech.modules.admin.dao.SysUserAccountMapper">
  6. <resultMap id="BaseResultMap" type="com.ydtech.modules.admin.model.po.SysUserAccount">
  7. <id property="userId" column="user_id" jdbcType="VARCHAR"/>
  8. <result property="handlingFee" column="handling_fee" jdbcType="DECIMAL"/>
  9. <result property="documentary" column="documentary" jdbcType="DECIMAL"/>
  10. <result property="promotion" column="promotion" jdbcType="DECIMAL"/>
  11. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  12. <result property="name" column="name" jdbcType="VARCHAR"/>
  13. <result property="deptId" column="deptId" jdbcType="VARCHAR"/>
  14. <result property="deptName" column="deptName" jdbcType="VARCHAR"/>
  15. <result property="handlingAmountWithdrawal" column="handling_amount_withdrawal" jdbcType="DECIMAL"/>
  16. <result property="handlingAmountAccount" column="handling_amount_account" jdbcType="DECIMAL"/>
  17. <result property="handlingAmountPayment" column="handling_amount_payment" jdbcType="DECIMAL"/>
  18. <result property="documentaryAmountWithdrawal" column="documentary_amount_withdrawal" jdbcType="DECIMAL"/>
  19. <result property="documentaryAmountAccount" column="documentary_amount_account" jdbcType="DECIMAL"/>
  20. <result property="documentaryAmountpayment" column="documentary_amount_payment" jdbcType="DECIMAL"/>
  21. <result property="promotionAmountWithdrawal" column="promotion_amount_withdrawal" jdbcType="DECIMAL"/>
  22. <result property="promotionAmountAccount" column="promotion_amount_account" jdbcType="DECIMAL"/>
  23. <result property="promotionAmountPayment" column="promotion_amount_payment" jdbcType="DECIMAL"/>
  24. <collection property="sysUserAccountCardList" ofType="com.ydtech.modules.admin.model.po.SysUserBankCard"
  25. resultMap="sysUserAccountCardList"/>
  26. </resultMap>
  27. <resultMap id="sysUserAccountCardList" type="com.ydtech.modules.admin.model.po.SysUserBankCard">
  28. <result property="bankNumber" column="bank_number" jdbcType="VARCHAR"/>
  29. <result property="bankAccount" column="bank_account" jdbcType="VARCHAR"/>
  30. <result property="bankAddress" column="bank_address" jdbcType="VARCHAR"/>
  31. </resultMap>
  32. <sql id="Base_Column_List">
  33. user_id,handling_fee,documentary,
  34. promotion,create_time
  35. </sql>
  36. <select id="queryPageOrder" resultType="com.ydtech.modules.admin.model.po.SysUserAccount">
  37. select
  38. a.user_id as "userId",
  39. a.handling_fee as "handlingFee",
  40. a.documentary as "documentary",
  41. a.promotion as "promotion",
  42. a.create_time as "createTime",
  43. a.handling_amount_withdrawal as "handlingAmountWithdrawal",
  44. a.handling_amount_account as "handlingAmountAccount",
  45. a.handling_amount_payment as "handlingAmountPayment",
  46. a.documentary_amount_withdrawal as "documentaryAmountWithdrawal",
  47. a.documentary_amount_account as "documentaryAmountAccount",
  48. a.documentary_amount_payment as "documentaryAmountPayment",
  49. a.promotion_amount_withdrawal as "promotionAmountWithdrawal",
  50. a.promotion_amount_account as "promotionAmountAccount",
  51. a.promotion_amount_payment as "promotionAmountPayment",
  52. b.dept_id as "deptId",
  53. b.name as "name",
  54. sd.name as "deptName"
  55. from
  56. sys_user_account a
  57. left join sys_user b on a.user_id = b.id
  58. left join sys_dept sd on sd.id =b.dept_id
  59. <where>
  60. <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
  61. and a.user_id = #{sysUserAccountVo.userId}
  62. </if>
  63. <if test="sysUserAccountVo.deptId != null and sysUserAccountVo.deptId != ''">
  64. and b.dept_id like concat(#{sysUserAccountVo.deptId},'%')
  65. </if>
  66. </where>
  67. </select>
  68. <select id="getById" resultType="com.ydtech.modules.admin.model.po.SysUserAccount">
  69. select
  70. a.user_id as "userId",
  71. a.handling_fee as "handlingFee",
  72. a.documentary as "documentary",
  73. a.promotion as "promotion",
  74. a.create_time as "createTime",
  75. a.handling_amount_withdrawal as "handlingAmountWithdrawal",
  76. a.handling_amount_account as "handlingAmountAccount",
  77. a.handling_amount_payment as "handlingAmountPayment",
  78. a.documentary_amount_withdrawal as "documentaryAmountWithdrawal",
  79. a.documentary_amount_account as "documentaryAmountAccount",
  80. a.documentary_amount_payment as "documentaryAmountPayment",
  81. a.promotion_amount_withdrawal as "promotionAmountWithdrawal",
  82. a.promotion_amount_account as "promotionAmountAccount",
  83. a.promotion_amount_payment as "promotionAmountPayment"
  84. from sys_user_account a
  85. <where>
  86. <if test="userId != null and userId != ''">
  87. and a.user_id = #{userId}
  88. </if>
  89. </where>
  90. </select>
  91. <select id="queryPageOrder1" resultMap="BaseResultMap">
  92. select
  93. a.user_id,
  94. a.handling_fee,
  95. a.documentary,
  96. a.promotion,
  97. a.create_time,
  98. a.handling_amount_withdrawal,
  99. a.handling_amount_account,
  100. a.handling_amount_payment,
  101. a.documentary_amount_withdrawal,
  102. a.documentary_amount_account,
  103. a.documentary_amount_payment,
  104. a.promotion_amount_withdrawal,
  105. a.promotion_amount_account,
  106. a.promotion_amount_payment,
  107. b.dept_id as deptId,
  108. b.name as name,
  109. sd.name as deptName,
  110. c.bank_number,
  111. c.bank_account,
  112. c.bank_address
  113. from
  114. sys_user_account a
  115. left join sys_user b on a.user_id = b.id
  116. left join sys_dept sd on sd.id =b.dept_id
  117. left join sys_user_bank_card c on c.user_id = a.user_id and c.audit_status = '1'
  118. <where>
  119. 1=1
  120. <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
  121. and a.user_id = #{sysUserAccountVo.userId}
  122. </if>
  123. <if test="sysUserAccountVo.deptId != null and sysUserAccountVo.deptId != ''">
  124. and b.dept_id like concat(#{sysUserAccountVo.deptId},'%')
  125. </if>
  126. <if test="sysUserAccountVo.userName != null and sysUserAccountVo.userName != ''">
  127. and b.name = #{sysUserAccountVo.userName}
  128. </if>
  129. <if test="sysUserAccountVo.bankNumber != null and sysUserAccountVo.bankNumber != ''">
  130. and c.bank_number = #{sysUserAccountVo.bankNumber}
  131. </if>
  132. </where>
  133. </select>
  134. </mapper>