소스 검색

档案信息修改

LIVE_YE 1 년 전
부모
커밋
5f5795b99c

+ 1 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/course/CourseTableController.java

@@ -75,7 +75,7 @@ public class CourseTableController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody CourseTable courseTable)
     {
-        return toAjax(courseTableService.insertCourseTable(courseTable));
+        return courseTableService.insertCourseTable(courseTable);
     }
 
     /**

+ 22 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/StudentInfo.java

@@ -117,10 +117,32 @@ public class StudentInfo extends BaseEntity
     private String isPoverty;
 
 
+    /** 紧急联系人 */
+    private String emergencyContact;
+    /** 紧急联系人手机号 */
+    private String emergencyContactTelephone;
+
     private String classId;
 
     private Long parentsId;
 
+    public String getEmergencyContact() {
+        return emergencyContact;
+    }
+
+    public String getEmergencyContactTelephone() {
+        return emergencyContactTelephone;
+    }
+
+    public void setEmergencyContact(String emergencyContact) {
+        this.emergencyContact = emergencyContact;
+    }
+
+    public void setEmergencyContactTelephone(String emergencyContactTelephone) {
+        this.emergencyContactTelephone = emergencyContactTelephone;
+    }
+
+
     public Long getParentsId() {
         return parentsId;
     }

+ 21 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/StudentInfoOld.java

@@ -126,6 +126,27 @@ public class StudentInfoOld extends BaseEntity
     /** 是否贫困(1:是,2:否) */
     private String isPoverty;
 
+    /** 紧急联系人 */
+    private String emergencyContact;
+    /** 紧急联系人手机号 */
+    private String emergencyContactTelephone;
+
+    public String getEmergencyContact() {
+        return emergencyContact;
+    }
+
+    public String getEmergencyContactTelephone() {
+        return emergencyContactTelephone;
+    }
+
+    public void setEmergencyContact(String emergencyContact) {
+        this.emergencyContact = emergencyContact;
+    }
+
+    public void setEmergencyContactTelephone(String emergencyContactTelephone) {
+        this.emergencyContactTelephone = emergencyContactTelephone;
+    }
+
     public String getIsLset() {
         return isLset;
     }

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/TeacherInfo.java

@@ -101,7 +101,16 @@ public class TeacherInfo extends BaseEntity
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date jobTime;
 
+    /** 学校id */
+    private Long schoolId;
 
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
 
     public Date getOnBoardTime() {
         return onBoardTime;

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/ICourseTableService.java

@@ -35,7 +35,7 @@ public interface ICourseTableService
      * @param courseTable 课程
      * @return 结果
      */
-    public int insertCourseTable(CourseTable courseTable);
+    public AjaxResult insertCourseTable(CourseTable courseTable);
 
     /**
      * 修改课程

+ 13 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CourseTableServiceImpl.java

@@ -156,9 +156,20 @@ public class CourseTableServiceImpl implements ICourseTableService {
      * @return 结果
      */
     @Override
-    public int insertCourseTable(CourseTable courseTable) {
+    public AjaxResult insertCourseTable(CourseTable courseTable) {
+
+        CourseTable table = new CourseTable();
+        table.setSchoolId(courseTable.getSchoolId());
+        table.setClassId(courseTable.getClassId());
+        table.setWeek(courseTable.getWeek());
+        List<CourseTable> courseTableList = courseTableMapper.selectCourseTableList(table);
+        if(courseTableList!=null && courseTableList.size()>0){
+            return AjaxResult.error("当前课表已存在,请前去修改");
+        }
         courseTable.setCreateTime(DateUtils.getNowDate());
-        return courseTableMapper.insertCourseTable(courseTable);
+        int rows = courseTableMapper.insertCourseTable(courseTable);
+
+        return rows > 0 ? AjaxResult.success() : AjaxResult.error();
     }
 
     /**

+ 1 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/CourseTableTimeServiceImpl.java

@@ -51,7 +51,7 @@ public class CourseTableTimeServiceImpl implements ICourseTableTimeService
      * @return 结果
      */
     @Override
-    public int insertCourseTableTime(CourseTableTime courseTableTime)
+    public int  insertCourseTableTime(CourseTableTime courseTableTime)
     {
         courseTableTime.setCreateTime(DateUtils.getNowDate());
         return courseTableTimeMapper.insertCourseTableTime(courseTableTime);

+ 29 - 43
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/StudentInfoOldServiceImpl.java

@@ -5,6 +5,7 @@ import java.util.*;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.domain.StudentLiveOld;
 import com.ruoyi.system.mapper.StudentLiveOldMapper;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,13 +16,12 @@ import com.ruoyi.system.service.IStudentInfoOldService;
 
 /**
  * 学生档案历史信息Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2023-07-28
  */
 @Service
-public class StudentInfoOldServiceImpl implements IStudentInfoOldService 
-{
+public class StudentInfoOldServiceImpl implements IStudentInfoOldService {
     @Autowired
     private StudentInfoOldMapper studentInfoOldMapper;
     @Autowired
@@ -29,26 +29,24 @@ public class StudentInfoOldServiceImpl implements IStudentInfoOldService
 
     /**
      * 查询学生档案历史信息
-     * 
+     *
      * @param id 学生档案历史信息主键
      * @return 学生档案历史信息
      */
     @Override
-    public StudentInfoOld selectStudentInfoOldById(Long id)
-    {
+    public StudentInfoOld selectStudentInfoOldById(Long id) {
         return studentInfoOldMapper.selectStudentInfoOldById(id);
     }
 
     /**
      * 查询学生档案历史信息列表
-     * 
+     *
      * @param studentInfoOld 学生档案历史信息
      * @return 学生档案历史信息
      */
     @Override
-    public List<StudentInfoOld> selectStudentInfoOldList(StudentInfoOld studentInfoOld)
-    {
-        if(studentInfoOld.getStudentId()==null || studentInfoOld.getStudentId()==0L){
+    public List<StudentInfoOld> selectStudentInfoOldList(StudentInfoOld studentInfoOld) {
+        if (studentInfoOld.getStudentId() == null || studentInfoOld.getStudentId() == 0L) {
             throw new ServiceException("参数错误");
         }
         return studentInfoOldMapper.selectStudentInfoOldList(studentInfoOld);
@@ -56,95 +54,83 @@ public class StudentInfoOldServiceImpl implements IStudentInfoOldService
 
     /**
      * 新增学生档案历史信息
-     * 
+     *
      * @param studentInfoOld 学生档案历史信息
      * @return 结果
      */
     @Override
-    public int insertStudentInfoOld(StudentInfoOld studentInfoOld)
-    {
+    public int insertStudentInfoOld(StudentInfoOld studentInfoOld) {
         studentInfoOld.setCreateTime(DateUtils.getNowDate());
         return studentInfoOldMapper.insertStudentInfoOld(studentInfoOld);
     }
 
     /**
      * 修改学生档案历史信息
-     * 
+     *
      * @param studentInfoOld 学生档案历史信息
      * @return 结果
      */
     @Override
-    public int updateStudentInfoOld(StudentInfoOld studentInfoOld)
-    {
+    public int updateStudentInfoOld(StudentInfoOld studentInfoOld) {
         studentInfoOld.setUpdateTime(DateUtils.getNowDate());
         return studentInfoOldMapper.updateStudentInfoOld(studentInfoOld);
     }
 
     /**
      * 批量删除学生档案历史信息
-     * 
+     *
      * @param ids 需要删除的学生档案历史信息主键
      * @return 结果
      */
     @Override
-    public int deleteStudentInfoOldByIds(Long[] ids)
-    {
+    public int deleteStudentInfoOldByIds(Long[] ids) {
         return studentInfoOldMapper.deleteStudentInfoOldByIds(ids);
     }
 
     /**
      * 删除学生档案历史信息信息
-     * 
+     *
      * @param id 学生档案历史信息主键
      * @return 结果
      */
     @Override
-    public int deleteStudentInfoOldById(Long id)
-    {
+    public int deleteStudentInfoOldById(Long id) {
         return studentInfoOldMapper.deleteStudentInfoOldById(id);
     }
 
     @Override
     public AjaxResult selectStudentInfoOldListEcharts(StudentLiveOld studentLiveOld) {
-        if(studentLiveOld.getStudentId()==null || studentLiveOld.getStudentId()==0L){
+        if (studentLiveOld.getStudentId() == null || studentLiveOld.getStudentId() == 0L) {
             throw new ServiceException("参数错误");
         }
         List<StudentLiveOld> studentLiveOldList = studentLiveOldMapper.selectStudentLiveOldListEcharts(studentLiveOld);
 
-        Map<String,Object> map = new HashMap<>();
+        Map<String, Object> map = new HashMap<>();
         List<Object> x = new ArrayList<>();
         List<Object> y1 = new ArrayList<>();
         List<Object> y2 = new ArrayList<>();
         String sg = "0";
         String tz = "0";
 
-        for (int i = 0; i < studentLiveOldList.size(); i++) {
-            StudentLiveOld liveOld = studentLiveOldList.get(i);
-            if(i==0){
-                sg = liveOld.getHeight();
-                tz = liveOld.getWeight();
-                x.add(DateUtils.dateTime(liveOld.getUpdateTime()));
-                y1.add(liveOld.getHeight());
-                y2.add(liveOld.getWeight());
-
-                map.put("X",x);
-                map.put("Y1",y1);
-                map.put("Y2",y2);
-            }else{
-                if(!sg.equals(liveOld.getHeight()) || !tz.equals(liveOld.getWeight())){
+        if (studentLiveOldList != null && studentLiveOldList.size() > 0) {
+            for (int i = 0; i < studentLiveOldList.size(); i++) {
+                StudentLiveOld liveOld = studentLiveOldList.get(i);
+                if(StringUtils.isEmpty(liveOld.getHeight()) || StringUtils.isEmpty(liveOld.getWeight())){
+                    continue;
+                }
+                if (!sg.equals(liveOld.getHeight()) || !tz.equals(liveOld.getWeight())) {
                     sg = liveOld.getHeight();
                     tz = liveOld.getWeight();
                     x.add(DateUtils.dateTime(liveOld.getUpdateTime()));
                     y1.add(liveOld.getHeight());
                     y2.add(liveOld.getWeight());
-
-                    map.put("X",x);
-                    map.put("Y1",y1);
-                    map.put("Y2",y2);
                 }
             }
         }
 
-        return AjaxResult.success("成功",map);
+        map.put("X", x);
+        map.put("Y1", y1);
+        map.put("Y2", y2);
+        return AjaxResult.success("成功", map);
     }
 }

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TeacherInfoServiceImpl.java

@@ -47,6 +47,9 @@ public class TeacherInfoServiceImpl implements ITeacherInfoService
     public List<TeacherInfo> selectTeacherInfoList(TeacherInfo teacherInfo)
     {
         SysUser user = SecurityUtils.getLoginUser().getUser();
+        if(!"admin".equals(user.getUserName())){
+            teacherInfo.setSchoolId(user.getDeptId());
+        }
         return teacherInfoMapper.selectTeacherInfoList(teacherInfo);
     }
 

+ 17 - 3
ruoyi-system/src/main/resources/mapper/system/StudentInfoMapper.xml

@@ -45,6 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="isLset"    column="is_lset"    />
         <result property="isPoverty"    column="is_poverty"    />
 
+        <result property="emergencyContact"    column="emergency_contact"    />
+        <result property="emergencyContactTelephone"    column="emergency_contact_telephone"    />
+
 
         <result property="classId"    column="classId"    />
         <result property="parentsId"    column="parentsId"    />
@@ -55,13 +58,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select id, student_id, name, sex, age, school, student_number, id_card, height, weight, blood_type, political_status, identification_photo,
                entrance_permit, father_name, father_telephone, mother_name, mother_telephone, address, create_by, create_time, update_by, update_time,
                remark,is_nearsightedness,degree_myopia,health,mind,longitude,latitude,is_medical_history,medical_description,psychological_description,
-               is_lset,is_poverty from student_info
+               is_lset,is_poverty,emergency_contact,emergency_contact_telephone from student_info
     </sql>
 
     <select id="selectStudentInfoList" parameterType="StudentInfo" resultMap="StudentInfoResult">
         select s.id, s.student_id, s.name, s.sex, s.age, s.school, s.student_number, s.id_card, s.height, s.weight, s.blood_type, s.political_status, s.identification_photo,
         s.entrance_permit, s.father_name, s.father_telephone, s.mother_name, s.mother_telephone, s.address, s.create_by, s.create_time, s.update_by, s.update_time, s.remark,
-        s.is_nearsightedness,s.degree_myopia,s.health,mind,s.longitude,s.latitude,s.is_medical_history,s.medical_description,s.psychological_description, s.is_lset,s.is_poverty
+        s.is_nearsightedness,s.degree_myopia,s.health,mind,s.longitude,s.latitude,s.is_medical_history,s.medical_description,s.psychological_description, s.is_lset,s.is_poverty,
+        s.emergency_contact,s.emergency_contact_telephone
         from student_info s
         left join formal_parents_student f on s.student_id = f.id
         <where>  
@@ -87,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isNearsightedness != null  and isNearsightedness != ''"> and s.is_nearsightedness = #{isNearsightedness}</if>
             <if test="isMedicalHistory != null  and isMedicalHistory != ''"> and s.is_medical_history = #{isMedicalHistory}</if>
 
+            <if test="emergencyContact != null  and emergencyContact != ''"> and s.emergency_contact = #{emergencyContact}</if>
+            <if test="emergencyContactTelephone != null  and emergencyContactTelephone != ''"> and s.emergency_contact_telephone = #{emergencyContactTelephone}</if>
+
             <if test="classId != null "> and f.class_id = #{classId}</if>
             <if test="parentsId != null "> and f.parents_id = #{parentsId}</if>
 
@@ -144,6 +151,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
             <if test="isLset != null">is_lset,</if>
             <if test="isPoverty != null">is_poverty,</if>
+
+            <if test="emergencyContact != null">emergency_contact,</if>
+            <if test="emergencyContactTelephone != null">emergency_contact_telephone,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="studentId != null">#{studentId},</if>
@@ -185,7 +195,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isLset != null">#{isLset},</if>
             <if test="isPoverty != null">#{isPoverty},</if>
 
-
+            <if test="emergencyContact != null">#{emergencyContact},</if>
+            <if test="emergencyContactTelephone != null">#{emergencyContactTelephone},</if>
          </trim>
     </insert>
 
@@ -230,6 +241,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
             <if test="isLset != null">is_lset= #{isLset},</if>
             <if test="isPoverty != null">is_poverty= #{isPoverty},</if>
+
+            <if test="emergencyContact != null">emergency_contact= #{emergencyContact},</if>
+            <if test="emergencyContactTelephone != null">emergency_contact_telephone= #{emergencyContactTelephone},</if>
         </trim>
         where id = #{id}
     </update>

+ 16 - 1
ruoyi-system/src/main/resources/mapper/system/StudentInfoOldMapper.xml

@@ -42,10 +42,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
         <result property="isLset"    column="is_lset"    />
         <result property="isPoverty"    column="is_poverty"    />
+
+        <result property="emergencyContact"    column="emergency_contact"    />
+        <result property="emergencyContactTelephone"    column="emergency_contact_telephone"    />
     </resultMap>
 
     <sql id="selectStudentInfoOldVo">
-        select old_id, student_id, name, sex, age, school, student_number, id_card, is_nearsightedness, degree_myopia, height, weight, blood_type, political_status, health, identification_photo, mind, entrance_permit, father_name, father_telephone, mother_name, mother_telephone, address, longitude, latitude, create_by, create_time, update_by, update_time, remark,is_medical_history,medical_description,psychological_description,is_lset,is_poverty from student_info_old
+        select old_id, student_id, name, sex, age, school, student_number, id_card, is_nearsightedness, degree_myopia, height, weight, blood_type, political_status, health, identification_photo, mind, entrance_permit, father_name, father_telephone, mother_name, mother_telephone, address, longitude, latitude, create_by, create_time, update_by, update_time, remark,is_medical_history,medical_description,psychological_description,is_lset,is_poverty,emergency_contact,emergency_contact_telephone from student_info_old
     </sql>
 
     <select id="selectStudentInfoOldList" parameterType="StudentInfoOld" resultMap="StudentInfoOldResult">
@@ -75,6 +78,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="address != null  and address != ''"> and address = #{address}</if>
             <if test="longitude != null  and longitude != ''"> and longitude = #{longitude}</if>
             <if test="latitude != null  and latitude != ''"> and latitude = #{latitude}</if>
+            <if test="emergencyContact != null  and emergencyContact != ''"> and s.emergency_contact = #{emergencyContact}</if>
+            <if test="emergencyContactTelephone != null  and emergencyContactTelephone != ''"> and s.emergency_contact_telephone = #{emergencyContactTelephone}</if>
+
         </where>
         order by create_time desc
     </select>
@@ -153,6 +159,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
             <if test="isLset != null">is_lset,</if>
             <if test="isPoverty != null">is_poverty,</if>
+
+            <if test="emergencyContact != null">emergency_contact,</if>
+            <if test="emergencyContactTelephone != null">emergency_contact_telephone,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="studentId != null">#{studentId},</if>
@@ -191,6 +200,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
             <if test="isLset != null">#{isLset},</if>
             <if test="isPoverty != null">#{isPoverty},</if>
+
+            <if test="emergencyContact != null">#{emergencyContact},</if>
+            <if test="emergencyContactTelephone != null">#{emergencyContactTelephone},</if>
          </trim>
     </insert>
 
@@ -233,6 +245,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
             <if test="isLset != null">is_lset= #{isLset},</if>
             <if test="isPoverty != null">is_poverty= #{isPoverty},</if>
+
+            <if test="emergencyContact != null">emergency_contact= #{emergencyContact},</if>
+            <if test="emergencyContactTelephone != null">emergency_contact_telephone= #{emergencyContactTelephone},</if>
         </trim>
         where old_id = #{oldId}
     </update>

+ 35 - 20
ruoyi-system/src/main/resources/mapper/system/TeacherInfoMapper.xml

@@ -33,34 +33,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
+
+        <result property="schoolId"    column="schoolId"    />
     </resultMap>
 
     <sql id="selectTeacherInfoVo">
-        select id, teacher_id, name, sex, age, phone, professional, id_card, height, weight, blood_type, political_status, graduation_photo, degree_photo, teaching_photo, professional_photo, identification_photo, entrance_permit, address,on_board_time,job_time, create_by, create_time, update_by, update_time, remark from teacher_info
+        select id, teacher_id, name, sex, age, phone, professional, id_card, height, weight, blood_type, political_status, graduation_photo, degree_photo,
+                teaching_photo, professional_photo, identification_photo, entrance_permit, address,on_board_time,job_time, create_by, create_time,
+               update_by, update_time, remark from teacher_info
     </sql>
 
     <select id="selectTeacherInfoList" parameterType="TeacherInfo" resultMap="TeacherInfoResult">
-        <include refid="selectTeacherInfoVo"/>
+        select ANY_VALUE(t.id) as id, ANY_VALUE(t.teacher_id) as teacher_id,  ANY_VALUE(t.name) as name, ANY_VALUE(t.sex) as sex,
+        ANY_VALUE(t.age) as age, ANY_VALUE(t.phone) as phone, ANY_VALUE(t.professional) as professional, ANY_VALUE(t.id_card) as id_card,
+        ANY_VALUE(t.height) as height, ANY_VALUE(t.weight) as weight, ANY_VALUE(t.blood_type) as blood_type, ANY_VALUE(t.political_status) as political_status,
+        ANY_VALUE(t.graduation_photo) as graduation_photo, ANY_VALUE(t.degree_photo) as degree_photo,
+        ANY_VALUE(t.teaching_photo) as teaching_photo, ANY_VALUE(t.professional_photo) as professional_photo, ANY_VALUE(t.identification_photo) as identification_photo,
+        ANY_VALUE(t.entrance_permit) as entrance_permit, ANY_VALUE(t.address) as address,ANY_VALUE(t.on_board_time) as on_board_time,ANY_VALUE(t.job_time) as job_time,
+        ANY_VALUE(t.create_by) as create_by, ANY_VALUE(t.create_time) as create_time,
+        ANY_VALUE(t.update_by) as update_by, ANY_VALUE(t.update_time) as update_time, ANY_VALUE(t.remark) as remark
+        from teacher_info t
+        left join formal_teacher_class f on t.teacher_id = f.teacher_id
         <where>  
-            <if test="teacherId != null "> and teacher_id = #{teacherId}</if>
-            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
-            <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
-            <if test="age != null  and age != ''"> and age = #{age}</if>
-            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
-            <if test="professional != null  and professional != ''"> and professional = #{professional}</if>
-            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
-            <if test="height != null  and height != ''"> and height = #{height}</if>
-            <if test="weight != null  and weight != ''"> and weight = #{weight}</if>
-            <if test="bloodType != null  and bloodType != ''"> and blood_type = #{bloodType}</if>
-            <if test="politicalStatus != null  and politicalStatus != ''"> and political_status = #{politicalStatus}</if>
-            <if test="graduationPhoto != null  and graduationPhoto != ''"> and graduation_photo = #{graduationPhoto}</if>
-            <if test="degreePhoto != null  and degreePhoto != ''"> and degree_photo = #{degreePhoto}</if>
-            <if test="teachingPhoto != null  and teachingPhoto != ''"> and teaching_photo = #{teachingPhoto}</if>
-            <if test="professionalPhoto != null  and professionalPhoto != ''"> and professional_photo = #{professionalPhoto}</if>
-            <if test="identificationPhoto != null  and identificationPhoto != ''"> and identification_photo = #{identificationPhoto}</if>
-            <if test="entrancePermit != null  and entrancePermit != ''"> and entrance_permit = #{entrancePermit}</if>
-            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="teacherId != null "> and t.teacher_id = #{teacherId}</if>
+            <if test="name != null  and name != ''"> and t.name like concat('%', #{name}, '%')</if>
+            <if test="sex != null  and sex != ''"> and t.sex = #{sex}</if>
+            <if test="age != null  and age != ''"> and t.age = #{age}</if>
+            <if test="phone != null  and phone != ''"> and t.phone = #{phone}</if>
+            <if test="professional != null  and professional != ''"> and t.professional = #{professional}</if>
+            <if test="idCard != null  and idCard != ''"> and t.id_card = #{idCard}</if>
+            <if test="height != null  and height != ''"> and t.height = #{height}</if>
+            <if test="weight != null  and weight != ''"> and t.weight = #{weight}</if>
+            <if test="bloodType != null  and bloodType != ''"> and t.blood_type = #{bloodType}</if>
+            <if test="politicalStatus != null  and politicalStatus != ''"> and t.political_status = #{politicalStatus}</if>
+            <if test="graduationPhoto != null  and graduationPhoto != ''"> and t.graduation_photo = #{graduationPhoto}</if>
+            <if test="degreePhoto != null  and degreePhoto != ''"> and t.degree_photo = #{degreePhoto}</if>
+            <if test="teachingPhoto != null  and teachingPhoto != ''"> and t.teaching_photo = #{teachingPhoto}</if>
+            <if test="professionalPhoto != null  and professionalPhoto != ''"> and t.professional_photo = #{professionalPhoto}</if>
+            <if test="identificationPhoto != null  and identificationPhoto != ''"> and t.identification_photo = #{identificationPhoto}</if>
+            <if test="entrancePermit != null  and entrancePermit != ''"> and t.entrance_permit = #{entrancePermit}</if>
+            <if test="address != null  and address != ''"> and t.address = #{address}</if>
+            <if test="schoolId != null  and schoolId != ''"> and f.school_id = #{schoolId}</if>
         </where>
+        group by teacher_id
     </select>
     
     <select id="selectTeacherInfoById" parameterType="Long" resultMap="TeacherInfoResult">