USERSMapper.xml 7.2 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="com.tianbo.warehouse.dao.USERSMapper" >
  <resultMap id="BaseResultMap" type="com.tianbo.warehouse.model.USERS" >
    <id column="user_id" property="userId" jdbcType="INTEGER" />
    <result column="username" property="username" jdbcType="VARCHAR" />
    <result column="password" property="password" jdbcType="VARCHAR" />
    <result column="birthday" property="birthday" jdbcType="TIMESTAMP" />
    <result column="sex" property="sex" jdbcType="CHAR" />
    <result column="address" property="address" jdbcType="VARCHAR" />
    <result column="state" property="state" jdbcType="BIT" />
    <result column="mobilePhone" property="mobilephone" jdbcType="VARCHAR" />
    <result column="creatTime" property="creattime" jdbcType="TIMESTAMP" />
    <result column="updateTime" property="updatetime" jdbcType="TIMESTAMP" />
    <result column="userFace" property="userface" jdbcType="VARCHAR" />
    <result column="ext1" property="ext1" jdbcType="VARCHAR" />
    <result column="ext2" property="ext2" jdbcType="VARCHAR" />
    <result column="ext3" property="ext3" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    user_id, username, password, birthday, sex, address, state, mobilePhone, creatTime, 
    updateTime, userFace, ext1, ext2, ext3
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from users
    where user_id = #{userId,jdbcType=INTEGER}
  </select>
  <select id="selectByUsername" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select
    <include refid="Base_Column_List" />
    from USERS
    where USERNAME = #{username,jdbcType=VARCHAR}
  </select>
  <select id="selectAllUser" resultMap="BaseResultMap" >
    select
    <include refid="Base_Column_List" />
    from USERS
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from users
    where user_id = #{userId,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.tianbo.warehouse.model.USERS" >
    insert into users (user_id, username, password, 
      birthday, sex, address, 
      state, mobilePhone, creatTime, 
      updateTime, userFace, ext1, 
      ext2, ext3)
    values (#{userId,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, 
      #{birthday,jdbcType=TIMESTAMP}, #{sex,jdbcType=CHAR}, #{address,jdbcType=VARCHAR}, 
      #{state,jdbcType=BIT}, #{mobilephone,jdbcType=VARCHAR}, #{creattime,jdbcType=TIMESTAMP}, 
      #{updatetime,jdbcType=TIMESTAMP}, #{userface,jdbcType=VARCHAR}, #{ext1,jdbcType=VARCHAR}, 
      #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.warehouse.model.USERS" >
    insert into users
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="userId != null" >
        user_id,
      </if>
      <if test="username != null" >
        username,
      </if>
      <if test="password != null" >
        password,
      </if>
      <if test="birthday != null" >
        birthday,
      </if>
      <if test="sex != null" >
        sex,
      </if>
      <if test="address != null" >
        address,
      </if>
      <if test="state != null" >
        state,
      </if>
      <if test="mobilephone != null" >
        mobilePhone,
      </if>
      <if test="creattime != null" >
        creatTime,
      </if>
      <if test="updatetime != null" >
        updateTime,
      </if>
      <if test="userface != null" >
        userFace,
      </if>
      <if test="ext1 != null" >
        ext1,
      </if>
      <if test="ext2 != null" >
        ext2,
      </if>
      <if test="ext3 != null" >
        ext3,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="userId != null" >
        #{userId,jdbcType=INTEGER},
      </if>
      <if test="username != null" >
        #{username,jdbcType=VARCHAR},
      </if>
      <if test="password != null" >
        #{password,jdbcType=VARCHAR},
      </if>
      <if test="birthday != null" >
        #{birthday,jdbcType=TIMESTAMP},
      </if>
      <if test="sex != null" >
        #{sex,jdbcType=CHAR},
      </if>
      <if test="address != null" >
        #{address,jdbcType=VARCHAR},
      </if>
      <if test="state != null" >
        #{state,jdbcType=BIT},
      </if>
      <if test="mobilephone != null" >
        #{mobilephone,jdbcType=VARCHAR},
      </if>
      <if test="creattime != null" >
        #{creattime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null" >
        #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="userface != null" >
        #{userface,jdbcType=VARCHAR},
      </if>
      <if test="ext1 != null" >
        #{ext1,jdbcType=VARCHAR},
      </if>
      <if test="ext2 != null" >
        #{ext2,jdbcType=VARCHAR},
      </if>
      <if test="ext3 != null" >
        #{ext3,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.warehouse.model.USERS" >
    update users
    <set >
      <if test="username != null" >
        username = #{username,jdbcType=VARCHAR},
      </if>
      <if test="password != null" >
        password = #{password,jdbcType=VARCHAR},
      </if>
      <if test="birthday != null" >
        birthday = #{birthday,jdbcType=TIMESTAMP},
      </if>
      <if test="sex != null" >
        sex = #{sex,jdbcType=CHAR},
      </if>
      <if test="address != null" >
        address = #{address,jdbcType=VARCHAR},
      </if>
      <if test="state != null" >
        state = #{state,jdbcType=BIT},
      </if>
      <if test="mobilephone != null" >
        mobilePhone = #{mobilephone,jdbcType=VARCHAR},
      </if>
      <if test="creattime != null" >
        creatTime = #{creattime,jdbcType=TIMESTAMP},
      </if>
      <if test="updatetime != null" >
        updateTime = #{updatetime,jdbcType=TIMESTAMP},
      </if>
      <if test="userface != null" >
        userFace = #{userface,jdbcType=VARCHAR},
      </if>
      <if test="ext1 != null" >
        ext1 = #{ext1,jdbcType=VARCHAR},
      </if>
      <if test="ext2 != null" >
        ext2 = #{ext2,jdbcType=VARCHAR},
      </if>
      <if test="ext3 != null" >
        ext3 = #{ext3,jdbcType=VARCHAR},
      </if>
    </set>
    where user_id = #{userId,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tianbo.warehouse.model.USERS" >
    update users
    set username = #{username,jdbcType=VARCHAR},
      password = #{password,jdbcType=VARCHAR},
      birthday = #{birthday,jdbcType=TIMESTAMP},
      sex = #{sex,jdbcType=CHAR},
      address = #{address,jdbcType=VARCHAR},
      state = #{state,jdbcType=BIT},
      mobilePhone = #{mobilephone,jdbcType=VARCHAR},
      creatTime = #{creattime,jdbcType=TIMESTAMP},
      updateTime = #{updatetime,jdbcType=TIMESTAMP},
      userFace = #{userface,jdbcType=VARCHAR},
      ext1 = #{ext1,jdbcType=VARCHAR},
      ext2 = #{ext2,jdbcType=VARCHAR},
      ext3 = #{ext3,jdbcType=VARCHAR}
    where user_id = #{userId,jdbcType=INTEGER}
  </update>
</mapper>