lanan-system/dl-module-knowledge/src/main/resources/mapper/TTrainTeacherMapper.xml

44 lines
1.7 KiB
XML
Raw Normal View History

2024-08-12 15:04:39 +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="cn.iocoder.yudao.module.knowledge.dao.TTrainTeacherMapper">
<resultMap type="cn.iocoder.yudao.module.knowledge.entity.TTrainTeacher" id="tTrainTeacherMap">
<result property="teacherName" column="teacher_name"/>
<result property="professional" column="professional"/>
<result property="educationalBackground" column="educational_background"/>
</resultMap>
<!-- 用于select查询公用抽取的列 -->
<sql id="columns">
teacher_name,professional,educational_background
</sql>
<select id="findList" resultMap="tTrainTeacherMap">
select
<include refid="columns"/>
from t_train_teacher
<where>
<if test="teacherName != null and teacherName != ''">
teacher_name = #{teacherName}
</if>
<if test="professional != null and professional != ''">
professional = #{professional}
</if>
<if test="educationalBackground != null and educationalBackground != ''">
educational_background = #{educationalBackground}
</if>
</where>
</select>
<select id="findOneByName" resultType="cn.iocoder.yudao.module.knowledge.entity.TTrainTeacher">
select *
from t_train_teacher
<where>
<if test="teacherName != null and teacherName != ''">
teacher_name = #{teacherName}
</if>
</where>
</select>
</mapper>