NotifyRecordMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.NotifyRecordMapper">
  6. <resultMap id="BaseResultMap" type="com.mofangchuxing.aska.dao.domain.NotifyRecord">
  7. <id property="id" column="id" jdbcType="INTEGER"/>
  8. <result property="orderSn" column="order_sn" jdbcType="VARCHAR"/>
  9. <result property="mchId" column="mch_id" jdbcType="VARCHAR"/>
  10. <result property="openId" column="open_id" jdbcType="VARCHAR"/>
  11. <result property="totalFee" column="total_fee" jdbcType="VARCHAR"/>
  12. <result property="notifyUrl" column="notify_url" jdbcType="VARCHAR"/>
  13. <result property="notifyTimes" column="notify_times" jdbcType="INTEGER"/>
  14. <result property="status" column="status" jdbcType="INTEGER"/>
  15. <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
  16. <result property="modifiedTime" column="modified_time" jdbcType="TIMESTAMP"/>
  17. </resultMap>
  18. <sql id="Base_Column_List">
  19. id,order_sn,mch_id,
  20. open_id,total_fee,notify_url,
  21. notify_times,status,create_time,
  22. modified_time
  23. </sql>
  24. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  25. select
  26. <include refid="Base_Column_List" />
  27. from notify_record
  28. where id = #{id,jdbcType=INTEGER}
  29. </select>
  30. <select id="selectByOrderSn" resultMap="BaseResultMap">
  31. select
  32. <include refid="Base_Column_List" />
  33. from notify_record
  34. where order_sn = #{orderSn} limit 1
  35. </select>
  36. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  37. delete from notify_record
  38. where id = #{id,jdbcType=INTEGER}
  39. </delete>
  40. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.NotifyRecord" useGeneratedKeys="true">
  41. insert into notify_record
  42. ( id,order_sn,mch_id
  43. ,open_id,total_fee,notify_url
  44. ,notify_times,status,create_time
  45. ,modified_time)
  46. values (#{id,jdbcType=INTEGER},#{orderSn,jdbcType=VARCHAR},#{mchId,jdbcType=VARCHAR}
  47. ,#{openId,jdbcType=VARCHAR},#{totalFee,jdbcType=VARCHAR},#{notifyUrl,jdbcType=VARCHAR}
  48. ,#{notifyTimes,jdbcType=INTEGER},#{status,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP}
  49. ,#{modifiedTime,jdbcType=TIMESTAMP})
  50. </insert>
  51. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.mofangchuxing.aska.dao.domain.NotifyRecord" useGeneratedKeys="true">
  52. insert into notify_record
  53. <trim prefix="(" suffix=")" suffixOverrides=",">
  54. <if test="id != null">id,</if>
  55. <if test="orderSn != null">order_sn,</if>
  56. <if test="mchId != null">mch_id,</if>
  57. <if test="openId != null">open_id,</if>
  58. <if test="totalFee != null">total_fee,</if>
  59. <if test="notifyUrl != null">notify_url,</if>
  60. <if test="notifyTimes != null">notify_times,</if>
  61. <if test="status != null">status,</if>
  62. <if test="createTime != null">create_time,</if>
  63. <if test="modifiedTime != null">modified_time,</if>
  64. </trim>
  65. <trim prefix="values (" suffix=")" suffixOverrides=",">
  66. <if test="id != null">#{id,jdbcType=INTEGER},</if>
  67. <if test="orderSn != null">#{orderSn,jdbcType=VARCHAR},</if>
  68. <if test="mchId != null">#{mchId,jdbcType=VARCHAR},</if>
  69. <if test="openId != null">#{openId,jdbcType=VARCHAR},</if>
  70. <if test="totalFee != null">#{totalFee,jdbcType=VARCHAR},</if>
  71. <if test="notifyUrl != null">#{notifyUrl,jdbcType=VARCHAR},</if>
  72. <if test="notifyTimes != null">#{notifyTimes,jdbcType=INTEGER},</if>
  73. <if test="status != null">#{status,jdbcType=INTEGER},</if>
  74. <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
  75. <if test="modifiedTime != null">#{modifiedTime,jdbcType=TIMESTAMP},</if>
  76. </trim>
  77. </insert>
  78. <update id="updateByPrimaryKeySelective" parameterType="com.mofangchuxing.aska.dao.domain.NotifyRecord">
  79. update notify_record
  80. <set>
  81. <if test="orderSn != null">
  82. order_sn = #{orderSn,jdbcType=VARCHAR},
  83. </if>
  84. <if test="mchId != null">
  85. mch_id = #{mchId,jdbcType=VARCHAR},
  86. </if>
  87. <if test="openId != null">
  88. open_id = #{openId,jdbcType=VARCHAR},
  89. </if>
  90. <if test="totalFee != null">
  91. total_fee = #{totalFee,jdbcType=VARCHAR},
  92. </if>
  93. <if test="notifyUrl != null">
  94. notify_url = #{notifyUrl,jdbcType=VARCHAR},
  95. </if>
  96. <if test="notifyTimes != null">
  97. notify_times = #{notifyTimes,jdbcType=INTEGER},
  98. </if>
  99. <if test="status != null">
  100. status = #{status,jdbcType=INTEGER},
  101. </if>
  102. <if test="createTime != null">
  103. create_time = #{createTime,jdbcType=TIMESTAMP},
  104. </if>
  105. <if test="modifiedTime != null">
  106. modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
  107. </if>
  108. </set>
  109. where id = #{id,jdbcType=INTEGER}
  110. </update>
  111. <update id="updateByPrimaryKey" parameterType="com.mofangchuxing.aska.dao.domain.NotifyRecord">
  112. update notify_record
  113. set
  114. order_sn = #{orderSn,jdbcType=VARCHAR},
  115. mch_id = #{mchId,jdbcType=VARCHAR},
  116. open_id = #{openId,jdbcType=VARCHAR},
  117. total_fee = #{totalFee,jdbcType=VARCHAR},
  118. notify_url = #{notifyUrl,jdbcType=VARCHAR},
  119. notify_times = #{notifyTimes,jdbcType=INTEGER},
  120. status = #{status,jdbcType=INTEGER},
  121. create_time = #{createTime,jdbcType=TIMESTAMP},
  122. modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
  123. where id = #{id,jdbcType=INTEGER}
  124. </update>
  125. </mapper>