GoodsOrderPaymentMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
  4. <mapper namespace="com.ym.mec.biz.dal.dao.GoodsOrderPaymentDao">
  5. <resultMap type="com.ym.mec.biz.dal.entity.GoodsOrderPayment"
  6. id="GoodsOrderPayment">
  7. <result column="id_" property="id" />
  8. <result column="user_id_" property="userId" />
  9. <result column="goods_order_id_" property="goodsOrderId" />
  10. <result column="payment_channel_" property="paymentChannel" />
  11. <result column="payment_business_channel_" property="paymentBusinessChannel" />
  12. <result column="payment_account_no_" property="paymentAccountNo" />
  13. <result column="amount_" property="amount" />
  14. <result column="trans_no_" property="transNo" />
  15. <result column="order_no_" property="orderNo" />
  16. <result column="pay_status_" property="payStatus" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
  17. <result column="arrival_time_" property="arrivalTime" />
  18. <result column="remark_" property="remark" />
  19. <result column="create_time_" property="createTime" />
  20. <result column="update_time_" property="updateTime" />
  21. </resultMap>
  22. <!-- 根据主键查询一条记录 -->
  23. <select id="get" resultMap="GoodsOrderPayment">
  24. SELECT * FROM
  25. goods_order_payment WHERE id_ = #{id}
  26. </select>
  27. <!-- 全查询 -->
  28. <select id="findAll" resultMap="GoodsOrderPayment">
  29. SELECT * FROM goods_order_payment
  30. ORDER BY id_
  31. </select>
  32. <!-- 向数据库增加一条记录 -->
  33. <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.GoodsOrderPayment"
  34. useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  35. INSERT INTO goods_order_payment
  36. (id_,user_id_,goods_order_id_,payment_channel_,payment_business_channel_,payment_account_no_,amount_,trans_no_,order_no_,pay_status_,arrival_time_,remark_,create_time_,update_time_)
  37. VALUES(#{id},#{userId},#{goodsOrderId},#{paymentChannel},#{paymentBusinessChannel},#{paymentAccountNo},#{amount},#{transNo},#{orderNo},#{payStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{arrivalTime},#{remark},now(),now())
  38. </insert>
  39. <!-- 根据主键查询一条记录 -->
  40. <update id="update" parameterType="com.ym.mec.biz.dal.entity.GoodsOrderPayment">
  41. UPDATE goods_order_payment
  42. <set>
  43. <if test="payStatus != null">
  44. pay_status_ = #{payStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
  45. </if>
  46. <if test="orderNo != null">
  47. order_no_ = #{orderNo},
  48. </if>
  49. <if test="id != null">
  50. id_ = #{id},
  51. </if>
  52. <if test="amount != null">
  53. amount_ = #{amount},
  54. </if>
  55. <if test="arrivalTime != null">
  56. arrival_time_ = #{arrivalTime},
  57. </if>
  58. <if test="paymentChannel != null">
  59. payment_channel_ = #{paymentChannel},
  60. </if>
  61. <if test="createTime != null">
  62. create_time_ = #{createTime},
  63. </if>
  64. <if test="userId != null">
  65. user_id_ = #{userId},
  66. </if>
  67. <if test="remark != null">
  68. remark_ = #{remark},
  69. </if>
  70. <if test="paymentAccountNo != null">
  71. payment_account_no_ = #{paymentAccountNo},
  72. </if>
  73. <if test="paymentBusinessChannel != null">
  74. payment_business_channel_ = #{paymentBusinessChannel},
  75. </if>
  76. <if test="updateTime != null">
  77. update_time_ = NOW(),
  78. </if>
  79. <if test="goodsOrderId != null">
  80. goods_order_id_ = #{goodsOrderId},
  81. </if>
  82. <if test="transNo != null">
  83. trans_no_ = #{transNo},
  84. </if>
  85. </set>
  86. WHERE id_ = #{id}
  87. </update>
  88. <!-- 根据主键删除一条记录 -->
  89. <delete id="delete">
  90. DELETE FROM goods_order_payment WHERE id_ =
  91. #{id}
  92. </delete>
  93. <!-- 分页查询 -->
  94. <select id="queryPage" resultMap="GoodsOrderPayment"
  95. parameterType="map">
  96. SELECT * FROM goods_order_payment ORDER BY id_
  97. <include refid="global.limit" />
  98. </select>
  99. <!-- 查询当前表的总记录数 -->
  100. <select id="queryCount" resultType="int">
  101. SELECT COUNT(*) FROM
  102. goods_order_payment
  103. </select>
  104. </mapper>