2025-07-28 15:14:11 +08:00
|
|
|
<?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.srs.system.mapper.QgzxTeacherMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="QgzxTeacher" id="QgzxTeacherResult">
|
|
|
|
|
<result property="teacherId" column="teacher_id" />
|
|
|
|
|
<result property="name" column="name" />
|
|
|
|
|
<result property="gender" column="gender" />
|
|
|
|
|
<result property="age" column="age" />
|
|
|
|
|
<result property="employeeId" column="employee_id" />
|
|
|
|
|
<result property="deptId" column="dept_id" />
|
|
|
|
|
<result property="phoneNumber" column="phone_number" />
|
|
|
|
|
<result property="status" column="status" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="deptName" column="dept_name" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectQgzxTeacherVo">
|
|
|
|
|
select a.*,b.dept_name from qgzx_teacher a left join sys_dept b on a.dept_id=b.dept_id
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectQgzxTeacherList" parameterType="QgzxTeacher" resultMap="QgzxTeacherResult">
|
|
|
|
|
<include refid="selectQgzxTeacherVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="name != null and name != ''"> and a.name like concat('%', #{name}, '%')</if>
|
|
|
|
|
<if test="gender != null and gender != ''"> and a.gender = #{gender}</if>
|
|
|
|
|
<if test="age != null "> and a.age = #{age}</if>
|
|
|
|
|
<if test="employeeId != null and employeeId != ''"> and a.employee_id = #{employeeId}</if>
|
|
|
|
|
<if test="deptId != null "> and a.dept_id = #{deptId}</if>
|
|
|
|
|
<if test="phoneNumber != null and phoneNumber != ''"> and a.phone_number = #{phoneNumber}</if>
|
|
|
|
|
<if test="status != null and status != ''"> and a.status = #{status}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectQgzxTeacherByTeacherId" parameterType="Long" resultMap="QgzxTeacherResult">
|
|
|
|
|
<include refid="selectQgzxTeacherVo"/>
|
|
|
|
|
where teacher_id = #{teacherId}
|
|
|
|
|
</select>
|
2025-08-15 11:11:12 +08:00
|
|
|
<select id="selectTeacherList" resultType="com.srs.system.domain.QgzxTeacher">
|
|
|
|
|
select * from qgzx_teacher
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectDeptCode" resultType="java.lang.Long">
|
|
|
|
|
select a.dept_id
|
|
|
|
|
from sys_dept as a
|
|
|
|
|
where dept_code = #{ksh}
|
|
|
|
|
</select>
|
2025-09-12 02:30:51 +08:00
|
|
|
<select id="selectQgzxTeacherByEmployeeId" parameterType="String" resultMap="QgzxTeacherResult">
|
|
|
|
|
<include refid="selectQgzxTeacherVo"/>
|
|
|
|
|
where employee_id = #{employeeId}
|
|
|
|
|
</select>
|
2025-07-28 15:14:11 +08:00
|
|
|
<insert id="insertQgzxTeacher" parameterType="QgzxTeacher" useGeneratedKeys="true" keyProperty="teacherId">
|
|
|
|
|
insert into qgzx_teacher
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="name != null and name != ''">name,</if>
|
|
|
|
|
<if test="gender != null and gender != ''">gender,</if>
|
|
|
|
|
age,
|
|
|
|
|
<if test="employeeId != null and employeeId != ''">employee_id,</if>
|
|
|
|
|
<if test="deptId != null">dept_id,</if>
|
|
|
|
|
phone_number,
|
|
|
|
|
<if test="status != null and status != ''">status,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="name != null and name != ''">#{name},</if>
|
|
|
|
|
<if test="gender != null and gender != ''">#{gender},</if>
|
|
|
|
|
#{age},
|
|
|
|
|
<if test="employeeId != null and employeeId != ''">#{employeeId},</if>
|
|
|
|
|
<if test="deptId != null">#{deptId},</if>
|
|
|
|
|
#{phoneNumber},
|
|
|
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
2025-08-15 11:11:12 +08:00
|
|
|
<insert id="insertBatchSomeColumn">
|
|
|
|
|
insert into qgzx_teacher(name,gender,age,employee_id,dept_id,status,create_time)
|
|
|
|
|
values
|
|
|
|
|
<foreach item="entity" collection="List" separator="," open="(" close=")">
|
|
|
|
|
(
|
|
|
|
|
<if test="entity.name != null and entity.name != ''">#{entity.name},</if>
|
|
|
|
|
<if test="entity.gender != null and entity.gender != ''">#{entity.gender},</if>
|
|
|
|
|
<if test="entity.age!=null">#{entity.age},</if>
|
|
|
|
|
<if test="entity.employeeId != null and entity.employeeId != ''">#{entity.employeeId},</if>
|
|
|
|
|
<if test="entity.deptId!=null">#{entity.deptId},</if>
|
|
|
|
|
<if test="entity.status != null and entity.status != ''">#{entity.status},</if>
|
|
|
|
|
<if test="entity.createTime!=null">#{entity.createTime},</if>
|
|
|
|
|
)
|
|
|
|
|
</foreach>
|
|
|
|
|
</insert>
|
2025-07-28 15:14:11 +08:00
|
|
|
|
|
|
|
|
<update id="updateQgzxTeacher" parameterType="QgzxTeacher">
|
|
|
|
|
update qgzx_teacher
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="name != null and name != ''">name = #{name},</if>
|
|
|
|
|
<if test="gender != null and gender != ''">gender = #{gender},</if>
|
|
|
|
|
age = #{age},
|
|
|
|
|
<if test="employeeId != null and employeeId != ''">employee_id = #{employeeId},</if>
|
|
|
|
|
<if test="deptId != null">dept_id = #{deptId},</if>
|
|
|
|
|
phone_number = #{phoneNumber},
|
|
|
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
</trim>
|
|
|
|
|
where teacher_id = #{teacherId}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteQgzxTeacherByTeacherId" parameterType="Long">
|
|
|
|
|
delete from qgzx_teacher where teacher_id = #{teacherId}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteQgzxTeacherByTeacherIds" parameterType="String">
|
|
|
|
|
delete from qgzx_teacher where teacher_id in
|
|
|
|
|
<foreach item="teacherId" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{teacherId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
</mapper>
|