SysUserAccountMapper.xml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. <result property="sumAmount" column="sum_amount" jdbcType="DECIMAL"/>
  25. <result property="sumAmountWithdrawal" column="sum_amount_withdrawal" jdbcType="DECIMAL"/>
  26. <result property="sumAmountAccount" column="sum_amount_account" jdbcType="DECIMAL"/>
  27. <result property="sumAmountPayment" column="sum_amount_payment" jdbcType="DECIMAL"/>
  28. <collection property="sysUserAccountCardList" ofType="com.ydtech.modules.admin.model.po.SysUserBankCard"
  29. resultMap="sysUserAccountCardList"/>
  30. </resultMap>
  31. <resultMap id="sysUserAccountCardList" type="com.ydtech.modules.admin.model.po.SysUserBankCard">
  32. <id property="id" column="id" jdbcType="VARCHAR"/>
  33. <result property="bankNumber" column="bank_number" jdbcType="VARCHAR"/>
  34. <result property="bankAccount" column="bank_account" jdbcType="VARCHAR"/>
  35. <result property="bankAddress" column="bank_address" jdbcType="VARCHAR"/>
  36. <result property="realUserName" column="real_user_name" jdbcType="VARCHAR"/>
  37. <result property="auditStatus" column="audit_status" jdbcType="VARCHAR"/>
  38. <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
  39. </resultMap>
  40. <sql id="Base_Column_List">
  41. user_id,handling_fee,documentary,
  42. promotion,create_time
  43. </sql>
  44. <select id="queryPageOrder" resultType="com.ydtech.modules.admin.model.po.SysUserAccount">
  45. select
  46. a.user_id as "userId",
  47. a.handling_fee as "handlingFee",
  48. a.documentary as "documentary",
  49. a.promotion as "promotion",
  50. a.create_time as "createTime",
  51. a.handling_amount_withdrawal as "handlingAmountWithdrawal",
  52. a.handling_amount_account as "handlingAmountAccount",
  53. a.handling_amount_payment as "handlingAmountPayment",
  54. a.documentary_amount_withdrawal as "documentaryAmountWithdrawal",
  55. a.documentary_amount_account as "documentaryAmountAccount",
  56. a.documentary_amount_payment as "documentaryAmountPayment",
  57. a.promotion_amount_withdrawal as "promotionAmountWithdrawal",
  58. a.promotion_amount_account as "promotionAmountAccount",
  59. a.promotion_amount_payment as "promotionAmountPayment",
  60. b.dept_id as "deptId",
  61. b.name as "name",
  62. sd.name as "deptName"
  63. from
  64. sys_user_account a
  65. left join sys_user b on a.user_id = b.id
  66. left join sys_dept sd on sd.id =b.dept_id
  67. <where>
  68. <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
  69. and a.user_id = #{sysUserAccountVo.userId}
  70. </if>
  71. <if test="sysUserAccountVo.deptId != null and sysUserAccountVo.deptId != ''">
  72. and b.dept_id like concat(#{sysUserAccountVo.deptId},'%')
  73. </if>
  74. </where>
  75. </select>
  76. <select id="getById" resultType="com.ydtech.modules.admin.model.po.SysUserAccount">
  77. select
  78. a.user_id as "userId",
  79. a.handling_fee as "handlingFee",
  80. a.documentary as "documentary",
  81. a.promotion as "promotion",
  82. a.create_time as "createTime",
  83. a.handling_amount_withdrawal as "handlingAmountWithdrawal",
  84. a.handling_amount_account as "handlingAmountAccount",
  85. a.handling_amount_payment as "handlingAmountPayment",
  86. a.documentary_amount_withdrawal as "documentaryAmountWithdrawal",
  87. a.documentary_amount_account as "documentaryAmountAccount",
  88. a.documentary_amount_payment as "documentaryAmountPayment",
  89. a.promotion_amount_withdrawal as "promotionAmountWithdrawal",
  90. a.promotion_amount_account as "promotionAmountAccount",
  91. a.promotion_amount_payment as "promotionAmountPayment",
  92. ifnull(a.sum_amount,0) as "sumAmount",
  93. ifnull(a.sum_amount_withdrawal,0) as "sumAmountWithdrawal",
  94. ifnull(a.sum_amount_account,0) as "sumAmountAccount",
  95. ifnull(a.sum_amount_payment,0) as "sumAmountPayment"
  96. from sys_user_account a
  97. <where>
  98. <if test="userId != null and userId != ''">
  99. and a.user_id = #{userId}
  100. </if>
  101. </where>
  102. </select>
  103. <select id="queryPageOrder1" resultMap="BaseResultMap">
  104. select
  105. a.user_id,
  106. a.handling_fee,
  107. a.documentary,
  108. a.promotion,
  109. a.create_time,
  110. a.handling_amount_withdrawal,
  111. a.handling_amount_account,
  112. a.handling_amount_payment,
  113. a.documentary_amount_withdrawal,
  114. a.documentary_amount_account,
  115. a.documentary_amount_payment,
  116. a.promotion_amount_withdrawal,
  117. a.promotion_amount_account,
  118. a.promotion_amount_payment,
  119. b.dept_id as deptId,
  120. b.name as name,
  121. sd.name as deptName,
  122. c.id,
  123. c.bank_number,
  124. c.bank_account,
  125. c.bank_address,
  126. c.del_flag,
  127. c.audit_status,
  128. c.real_user_name,
  129. a.sum_amount,
  130. a.sum_amount_withdrawal,
  131. a.sum_amount_account,
  132. a.sum_amount_payment
  133. from
  134. sys_user_account a
  135. left join sys_user b on a.user_id = b.id
  136. left join sys_dept sd on sd.id = b.dept_id
  137. left join sys_user_bank_card c on c.user_id = a.user_id
  138. <where>
  139. 1=1
  140. <if test="sysUserAccountVo.userId != null and sysUserAccountVo.userId != ''">
  141. and a.user_id = #{sysUserAccountVo.userId}
  142. </if>
  143. <if test="sysUserAccountVo.name != null and sysUserAccountVo.name != ''">
  144. and b.name = #{sysUserAccountVo.name}
  145. </if>
  146. <if test="sysUserAccountVo.deptId != null and sysUserAccountVo.deptId != ''">
  147. and b.dept_id like concat(#{sysUserAccountVo.deptId}, '%')
  148. </if>
  149. <if test="sysUserAccountVo.userName != null and sysUserAccountVo.userName != ''">
  150. and b.name = #{sysUserAccountVo.userName}
  151. </if>
  152. <if test="sysUserAccountVo.bankNumber != null and sysUserAccountVo.bankNumber != ''">
  153. and c.bank_number = #{sysUserAccountVo.bankNumber}
  154. </if>
  155. </where>
  156. </select>
  157. </mapper>