AppUserMapper.xml 14.1 KB
<?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.nafmii.mapper.user.AppUserMapper">
  <resultMap id="BaseResultMap" type="org.nafmii.entity.user.AppUser">
    <id column="ID" jdbcType="BIGINT" property="id" />
    <result column="USER_NAME" jdbcType="VARCHAR" property="userName" />
    <result column="LOGIN_PWD" jdbcType="VARCHAR" property="loginPwd" />
    <result column="REAL_NAME" jdbcType="VARCHAR" property="realName" />
    <result column="PHONE" jdbcType="VARCHAR" property="phone" />
    <result column="BIRTHDAY" jdbcType="VARCHAR" property="birthday" />
    <result column="EMAIL" jdbcType="VARCHAR" property="email" />
    <result column="HEAD_PICTURE" jdbcType="VARCHAR" property="headPicture" />
    <result column="NATIONALITY" jdbcType="VARCHAR" property="nationality" />
    <result column="UNIT_NAME" jdbcType="VARCHAR" property="unitName" />
    <result column="OPEN_ID" jdbcType="VARCHAR" property="openId" />
    <result column="FIGERPRINT_FALG" jdbcType="VARCHAR" property="figerprintFalg" />
    <result column="FACEID_FALG" jdbcType="VARCHAR" property="faceidFalg" />
    <result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
    <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="IS_ENABLE" jdbcType="VARCHAR" property="isEnable" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <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>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">
    <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>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">
    ID, USER_NAME, LOGIN_PWD, REAL_NAME, PHONE, BIRTHDAY, EMAIL, HEAD_PICTURE, NATIONALITY, 
    UNIT_NAME, OPEN_ID, FIGERPRINT_FALG, FACEID_FALG, CREATE_TIME, UPDATE_TIME, IS_ENABLE
  </sql>
  <select id="selectByExample" parameterType="org.nafmii.entity.user.AppUserExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from APP_USER
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from APP_USER
    where ID = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from APP_USER
    where ID = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="org.nafmii.entity.user.AppUserExample">
    delete from APP_USER
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.nafmii.entity.user.AppUserExample">
    insert into APP_USER (ID, USER_NAME, LOGIN_PWD, 
      REAL_NAME, PHONE, BIRTHDAY, 
      EMAIL, HEAD_PICTURE, NATIONALITY, 
      UNIT_NAME, OPEN_ID, FIGERPRINT_FALG, 
      FACEID_FALG, CREATE_TIME, UPDATE_TIME, 
      IS_ENABLE)
    values (#{id,jdbcType=BIGINT}, #{userName,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR}, 
      #{realName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{birthday,jdbcType=VARCHAR}, 
      #{email,jdbcType=VARCHAR}, #{headPicture,jdbcType=VARCHAR}, #{nationality,jdbcType=VARCHAR}, 
      #{unitName,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, #{figerprintFalg,jdbcType=VARCHAR}, 
      #{faceidFalg,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{isEnable,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="org.nafmii.entity.user.AppUserExample">
    insert into APP_USER
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        ID,
      </if>
      <if test="userName != null">
        USER_NAME,
      </if>
      <if test="loginPwd != null">
        LOGIN_PWD,
      </if>
      <if test="realName != null">
        REAL_NAME,
      </if>
      <if test="phone != null">
        PHONE,
      </if>
      <if test="birthday != null">
        BIRTHDAY,
      </if>
      <if test="email != null">
        EMAIL,
      </if>
      <if test="headPicture != null">
        HEAD_PICTURE,
      </if>
      <if test="nationality != null">
        NATIONALITY,
      </if>
      <if test="unitName != null">
        UNIT_NAME,
      </if>
      <if test="openId != null">
        OPEN_ID,
      </if>
      <if test="figerprintFalg != null">
        FIGERPRINT_FALG,
      </if>
      <if test="faceidFalg != null">
        FACEID_FALG,
      </if>
      <if test="createTime != null">
        CREATE_TIME,
      </if>
      <if test="updateTime != null">
        UPDATE_TIME,
      </if>
      <if test="isEnable != null">
        IS_ENABLE,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="userName != null">
        #{userName,jdbcType=VARCHAR},
      </if>
      <if test="loginPwd != null">
        #{loginPwd,jdbcType=VARCHAR},
      </if>
      <if test="realName != null">
        #{realName,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="birthday != null">
        #{birthday,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        #{email,jdbcType=VARCHAR},
      </if>
      <if test="headPicture != null">
        #{headPicture,jdbcType=VARCHAR},
      </if>
      <if test="nationality != null">
        #{nationality,jdbcType=VARCHAR},
      </if>
      <if test="unitName != null">
        #{unitName,jdbcType=VARCHAR},
      </if>
      <if test="openId != null">
        #{openId,jdbcType=VARCHAR},
      </if>
      <if test="figerprintFalg != null">
        #{figerprintFalg,jdbcType=VARCHAR},
      </if>
      <if test="faceidFalg != null">
        #{faceidFalg,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isEnable != null">
        #{isEnable,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.nafmii.entity.user.AppUserExample" resultType="java.lang.Long">
    select count(*) from APP_USER
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update APP_USER
    <set>
      <if test="record.id != null">
        ID = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.userName != null">
        USER_NAME = #{record.userName,jdbcType=VARCHAR},
      </if>
      <if test="record.loginPwd != null">
        LOGIN_PWD = #{record.loginPwd,jdbcType=VARCHAR},
      </if>
      <if test="record.realName != null">
        REAL_NAME = #{record.realName,jdbcType=VARCHAR},
      </if>
      <if test="record.phone != null">
        PHONE = #{record.phone,jdbcType=VARCHAR},
      </if>
      <if test="record.birthday != null">
        BIRTHDAY = #{record.birthday,jdbcType=VARCHAR},
      </if>
      <if test="record.email != null">
        EMAIL = #{record.email,jdbcType=VARCHAR},
      </if>
      <if test="record.headPicture != null">
        HEAD_PICTURE = #{record.headPicture,jdbcType=VARCHAR},
      </if>
      <if test="record.nationality != null">
        NATIONALITY = #{record.nationality,jdbcType=VARCHAR},
      </if>
      <if test="record.unitName != null">
        UNIT_NAME = #{record.unitName,jdbcType=VARCHAR},
      </if>
      <if test="record.openId != null">
        OPEN_ID = #{record.openId,jdbcType=VARCHAR},
      </if>
      <if test="record.figerprintFalg != null">
        FIGERPRINT_FALG = #{record.figerprintFalg,jdbcType=VARCHAR},
      </if>
      <if test="record.faceidFalg != null">
        FACEID_FALG = #{record.faceidFalg,jdbcType=VARCHAR},
      </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.isEnable != null">
        IS_ENABLE = #{record.isEnable,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update APP_USER
    set ID = #{record.id,jdbcType=BIGINT},
      USER_NAME = #{record.userName,jdbcType=VARCHAR},
      LOGIN_PWD = #{record.loginPwd,jdbcType=VARCHAR},
      REAL_NAME = #{record.realName,jdbcType=VARCHAR},
      PHONE = #{record.phone,jdbcType=VARCHAR},
      BIRTHDAY = #{record.birthday,jdbcType=VARCHAR},
      EMAIL = #{record.email,jdbcType=VARCHAR},
      HEAD_PICTURE = #{record.headPicture,jdbcType=VARCHAR},
      NATIONALITY = #{record.nationality,jdbcType=VARCHAR},
      UNIT_NAME = #{record.unitName,jdbcType=VARCHAR},
      OPEN_ID = #{record.openId,jdbcType=VARCHAR},
      FIGERPRINT_FALG = #{record.figerprintFalg,jdbcType=VARCHAR},
      FACEID_FALG = #{record.faceidFalg,jdbcType=VARCHAR},
      CREATE_TIME = #{record.createTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{record.updateTime,jdbcType=TIMESTAMP},
      IS_ENABLE = #{record.isEnable,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.nafmii.entity.user.AppUserExample">
    update APP_USER
    <set>
      <if test="userName != null">
        USER_NAME = #{userName,jdbcType=VARCHAR},
      </if>
      <if test="loginPwd != null">
        LOGIN_PWD = #{loginPwd,jdbcType=VARCHAR},
      </if>
      <if test="realName != null">
        REAL_NAME = #{realName,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        PHONE = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="birthday != null">
        BIRTHDAY = #{birthday,jdbcType=VARCHAR},
      </if>
      <if test="email != null">
        EMAIL = #{email,jdbcType=VARCHAR},
      </if>
      <if test="headPicture != null">
        HEAD_PICTURE = #{headPicture,jdbcType=VARCHAR},
      </if>
      <if test="nationality != null">
        NATIONALITY = #{nationality,jdbcType=VARCHAR},
      </if>
      <if test="unitName != null">
        UNIT_NAME = #{unitName,jdbcType=VARCHAR},
      </if>
      <if test="openId != null">
        OPEN_ID = #{openId,jdbcType=VARCHAR},
      </if>
      <if test="figerprintFalg != null">
        FIGERPRINT_FALG = #{figerprintFalg,jdbcType=VARCHAR},
      </if>
      <if test="faceidFalg != null">
        FACEID_FALG = #{faceidFalg,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="isEnable != null">
        IS_ENABLE = #{isEnable,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.nafmii.entity.user.AppUserExample">
    update APP_USER
    set USER_NAME = #{userName,jdbcType=VARCHAR},
      LOGIN_PWD = #{loginPwd,jdbcType=VARCHAR},
      REAL_NAME = #{realName,jdbcType=VARCHAR},
      PHONE = #{phone,jdbcType=VARCHAR},
      BIRTHDAY = #{birthday,jdbcType=VARCHAR},
      EMAIL = #{email,jdbcType=VARCHAR},
      HEAD_PICTURE = #{headPicture,jdbcType=VARCHAR},
      NATIONALITY = #{nationality,jdbcType=VARCHAR},
      UNIT_NAME = #{unitName,jdbcType=VARCHAR},
      OPEN_ID = #{openId,jdbcType=VARCHAR},
      FIGERPRINT_FALG = #{figerprintFalg,jdbcType=VARCHAR},
      FACEID_FALG = #{faceidFalg,jdbcType=VARCHAR},
      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
      IS_ENABLE = #{isEnable,jdbcType=VARCHAR}
    where ID = #{id,jdbcType=BIGINT}
  </update>
</mapper>