ClassGroupTeacherSalaryMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.ClassGroupTeacherSalaryDao">
  4. <resultMap id="ClassGroupTeacherSalary" type="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary">
  5. <id column="id_" jdbcType="BIGINT" property="id" />
  6. <result column="music_group_id_" jdbcType="INTEGER" property="musicGroupId" />
  7. <result column="class_group_id_" jdbcType="INTEGER" property="classGroupId" />
  8. <result column="teacher_role_" jdbcType="VARCHAR" property="teacherRole" />
  9. <result column="user_id_" jdbcType="INTEGER" property="userId" />
  10. <result column="salary_" jdbcType="DECIMAL" property="salary" />
  11. <result column="online_classes_salary_" jdbcType="DECIMAL" property="onlineClassesSalary" />
  12. <result column="create_time_" jdbcType="TIMESTAMP" property="createTime" />
  13. <result column="update_time_" jdbcType="TIMESTAMP" property="updateTime" />
  14. </resultMap>
  15. <select id="get" parameterType="java.lang.Long" resultMap="ClassGroupTeacherSalary">
  16. select * from class_group_teacher_salary where id_ = #{id}
  17. </select>
  18. <delete id="delete" parameterType="java.lang.Long">
  19. delete from class_group_teacher_salary
  20. where id_ = #{id}
  21. </delete>
  22. <insert id="insert" keyColumn="id_" keyProperty="id" parameterType="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary" useGeneratedKeys="true">
  23. insert into class_group_teacher_salary
  24. <trim prefix="(" suffix=")" suffixOverrides=",">
  25. <if test="musicGroupId != null">
  26. music_group_id_,
  27. </if>
  28. <if test="classGroupId != null">
  29. class_group_id_,
  30. </if>
  31. <if test="teacherRole != null">
  32. teacher_role_,
  33. </if>
  34. <if test="userId != null">
  35. user_id_,
  36. </if>
  37. <if test="salary != null">
  38. salary_,
  39. </if>
  40. <if test="onlineClassesSalary != null">
  41. online_classes_salary_,
  42. </if>
  43. <if test="createTime != null">
  44. create_time_,
  45. </if>
  46. <if test="updateTime != null">
  47. update_time_,
  48. </if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="musicGroupId != null">
  52. #{musicGroupId,jdbcType=INTEGER},
  53. </if>
  54. <if test="classGroupId != null">
  55. #{classGroupId,jdbcType=INTEGER},
  56. </if>
  57. <if test="teacherRole != null">
  58. #{teacherRole,jdbcType=VARCHAR},
  59. </if>
  60. <if test="userId != null">
  61. #{userId,jdbcType=INTEGER},
  62. </if>
  63. <if test="salary != null">
  64. #{salary,jdbcType=DECIMAL},
  65. </if>
  66. <if test="onlineClassesSalary != null">
  67. #{onlineClassesSalary,jdbcType=DECIMAL},
  68. </if>
  69. <if test="createTime != null">
  70. #{createTime,jdbcType=TIMESTAMP},
  71. </if>
  72. <if test="updateTime != null">
  73. #{updateTime,jdbcType=TIMESTAMP},
  74. </if>
  75. </trim>
  76. </insert>
  77. <update id="update" parameterType="com.ym.mec.biz.dal.entity.ClassGroupTeacherSalary">
  78. update class_group_teacher_salary
  79. <set>
  80. <if test="musicGroupId != null">
  81. music_group_id_ = #{musicGroupId,jdbcType=INTEGER},
  82. </if>
  83. <if test="classGroupId != null">
  84. class_group_id_ = #{classGroupId,jdbcType=INTEGER},
  85. </if>
  86. <if test="teacherRole != null">
  87. teacher_role_ = #{teacherRole,jdbcType=VARCHAR},
  88. </if>
  89. <if test="userId != null">
  90. user_id_ = #{userId,jdbcType=INTEGER},
  91. </if>
  92. <if test="salary != null">
  93. salary_ = #{salary,jdbcType=DECIMAL},
  94. </if>
  95. <if test="onlineClassesSalary != null">
  96. online_classes_salary_ = #{onlineClassesSalary,jdbcType=DECIMAL},
  97. </if>
  98. <if test="createTime != null">
  99. create_time_ = #{createTime,jdbcType=TIMESTAMP},
  100. </if>
  101. <if test="updateTime != null">
  102. update_time_ = #{updateTime,jdbcType=TIMESTAMP},
  103. </if>
  104. </set>
  105. where id_ = #{id,jdbcType=BIGINT}
  106. </update>
  107. <!-- 分页查询 -->
  108. <select id="queryPage" resultMap="ClassGroupTeacherSalary" parameterType="map">
  109. SELECT * FROM class_group_teacher_salary ORDER BY id_
  110. <include refid="global.limit"/>
  111. </select>
  112. <!-- 查询当前表的总记录数 -->
  113. <select id="queryCount" resultType="int">
  114. SELECT COUNT(*) FROM class_group_teacher_salary
  115. </select>
  116. <!-- 获取乐团老师课酬配置表 -->
  117. <select id="findByMusicGroupId" resultMap="ClassGroupTeacherSalary">
  118. SELECT * FROM class_group_teacher_salary WHERE music_group_id_ = #{musicGroupId}
  119. </select>
  120. </mapper>