TLoadOrderMapper.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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.ruoyi.bussiness.mapper.TLoadOrderMapper">
  6. <resultMap type="com.ruoyi.bussiness.domain.TLoadOrder" id="TLoadOrderResult">
  7. <result property="id" column="id" />
  8. <result property="proId" column="pro_id" />
  9. <result property="userId" column="user_id" />
  10. <result property="createTime" column="create_time" />
  11. <result property="amount" column="amount" />
  12. <result property="rate" column="rate" />
  13. <result property="interest" column="interest" />
  14. <result property="status" column="status" />
  15. <result property="finalRepayTime" column="final_repay_time" />
  16. <result property="disburseTime" column="disburse_time" />
  17. <result property="returnTime" column="return_time" />
  18. <result property="disburseAmount" column="disburse_amount" />
  19. <result property="adminParentIds" column="admin_parent_ids" />
  20. <result property="cardUrl" column="card_url" />
  21. <result property="cardBackUrl" column="card_back_url" />
  22. <result property="capitalUrl" column="capital_url" />
  23. <result property="licenseUrl" column="license_url" />
  24. <result property="orderNo" column="order_no" />
  25. <result property="cycleType" column="cycle_type" />
  26. <result property="remark" column="remark" />
  27. <result property="createBy" column="create_by" />
  28. <result property="updateBy" column="update_by" />
  29. <result property="updateTime" column="update_time" />
  30. <result property="searchValue" column="search_value" />
  31. <collection property="tLoadProduct" ofType="com.ruoyi.bussiness.domain.TLoadProduct">
  32. <result property="id" column="p_id" />
  33. <result property="amountMin" column="p_amount_min" />
  34. <result property="amountMax" column="p_amount_max" />
  35. <result property="cycleType" column="p_cycle_type" />
  36. <result property="repayType" column="p_repay_type" />
  37. <result property="status" column="p_status" />
  38. <result property="createBy" column="p_create_by" />
  39. <result property="createTime" column="p_create_time" />
  40. <result property="updateBy" column="p_update_by" />
  41. <result property="updateTime" column="p_update_time" />
  42. <result property="remark" column="p_remark" />
  43. <result property="searchValue" column="p_search_value" />
  44. <result property="odds" column="p_odds" />
  45. <result property="repayOrg" column="p_repay_org" />
  46. <result property="isFreeze" column="p_is_freeze" />
  47. </collection>
  48. </resultMap>
  49. <sql id="selectTLoadOrderVo">
  50. select a.id, a.pro_id, a.user_id, a.create_time, a.amount, a.rate, a.interest, a.status, a.final_repay_time,
  51. a.disburse_time, a.return_time, a.disburse_amount, a.admin_parent_ids, a.card_url, a.card_back_url,
  52. a.capital_url, a.license_url, a.order_no, a.cycle_type, a.remark, a.create_by, a.update_by, a.update_time, a.search_value,
  53. p.id p_id, p.amount_min p_amount_min, p.amount_max p_amount_max, p.cycle_type p_cycle_type, p.repay_type p_repay_type, p.status p_status, p.create_by p_create_by,
  54. p.create_time p_create_time, p.update_by p_update_by, p.update_time p_update_time, p.remark p_remark, p.search_value p_search_value,
  55. p.odds p_odds, p.repay_org p_repay_org, p.is_freeze p_is_freeze
  56. from t_load_order a
  57. left join t_load_product p on p.id = a.pro_id
  58. </sql>
  59. <select id="selectTLoadOrderList" parameterType="TLoadOrder" resultMap="TLoadOrderResult">
  60. <include refid="selectTLoadOrderVo"/>
  61. <where>
  62. <if test="proId != null "> and a.pro_id = #{proId}</if>
  63. <if test="userId != null "> and a.user_id = #{userId}</if>
  64. <if test="amount != null "> and a.amount = #{amount}</if>
  65. <if test="rate != null "> and a.rate = #{rate}</if>
  66. <if test="interest != null "> and a.interest = #{interest}</if>
  67. <if test="status != null "> and a.status = #{status}</if>
  68. <if test="finalRepayTime != null "> and a.final_repay_time = #{finalRepayTime}</if>
  69. <if test="disburseTime != null "> and a.disburse_time = #{disburseTime}</if>
  70. <if test="returnTime != null "> and a.return_time = #{returnTime}</if>
  71. <if test="disburseAmount != null "> and a.disburse_amount = #{disburseAmount}</if>
  72. <if test="adminParentIds != null and adminParentIds!=''">
  73. AND find_in_set(#{adminParentIds},admin_parent_ids)
  74. </if>
  75. <if test="cardUrl != null and cardUrl != ''"> and a.card_url = #{cardUrl}</if>
  76. <if test="cardBackUrl != null and cardBackUrl != ''"> and a.card_back_url = #{cardBackUrl}</if>
  77. <if test="capitalUrl != null and capitalUrl != ''"> and a.capital_url = #{capitalUrl}</if>
  78. <if test="licenseUrl != null and licenseUrl != ''"> and a.license_url = #{licenseUrl}</if>
  79. <if test="orderNo != null and orderNo != ''"> and a.order_no = #{orderNo}</if>
  80. <if test="cycleType != null "> and a.cycle_type = #{cycleType}</if>
  81. <if test="searchValue != null and searchValue != ''"> and a.search_value = #{searchValue}</if>
  82. <if test="params!=null and params!=''">
  83. <if test="params.amountMin!=null">
  84. and a.amount <![CDATA[ >= ]]> #{params.amountMin}
  85. </if>
  86. <if test="params.amountMax!=null">
  87. and a.amount <![CDATA[ <= ]]> #{params.amountMax}
  88. </if>
  89. </if>
  90. </where>
  91. order by a.update_time desc
  92. </select>
  93. <select id="selectTLoadOrderById" parameterType="Long" resultMap="TLoadOrderResult">
  94. <include refid="selectTLoadOrderVo"/>
  95. where a.id = #{id}
  96. </select>
  97. <select id="selectListByUserId" resultType="com.ruoyi.bussiness.domain.TLoadOrder"
  98. parameterType="com.ruoyi.bussiness.domain.TLoadOrder">
  99. <include refid="selectTLoadOrderVo"/>
  100. <where>
  101. and p.is_freeze = '2'
  102. and a.status != '3'
  103. and a.status != '2'
  104. <if test="userId!=null">
  105. and a.user_id = #{userId}
  106. </if>
  107. </where>
  108. </select>
  109. <insert id="insertTLoadOrder" parameterType="TLoadOrder" useGeneratedKeys="true" keyProperty="id">
  110. insert into t_load_order
  111. <trim prefix="(" suffix=")" suffixOverrides=",">
  112. <if test="proId != null">pro_id,</if>
  113. <if test="userId != null">user_id,</if>
  114. <if test="createTime != null">create_time,</if>
  115. <if test="amount != null">amount,</if>
  116. <if test="rate != null">rate,</if>
  117. <if test="interest != null">interest,</if>
  118. <if test="status != null">status,</if>
  119. <if test="finalRepayTime != null">final_repay_time,</if>
  120. <if test="disburseTime != null">disburse_time,</if>
  121. <if test="returnTime != null">return_time,</if>
  122. <if test="disburseAmount != null">disburse_amount,</if>
  123. <if test="adminParentIds != null">admin_parent_ids,</if>
  124. <if test="cardUrl != null">card_url,</if>
  125. <if test="cardBackUrl != null">card_back_url,</if>
  126. <if test="capitalUrl != null">capital_url,</if>
  127. <if test="licenseUrl != null">license_url,</if>
  128. <if test="orderNo != null">order_no,</if>
  129. <if test="cycleType != null">cycle_type,</if>
  130. <if test="remark != null">remark,</if>
  131. <if test="createBy != null">create_by,</if>
  132. <if test="updateBy != null">update_by,</if>
  133. <if test="updateTime != null">update_time,</if>
  134. <if test="searchValue != null">search_value,</if>
  135. </trim>
  136. <trim prefix="values (" suffix=")" suffixOverrides=",">
  137. <if test="proId != null">#{proId},</if>
  138. <if test="userId != null">#{userId},</if>
  139. <if test="createTime != null">#{createTime},</if>
  140. <if test="amount != null">#{amount},</if>
  141. <if test="rate != null">#{rate},</if>
  142. <if test="interest != null">#{interest},</if>
  143. <if test="status != null">#{status},</if>
  144. <if test="finalRepayTime != null">#{finalRepayTime},</if>
  145. <if test="disburseTime != null">#{disburseTime},</if>
  146. <if test="returnTime != null">#{returnTime},</if>
  147. <if test="disburseAmount != null">#{disburseAmount},</if>
  148. <if test="adminParentIds != null">#{adminParentIds},</if>
  149. <if test="cardUrl != null">#{cardUrl},</if>
  150. <if test="cardBackUrl != null">#{cardBackUrl},</if>
  151. <if test="capitalUrl != null">#{capitalUrl},</if>
  152. <if test="licenseUrl != null">#{licenseUrl},</if>
  153. <if test="orderNo != null">#{orderNo},</if>
  154. <if test="cycleType != null">#{cycleType},</if>
  155. <if test="remark != null">#{remark},</if>
  156. <if test="createBy != null">#{createBy},</if>
  157. <if test="updateBy != null">#{updateBy},</if>
  158. <if test="updateTime != null">#{updateTime},</if>
  159. <if test="searchValue != null">#{searchValue},</if>
  160. </trim>
  161. </insert>
  162. <update id="updateTLoadOrder" parameterType="TLoadOrder">
  163. update t_load_order
  164. <trim prefix="SET" suffixOverrides=",">
  165. <if test="proId != null">pro_id = #{proId},</if>
  166. <if test="userId != null">user_id = #{userId},</if>
  167. <if test="createTime != null">create_time = #{createTime},</if>
  168. <if test="amount != null">amount = #{amount},</if>
  169. <if test="rate != null">rate = #{rate},</if>
  170. <if test="interest != null">interest = #{interest},</if>
  171. <if test="status != null">status = #{status},</if>
  172. <if test="finalRepayTime != null">final_repay_time = #{finalRepayTime},</if>
  173. <if test="disburseTime != null">disburse_time = #{disburseTime},</if>
  174. <if test="returnTime != null">return_time = #{returnTime},</if>
  175. <if test="disburseAmount != null">disburse_amount = #{disburseAmount},</if>
  176. <if test="adminParentIds != null">admin_parent_ids = #{adminParentIds},</if>
  177. <if test="cardUrl != null">card_url = #{cardUrl},</if>
  178. <if test="cardBackUrl != null">card_back_url = #{cardBackUrl},</if>
  179. <if test="capitalUrl != null">capital_url = #{capitalUrl},</if>
  180. <if test="licenseUrl != null">license_url = #{licenseUrl},</if>
  181. <if test="orderNo != null">order_no = #{orderNo},</if>
  182. <if test="cycleType != null">cycle_type = #{cycleType},</if>
  183. <if test="remark != null">remark = #{remark},</if>
  184. <if test="createBy != null">create_by = #{createBy},</if>
  185. <if test="updateBy != null">update_by = #{updateBy},</if>
  186. <if test="updateTime != null">update_time = #{updateTime},</if>
  187. <if test="searchValue != null">search_value = #{searchValue},</if>
  188. </trim>
  189. where id = #{id}
  190. </update>
  191. <delete id="deleteTLoadOrderById" parameterType="Long">
  192. delete from t_load_order where id = #{id}
  193. </delete>
  194. <delete id="deleteTLoadOrderByIds" parameterType="String">
  195. delete from t_load_order where id in
  196. <foreach item="id" collection="array" open="(" separator="," close=")">
  197. #{id}
  198. </foreach>
  199. </delete>
  200. </mapper>