|
|
@@ -1,80 +1,102 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.ym.mec.biz.dal.dao.MusicGroupOrganizationCourseSettingsDao">
|
|
|
- <resultMap id="MusicGroupOrganizationCourseSettings" type="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
|
|
|
- <!--@mbg.generated-->
|
|
|
- <!--@Table music_group_organization_course_settings-->
|
|
|
- <id column="id_" property="id" />
|
|
|
- <result column="name_" property="name" />
|
|
|
- <result column="organ_id_" property="organId" />
|
|
|
- <result column="charge_type_id_" property="chargeTypeId" />
|
|
|
- <result column="total_current_price_" property="totalCurrentPrice" />
|
|
|
- <result column="total_original_price_" property="totalOriginalPrice" />
|
|
|
- <result column="create_time_" property="createTime" />
|
|
|
- <result column="update_time_" property="updateTime" />
|
|
|
- </resultMap>
|
|
|
- <sql id="Base_Column_List">
|
|
|
- <!--@mbg.generated-->
|
|
|
- id_, name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_,
|
|
|
- create_time_, update_time_
|
|
|
- </sql>
|
|
|
- <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettings">
|
|
|
- <!--@mbg.generated-->
|
|
|
- select
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from music_group_organization_course_settings
|
|
|
- where id_ = #{id}
|
|
|
- </select>
|
|
|
- <delete id="delete" parameterType="java.lang.Integer">
|
|
|
- <!--@mbg.generated-->
|
|
|
- delete from music_group_organization_course_settings
|
|
|
- where id_ = #{id}
|
|
|
- </delete>
|
|
|
- <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings" useGeneratedKeys="true">
|
|
|
- <!--@mbg.generated-->
|
|
|
- insert into music_group_organization_course_settings (name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_,
|
|
|
- create_time_, update_time_)
|
|
|
- values (#{name}, #{organId}, #{chargeTypeId}, #{totalCurrentPrice}, #{totalOriginalPrice},
|
|
|
- #{createTime}, #{updateTime})
|
|
|
- </insert>
|
|
|
- <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
|
|
|
- <!--@mbg.generated-->
|
|
|
- update music_group_organization_course_settings
|
|
|
- <set>
|
|
|
- <if test="name != null">
|
|
|
- name_ = #{name},
|
|
|
- </if>
|
|
|
- <if test="organId != null">
|
|
|
- organ_id_ = #{organId},
|
|
|
- </if>
|
|
|
- <if test="chargeTypeId != null">
|
|
|
- charge_type_id_ = #{chargeTypeId},
|
|
|
- </if>
|
|
|
- <if test="totalCurrentPrice != null">
|
|
|
- total_current_price_ = #{totalCurrentPrice},
|
|
|
- </if>
|
|
|
- <if test="totalOriginalPrice != null">
|
|
|
- total_original_price_ = #{totalOriginalPrice},
|
|
|
- </if>
|
|
|
- <if test="createTime != null">
|
|
|
- create_time_ = #{createTime},
|
|
|
- </if>
|
|
|
- <if test="updateTime != null">
|
|
|
- update_time_ = #{updateTime},
|
|
|
- </if>
|
|
|
- </set>
|
|
|
- where id_ = #{id}
|
|
|
- </update>
|
|
|
+ <resultMap id="MusicGroupOrganizationCourseSettings"
|
|
|
+ type="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table music_group_organization_course_settings-->
|
|
|
+ <id column="id_" property="id"/>
|
|
|
+ <result column="name_" property="name"/>
|
|
|
+ <result column="organ_id_" property="organId"/>
|
|
|
+ <result column="charge_type_id_" property="chargeTypeId"/>
|
|
|
+ <result column="total_current_price_" property="totalCurrentPrice"/>
|
|
|
+ <result column="total_original_price_" property="totalOriginalPrice"/>
|
|
|
+ <result column="create_time_" property="createTime"/>
|
|
|
+ <result column="update_time_" property="updateTime"/>
|
|
|
+ <collection property="details" ofType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettingsDetail"
|
|
|
+ columnPrefix="detail_">
|
|
|
+ <result column="id_" property="id"/>
|
|
|
+ <result column="course_type_" property="courseType" typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler"/>
|
|
|
+ <result column="is_student_optional_" property="isStudentOptional"/>
|
|
|
+ <result column="course_total_minuties_" property="courseTotalMinuties"/>
|
|
|
+ <result column="unit_price_" property="unitPrice"/>
|
|
|
+ <result column="course_current_price_" property="courseOriginalPrice"/>
|
|
|
+ <result column="course_original_price_" property="courseCurrentPrice"/>
|
|
|
+ </collection>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ id_, name_, organ_id_, charge_type_id_, total_current_price_, total_original_price_,
|
|
|
+ create_time_, update_time_
|
|
|
+ </sql>
|
|
|
+ <select id="get" parameterType="java.lang.Integer" resultMap="MusicGroupOrganizationCourseSettings">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List"/>
|
|
|
+ from music_group_organization_course_settings
|
|
|
+ where id_ = #{id}
|
|
|
+ </select>
|
|
|
+ <delete id="delete" parameterType="java.lang.Integer">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ delete from music_group_organization_course_settings
|
|
|
+ where id_ = #{id}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id_" keyProperty="id"
|
|
|
+ parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings" useGeneratedKeys="true">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ insert into music_group_organization_course_settings (name_, organ_id_, charge_type_id_, total_current_price_,
|
|
|
+ total_original_price_,
|
|
|
+ create_time_, update_time_)
|
|
|
+ values (#{name}, #{organId}, #{chargeTypeId}, #{totalCurrentPrice}, #{totalOriginalPrice},
|
|
|
+ #{createTime}, #{updateTime})
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.MusicGroupOrganizationCourseSettings">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ update music_group_organization_course_settings
|
|
|
+ <set>
|
|
|
+ <if test="name != null">
|
|
|
+ name_ = #{name},
|
|
|
+ </if>
|
|
|
+ <if test="organId != null">
|
|
|
+ organ_id_ = #{organId},
|
|
|
+ </if>
|
|
|
+ <if test="chargeTypeId != null">
|
|
|
+ charge_type_id_ = #{chargeTypeId},
|
|
|
+ </if>
|
|
|
+ <if test="totalCurrentPrice != null">
|
|
|
+ total_current_price_ = #{totalCurrentPrice},
|
|
|
+ </if>
|
|
|
+ <if test="totalOriginalPrice != null">
|
|
|
+ total_original_price_ = #{totalOriginalPrice},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time_ = #{createTime},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_ = #{id}
|
|
|
+ </update>
|
|
|
|
|
|
- <!-- 分页查询 -->
|
|
|
- <select id="queryPage" resultMap="MusicGroupOrganizationCourseSettings" parameterType="map">
|
|
|
- SELECT * FROM music_group_organization_course_settings ORDER BY id_
|
|
|
- <include refid="global.limit" />
|
|
|
- </select>
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="MusicGroupOrganizationCourseSettings" parameterType="map">
|
|
|
+ SELECT mgocs.*,mgocsd.id_ detail_id_,mgocsd.course_type_ detail_course_type_, mgocsd.is_student_optional_
|
|
|
+ detail_is_student_optional_,mgocsd.course_total_minuties_ detail_course_total_minuties_,
|
|
|
+ mgocsd.unit_price_ detail_unit_price_,mgocsd.course_current_price_ detail_course_current_price_,
|
|
|
+ mgocsd.course_original_price_ detail_course_original_price_,mgocsd.course_current_price_
|
|
|
+ detail_course_current_price_
|
|
|
+ FROM music_group_organization_course_settings mgocs
|
|
|
+ LEFT JOIN music_group_organization_course_settings_detail mgocsd ON mgocs.id_ =
|
|
|
+ mgocsd.music_group_organization_course_settings_id_
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
|
|
|
- <!-- 查询当前表的总记录数 -->
|
|
|
- <select id="queryCount" resultType="int">
|
|
|
- SELECT COUNT(*) FROM
|
|
|
- music_group_organization_course_settings
|
|
|
- </select>
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int">
|
|
|
+ SELECT COUNT(*)
|
|
|
+ FROM music_group_organization_course_settings mgocs
|
|
|
+ LEFT JOIN music_group_organization_course_settings_detail mgocsd
|
|
|
+ ON mgocs.id_ = mgocsd.music_group_organization_course_settings_id_
|
|
|
+ </select>
|
|
|
</mapper>
|