|
|
@@ -117,12 +117,77 @@
|
|
|
<result column="classes" property="classes" jdbcType="VARCHAR" />
|
|
|
</resultMap>
|
|
|
|
|
|
- <select id="selectTeacher" parameterType="long" resultMap="teacherMap">
|
|
|
- select sys_teacher.teacher_name teacher,sys_grade.grade_name grade,sys_clazz.clazz_name classes,subject.subject_name subject
|
|
|
-from sys_teacher_clazz left join subject on sys_teacher_clazz.subject_id = subject.subject_id
|
|
|
-left join sys_clazz on sys_teacher_clazz.clazz_id = sys_clazz.clazz_id
|
|
|
-left join sys_grade on sys_grade.grade_id=sys_clazz.grade_id
|
|
|
-left join sys_teacher on sys_teacher.teacher_id = sys_teacher_clazz.teacher_id
|
|
|
-where sys_teacher_clazz.clazz_id=#{id};
|
|
|
+ <select id="selectTeacher" parameterType="long" resultType="com.usoftchina.smartschool.school.po.SysTeacherClazz">
|
|
|
+ select * from sys_teacher_clazz where teacher_clazz_id = #{id}
|
|
|
</select>
|
|
|
+
|
|
|
+
|
|
|
+ <insert id="insertTeacher" parameterType="com.usoftchina.smartschool.school.po.SysTeacherClazz" >
|
|
|
+ insert into sys_teacher_clazz
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="clazz_id != null" >
|
|
|
+ clazz_id,
|
|
|
+ </if>
|
|
|
+ <if test="teacher_id != null" >
|
|
|
+ teacher_id,
|
|
|
+ </if>
|
|
|
+ <if test="subject_id != null" >
|
|
|
+ subject_id,
|
|
|
+ </if>
|
|
|
+ <if test="clazz_name != null" >
|
|
|
+ clazz_name,
|
|
|
+ </if>
|
|
|
+ <if test="teacher_name != null" >
|
|
|
+ teacher_name,
|
|
|
+ </if>
|
|
|
+ <if test="subject_name != null" >
|
|
|
+ subject_name,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="clazz_id != null" >
|
|
|
+ #{clazz_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="teacher_id != null" >
|
|
|
+ #{teacher_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="subject_id != null" >
|
|
|
+ #{subject_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="clazz_name != null" >
|
|
|
+ #{clazz_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="teacher_name != null" >
|
|
|
+ #{teacher_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="subject_name != null" >
|
|
|
+ #{subject_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="updateTeacher" parameterType="com.usoftchina.smartschool.school.po.SysTeacherClazz" >
|
|
|
+ update sys_teacher_clazz
|
|
|
+ <set >
|
|
|
+ <if test="clazz_id != null" >
|
|
|
+ clazz_id = #{clazz_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="teacher_id != null" >
|
|
|
+ teacher_id = #{teacher_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="subject_id != null" >
|
|
|
+ subject_id = #{subject_id,jdbcType=BIGINT},
|
|
|
+ </if>
|
|
|
+ <if test="clazz_name != null" >
|
|
|
+ clazz_name = #{clazz_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="teacher_name != null" >
|
|
|
+ teacher_name = #{teacher_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="subject_name != null" >
|
|
|
+ subject_name = #{subject_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where teacher_clazz_id = #{teacher_clazz_id,jdbcType=BIGINT}
|
|
|
+ </update>
|
|
|
</mapper>
|