TransactionRecord.xml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <!-- namespace必须指向DAO接口 -->
  5. <mapper namespace="com.jpsoft.picc.modules.base.dao.TransactionRecordDAO">
  6. <resultMap id="TransactionRecordMap" type="com.jpsoft.picc.modules.base.entity.TransactionRecord">
  7. <id property="id" column="id_" />
  8. <result property="companyId" column="company_id" />
  9. <result property="transactionNumber" column="transaction_number" />
  10. <result property="amount" column="amount_" />
  11. <result property="orderNo" column="order_no" />
  12. <result property="paymentStatus" column="payment_status" />
  13. <result property="buyType" column="buy_type" />
  14. <result property="paymentTime" column="payment_time" />
  15. <result property="createBy" column="create_by" />
  16. <result property="createTime" column="create_time" />
  17. <result property="updateBy" column="update_by" />
  18. <result property="updateTime" column="update_time" />
  19. <result property="delFlag" column="del_flag" />
  20. </resultMap>
  21. <insert id="insert" parameterType="com.jpsoft.picc.modules.base.entity.TransactionRecord">
  22. <!--
  23. <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
  24. select sys_guid() from dual
  25. </selectKey>
  26. -->
  27. <![CDATA[
  28. insert into base_transaction_record
  29. (id_,company_id,transaction_number,amount_,order_no,payment_status,buy_type,payment_time,create_by,create_time,update_by,update_time,del_flag)
  30. values
  31. (
  32. #{id,jdbcType=VARCHAR}
  33. ,#{companyId,jdbcType=VARCHAR}
  34. ,#{transactionNumber,jdbcType=VARCHAR}
  35. ,#{amount,jdbcType= NUMERIC }
  36. ,#{orderNo,jdbcType=VARCHAR}
  37. ,#{paymentStatus,jdbcType=VARCHAR}
  38. ,#{buyType,jdbcType=VARCHAR}
  39. ,#{paymentTime,jdbcType= TIMESTAMP }
  40. ,#{createBy,jdbcType=VARCHAR}
  41. ,#{createTime,jdbcType= TIMESTAMP }
  42. ,#{updateBy,jdbcType=VARCHAR}
  43. ,#{updateTime,jdbcType= TIMESTAMP }
  44. ,#{delFlag,jdbcType= NUMERIC }
  45. )
  46. ]]>
  47. </insert>
  48. <delete id="delete" parameterType="string">
  49. delete from base_transaction_record where id_=#{id,jdbcType=VARCHAR}
  50. </delete>
  51. <update id="update" parameterType="com.jpsoft.picc.modules.base.entity.TransactionRecord">
  52. update base_transaction_record
  53. <set>
  54. <if test="companyId!=null">
  55. company_id=#{companyId,jdbcType=VARCHAR},
  56. </if>
  57. <if test="transactionNumber!=null">
  58. transaction_number=#{transactionNumber,jdbcType=VARCHAR},
  59. </if>
  60. <if test="amount!=null">
  61. amount_=#{amount,jdbcType= NUMERIC },
  62. </if>
  63. <if test="orderNo!=null">
  64. order_no=#{orderNo,jdbcType=VARCHAR},
  65. </if>
  66. <if test="paymentStatus!=null">
  67. payment_status=#{paymentStatus,jdbcType=VARCHAR},
  68. </if>
  69. <if test="buyType!=null">
  70. buy_type=#{buyType,jdbcType=VARCHAR},
  71. </if>
  72. <if test="paymentTime!=null">
  73. payment_time=#{paymentTime,jdbcType= TIMESTAMP },
  74. </if>
  75. <if test="createBy!=null">
  76. create_by=#{createBy,jdbcType=VARCHAR},
  77. </if>
  78. <if test="createTime!=null">
  79. create_time=#{createTime,jdbcType= TIMESTAMP },
  80. </if>
  81. <if test="updateBy!=null">
  82. update_by=#{updateBy,jdbcType=VARCHAR},
  83. </if>
  84. <if test="updateTime!=null">
  85. update_time=#{updateTime,jdbcType= TIMESTAMP },
  86. </if>
  87. <if test="delFlag!=null">
  88. del_flag=#{delFlag,jdbcType= NUMERIC },
  89. </if>
  90. </set>
  91. where id_=#{id}
  92. </update>
  93. <select id="get" parameterType="string" resultMap="TransactionRecordMap">
  94. select
  95. id_,company_id,transaction_number,amount_,order_no,payment_status,buy_type,payment_time,create_by,create_time,update_by,update_time,del_flag from base_transaction_record where id_=#{0}
  96. </select>
  97. <select id="exist" parameterType="string" resultType="int">
  98. select count(*) from base_transaction_record where id_=#{0}
  99. </select>
  100. <select id="list" resultMap="TransactionRecordMap">
  101. select * from base_transaction_record
  102. </select>
  103. <select id="search" parameterType="hashmap" resultMap="TransactionRecordMap">
  104. <![CDATA[
  105. select * from base_transaction_record
  106. ]]>
  107. <where>
  108. <if test="searchParams.id != null">
  109. and ID_ like #{searchParams.id}
  110. </if>
  111. </where>
  112. <foreach item="sort" collection="sortList" open="order by" separator=",">
  113. ${sort.name} ${sort.order}
  114. </foreach>
  115. </select>
  116. </mapper>