<?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="org.linlinjava.jz.db.dao.SysUserMapper">
  <resultMap id="BaseResultMap" type="org.linlinjava.jz.db.domain.SysUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="user_account" jdbcType="VARCHAR" property="userAccount" />
    <result column="user_password" jdbcType="VARCHAR" property="userPassword" />
    <result column="initial_password" jdbcType="VARCHAR" property="initialPassword" />
    <result column="weixin_openid" jdbcType="VARCHAR" property="weixinOpenid" />
    <result column="head_img" jdbcType="BIGINT" property="headImg" />
    <result column="mobile" jdbcType="VARCHAR" property="mobile" />
    <result column="user_name" jdbcType="VARCHAR" property="userName" />
    <result column="id_card" jdbcType="VARCHAR" property="idCard" />
    <result column="gender" jdbcType="VARCHAR" property="gender" />
    <result column="birthday" jdbcType="VARCHAR" property="birthday" />
    <result column="type" jdbcType="INTEGER" property="type" />
    <result column="state" jdbcType="BIGINT" property="state" />
    <result column="registration_id" jdbcType="VARCHAR" property="registrationId" />
    <result column="user_alias" jdbcType="VARCHAR" property="userAlias" />
    <result column="login_type" jdbcType="VARCHAR" property="loginType" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
    <result column="last_login_ip" jdbcType="VARCHAR" property="lastLoginIp" />
    <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="role_ids" jdbcType="VARCHAR" property="roleIds" typeHandler="org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler" />
    <result column="avatar" jdbcType="VARCHAR" property="avatar" />
    <result column="department_id" jdbcType="INTEGER" property="departmentId" />
    <result column="ext_no" jdbcType="VARCHAR" property="extNo" />
    <association property="department" column="department_id" select="getDepart" javaType="org.linlinjava.jz.db.domain.JzDepartment"></association>
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
            <foreach collection="criteria.roleIdsCriteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
            <foreach collection="criteria.roleIdsCriteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler} and #{criterion.secondValue,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, user_account, user_password, initial_password, weixin_openid, head_img, mobile, 
    user_name, id_card, gender, birthday, `type`, `state`, registration_id, user_alias, 
    login_type, remark, last_login_ip, last_login_time, create_time, update_time, role_ids, 
    avatar, department_id, ext_no
  </sql>
  <select id="selectByExample" parameterType="org.linlinjava.jz.db.domain.SysUserExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sys_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="example != null and example.distinct">
      distinct
    </if>
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from sys_user
    <if test="example != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example != null and example.orderByClause != null">
      order by ${example.orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from sys_user
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from sys_user
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from sys_user
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="org.linlinjava.jz.db.domain.SysUserExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from sys_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.linlinjava.jz.db.domain.SysUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_user (user_account, user_password, initial_password, 
      weixin_openid, head_img, mobile, 
      user_name, id_card, gender, 
      birthday, `type`, `state`, 
      registration_id, user_alias, login_type, 
      remark, last_login_ip, last_login_time, 
      create_time, update_time, role_ids, 
      avatar, department_id, ext_no
      )
    values (#{userAccount,jdbcType=VARCHAR}, #{userPassword,jdbcType=VARCHAR}, #{initialPassword,jdbcType=VARCHAR}, 
      #{weixinOpenid,jdbcType=VARCHAR}, #{headImg,jdbcType=BIGINT}, #{mobile,jdbcType=VARCHAR}, 
      #{userName,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, 
      #{birthday,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{state,jdbcType=BIGINT}, 
      #{registrationId,jdbcType=VARCHAR}, #{userAlias,jdbcType=VARCHAR}, #{loginType,jdbcType=VARCHAR}, 
      #{remark,jdbcType=VARCHAR}, #{lastLoginIp,jdbcType=VARCHAR}, #{lastLoginTime,jdbcType=TIMESTAMP}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{roleIds,jdbcType=VARCHAR,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler}, 
      #{avatar,jdbcType=VARCHAR}, #{departmentId,jdbcType=INTEGER}, #{extNo,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="org.linlinjava.jz.db.domain.SysUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="userAccount != null">
        user_account,
      </if>
      <if test="userPassword != null">
        user_password,
      </if>
      <if test="initialPassword != null">
        initial_password,
      </if>
      <if test="weixinOpenid != null">
        weixin_openid,
      </if>
      <if test="headImg != null">
        head_img,
      </if>
      <if test="mobile != null">
        mobile,
      </if>
      <if test="userName != null">
        user_name,
      </if>
      <if test="idCard != null">
        id_card,
      </if>
      <if test="gender != null">
        gender,
      </if>
      <if test="birthday != null">
        birthday,
      </if>
      <if test="type != null">
        `type`,
      </if>
      <if test="state != null">
        `state`,
      </if>
      <if test="registrationId != null">
        registration_id,
      </if>
      <if test="userAlias != null">
        user_alias,
      </if>
      <if test="loginType != null">
        login_type,
      </if>
      <if test="remark != null">
        remark,
      </if>
      <if test="lastLoginIp != null">
        last_login_ip,
      </if>
      <if test="lastLoginTime != null">
        last_login_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="roleIds != null">
        role_ids,
      </if>
      <if test="avatar != null">
        avatar,
      </if>
      <if test="departmentId != null">
        department_id,
      </if>
      <if test="extNo != null">
        ext_no,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="userAccount != null">
        #{userAccount,jdbcType=VARCHAR},
      </if>
      <if test="userPassword != null">
        #{userPassword,jdbcType=VARCHAR},
      </if>
      <if test="initialPassword != null">
        #{initialPassword,jdbcType=VARCHAR},
      </if>
      <if test="weixinOpenid != null">
        #{weixinOpenid,jdbcType=VARCHAR},
      </if>
      <if test="headImg != null">
        #{headImg,jdbcType=BIGINT},
      </if>
      <if test="mobile != null">
        #{mobile,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="idCard != null">
        #{idCard,jdbcType=VARCHAR},
      </if>
      <if test="gender != null">
        #{gender,jdbcType=VARCHAR},
      </if>
      <if test="birthday != null">
        #{birthday,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="state != null">
        #{state,jdbcType=BIGINT},
      </if>
      <if test="registrationId != null">
        #{registrationId,jdbcType=VARCHAR},
      </if>
      <if test="userAlias != null">
        #{userAlias,jdbcType=VARCHAR},
      </if>
      <if test="loginType != null">
        #{loginType,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
      <if test="lastLoginIp != null">
        #{lastLoginIp,jdbcType=VARCHAR},
      </if>
      <if test="lastLoginTime != null">
        #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="roleIds != null">
        #{roleIds,jdbcType=VARCHAR,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler},
      </if>
      <if test="avatar != null">
        #{avatar,jdbcType=VARCHAR},
      </if>
      <if test="departmentId != null">
        #{departmentId,jdbcType=INTEGER},
      </if>
      <if test="extNo != null">
        #{extNo,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.linlinjava.jz.db.domain.SysUserExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from sys_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update sys_user
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.userAccount != null">
        user_account = #{record.userAccount,jdbcType=VARCHAR},
      </if>
      <if test="record.userPassword != null">
        user_password = #{record.userPassword,jdbcType=VARCHAR},
      </if>
      <if test="record.initialPassword != null">
        initial_password = #{record.initialPassword,jdbcType=VARCHAR},
      </if>
      <if test="record.weixinOpenid != null">
        weixin_openid = #{record.weixinOpenid,jdbcType=VARCHAR},
      </if>
      <if test="record.headImg != null">
        head_img = #{record.headImg,jdbcType=BIGINT},
      </if>
      <if test="record.mobile != null">
        mobile = #{record.mobile,jdbcType=VARCHAR},
      </if>
      <if test="record.userName != null">
        user_name = #{record.userName,jdbcType=VARCHAR},
      </if>
      <if test="record.idCard != null">
        id_card = #{record.idCard,jdbcType=VARCHAR},
      </if>
      <if test="record.gender != null">
        gender = #{record.gender,jdbcType=VARCHAR},
      </if>
      <if test="record.birthday != null">
        birthday = #{record.birthday,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        `type` = #{record.type,jdbcType=INTEGER},
      </if>
      <if test="record.state != null">
        `state` = #{record.state,jdbcType=BIGINT},
      </if>
      <if test="record.registrationId != null">
        registration_id = #{record.registrationId,jdbcType=VARCHAR},
      </if>
      <if test="record.userAlias != null">
        user_alias = #{record.userAlias,jdbcType=VARCHAR},
      </if>
      <if test="record.loginType != null">
        login_type = #{record.loginType,jdbcType=VARCHAR},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
      <if test="record.lastLoginIp != null">
        last_login_ip = #{record.lastLoginIp,jdbcType=VARCHAR},
      </if>
      <if test="record.lastLoginTime != null">
        last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.roleIds != null">
        role_ids = #{record.roleIds,jdbcType=VARCHAR,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler},
      </if>
      <if test="record.avatar != null">
        avatar = #{record.avatar,jdbcType=VARCHAR},
      </if>
      <if test="record.departmentId != null">
        department_id = #{record.departmentId,jdbcType=INTEGER},
      </if>
      <if test="record.extNo != null">
        ext_no = #{record.extNo,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update sys_user
    set id = #{record.id,jdbcType=BIGINT},
      user_account = #{record.userAccount,jdbcType=VARCHAR},
      user_password = #{record.userPassword,jdbcType=VARCHAR},
      initial_password = #{record.initialPassword,jdbcType=VARCHAR},
      weixin_openid = #{record.weixinOpenid,jdbcType=VARCHAR},
      head_img = #{record.headImg,jdbcType=BIGINT},
      mobile = #{record.mobile,jdbcType=VARCHAR},
      user_name = #{record.userName,jdbcType=VARCHAR},
      id_card = #{record.idCard,jdbcType=VARCHAR},
      gender = #{record.gender,jdbcType=VARCHAR},
      birthday = #{record.birthday,jdbcType=VARCHAR},
      `type` = #{record.type,jdbcType=INTEGER},
      `state` = #{record.state,jdbcType=BIGINT},
      registration_id = #{record.registrationId,jdbcType=VARCHAR},
      user_alias = #{record.userAlias,jdbcType=VARCHAR},
      login_type = #{record.loginType,jdbcType=VARCHAR},
      remark = #{record.remark,jdbcType=VARCHAR},
      last_login_ip = #{record.lastLoginIp,jdbcType=VARCHAR},
      last_login_time = #{record.lastLoginTime,jdbcType=TIMESTAMP},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      role_ids = #{record.roleIds,jdbcType=VARCHAR,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler},
      avatar = #{record.avatar,jdbcType=VARCHAR},
      department_id = #{record.departmentId,jdbcType=INTEGER},
      ext_no = #{record.extNo,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.jz.db.domain.SysUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update sys_user
    <set>
      <if test="userAccount != null">
        user_account = #{userAccount,jdbcType=VARCHAR},
      </if>
      <if test="userPassword != null">
        user_password = #{userPassword,jdbcType=VARCHAR},
      </if>
      <if test="initialPassword != null">
        initial_password = #{initialPassword,jdbcType=VARCHAR},
      </if>
      <if test="weixinOpenid != null">
        weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
      </if>
      <if test="headImg != null">
        head_img = #{headImg,jdbcType=BIGINT},
      </if>
      <if test="mobile != null">
        mobile = #{mobile,jdbcType=VARCHAR},
      </if>
      <if test="userName != null">
        user_name = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="idCard != null">
        id_card = #{idCard,jdbcType=VARCHAR},
      </if>
      <if test="gender != null">
        gender = #{gender,jdbcType=VARCHAR},
      </if>
      <if test="birthday != null">
        birthday = #{birthday,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        `type` = #{type,jdbcType=INTEGER},
      </if>
      <if test="state != null">
        `state` = #{state,jdbcType=BIGINT},
      </if>
      <if test="registrationId != null">
        registration_id = #{registrationId,jdbcType=VARCHAR},
      </if>
      <if test="userAlias != null">
        user_alias = #{userAlias,jdbcType=VARCHAR},
      </if>
      <if test="loginType != null">
        login_type = #{loginType,jdbcType=VARCHAR},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
      <if test="lastLoginIp != null">
        last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
      </if>
      <if test="lastLoginTime != null">
        last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="roleIds != null">
        role_ids = #{roleIds,jdbcType=VARCHAR,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler},
      </if>
      <if test="avatar != null">
        avatar = #{avatar,jdbcType=VARCHAR},
      </if>
      <if test="departmentId != null">
        department_id = #{departmentId,jdbcType=INTEGER},
      </if>
      <if test="extNo != null">
        ext_no = #{extNo,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.linlinjava.jz.db.domain.SysUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update sys_user
    set user_account = #{userAccount,jdbcType=VARCHAR},
      user_password = #{userPassword,jdbcType=VARCHAR},
      initial_password = #{initialPassword,jdbcType=VARCHAR},
      weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
      head_img = #{headImg,jdbcType=BIGINT},
      mobile = #{mobile,jdbcType=VARCHAR},
      user_name = #{userName,jdbcType=VARCHAR},
      id_card = #{idCard,jdbcType=VARCHAR},
      gender = #{gender,jdbcType=VARCHAR},
      birthday = #{birthday,jdbcType=VARCHAR},
      `type` = #{type,jdbcType=INTEGER},
      `state` = #{state,jdbcType=BIGINT},
      registration_id = #{registrationId,jdbcType=VARCHAR},
      user_alias = #{userAlias,jdbcType=VARCHAR},
      login_type = #{loginType,jdbcType=VARCHAR},
      remark = #{remark,jdbcType=VARCHAR},
      last_login_ip = #{lastLoginIp,jdbcType=VARCHAR},
      last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      role_ids = #{roleIds,jdbcType=VARCHAR,typeHandler=org.linlinjava.jz.db.mybatis.JsonIntegerArrayTypeHandler},
      avatar = #{avatar,jdbcType=VARCHAR},
      department_id = #{departmentId,jdbcType=INTEGER},
      ext_no = #{extNo,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectOneByExample" parameterType="org.linlinjava.jz.db.domain.SysUserExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <include refid="Base_Column_List" />
    from sys_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
  <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from sys_user
    <if test="example != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example != null and example.orderByClause != null">
      order by ${example.orderByClause}
    </if>
    limit 1
  </select>

  <select id="getDepart" parameterType="java.lang.Integer" resultMap="BaseResultMap2">
    select    id, name    from jz_department   where id = #{order_shop_id,jdbcType=INTEGER}
  </select>
  <resultMap id="BaseResultMap2" type="org.linlinjava.jz.db.domain.JzDepartment">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
  </resultMap>
</mapper>