AskaCashrequestMapper.xml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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.mofangchuxing.aska.dao.mapper.AskaCashrequestMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.AskaCashrequest">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="partnerId" column="partnerId" jdbcType="INTEGER"/>
  9. <result property="partnerType" column="partnerType" jdbcType="CHAR"/>
  10. <result property="partnerName" column="partnerName" jdbcType="VARCHAR"/>
  11. <result property="requestAmount" column="requestAmount" jdbcType="INTEGER"/>
  12. <result property="requestTime" column="requestTime" jdbcType="TIMESTAMP"/>
  13. <result property="status" column="status" jdbcType="CHAR"/>
  14. <result property="amount" column="amount" jdbcType="INTEGER"/>
  15. <result property="payTime" column="payTime" jdbcType="TIMESTAMP"/>
  16. <result property="note" column="note" jdbcType="VARCHAR"/>
  17. <result property="userId" column="userId" jdbcType="INTEGER"/>
  18. <result property="userName" column="userName" jdbcType="VARCHAR"/>
  19. </resultMap>
  20. <sql id="Base_Column_List">
  21. id,partnerId,partnerType,
  22. partnerName,requestAmount,requestTime,
  23. status,amount,payTime,
  24. note,userId,userName
  25. </sql>
  26. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  27. select
  28. <include refid="Base_Column_List" />
  29. from aska_cashrequest
  30. where id = #{id,jdbcType=INTEGER}
  31. </select>
  32. <select id="getCashHistory" resultType="com.mofangchuxing.aska.dao.domain.AskaCashrequest">
  33. select <include refid="Base_Column_List" />
  34. from aska_cashrequest
  35. where 1=1
  36. <if test="channelId != null and channelId != ''">
  37. and partnerType = 'channel' and partnerId = #{channelId}
  38. </if>
  39. <if test="retailId != null and retailId != ''">
  40. and partnerType = 'retail' and partnerId = #{retailId}
  41. </if>
  42. </select>
  43. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  44. delete from aska_cashrequest
  45. where id = #{id,jdbcType=INTEGER}
  46. </delete>
  47. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaCashrequest" useGeneratedKeys="true">
  48. insert into aska_cashrequest
  49. ( id,partnerId,partnerType
  50. ,partnerName,requestAmount,requestTime
  51. ,status,amount,payTime
  52. ,note,userId,userName
  53. )
  54. values (#{id,jdbcType=INTEGER},#{partnerId,jdbcType=INTEGER},#{partnerType,jdbcType=CHAR}
  55. ,#{partnerName,jdbcType=VARCHAR},#{requestAmount,jdbcType=INTEGER},#{requestTime,jdbcType=TIMESTAMP}
  56. ,#{status,jdbcType=CHAR},#{amount,jdbcType=INTEGER},#{payTime,jdbcType=TIMESTAMP}
  57. ,#{note,jdbcType=VARCHAR},#{userId,jdbcType=INTEGER},#{userName,jdbcType=VARCHAR}
  58. )
  59. </insert>
  60. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.AskaCashrequest" useGeneratedKeys="true">
  61. insert into aska_cashrequest
  62. <trim prefix="(" suffix=")" suffixOverrides=",">
  63. <if test="id != null">id,</if>
  64. <if test="partnerId != null">partnerId,</if>
  65. <if test="partnerType != null">partnerType,</if>
  66. <if test="partnerName != null">partnerName,</if>
  67. <if test="requestAmount != null">requestAmount,</if>
  68. <if test="requestTime != null">requestTime,</if>
  69. <if test="status != null">status,</if>
  70. <if test="amount != null">amount,</if>
  71. <if test="payTime != null">payTime,</if>
  72. <if test="note != null">note,</if>
  73. <if test="userId != null">userId,</if>
  74. <if test="userName != null">userName,</if>
  75. </trim>
  76. <trim prefix="values (" suffix=")" suffixOverrides=",">
  77. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  78. <if test="partnerId != null">#{partnerId,jdbcType=INTEGER},</if>
  79. <if test="partnerType != null">#{partnerType,jdbcType=CHAR},</if>
  80. <if test="partnerName != null">#{partnerName,jdbcType=VARCHAR},</if>
  81. <if test="requestAmount != null">#{requestAmount,jdbcType=INTEGER},</if>
  82. <if test="requestTime != null">#{requestTime,jdbcType=TIMESTAMP},</if>
  83. <if test="status != null">#{status,jdbcType=CHAR},</if>
  84. <if test="amount != null">#{amount,jdbcType=INTEGER},</if>
  85. <if test="payTime != null">#{payTime,jdbcType=TIMESTAMP},</if>
  86. <if test="note != null">#{note,jdbcType=VARCHAR},</if>
  87. <if test="userId != null">#{userId,jdbcType=INTEGER},</if>
  88. <if test="userName != null">#{userName,jdbcType=VARCHAR},</if>
  89. </trim>
  90. </insert>
  91. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.AskaCashrequest">
  92. update aska_cashrequest
  93. <set>
  94. <if test="partnerId != null">
  95. partnerId = #{partnerId,jdbcType=INTEGER},
  96. </if>
  97. <if test="partnerType != null">
  98. partnerType = #{partnerType,jdbcType=CHAR},
  99. </if>
  100. <if test="partnerName != null">
  101. partnerName = #{partnerName,jdbcType=VARCHAR},
  102. </if>
  103. <if test="requestAmount != null">
  104. requestAmount = #{requestAmount,jdbcType=INTEGER},
  105. </if>
  106. <if test="requestTime != null">
  107. requestTime = #{requestTime,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="status != null">
  110. status = #{status,jdbcType=CHAR},
  111. </if>
  112. <if test="amount != null">
  113. amount = #{amount,jdbcType=INTEGER},
  114. </if>
  115. <if test="payTime != null">
  116. payTime = #{payTime,jdbcType=TIMESTAMP},
  117. </if>
  118. <if test="note != null">
  119. note = #{note,jdbcType=VARCHAR},
  120. </if>
  121. <if test="userId != null">
  122. userId = #{userId,jdbcType=INTEGER},
  123. </if>
  124. <if test="userName != null">
  125. userName = #{userName,jdbcType=VARCHAR},
  126. </if>
  127. </set>
  128. where id = #{id,jdbcType=INTEGER}
  129. </update>
  130. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.AskaCashrequest">
  131. update aska_cashrequest
  132. set
  133. partnerId = #{partnerId,jdbcType=INTEGER},
  134. partnerType = #{partnerType,jdbcType=CHAR},
  135. partnerName = #{partnerName,jdbcType=VARCHAR},
  136. requestAmount = #{requestAmount,jdbcType=INTEGER},
  137. requestTime = #{requestTime,jdbcType=TIMESTAMP},
  138. status = #{status,jdbcType=CHAR},
  139. amount = #{amount,jdbcType=INTEGER},
  140. payTime = #{payTime,jdbcType=TIMESTAMP},
  141. note = #{note,jdbcType=VARCHAR},
  142. userId = #{userId,jdbcType=INTEGER},
  143. userName = #{userName,jdbcType=VARCHAR}
  144. where id = #{id,jdbcType=INTEGER}
  145. </update>
  146. </mapper>