StudentApplyRefundsMapper.xml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. 这个文件是自动生成的。
  5. 不要修改此文件。所有改动将在下次重新自动生成时丢失。
  6. -->
  7. <mapper namespace="com.ym.mec.web.dal.dao.StudentApplyRefundsDao">
  8. <resultMap type="com.ym.mec.web.dal.entity.StudentApplyRefunds" id="StudentApplyRefunds">
  9. <result column="id_" property="id"/>
  10. <result column="user_id_" property="userId"/>
  11. <result column="order_no_" property="orderNo"/>
  12. <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
  13. <result column="expect_amount_" property="expectAmount"/>
  14. <result column="actual_amount_" property="actualAmount"/>
  15. <result column="create_time_" property="createTime"/>
  16. <result column="update_time_" property="updateTime"/>
  17. <result column="orig_payment_order_id_" property="origPaymentOrderId"/>
  18. </resultMap>
  19. <!-- 根据主键查询一条记录 -->
  20. <select id="get" resultMap="StudentApplyRefunds">
  21. SELECT * FROM student_apply_refunds WHERE id_ = #{id}
  22. </select>
  23. <!-- 全查询 -->
  24. <select id="findAll" resultMap="StudentApplyRefunds">
  25. SELECT * FROM student_apply_refunds ORDER BY id_
  26. </select>
  27. <!-- 向数据库增加一条记录 -->
  28. <insert id="insert" parameterType="com.ym.mec.web.dal.entity.StudentApplyRefunds" useGeneratedKeys="true"
  29. keyColumn="id" keyProperty="id">
  30. <!--
  31. <selectKey resultClass="int" keyProperty="id" >
  32. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  33. </selectKey>
  34. -->
  35. INSERT INTO student_apply_refunds
  36. (id_,user_id_,order_no_,status_,expect_amount_,actual_amount_,create_time_,update_time_,orig_payment_order_id_)
  37. VALUES(#{id},#{userId},#{orderNo},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{expectAmount},#{actualAmount},now(),now(),#{origPaymentOrderId})
  38. </insert>
  39. <!-- 根据主键查询一条记录 -->
  40. <update id="update" parameterType="com.ym.mec.web.dal.entity.StudentApplyRefunds">
  41. UPDATE student_apply_refunds
  42. <set>
  43. <if test="status != null">
  44. status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
  45. </if>
  46. <if test="userId != null">
  47. user_id_ = #{userId},
  48. </if>
  49. <if test="orderNo != null">
  50. order_no_ = #{orderNo},
  51. </if>
  52. <if test="expectAmount != null">
  53. expect_amount_ = #{expectAmount},
  54. </if>
  55. <if test="updateTime != null">
  56. update_time_ = #{updateTime},
  57. </if>
  58. <if test="origPaymentOrderId != null">
  59. orig_payment_order_id_ = #{origPaymentOrderId},
  60. </if>
  61. <if test="actualAmount != null">
  62. actual_amount_ = #{actualAmount},
  63. </if>
  64. </set>
  65. WHERE id_ = #{id}
  66. </update>
  67. <!-- 根据主键删除一条记录 -->
  68. <delete id="delete">
  69. DELETE FROM student_apply_refunds WHERE id_ = #{id}
  70. </delete>
  71. <!-- 分页查询 -->
  72. <select id="queryPage" resultMap="StudentApplyRefunds" parameterType="map">
  73. SELECT * FROM student_apply_refunds ORDER BY id_
  74. <include refid="global.limit"/>
  75. </select>
  76. <!-- 查询当前表的总记录数 -->
  77. <select id="queryCount" resultType="int">
  78. SELECT COUNT(*) FROM student_apply_refunds
  79. </select>
  80. </mapper>