<?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.nbclass.szxgl.mapper.SyUsersMapper">
  <resultMap id="BaseResultMap" type="com.nbclass.szxgl.model.SyUsers">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="CHAR" property="id" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="true_name" jdbcType="VARCHAR" property="trueName" />
    <result column="user_password" jdbcType="CHAR" property="userPassword" />
    <result column="register_time" jdbcType="TIMESTAMP" property="registerTime" />
    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
    <result column="last_login_ip" jdbcType="VARCHAR" property="lastLoginIp" />
    <result column="error_time" jdbcType="TIMESTAMP" property="errorTime" />
    <result column="error_count" jdbcType="INTEGER" property="errorCount" />
    <result column="user_status" jdbcType="BIT" property="userStatus" />
    <result column="dept_id" jdbcType="CHAR" property="deptId" />
    <result column="user_desc" jdbcType="VARCHAR" property="userDesc" />
    <result column="user_sex" jdbcType="BIT" property="userSex" />
    <result column="register_uid" jdbcType="CHAR" property="registerUid" />
    <result column="mobile_phone_number" jdbcType="CHAR" property="mobilePhoneNumber" />
    <result column="isleader" jdbcType="BIT" property="isleader" />
  </resultMap>


    <select id="findByUserName" parameterType="java.lang.String" resultType="com.nbclass.szxgl.model.SyUsers">
		SELECT  *  from sy_users where user_name =#{userName}
	</select>

	<select id="findIdByDeptId" parameterType="java.lang.String" resultType="string">
		select id from SyUsers where deptId=#{deptId}
	</select>

    <select id="getByIsLeader" resultType="java.lang.String">
        select user_name from sy_users where deptId=#{deptId} and isleader = 1
    </select>

</mapper>
