<?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.devplatform.equipment.modules.sysuser.dao.SysUserDao">
  <!-- Result Map -->
  <resultMap id="BaseResultMap" type="com.devplatform.equipment.modules.sysuser.bean.SysUser">
    <result column="user_id" property="userId"/>
    <result column="org_id" property="orgId"/>
    <result column="username" property="username"/>
    <result column="password" property="password"/>
    <result column="name" property="name"/>
    <result column="job" property="job"/>
    <result column="gender" property="gender"/>
    <result column="salt" property="salt"/>
    <result column="email" property="email"/>
    <result column="mobile" property="mobile"/>
    <result column="detail" property="detail"/>
    <result column="status" property="status"/>
    <result column="sys_sign" property="sysSign"/>
    <result column="create_user_id" property="createUserId"/>
    <result column="create_time" property="createTime"/>
    <result column="update_user_id" property="updateUserId"/>
    <result column="update_time" property="updateTime"/>
    <result column="byx1" property="byx1"/>
    <result column="byx2" property="byx2"/>
    <result column="byx3" property="byx3"/>
    <result column="station_id" property="stationId"/>
  </resultMap>

  <!-- sys_user table all fields -->
  <sql id="Base_Column_List">
        user_id,org_id,username,password,name,job,gender,salt,email,mobile,detail,status,sys_sign,create_user_id,create_time,update_user_id,update_time,byx1,byx2,byx3,station_id
    </sql>

  <!-- 公共查询条件 -->
  <sql id="Example_Where_Clause">
    where deleted=0
    <if test="userId!=null and userId!=''">and user_id = #{userId}</if>
    <if test="orgId!=null and orgId!=''">and org_id = #{orgId}</if>
    <if test="username!=null and username!=''">and username = #{username}</if>
    <if test="password!=null and password!=''">and password = #{password}</if>
    <if test="name!=null and name!=''">and name = #{name}</if>
    <if test="job!=null and job!=''">and job = #{job}</if>
    <if test="gender!=null ">and gender = #{gender}</if>
    <if test="salt!=null and salt!=''">and salt = #{salt}</if>
    <if test="email!=null and email!=''">and email = #{email}</if>
    <if test="mobile!=null and mobile!=''">and mobile = #{mobile}</if>
    <if test="detail!=null and detail!=''">and detail = #{detail}</if>
    <if test="status!=null ">and status = #{status}</if>
    <if test="sysSign!=null and sysSign!=''">and sys_sign = #{sysSign}</if>
    <if test="createUserId!=null and createUserId!=''">and create_user_id = #{createUserId}</if>
    <if test="createTime!=null ">and create_time = #{createTime}</if>
    <if test="updateUserId!=null and updateUserId!=''">and update_user_id = #{updateUserId}</if>
    <if test="updateTime!=null ">and update_time = #{updateTime}</if>
    <if test="byx1!=null and byx1!=''">and byx1 = #{byx1}</if>
    <if test="byx2!=null and byx2!=''">and byx2 = #{byx2}</if>
    <if test="byx3!=null and byx3!=''">and byx3 = #{byx3}</if>
    <if test="stationId!=null and stationId!=''">and station_id = #{stationId}</if>
  </sql>
  <select id="getAllSysUser" resultType="com.devplatform.equipment.modules.sysuser.bean.SysUser">
        SELECT user_id, name, mobile
        FROM sys_user
        WHERE user_id &lt;&gt; 1
          AND deleted = 0
          AND status != 0
          AND station_id = #{stationId}
    </select>


</mapper>


