2026-03-10 16:40:19 +08:00

107 lines
4.2 KiB
XML

<?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.univ3e.dao.UnivTeacherDao">
<update id="doSaveUpdate" parameterType="com.univ3e.entity.UnivTeacher">
Update UnivTeacher
<set>
<if test="schoolid != null">schoolid = #{schoolid},</if>
<if test="loginno != null">loginno = #{loginno},</if>
<if test="password != null">password = #{password},</if>
<if test="truename != null">truename = #{truename},</if>
<if test="nickname != null">nickname = #{nickname},</if>
<if test="gender != null">gender = #{gender},</if>
<if test="address != null">address = #{address},</if>
<if test="areaid != null">areaid = #{areaid},</if>
<if test="recognizecode != null">recognizecode = #{recognizecode},</if>
<if test="cellphone != null">cellphone = #{cellphone},</if>
<if test="telephone != null">telephone = #{telephone},</if>
<if test="avatar != null">avatar = #{avatar},</if>
<if test="email != null">email = #{email},</if>
<if test="status != null">status = #{status},</if>
<if test="source != null">source = #{source},</if>
<if test="jdtoken != null">jdtoken = #{jdtoken},</if>
<if test="lastsignin != null">lastsignin = #{lastsignin},</if>
<if test="signature != null">signature = #{signature}</if>
</set>
WHERE teacherid = #{teacherid}
</update>
<select id="findByLoginno" parameterType="string" resultType="com.univ3e.entity.UnivTeacher">
SELECT * FROM UnivTeacher
WHERE loginno = #{loginno}
</select>
<select id="findClassMessByTeacherid" parameterType="long" resultType="com.univ3e.entity.UnivClassmessage" >
select t.* from univclassmessage t,univclasses a,univclassownmessage b
where t.classmessageid = b.classmessageid and b.classesid = a.classesid
and a.teacherid = #{teacherid} and t.status = 1
order by created desc limit 1
</select>
<select id="findClassMessByTeacherids" parameterType="map" resultType="com.univ3e.entity.UnivClassmessage" >
select t.* from univclassmessage t,univclassownmessage b
where t.classmessageid = b.classmessageid
and b.classesid = #{classesId} and t.status = 1
<if test="status == '1'.toString()">
order by created desc
</if>
<if test="status == '2'.toString()">
order by created ASC
</if>
</select>
<select id="findById" parameterType="long" resultType="com.univ3e.entity.UnivTeacher">
SELECT * FROM UnivTeacher
WHERE teacherid = #{teacherid}
</select>
<select id="findByIds" parameterType="list" resultType="com.univ3e.entity.UnivTeacher">
SELECT * FROM UnivTeacher
WHERE teacherid in
<foreach item="item" index="index" collection="list"
open="(" separator="," close=")">
#{item}
</foreach>
</select>
<select id="findFollowMates" parameterType="long" resultType="com._3e.http.myspace.dto._3EResClassMates" >
SELECT * from univstudent t,univfollowship s
where t.studentid = s.befollower and t.status = 1
and s.follower = #{follower}
</select>
<select id="findPhbUserInfo" parameterType="long" resultType="com._3e.dto.PhbUserInfo" >
select b.teacherId as uid , b.truename , '' as className , e.schoolName
from UnivTeacher b
inner join UnivErsity e
on b.schoolId = e.schoolId where b.teacherId = #{teacherid}
</select>
<select id="findNeedAuditStudent" parameterType="map" resultType="com._3e.dto.NeedAuditStudent" >
SELECT b.studentid,b.truename,b.nickname,b.recognizecode,C .classesid,C .classname
FROM Univstudentownclass A, Univstudent b, Univclasses C
where A .studentid = b.studentid and A .classesid = C .classesid
AND C .teacherid = #{teacherId} and c.status = 1 and c.classtype =2 and a.status = 0
<if test="page != null">
LIMIT #{page.limit} OFFSET #{page.offset}
</if>
</select>
<update id="auditinTeam" parameterType="map">
update Univstudentownclass set status = 1 where studentid = #{studentId} and classesid = #{classesId}
</update>
<insert id= "doSave" parameterType="com.univ3e.entity.UnivStudentOwnClass" >
INSERT INTO univstudentownclass(studentid,classesid,isdelegate,status,areaid)
VALUES (#{studentid},#{classesid},#{isdelegate},#{status},#{areaid})
</insert>
<select id="findCreatedById" parameterType="map" resultType="com.univ3e.entity.UnivTeacher">
select created from univteacher where teacherid = #{studentid} and areaid = #{areaid}
</select>
</mapper>