|
@@ -1,37 +1,51 @@
|
|
|
<?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">
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="org.dromara.system.mapper.FormalTeacherClassMapper">
|
|
|
<resultMap type="org.dromara.system.domain.vo.FormalTeacherClassVo" id="FormalTeacherClassResult">
|
|
|
- <result property="id" column="id" />
|
|
|
- <result property="teacherId" column="teacher_id" />
|
|
|
- <result property="teacherName" column="teacher_name" />
|
|
|
- <result property="schoolId" column="school_id" />
|
|
|
- <result property="schoolName" column="school_name" />
|
|
|
- <result property="classId" column="class_id" />
|
|
|
- <result property="className" column="class_name" />
|
|
|
- <result property="discipline" column="discipline" />
|
|
|
- <result property="createBy" column="create_by" />
|
|
|
- <result property="createTime" column="create_time" />
|
|
|
- <result property="updateBy" column="update_by" />
|
|
|
- <result property="updateTime" column="update_time" />
|
|
|
- <result property="remark" column="remark" />
|
|
|
+ <result property="id" column="id"/>
|
|
|
+ <result property="teacherId" column="teacher_id"/>
|
|
|
+ <result property="teacherName" column="teacher_name"/>
|
|
|
+ <result property="schoolId" column="school_id"/>
|
|
|
+ <result property="schoolName" column="school_name"/>
|
|
|
+ <result property="classId" column="class_id"/>
|
|
|
+ <result property="className" column="class_name"/>
|
|
|
+ <result property="discipline" column="discipline"/>
|
|
|
+ <result property="createBy" column="create_by"/>
|
|
|
+ <result property="createTime" column="create_time"/>
|
|
|
+ <result property="updateBy" column="update_by"/>
|
|
|
+ <result property="updateTime" column="update_time"/>
|
|
|
+ <result property="remark" column="remark"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFormalTeacherClassVo">
|
|
|
- select id, teacher_id,teacher_name, school_id, school_name, class_id, class_name, discipline, create_by, create_time, update_by, update_time, remark from formal_teacher_class
|
|
|
+ select id,
|
|
|
+ teacher_id,
|
|
|
+ teacher_name,
|
|
|
+ school_id,
|
|
|
+ school_name,
|
|
|
+ class_id,
|
|
|
+ class_name,
|
|
|
+ discipline,
|
|
|
+ create_by,
|
|
|
+ create_time,
|
|
|
+ update_by,
|
|
|
+ update_time,
|
|
|
+ remark
|
|
|
+ from formal_teacher_class
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFormalTeacherClassList" parameterType="FormalTeacherClass" resultMap="FormalTeacherClassResult">
|
|
|
<include refid="selectFormalTeacherClassVo"/>
|
|
|
<where>
|
|
|
- <if test="teacherId != null and teacherId != ''"> and teacher_id = #{teacherId}</if>
|
|
|
- <if test="schoolId != null and schoolId != ''"> and school_id = #{schoolId}</if>
|
|
|
- <if test="schoolName != null and schoolName != ''"> and school_name like concat('%', #{schoolName}, '%')</if>
|
|
|
- <if test="classId != null and classId != ''"> and class_id = #{classId}</if>
|
|
|
- <if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
|
|
|
- <if test="discipline != null and discipline != ''"> and discipline = #{discipline}</if>
|
|
|
+ <if test="teacherId != null and teacherId != ''">and teacher_id = #{teacherId}</if>
|
|
|
+ <if test="schoolId != null and schoolId != ''">and school_id = #{schoolId}</if>
|
|
|
+ <if test="schoolName != null and schoolName != ''">and school_name like concat('%', #{schoolName}, '%')
|
|
|
+ </if>
|
|
|
+ <if test="classId != null and classId != ''">and class_id = #{classId}</if>
|
|
|
+ <if test="className != null and className != ''">and class_name like concat('%', #{className}, '%')</if>
|
|
|
+ <if test="discipline != null and discipline != ''">and discipline = #{discipline}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
|
|
@@ -92,7 +106,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</update>
|
|
|
|
|
|
<delete id="deleteFormalTeacherClassById" parameterType="Long">
|
|
|
- delete from formal_teacher_class where id = #{id}
|
|
|
+ delete
|
|
|
+ from formal_teacher_class
|
|
|
+ where id = #{id}
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteFormalTeacherClassByIds" parameterType="String">
|
|
@@ -102,11 +118,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
<delete id="deleteFormalTeacherClassByTeacherId" parameterType="java.lang.Long">
|
|
|
- delete from formal_teacher_class where teacher_id = #{userId}
|
|
|
+ delete
|
|
|
+ from formal_teacher_class
|
|
|
+ where teacher_id = #{userId}
|
|
|
</delete>
|
|
|
|
|
|
<select id="getTeacherClass" parameterType="string" resultMap="FormalTeacherClassResult">
|
|
|
<include refid="selectFormalTeacherClassVo"/>
|
|
|
where teacher_id = #{teacherId}
|
|
|
</select>
|
|
|
+ <select id="queryMapperList" resultMap="FormalTeacherClassResult">
|
|
|
+ <include refid="selectFormalTeacherClassVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="teacherId != null and teacherId != ''">and teacher_id = #{teacherId}</if>
|
|
|
+ <if test="schoolId != null and schoolId != ''">and school_id = #{schoolId}</if>
|
|
|
+ <if test="schoolName != null and schoolName != ''">and school_name like concat('%', #{schoolName}, '%')</if>
|
|
|
+ <if test="classId != null and classId != ''">and class_id = #{classId}</if>
|
|
|
+ <if test="className != null and className != ''">and class_name like concat('%', #{className}, '%')</if>
|
|
|
+ <if test="discipline != null and discipline != ''">and discipline = #{discipline}</if>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
</mapper>
|