Browse Source

新增老师课时对应薪酬表

周箭河 5 years ago
parent
commit
56f751fd69

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ClassGroupTeacherSalaryDao.java

@@ -0,0 +1,9 @@
+package com.ym.mec.biz.dal.dao;
+
+
+import com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary;
+import com.ym.mec.common.dal.BaseDAO;
+
+public interface ClassGroupTeacherSalaryDao extends BaseDAO<Integer, ClassGroupTeacherSalary> {
+
+}

+ 105 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ClassGroupTeacherSalary.java

@@ -0,0 +1,105 @@
+package com.ym.mec.biz.dal.entity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class ClassGroupTeacherSalary {
+    private Long id;
+
+    private Integer musicGroupId;
+
+    private Integer classGroupId;
+
+    /**
+    * 老师角色(主教、助教)
+    */
+    private String teacherRole;
+
+    private Integer userId;
+
+    /**
+    * 课时长
+    */
+    private Integer duration;
+
+    /**
+    * 薪酬
+    */
+    private BigDecimal salary;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Integer getMusicGroupId() {
+        return musicGroupId;
+    }
+
+    public void setMusicGroupId(Integer musicGroupId) {
+        this.musicGroupId = musicGroupId;
+    }
+
+    public Integer getClassGroupId() {
+        return classGroupId;
+    }
+
+    public void setClassGroupId(Integer classGroupId) {
+        this.classGroupId = classGroupId;
+    }
+
+    public String getTeacherRole() {
+        return teacherRole;
+    }
+
+    public void setTeacherRole(String teacherRole) {
+        this.teacherRole = teacherRole;
+    }
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getDuration() {
+        return duration;
+    }
+
+    public void setDuration(Integer duration) {
+        this.duration = duration;
+    }
+
+    public BigDecimal getSalary() {
+        return salary;
+    }
+
+    public void setSalary(BigDecimal salary) {
+        this.salary = salary;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 124 - 0
mec-biz/src/main/resources/config/mybatis/ClassGroupTeacherSalaryMapper.xml

@@ -0,0 +1,124 @@
+<?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.ClassGroupTeacherSalaryDao">
+  <resultMap id="ClassGroupTeacherSalary" type="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary">
+    <id column="id_" jdbcType="BIGINT" property="id" />
+    <result column="music_group_id_" jdbcType="INTEGER" property="musicGroupId" />
+    <result column="class_group_id_" jdbcType="INTEGER" property="classGroupId" />
+    <result column="teacher_role_" jdbcType="VARCHAR" property="teacherRole" />
+    <result column="user_id_" jdbcType="INTEGER" property="userId" />
+    <result column="duration_" jdbcType="INTEGER" property="duration" />
+    <result column="salary_" jdbcType="DECIMAL" property="salary" />
+    <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    
+    id_, music_group_id_, class_group_id_, teacher_role_, user_id_, duration_, salary_, 
+    create_time_, update_time_
+  </sql>
+  <select id="get" parameterType="java.lang.Long" resultMap="ClassGroupTeacherSalary">
+     select * from class_group_teacher_salary where id_ = #{id}
+  </select>
+  <delete id="delete" parameterType="java.lang.Long">
+    delete from class_group_teacher_salary
+    where id_ = #{id}
+  </delete>
+  <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary" useGeneratedKeys="true">
+    
+    insert into class_group_teacher_salary
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="musicGroupId != null">
+        music_group_id_,
+      </if>
+      <if test="classGroupId != null">
+        class_group_id_,
+      </if>
+      <if test="teacherRole != null">
+        teacher_role_,
+      </if>
+      <if test="userId != null">
+        user_id_,
+      </if>
+      <if test="duration != null">
+        duration_,
+      </if>
+      <if test="salary != null">
+        salary_,
+      </if>
+      <if test="createTime != null">
+        create_time_,
+      </if>
+      <if test="updateTime != null">
+        update_time_,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="musicGroupId != null">
+        #{musicGroupId,jdbcType=INTEGER},
+      </if>
+      <if test="classGroupId != null">
+        #{classGroupId,jdbcType=INTEGER},
+      </if>
+      <if test="teacherRole != null">
+        #{teacherRole,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null">
+        #{userId,jdbcType=INTEGER},
+      </if>
+      <if test="duration != null">
+        #{duration,jdbcType=INTEGER},
+      </if>
+      <if test="salary != null">
+        #{salary,jdbcType=DECIMAL},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="update" parameterType="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary">
+    
+    update class_group_teacher_salary
+    <set>
+      <if test="musicGroupId != null">
+        music_group_id_ = #{musicGroupId,jdbcType=INTEGER},
+      </if>
+      <if test="classGroupId != null">
+        class_group_id_ = #{classGroupId,jdbcType=INTEGER},
+      </if>
+      <if test="teacherRole != null">
+        teacher_role_ = #{teacherRole,jdbcType=VARCHAR},
+      </if>
+      <if test="userId != null">
+        user_id_ = #{userId,jdbcType=INTEGER},
+      </if>
+      <if test="duration != null">
+        duration_ = #{duration,jdbcType=INTEGER},
+      </if>
+      <if test="salary != null">
+        salary_ = #{salary,jdbcType=DECIMAL},
+      </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>
+  <!-- 分页查询 -->
+  <select id="queryPage" resultMap="ClassGroupTeacherSalary" parameterType="map">
+    SELECT * FROM class_group_teacher_salary ORDER BY id_
+    <include refid="global.limit"/>
+  </select>
+
+  <!-- 查询当前表的总记录数 -->
+  <select id="queryCount" resultType="int">
+    SELECT COUNT(*) FROM class_group_teacher_salary
+  </select>
+</mapper>