|
@@ -0,0 +1,118 @@
|
|
|
+<?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.TeacherCourseRewardDao">
|
|
|
+ <resultMap id="teacherCourseReward" type="com.ym.mec.biz.dal.entity.TeacherCourseReward">
|
|
|
+ <id column="id_" jdbcType="BIGINT" property="id"/>
|
|
|
+ <result column="music_group_id_" jdbcType="VARCHAR" property="musicGroupId"/>
|
|
|
+ <result column="group_type_" jdbcType="VARCHAR" property="groupType"/>
|
|
|
+ <result column="course_schedule_id_list_" jdbcType="VARCHAR" property="courseScheduleIdList"/>
|
|
|
+ <result column="course_group_name_" jdbcType="VARCHAR" property="courseGroupName"/>
|
|
|
+ <result column="organ_id_" jdbcType="INTEGER" property="organId"/>
|
|
|
+ <result column="organ_name_" jdbcType="VARCHAR" property="organName"/>
|
|
|
+ <result column="teacher_id_" jdbcType="INTEGER" property="teacherId"/>
|
|
|
+ <result column="teacher_name_" jdbcType="VARCHAR" property="teacherName"/>
|
|
|
+ <result column="expect_reward_amount_" jdbcType="DECIMAL" property="expectRewardAmount"/>
|
|
|
+ <result column="actual_reward_amount_" jdbcType="DECIMAL" property="actualRewardAmount"/>
|
|
|
+ <result column="memo_" jdbcType="VARCHAR" property="memo"/>
|
|
|
+ <result column="create_time_" jdbcType="TIMESTAMP" property="createTime"/>
|
|
|
+ <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ id_, music_group_id_, group_type_, course_schedule_id_list_, course_group_name_,
|
|
|
+ organ_id_, teacher_id_, expect_reward_amount_, actual_reward_amount_, memo_, create_time_,
|
|
|
+ update_time_
|
|
|
+ </sql>
|
|
|
+ <select id="get" parameterType="java.lang.Long" resultMap="teacherCourseReward">
|
|
|
+ select *
|
|
|
+ from teacher_course_reward
|
|
|
+ where id_ = #{id,jdbcType=BIGINT}
|
|
|
+ </select>
|
|
|
+ <delete id="delete" parameterType="java.lang.Long">
|
|
|
+ delete
|
|
|
+ from teacher_course_reward
|
|
|
+ where id_ = #{id,jdbcType=BIGINT}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.TeacherCourseReward"
|
|
|
+ useGeneratedKeys="true">
|
|
|
+ insert into teacher_course_reward (music_group_id_, group_type_, course_schedule_id_list_,
|
|
|
+ course_group_name_, organ_id_, teacher_id_,
|
|
|
+ expect_reward_amount_, actual_reward_amount_,
|
|
|
+ memo_, create_time_, update_time_)
|
|
|
+ values (#{musicGroupId,jdbcType=VARCHAR}, #{groupType,jdbcType=VARCHAR},
|
|
|
+ #{courseScheduleIdList,jdbcType=VARCHAR},
|
|
|
+ #{courseGroupName,jdbcType=VARCHAR}, #{organId,jdbcType=INTEGER}, #{teacherId,jdbcType=INTEGER},
|
|
|
+ #{expectRewardAmount,jdbcType=DECIMAL}, #{actualRewardAmount,jdbcType=DECIMAL},
|
|
|
+ #{memo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
|
|
+ </insert>
|
|
|
+ <update id="update" parameterType="com.ym.mec.biz.dal.entity.TeacherCourseReward">
|
|
|
+ update teacher_course_reward
|
|
|
+ <set>
|
|
|
+ <if test="musicGroupId != null">
|
|
|
+ music_group_id_ = #{musicGroupId,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="groupType != null">
|
|
|
+ group_type_ = #{groupType,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="courseScheduleIdList != null">
|
|
|
+ course_schedule_id_list_ = #{courseScheduleIdList,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="courseGroupName != null">
|
|
|
+ course_group_name_ = #{courseGroupName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="organId != null">
|
|
|
+ organ_id_ = #{organId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="teacherId != null">
|
|
|
+ teacher_id_ = #{teacherId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="expectRewardAmount != null">
|
|
|
+ expect_reward_amount_ = #{expectRewardAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="actualRewardAmount != null">
|
|
|
+ actual_reward_amount_ = #{actualRewardAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="memo != null">
|
|
|
+ memo_ = #{memo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time_ = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ update_time_ = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where id_ = #{id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <sql id="queryCondition">
|
|
|
+ <where>
|
|
|
+ <if test="teacherId!=null">
|
|
|
+ AND tcr.teacher_id_=#{teacherId}
|
|
|
+ </if>
|
|
|
+ <if test="search!=null">
|
|
|
+ AND (tcr.course_group_name_ LIKE CONCAT('%', #{search}, '%') OR tcr.music_group_id_ LIKE CONCAT(#{search}, '%'))
|
|
|
+ </if>
|
|
|
+ <if test="organId!=null">
|
|
|
+ AND FIND_IN_SET(tcr.organ_id_ ,#{organId})
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <!-- 分页查询 -->
|
|
|
+ <select id="queryPage" resultMap="teacherCourseReward" parameterType="map">
|
|
|
+ SELECT tcr.*,su.real_name_ teacher_name_,o.name_ organ_name_ FROM teacher_course_reward tcr
|
|
|
+ LEFT JOIN sys_user su ON su.id_ = tcr.teacher_id_
|
|
|
+ LEFT JOIN organization o ON o.id_ = tcr.organ_id_
|
|
|
+ <include refid="queryCondition"/>
|
|
|
+ ORDER BY tcr.id_ DESC
|
|
|
+ <include refid="global.limit"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询当前表的总记录数 -->
|
|
|
+ <select id="queryCount" resultType="int" parameterType="map">
|
|
|
+ SELECT count(*) FROM teacher_course_reward tcr
|
|
|
+ <include refid="queryCondition"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|