<?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.system.mapper.SysTeacherMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ruoyi.course.domain.Context">
        <result column="user_name" property="userName" />
        <result column="sex" property="sex" />
        <result column="phonenumber" property="phonenumber" />
        <result column="avatar" property="avatar" />
        <result column="context" property="context" />
        <result column="releases" property="releases" />
        <result column="url" property="url" />
        <result column="intro" property="intro" />
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        user_id, user_name, sex, phonenumber, avatar,context,releases,url,intro
    </sql>
    <select id="findList" resultType="com.ruoyi.system.domain.SysTeacher">

        SELECT
            a.user_id ,
            b.teacher_name as user_name,
            b.avatar_img as avatar,
            b.intro
        FROM sys_user a, sys_teacher b
        WHERE a.user_id=b.user_id
          and a.delete_flag='0'
          and a.teacher=1
          and a.status='0'
          and b.releases=1
          and a.dept_id= #{visitStore}
    </select>

    <select id="getOne" resultType="com.ruoyi.system.domain.SysTeacher">

        SELECT
            a.user_id as user_id,
            b.teacher_name as user_name,
            a.sex,
            a.phonenumber,
            b.avatar_img as avatar,
            b.context,
            b.releases,
            b.url,
            b.intro,
            c.app_user_id as appUserId
        FROM sys_user a, sys_teacher b,yj_app_user c
        WHERE a.user_id=b.user_id
          and a.user_id=c.manage_account_id
          and b.releases=1
          and a.delete_flag='0'
          and a.teacher=1
          and a.user_id =#{userId}
    </select>
</mapper>
