MusicGroupSubjectPlanMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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.MusicGroupSubjectPlanDao">
  8. <resultMap type="com.ym.mec.web.dal.entity.MusicGroupSubjectPlan" id="MusicGroupSubjectPlan">
  9. <result column="id_" property="id"/>
  10. <result column="music_group_id_" property="musicGroupId"/>
  11. <result column="subject_id_" property="subjectId"/>
  12. <result column="expected_student_num_" property="expectedStudentNum"/>
  13. <result column="apply_student_num_" property="applyStudentNum"/>
  14. <result column="fee_" property="fee"/>
  15. <result column="kit_group_purchase_type_" property="kitGroupPurchaseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
  16. <result column="deposit_fee_" property="depositFee"/>
  17. <result column="create_time_" property="createTime"/>
  18. <result column="update_time_" property="updateTime"/>
  19. </resultMap>
  20. <!-- 根据主键查询一条记录 -->
  21. <select id="get" resultMap="MusicGroupSubjectPlan">
  22. SELECT * FROM music_group_subject_plan WHERE id_ = #{id}
  23. </select>
  24. <!-- 全查询 -->
  25. <select id="findAll" resultMap="MusicGroupSubjectPlan">
  26. SELECT * FROM music_group_subject_plan ORDER BY id_
  27. </select>
  28. <!-- 向数据库增加一条记录 -->
  29. <insert id="insert" parameterType="com.ym.mec.web.dal.entity.MusicGroupSubjectPlan" useGeneratedKeys="true"
  30. keyColumn="id" keyProperty="id">
  31. INSERT INTO music_group_subject_plan
  32. (id_,music_group_id_,subject_id_,expected_student_num_,apply_student_num_,fee_,kit_group_purchase_type_,deposit_fee_,create_time_,update_time_)
  33. VALUES(#{id},#{musicGroupId},#{subjectId},#{expectedStudentNum},#{applyStudentNum},#{fee},#{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{depositFee},now(),now())
  34. </insert>
  35. <!-- 根据主键查询一条记录 -->
  36. <update id="update" parameterType="com.ym.mec.web.dal.entity.MusicGroupSubjectPlan">
  37. UPDATE music_group_subject_plan
  38. <set>
  39. <if test="subjectId != null">
  40. subject_id_ = #{subjectId},
  41. </if>
  42. <if test="applyStudentNum != null">
  43. apply_student_num_ = #{applyStudentNum},
  44. </if>
  45. <if test="fee != null">
  46. fee_ = #{fee},
  47. </if>
  48. <if test="kitGroupPurchaseType != null">
  49. kit_group_purchase_type_ = #{kitGroupPurchaseType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
  50. </if>
  51. <if test="updateTime != null">
  52. update_time_ = #{updateTime},
  53. </if>
  54. <if test="depositFee != null">
  55. deposit_fee_ = #{depositFee},
  56. </if>
  57. <if test="expectedStudentNum != null">
  58. expected_student_num_ = #{expectedStudentNum},
  59. </if>
  60. <if test="musicGroupId != null">
  61. music_group_id_ = #{musicGroupId},
  62. </if>
  63. </set>
  64. WHERE id_ = #{id}
  65. </update>
  66. <!-- 根据主键删除一条记录 -->
  67. <delete id="delete">
  68. DELETE FROM music_group_subject_plan WHERE id_ = #{id}
  69. </delete>
  70. <!-- 分页查询 -->
  71. <select id="queryPage" resultMap="MusicGroupSubjectPlan" parameterType="map">
  72. SELECT * FROM music_group_subject_plan ORDER BY id_
  73. <include refid="global.limit"/>
  74. </select>
  75. <!-- 查询当前表的总记录数 -->
  76. <select id="queryCount" resultType="int">
  77. SELECT COUNT(*) FROM music_group_subject_plan
  78. </select>
  79. </mapper>