Files
zhxg_java/srs-teacher/src/main/resources/mapper/teacher/SysTeacherStuTalkMaterialsMapper.xml
2025-07-28 15:14:11 +08:00

124 lines
6.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.srs.teacher.mapper.SysTeacherStuTalkMaterialsMapper">
<resultMap type="SysTeacherStuTalkMaterials" id="SysTeacherStuTalkMaterialsResult">
<result property="id" column="id"/>
<result property="developmentTime" column="development_time"/>
<result property="place" column="place"/>
<result property="className" column="class_name"/>
<result property="stuName" column="stu_name"/>
<result property="mainContent" column="main_content"/>
<result property="fdyName" column="fdy_name"/>
<result property="fillingYear" column="filling_year"/>
<result property="fillingMonth" column="filling_month"/>
</resultMap>
<sql id="selectSysTeacherStuTalkMaterialsVo">
select id,
development_time,
place,
class_name,
stu_name,
main_content,
fdy_name,
filling_year,
filling_month
from sys_teacher_stu_talk_materials
</sql>
<select id="selectSysTeacherStuTalkMaterialsList" parameterType="SysTeacherStuTalkMaterials"
resultMap="SysTeacherStuTalkMaterialsResult">
<include refid="selectSysTeacherStuTalkMaterialsVo"/>
<where>
<if test="developmentTime != null ">and development_time = #{developmentTime}</if>
<if test="place != null and place != ''"> and place like concat('%', #{place}, '%')</if>
<if test="className != null and className != ''">and class_name like concat('%', #{className}, '%')</if>
<if test="stuName != null and stuName != ''">and stu_name like concat('%', #{stuName}, '%')</if>
<if test="mainContent != null and mainContent != ''">and main_content = #{mainContent}</if>
<if test="fdyName != null and fdyName != ''">and fdy_name like concat('%', #{fdyName}, '%')</if>
<if test="fillingYear != null and fillingYear != ''">and filling_year = #{fillingYear}</if>
<if test="fillingMonth != null and fillingMonth != ''">and filling_month = #{fillingMonth}</if>
</where>
order by id desc
</select>
<!--根据名称、年份、月份查询-->
<select id="selectSysTeacherStuTalkMaterialsByFdyName" parameterType="String"
resultMap="SysTeacherStuTalkMaterialsResult">
<include refid="selectSysTeacherStuTalkMaterialsVo"/>
<where>
<if test="fdyName != null and fdyName != ''">
and fdy_name = #{fdyName}
</if>
<if test="fillingYear != null and fillingYear != ''">
and filling_year = #{fillingYear}
</if>
<if test="fillingMonth != null and fillingMonth != ''">
and filling_month = #{fillingMonth}
</if>
</where>
order by id desc
</select>
<select id="selectSysTeacherStuTalkMaterialsById" parameterType="Long" resultMap="SysTeacherStuTalkMaterialsResult">
<include refid="selectSysTeacherStuTalkMaterialsVo"/>
where id = #{id}
</select>
<insert id="insertSysTeacherStuTalkMaterials" parameterType="SysTeacherStuTalkMaterials">
insert into sys_teacher_stu_talk_materials
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="developmentTime != null">development_time,</if>
<if test="place != null and place != ''">place,</if>
<if test="className != null and className != ''">class_name,</if>
<if test="stuName != null and stuName != ''">stu_name,</if>
<if test="mainContent != null and mainContent != ''">main_content,</if>
<if test="fdyName != null and fdyName != ''">fdy_name,</if>
<if test="fillingYear != null and fillingYear != ''">filling_year,</if>
<if test="fillingMonth != null and fillingMonth != ''">filling_month,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="developmentTime != null">#{developmentTime},</if>
<if test="place != null and place != ''">#{place},</if>
<if test="className != null and className != ''">#{className},</if>
<if test="stuName != null and stuName != ''">#{stuName},</if>
<if test="mainContent != null and mainContent != ''">#{mainContent},</if>
<if test="fdyName != null and fdyName != ''">#{fdyName},</if>
<if test="fillingYear != null and fillingYear != ''">#{fillingYear},</if>
<if test="fillingMonth != null and fillingMonth != ''">#{fillingMonth},</if>
</trim>
</insert>
<update id="updateSysTeacherStuTalkMaterials" parameterType="SysTeacherStuTalkMaterials">
update sys_teacher_stu_talk_materials
<trim prefix="SET" suffixOverrides=",">
<if test="developmentTime != null">development_time = #{developmentTime},</if>
<if test="place != null and place != ''">place = #{place},</if>
<if test="className != null and className != ''">class_name = #{className},</if>
<if test="stuName != null and stuName != ''">stu_name = #{stuName},</if>
<if test="mainContent != null and mainContent != ''">main_content = #{mainContent},</if>
<if test="fdyName != null and fdyName != ''">fdy_name = #{fdyName},</if>
<if test="fillingYear != null and fillingYear != ''">filling_year = #{fillingYear},</if>
<if test="fillingMonth != null and fillingMonth != ''">filling_month = #{fillingMonth},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysTeacherStuTalkMaterialsById" parameterType="Long">
delete
from sys_teacher_stu_talk_materials
where id = #{id}
</delete>
<delete id="deleteSysTeacherStuTalkMaterialsByIds" parameterType="String">
delete from sys_teacher_stu_talk_materials where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>