代码提交:3-13
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?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.ruoyi.os.mapper.StudentInfoMapper">
|
||||
<resultMap type="StudentInfo" id="StudentInfoResult">
|
||||
<result property="stuId" column="stu_id" />
|
||||
<result property="stuNo" column="stu_no" />
|
||||
<result property="stuName" column="stu_name" />
|
||||
<result property="gender" column="gender" />
|
||||
<result property="majorName" column="major_name" />
|
||||
<result property="className" column="class_name" />
|
||||
<result property="teacherName" column="teacher_name" />
|
||||
<result property="deptName" column="dept_name" />
|
||||
<result property="idCard" column="id_card" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 不是 完整 的 -->
|
||||
<sql id="selectStudentInfo">
|
||||
select stu_id, stu_no, stu_name, gender, major_name, class_name, teacher_name , dept_name,id_card from view_stu_info
|
||||
</sql>
|
||||
|
||||
<!-- 查询 -->
|
||||
<select id="selectStudentInfoList" parameterType="StudentInfo" resultMap="StudentInfoResult">
|
||||
<include refid="selectStudentInfo"/>
|
||||
<where>
|
||||
<if test="stuNo != null and stuNo != ''"> and stu_no = #{stuNo}</if>
|
||||
<if test="stuName != null and stuName != ''"> and stu_name like concat('%', #{stuName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 查询 id -->
|
||||
<select id="selectStudentInfoByStudentId" parameterType="String" resultMap="StudentInfoResult">
|
||||
<include refid="selectStudentInfo"/>
|
||||
where stu_id = #{stuId}
|
||||
</select>
|
||||
|
||||
<select id="getTeachingStaffInfo" parameterType="HealthcareOsPatientInfo" resultType="com.ruoyi.os.domain.HealthcareOsPatientInfo">
|
||||
SELECT
|
||||
'1' AS patientType,
|
||||
u.user_name AS studentId,
|
||||
u.nick_name AS name,
|
||||
CASE
|
||||
WHEN u.sex = '0' THEN 0
|
||||
WHEN u.sex = '1' THEN 1
|
||||
ELSE 2
|
||||
END AS gender,
|
||||
u.phonenumber AS phone,
|
||||
d.dept_name AS department
|
||||
FROM sys_user u
|
||||
LEFT JOIN sys_dept d ON u.dept_id = d.dept_id
|
||||
<where>
|
||||
<if test="studentId != null and studentId != ''"> and u.user_name = #{studentId}</if>
|
||||
<if test="name != null and name != ''"> and u.nick_name like concat('%', #{name}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user