<?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.microservices.wiki.mapper.sys.UserMapper">
    <resultMap id="BaseResultMap" type="com.microservices.wiki.domain.sys.User">
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="login" property="login" jdbcType="VARCHAR" />
    <result column="hashed_password" property="hashedPassword" jdbcType="VARCHAR" />
    <result column="firstname" property="firstname" jdbcType="VARCHAR" />
    <result column="lastname" property="lastname" jdbcType="VARCHAR" />
    <result column="mail" property="mail" jdbcType="VARCHAR" />
    <result column="admin" property="admin" jdbcType="BIT" />
    <result column="status" property="status" jdbcType="INTEGER" />
    <result column="last_login_on" property="lastLoginOn" jdbcType="TIMESTAMP" />
    <result column="language" property="language" jdbcType="VARCHAR" />
    <result column="auth_source_id" property="authSourceId" jdbcType="INTEGER" />
    <result column="created_on" property="createdOn" jdbcType="TIMESTAMP" />
    <result column="updated_on" property="updatedOn" jdbcType="TIMESTAMP" />
    <result column="type" property="type" jdbcType="VARCHAR" />
    <result column="identity_url" property="identityUrl" jdbcType="VARCHAR" />
    <result column="mail_notification" property="mailNotification" jdbcType="VARCHAR" />
    <result column="salt" property="salt" jdbcType="VARCHAR" />
    <result column="gid" property="gid" jdbcType="INTEGER" />
    <result column="visits" property="visits" jdbcType="INTEGER" />
    <result column="excellent_teacher" property="excellentTeacher" jdbcType="INTEGER" />
    <result column="excellent_student" property="excellentStudent" jdbcType="INTEGER" />
    <result column="phone" property="phone" jdbcType="VARCHAR" />
    <result column="authentication" property="authentication" jdbcType="BIT" />
    <result column="grade" property="grade" jdbcType="INTEGER" />
    <result column="experience" property="experience" jdbcType="INTEGER" />
    <result column="nickname" property="nickname" jdbcType="VARCHAR" />
    <result column="show_realname" property="showRealname" jdbcType="BIT" />
    <result column="professional_certification" property="professionalCertification" jdbcType="BIT" />
    <result column="ID_number" property="idNumber" jdbcType="VARCHAR" />
    <result column="certification" property="certification" jdbcType="INTEGER" />
    <result column="homepage_teacher" property="homepageTeacher" jdbcType="BIT" />
    <result column="homepage_engineer" property="homepageEngineer" jdbcType="BIT" />
    <result column="is_test" property="isTest" jdbcType="TINYINT" />
    <result column="ecoder_user_id" property="ecoderUserId" jdbcType="INTEGER" />
    <result column="business" property="business" jdbcType="BIT" />
    <result column="profile_completed" property="profileCompleted" jdbcType="BIT" />
    <result column="laboratory_id" property="laboratoryId" jdbcType="BIGINT" />
    <result column="platform" property="platform" jdbcType="VARCHAR" />
    <result column="gitea_token" property="giteaToken" jdbcType="VARCHAR" />
    <result column="gitea_uid" property="giteaUid" jdbcType="INTEGER" />
    <result column="is_shixun_marker" property="isShixunMarker" jdbcType="BIT" />
    <result column="is_sync_pwd" property="isSyncPwd" jdbcType="BIT" />
    <result column="watchers_count" property="watchersCount" jdbcType="INTEGER" />
    <result column="devops_step" property="devopsStep" jdbcType="INTEGER" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    id, login, hashed_password, firstname, lastname, mail, admin, status, last_login_on, 
    language, auth_source_id, created_on, updated_on, type, identity_url, mail_notification, 
    salt, gid, visits, nickname, gitea_token
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from users
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from users
    where id = #{id,jdbcType=INTEGER}
  </delete>
    <insert id="insert" parameterType="com.microservices.wiki.domain.sys.User">
    insert into users (id, login, hashed_password, 
      firstname, lastname, mail, 
      admin, status, last_login_on, 
      language, auth_source_id, created_on, 
      updated_on, type, identity_url, 
      mail_notification, salt, gid, 
      visits, excellent_teacher, excellent_student, 
      phone, authentication, grade, 
      experience, nickname, show_realname, 
      professional_certification, ID_number, certification, 
      homepage_teacher, homepage_engineer, is_test, 
      ecoder_user_id, business, profile_completed, 
      laboratory_id, platform, gitea_token, 
      gitea_uid, is_shixun_marker, is_sync_pwd, 
      watchers_count,
      devops_step)
    values (#{id,jdbcType=INTEGER}, #{login,jdbcType=VARCHAR}, #{hashedPassword,jdbcType=VARCHAR}, 
      #{firstname,jdbcType=VARCHAR}, #{lastname,jdbcType=VARCHAR}, #{mail,jdbcType=VARCHAR}, 
      #{admin,jdbcType=BIT}, #{status,jdbcType=INTEGER}, #{lastLoginOn,jdbcType=TIMESTAMP}, 
      #{language,jdbcType=VARCHAR}, #{authSourceId,jdbcType=INTEGER}, #{createdOn,jdbcType=TIMESTAMP}, 
      #{updatedOn,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{identityUrl,jdbcType=VARCHAR}, 
      #{mailNotification,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR}, #{gid,jdbcType=INTEGER}, 
      #{visits,jdbcType=INTEGER}, #{excellentTeacher,jdbcType=INTEGER}, #{excellentStudent,jdbcType=INTEGER}, 
      #{phone,jdbcType=VARCHAR}, #{authentication,jdbcType=BIT}, #{grade,jdbcType=INTEGER}, 
      #{experience,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR}, #{showRealname,jdbcType=BIT}, 
      #{professionalCertification,jdbcType=BIT}, #{idNumber,jdbcType=VARCHAR}, #{certification,jdbcType=INTEGER}, 
      #{homepageTeacher,jdbcType=BIT}, #{homepageEngineer,jdbcType=BIT}, #{isTest,jdbcType=TINYINT}, 
      #{ecoderUserId,jdbcType=INTEGER}, #{business,jdbcType=BIT}, #{profileCompleted,jdbcType=BIT}, 
      #{laboratoryId,jdbcType=BIGINT}, #{platform,jdbcType=VARCHAR}, #{giteaToken,jdbcType=VARCHAR}, 
      #{giteaUid,jdbcType=INTEGER}, #{isShixunMarker,jdbcType=BIT}, #{isSyncPwd,jdbcType=BIT}, 
      #{watchersCount,jdbcType=INTEGER}, #{enterpriseCertification,jdbcType=BIT}, #{adminRole,jdbcType=TINYINT}, 
      #{devopsStep,jdbcType=INTEGER})
  </insert>
    <insert id="insertSelective" parameterType="com.microservices.wiki.domain.sys.User">
    insert into users
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="login != null" >
        login,
      </if>
      <if test="hashedPassword != null" >
        hashed_password,
      </if>
      <if test="firstname != null" >
        firstname,
      </if>
      <if test="lastname != null" >
        lastname,
      </if>
      <if test="mail != null" >
        mail,
      </if>
      <if test="admin != null" >
        admin,
      </if>
      <if test="status != null" >
        status,
      </if>
      <if test="lastLoginOn != null" >
        last_login_on,
      </if>
      <if test="language != null" >
        language,
      </if>
      <if test="authSourceId != null" >
        auth_source_id,
      </if>
      <if test="createdOn != null" >
        created_on,
      </if>
      <if test="updatedOn != null" >
        updated_on,
      </if>
      <if test="type != null" >
        type,
      </if>
      <if test="identityUrl != null" >
        identity_url,
      </if>
      <if test="mailNotification != null" >
        mail_notification,
      </if>
      <if test="salt != null" >
        salt,
      </if>
      <if test="gid != null" >
        gid,
      </if>
      <if test="visits != null" >
        visits,
      </if>
      <if test="excellentTeacher != null" >
        excellent_teacher,
      </if>
      <if test="excellentStudent != null" >
        excellent_student,
      </if>
      <if test="phone != null" >
        phone,
      </if>
      <if test="authentication != null" >
        authentication,
      </if>
      <if test="grade != null" >
        grade,
      </if>
      <if test="experience != null" >
        experience,
      </if>
      <if test="nickname != null" >
        nickname,
      </if>
      <if test="showRealname != null" >
        show_realname,
      </if>
      <if test="professionalCertification != null" >
        professional_certification,
      </if>
      <if test="idNumber != null" >
        ID_number,
      </if>
      <if test="certification != null" >
        certification,
      </if>
      <if test="homepageTeacher != null" >
        homepage_teacher,
      </if>
      <if test="homepageEngineer != null" >
        homepage_engineer,
      </if>
      <if test="isTest != null" >
        is_test,
      </if>
      <if test="ecoderUserId != null" >
        ecoder_user_id,
      </if>
      <if test="business != null" >
        business,
      </if>
      <if test="profileCompleted != null" >
        profile_completed,
      </if>
      <if test="laboratoryId != null" >
        laboratory_id,
      </if>
      <if test="platform != null" >
        platform,
      </if>
      <if test="giteaToken != null" >
        gitea_token,
      </if>
      <if test="giteaUid != null" >
        gitea_uid,
      </if>
      <if test="isShixunMarker != null" >
        is_shixun_marker,
      </if>
      <if test="isSyncPwd != null" >
        is_sync_pwd,
      </if>
      <if test="watchersCount != null" >
        watchers_count,
      </if>
      <if test="devopsStep != null" >
        devops_step,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="login != null" >
        #{login,jdbcType=VARCHAR},
      </if>
      <if test="hashedPassword != null" >
        #{hashedPassword,jdbcType=VARCHAR},
      </if>
      <if test="firstname != null" >
        #{firstname,jdbcType=VARCHAR},
      </if>
      <if test="lastname != null" >
        #{lastname,jdbcType=VARCHAR},
      </if>
      <if test="mail != null" >
        #{mail,jdbcType=VARCHAR},
      </if>
      <if test="admin != null" >
        #{admin,jdbcType=BIT},
      </if>
      <if test="status != null" >
        #{status,jdbcType=INTEGER},
      </if>
      <if test="lastLoginOn != null" >
        #{lastLoginOn,jdbcType=TIMESTAMP},
      </if>
      <if test="language != null" >
        #{language,jdbcType=VARCHAR},
      </if>
      <if test="authSourceId != null" >
        #{authSourceId,jdbcType=INTEGER},
      </if>
      <if test="createdOn != null" >
        #{createdOn,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedOn != null" >
        #{updatedOn,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null" >
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="identityUrl != null" >
        #{identityUrl,jdbcType=VARCHAR},
      </if>
      <if test="mailNotification != null" >
        #{mailNotification,jdbcType=VARCHAR},
      </if>
      <if test="salt != null" >
        #{salt,jdbcType=VARCHAR},
      </if>
      <if test="gid != null" >
        #{gid,jdbcType=INTEGER},
      </if>
      <if test="visits != null" >
        #{visits,jdbcType=INTEGER},
      </if>
      <if test="excellentTeacher != null" >
        #{excellentTeacher,jdbcType=INTEGER},
      </if>
      <if test="excellentStudent != null" >
        #{excellentStudent,jdbcType=INTEGER},
      </if>
      <if test="phone != null" >
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="authentication != null" >
        #{authentication,jdbcType=BIT},
      </if>
      <if test="grade != null" >
        #{grade,jdbcType=INTEGER},
      </if>
      <if test="experience != null" >
        #{experience,jdbcType=INTEGER},
      </if>
      <if test="nickname != null" >
        #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="showRealname != null" >
        #{showRealname,jdbcType=BIT},
      </if>
      <if test="professionalCertification != null" >
        #{professionalCertification,jdbcType=BIT},
      </if>
      <if test="idNumber != null" >
        #{idNumber,jdbcType=VARCHAR},
      </if>
      <if test="certification != null" >
        #{certification,jdbcType=INTEGER},
      </if>
      <if test="homepageTeacher != null" >
        #{homepageTeacher,jdbcType=BIT},
      </if>
      <if test="homepageEngineer != null" >
        #{homepageEngineer,jdbcType=BIT},
      </if>
      <if test="isTest != null" >
        #{isTest,jdbcType=TINYINT},
      </if>
      <if test="ecoderUserId != null" >
        #{ecoderUserId,jdbcType=INTEGER},
      </if>
      <if test="business != null" >
        #{business,jdbcType=BIT},
      </if>
      <if test="profileCompleted != null" >
        #{profileCompleted,jdbcType=BIT},
      </if>
      <if test="laboratoryId != null" >
        #{laboratoryId,jdbcType=BIGINT},
      </if>
      <if test="platform != null" >
        #{platform,jdbcType=VARCHAR},
      </if>
      <if test="giteaToken != null" >
        #{giteaToken,jdbcType=VARCHAR},
      </if>
      <if test="giteaUid != null" >
        #{giteaUid,jdbcType=INTEGER},
      </if>
      <if test="isShixunMarker != null" >
        #{isShixunMarker,jdbcType=BIT},
      </if>
      <if test="isSyncPwd != null" >
        #{isSyncPwd,jdbcType=BIT},
      </if>
      <if test="watchersCount != null" >
        #{watchersCount,jdbcType=INTEGER},
      </if>
      <if test="enterpriseCertification != null" >
        #{enterpriseCertification,jdbcType=BIT},
      </if>
      <if test="adminRole != null" >
        #{adminRole,jdbcType=TINYINT},
      </if>
      <if test="devopsStep != null" >
        #{devopsStep,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.microservices.wiki.domain.sys.User">
    update users
    <set >
      <if test="login != null" >
        login = #{login,jdbcType=VARCHAR},
      </if>
      <if test="hashedPassword != null" >
        hashed_password = #{hashedPassword,jdbcType=VARCHAR},
      </if>
      <if test="firstname != null" >
        firstname = #{firstname,jdbcType=VARCHAR},
      </if>
      <if test="lastname != null" >
        lastname = #{lastname,jdbcType=VARCHAR},
      </if>
      <if test="mail != null" >
        mail = #{mail,jdbcType=VARCHAR},
      </if>
      <if test="admin != null" >
        admin = #{admin,jdbcType=BIT},
      </if>
      <if test="status != null" >
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="lastLoginOn != null" >
        last_login_on = #{lastLoginOn,jdbcType=TIMESTAMP},
      </if>
      <if test="language != null" >
        language = #{language,jdbcType=VARCHAR},
      </if>
      <if test="authSourceId != null" >
        auth_source_id = #{authSourceId,jdbcType=INTEGER},
      </if>
      <if test="createdOn != null" >
        created_on = #{createdOn,jdbcType=TIMESTAMP},
      </if>
      <if test="updatedOn != null" >
        updated_on = #{updatedOn,jdbcType=TIMESTAMP},
      </if>
      <if test="type != null" >
        type = #{type,jdbcType=VARCHAR},
      </if>
      <if test="identityUrl != null" >
        identity_url = #{identityUrl,jdbcType=VARCHAR},
      </if>
      <if test="mailNotification != null" >
        mail_notification = #{mailNotification,jdbcType=VARCHAR},
      </if>
      <if test="salt != null" >
        salt = #{salt,jdbcType=VARCHAR},
      </if>
      <if test="gid != null" >
        gid = #{gid,jdbcType=INTEGER},
      </if>
      <if test="visits != null" >
        visits = #{visits,jdbcType=INTEGER},
      </if>
      <if test="excellentTeacher != null" >
        excellent_teacher = #{excellentTeacher,jdbcType=INTEGER},
      </if>
      <if test="excellentStudent != null" >
        excellent_student = #{excellentStudent,jdbcType=INTEGER},
      </if>
      <if test="phone != null" >
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="authentication != null" >
        authentication = #{authentication,jdbcType=BIT},
      </if>
      <if test="grade != null" >
        grade = #{grade,jdbcType=INTEGER},
      </if>
      <if test="experience != null" >
        experience = #{experience,jdbcType=INTEGER},
      </if>
      <if test="nickname != null" >
        nickname = #{nickname,jdbcType=VARCHAR},
      </if>
      <if test="showRealname != null" >
        show_realname = #{showRealname,jdbcType=BIT},
      </if>
      <if test="professionalCertification != null" >
        professional_certification = #{professionalCertification,jdbcType=BIT},
      </if>
      <if test="idNumber != null" >
        ID_number = #{idNumber,jdbcType=VARCHAR},
      </if>
      <if test="certification != null" >
        certification = #{certification,jdbcType=INTEGER},
      </if>
      <if test="homepageTeacher != null" >
        homepage_teacher = #{homepageTeacher,jdbcType=BIT},
      </if>
      <if test="homepageEngineer != null" >
        homepage_engineer = #{homepageEngineer,jdbcType=BIT},
      </if>
      <if test="isTest != null" >
        is_test = #{isTest,jdbcType=TINYINT},
      </if>
      <if test="ecoderUserId != null" >
        ecoder_user_id = #{ecoderUserId,jdbcType=INTEGER},
      </if>
      <if test="business != null" >
        business = #{business,jdbcType=BIT},
      </if>
      <if test="profileCompleted != null" >
        profile_completed = #{profileCompleted,jdbcType=BIT},
      </if>
      <if test="laboratoryId != null" >
        laboratory_id = #{laboratoryId,jdbcType=BIGINT},
      </if>
      <if test="platform != null" >
        platform = #{platform,jdbcType=VARCHAR},
      </if>
      <if test="giteaToken != null" >
        gitea_token = #{giteaToken,jdbcType=VARCHAR},
      </if>
      <if test="giteaUid != null" >
        gitea_uid = #{giteaUid,jdbcType=INTEGER},
      </if>
      <if test="isShixunMarker != null" >
        is_shixun_marker = #{isShixunMarker,jdbcType=BIT},
      </if>
      <if test="isSyncPwd != null" >
        is_sync_pwd = #{isSyncPwd,jdbcType=BIT},
      </if>
      <if test="watchersCount != null" >
        watchers_count = #{watchersCount,jdbcType=INTEGER},
      </if>
      <if test="devopsStep != null" >
        devops_step = #{devopsStep,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
    <update id="updateByPrimaryKey" parameterType="com.microservices.wiki.domain.sys.User">
    update users
    set login = #{login,jdbcType=VARCHAR},
      hashed_password = #{hashedPassword,jdbcType=VARCHAR},
      firstname = #{firstname,jdbcType=VARCHAR},
      lastname = #{lastname,jdbcType=VARCHAR},
      mail = #{mail,jdbcType=VARCHAR},
      admin = #{admin,jdbcType=BIT},
      status = #{status,jdbcType=INTEGER},
      last_login_on = #{lastLoginOn,jdbcType=TIMESTAMP},
      language = #{language,jdbcType=VARCHAR},
      auth_source_id = #{authSourceId,jdbcType=INTEGER},
      created_on = #{createdOn,jdbcType=TIMESTAMP},
      updated_on = #{updatedOn,jdbcType=TIMESTAMP},
      type = #{type,jdbcType=VARCHAR},
      identity_url = #{identityUrl,jdbcType=VARCHAR},
      mail_notification = #{mailNotification,jdbcType=VARCHAR},
      salt = #{salt,jdbcType=VARCHAR},
      gid = #{gid,jdbcType=INTEGER},
      visits = #{visits,jdbcType=INTEGER},
      excellent_teacher = #{excellentTeacher,jdbcType=INTEGER},
      excellent_student = #{excellentStudent,jdbcType=INTEGER},
      phone = #{phone,jdbcType=VARCHAR},
      authentication = #{authentication,jdbcType=BIT},
      grade = #{grade,jdbcType=INTEGER},
      experience = #{experience,jdbcType=INTEGER},
      nickname = #{nickname,jdbcType=VARCHAR},
      show_realname = #{showRealname,jdbcType=BIT},
      professional_certification = #{professionalCertification,jdbcType=BIT},
      ID_number = #{idNumber,jdbcType=VARCHAR},
      certification = #{certification,jdbcType=INTEGER},
      homepage_teacher = #{homepageTeacher,jdbcType=BIT},
      homepage_engineer = #{homepageEngineer,jdbcType=BIT},
      is_test = #{isTest,jdbcType=TINYINT},
      ecoder_user_id = #{ecoderUserId,jdbcType=INTEGER},
      business = #{business,jdbcType=BIT},
      profile_completed = #{profileCompleted,jdbcType=BIT},
      laboratory_id = #{laboratoryId,jdbcType=BIGINT},
      platform = #{platform,jdbcType=VARCHAR},
      gitea_token = #{giteaToken,jdbcType=VARCHAR},
      gitea_uid = #{giteaUid,jdbcType=INTEGER},
      is_shixun_marker = #{isShixunMarker,jdbcType=BIT},
      is_sync_pwd = #{isSyncPwd,jdbcType=BIT},
      watchers_count = #{watchersCount,jdbcType=INTEGER},
      devops_step = #{devopsStep,jdbcType=INTEGER}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>