StudentWithdrawMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.StudentWithdrawDao">
  8. <resultMap type="com.ym.mec.web.dal.entity.StudentWithdraw" id="StudentWithdraw">
  9. <result column="id_" property="id"/>
  10. <result column="user_id_" property="userId"/>
  11. <result column="bank_card_no_" property="bankCardNo"/>
  12. <result column="trans_no_" property="transNo"/>
  13. <result column="status_" property="status" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
  14. <result column="amount_" property="amount"/>
  15. <result column="fee_user_" property="feeUser"/>
  16. <result column="fee_platform_" property="feePlatform"/>
  17. <result column="description_" property="description"/>
  18. <result column="comment_" property="comment"/>
  19. <result column="create_time_" property="createTime"/>
  20. <result column="modify_time_" property="modifyTime"/>
  21. </resultMap>
  22. <!-- 根据主键查询一条记录 -->
  23. <select id="get" resultMap="StudentWithdraw">
  24. SELECT * FROM student_withdraw WHERE id_ = #{id}
  25. </select>
  26. <!-- 全查询 -->
  27. <select id="findAll" resultMap="StudentWithdraw">
  28. SELECT * FROM student_withdraw ORDER BY id_
  29. </select>
  30. <!-- 向数据库增加一条记录 -->
  31. <insert id="insert" parameterType="com.ym.mec.web.dal.entity.StudentWithdraw" useGeneratedKeys="true" keyColumn="id"
  32. keyProperty="id">
  33. <!--
  34. <selectKey resultClass="int" keyProperty="id" >
  35. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  36. </selectKey>
  37. -->
  38. INSERT INTO student_withdraw
  39. (id_,user_id_,bank_card_no_,trans_no_,status_,amount_,fee_user_,fee_platform_,description_,comment_,create_time_,modify_time_)
  40. VALUES(#{id},#{userId},#{bankCardNo},#{transNo},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{amount},#{feeUser},#{feePlatform},#{description},#{comment},now(),now())
  41. </insert>
  42. <!-- 根据主键查询一条记录 -->
  43. <update id="update" parameterType="com.ym.mec.web.dal.entity.StudentWithdraw">
  44. UPDATE student_withdraw
  45. <set>
  46. <if test="status != null">
  47. status_ = #{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
  48. </if>
  49. <if test="userId != null">
  50. user_id_ = #{userId},
  51. </if>
  52. <if test="modifyTime != null">
  53. modify_time_ = #{modifyTime},
  54. </if>
  55. <if test="feePlatform != null">
  56. fee_platform_ = #{feePlatform},
  57. </if>
  58. <if test="comment != null">
  59. comment_ = #{comment},
  60. </if>
  61. <if test="amount != null">
  62. amount_ = #{amount},
  63. </if>
  64. <if test="feeUser != null">
  65. fee_user_ = #{feeUser},
  66. </if>
  67. <if test="bankCardNo != null">
  68. bank_card_no_ = #{bankCardNo},
  69. </if>
  70. <if test="description != null">
  71. description_ = #{description},
  72. </if>
  73. <if test="transNo != null">
  74. trans_no_ = #{transNo},
  75. </if>
  76. </set>
  77. WHERE id_ = #{id}
  78. </update>
  79. <!-- 根据主键删除一条记录 -->
  80. <delete id="delete">
  81. DELETE FROM student_withdraw WHERE id_ = #{id}
  82. </delete>
  83. <!-- 分页查询 -->
  84. <select id="queryPage" resultMap="StudentWithdraw" parameterType="map">
  85. SELECT * FROM student_withdraw ORDER BY id_
  86. <include refid="global.limit"/>
  87. </select>
  88. <!-- 查询当前表的总记录数 -->
  89. <select id="queryCount" resultType="int">
  90. SELECT COUNT(*) FROM student_withdraw
  91. </select>
  92. </mapper>