MusicSheetAccompanimentMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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.yonge.cooleshow.biz.dal.dao.MusicSheetAccompanimentDao">
  8. <resultMap type="com.yonge.cooleshow.biz.dal.entity.MusicSheetAccompaniment" id="BaseResultMap">
  9. <result column="id_" property="id" />
  10. <result column="music_sheet_id_" property="musicSheetId" />
  11. <result column="music_subject_" property="musicSubject" />
  12. <result column="audio_file_url_" property="audioFileUrl" />
  13. <result column="sort_number_" property="sortNumber" />
  14. <result column="create_time_" property="createTime" />
  15. <result column="create_by_" property="createBy" />
  16. </resultMap>
  17. <!-- 根据主键查询一条记录 -->
  18. <select id="get" resultMap="BaseResultMap" >
  19. SELECT * FROM music_sheet_accompaniment WHERE id_ = #{id}
  20. </select>
  21. <!-- 全查询 -->
  22. <select id="findAll" resultMap="BaseResultMap">
  23. SELECT * FROM music_sheet_accompaniment ORDER BY id_
  24. </select>
  25. <delete id="delete" parameterType="MusicSheetAccompaniment">
  26. delete from music_sheet_accompaniment
  27. where 1=1
  28. <if test="musicSheetId != null and musicSheetId != ''">
  29. and music_sheet_id_ = #{musicSheetId}
  30. </if>
  31. <if test="musicSubject != null and musicSubject != ''">
  32. and music_subject_ = #{musicSubject}
  33. </if>
  34. <if test="audioFileUrl != null and audioFileUrl != ''">
  35. and audio_file_url_ = #{audioFileUrl}
  36. </if>
  37. <if test="sortNumber != null and sortNumber != ''">
  38. and sort_number_ = #{sortNumber}
  39. </if>
  40. <if test="createTime != null and createTime != ''">
  41. and create_time_ = #{createTime}
  42. </if>
  43. <if test="createBy != null and createBy != ''">
  44. and create_by_ = #{createBy}
  45. </if>
  46. </delete>
  47. <insert id="insert" parameterType="MusicSheetAccompaniment">
  48. insert into music_sheet_accompaniment
  49. (music_sheet_id_,music_subject_,audio_file_url_,sort_number_,create_time_,create_by_)
  50. values
  51. (#{musicSheetId},#{musicSubject},#{audioFileUrl},#{sortNumber},sysdate(),#{createBy})
  52. </insert>
  53. <update id="update" parameterType="MusicSheetAccompaniment">
  54. update music_sheet_accompaniment
  55. <set>
  56. <if test="musicSheetId != null">
  57. music_sheet_id_ = #{musicSheetId},
  58. </if>
  59. <if test="musicSubject != null and musicSubject != ''">
  60. music_subject_ = #{musicSubject},
  61. </if>
  62. <if test="audioFileUrl != null and audioFileUrl != ''">
  63. audio_file_url_ = #{audioFileUrl},
  64. </if>
  65. <if test="sortNumber != null">
  66. sort_number_ = #{sortNumber},
  67. </if>
  68. <if test="createTime != null">
  69. create_time_ = #{createTime},
  70. </if>
  71. <if test="createBy != null">
  72. create_by_ = #{createBy},
  73. </if>
  74. </set>
  75. where id = #{id}
  76. </update>
  77. <select id="findList" parameterType="MusicSheetAccompaniment" resultMap="BaseResultMap">
  78. select
  79. <include refid="Base_Column_List" />
  80. from music_sheet_accompaniment
  81. where 1=1
  82. <if test="musicSheetId != null">
  83. and music_sheet_id_ = #{musicSheetId}
  84. </if>
  85. <if test="musicSubject != null and musicSubject != ''">
  86. and music_subject_ = #{musicSubject}
  87. </if>
  88. <if test="audioFileUrl != null and audioFileUrl != ''">
  89. and audio_file_url_ = #{audioFileUrl}
  90. </if>
  91. <if test="sortNumber != null">
  92. and sort_number_ = #{sortNumber}
  93. </if>
  94. <if test="createTime != null">
  95. and create_time_ = #{createTime}
  96. </if>
  97. <if test="createBy != null">
  98. and create_by_ = #{createBy}
  99. </if>
  100. </select>
  101. <!-- 根据主键删除一条记录 -->
  102. <delete id="delete" >
  103. DELETE FROM music_sheet_accompaniment WHERE id_ = #{id}
  104. </delete>
  105. <!-- 分页查询 -->
  106. <select id="queryPage" resultMap="BaseResultMap" parameterType="map">
  107. SELECT * FROM music_sheet_accompaniment ORDER BY id_ <include refid="global.limit"/>
  108. </select>
  109. <!-- 查询当前表的总记录数 -->
  110. <select id="queryCount" resultType="int">
  111. SELECT COUNT(*) FROM music_sheet_accompaniment
  112. </select>
  113. </mapper>