MusicGroupOrganizationCourseSettingsMapper.xml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. <mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao">
  4. <resultMap id="MusicGroupOrganizationCourseSettings"
  5. type="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
  6. <!--@mbg.generated-->
  7. <!--@Table music_group_organization_course_settings-->
  8. <id column="id_" property="id"/>
  9. <result column="name_" property="name"/>
  10. <result column="organ_id_" property="organId"/>
  11. <result column="charge_type_id_" property="chargeTypeId"/>
  12. <result column="total_current_price_" property="totalCurrentPrice"/>
  13. <result column="total_original_price_" property="totalOriginalPrice"/>
  14. <result column="create_time_" property="createTime"/>
  15. <result column="update_time_" property="updateTime"/>
  16. </resultMap>
  17. <sql id="Base_Column_List">
  18. <!--@mbg.generated-->
  19. id_, name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_,
  20. create_time_, update_time_
  21. </sql>
  22. <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettings">
  23. <!--@mbg.generated-->
  24. select
  25. <include refid="Base_Column_List"/>
  26. from music_group_organization_course_settings
  27. where id_ = #{id}
  28. </select>
  29. <delete id="delete" parameterType="java.lang.Integer">
  30. <!--@mbg.generated-->
  31. delete from music_group_organization_course_settings
  32. where id_ = #{id}
  33. </delete>
  34. <insert id="insert" keyColumn="id_" keyProperty="id"
  35. parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings" useGeneratedKeys="true">
  36. <!--@mbg.generated-->
  37. insert into music_group_organization_course_settings (name_, organ_id_, charge_type_id_, total_current_price_,
  38. total_original_price_,
  39. create_time_, update_time_)
  40. values (#{name}, #{organId}, #{chargeTypeId}, #{totalCurrentPrice}, #{totalOriginalPrice},
  41. NOW(),NOW())
  42. </insert>
  43. <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
  44. <!--@mbg.generated-->
  45. update music_group_organization_course_settings
  46. <set>
  47. <if test="name != null">
  48. name_ = #{name},
  49. </if>
  50. <if test="organId != null">
  51. organ_id_ = #{organId},
  52. </if>
  53. <if test="chargeTypeId != null">
  54. charge_type_id_ = #{chargeTypeId},
  55. </if>
  56. <if test="totalCurrentPrice != null">
  57. total_current_price_ = #{totalCurrentPrice},
  58. </if>
  59. <if test="totalOriginalPrice != null">
  60. total_original_price_ = #{totalOriginalPrice},
  61. </if>
  62. <if test="createTime != null">
  63. create_time_ = #{createTime},
  64. </if>
  65. <if test="updateTime != null">
  66. update_time_ = #{updateTime},
  67. </if>
  68. </set>
  69. where id_ = #{id}
  70. </update>
  71. <!-- 分页查询 -->
  72. <select id="queryPage" resultMap="MusicGroupOrganizationCourseSettings" parameterType="map">
  73. SELECT mgocs.* FROM music_group_organization_course_settings mgocs
  74. <include refid="queryCondition"/>
  75. <include refid="global.limit"/>
  76. </select>
  77. <!-- 查询当前表的总记录数 -->
  78. <select id="queryCount" resultType="int">
  79. SELECT COUNT(mgocs.id_) FROM music_group_organization_course_settings mgocs
  80. <include refid="queryCondition"/>
  81. </select>
  82. <sql id="queryCondition">
  83. <where>
  84. <if test="organId != null">
  85. AND mgocs.organ_id_=#{organId}
  86. </if>
  87. <if test="chargeTypeId != null">
  88. AND mgocs.charge_type_id_ = #{chargeTypeId}
  89. </if>
  90. </where>
  91. </sql>
  92. </mapper>