TKzyUserMapper.xml 12.4 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.server.web.common.mapper.TKzyUserMapper">
  <resultMap id="BaseResultMap" type="com.server.web.common.model.TKzyUser">
    <constructor>
      <idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
      <arg column="full_name" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="head_photo" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="phone" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="user_category" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="duty" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="status" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="wx_openid" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="integral" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="sign_in_count" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="last_sign_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
      <arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
      <arg column="last_login_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
    </constructor>
  </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, full_name, head_photo, phone, user_category, duty, status, wx_openid, integral, 
    sign_in_count, last_sign_dt, create_dt, last_login_dt
  </sql>
  <select id="selectByExample" parameterType="com.server.web.common.model.TKzyUserExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_kzy_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 t_kzy_user
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_kzy_user
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.server.web.common.model.TKzyUserExample">
    delete from t_kzy_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyUser" useGeneratedKeys="true">
    insert into t_kzy_user (full_name, head_photo, phone, 
      user_category, duty, status, 
      wx_openid, integral, sign_in_count, 
      last_sign_dt, create_dt, last_login_dt
      )
    values (#{fullName,jdbcType=VARCHAR}, #{headPhoto,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
      #{userCategory,jdbcType=INTEGER}, #{duty,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
      #{wxOpenid,jdbcType=VARCHAR}, #{integral,jdbcType=INTEGER}, #{signInCount,jdbcType=INTEGER}, 
      #{lastSignDt,jdbcType=TIMESTAMP}, #{createDt,jdbcType=TIMESTAMP}, #{lastLoginDt,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TKzyUser" useGeneratedKeys="true">
    insert into t_kzy_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="fullName != null">
        full_name,
      </if>
      <if test="headPhoto != null">
        head_photo,
      </if>
      <if test="phone != null">
        phone,
      </if>
      <if test="userCategory != null">
        user_category,
      </if>
      <if test="duty != null">
        duty,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="wxOpenid != null">
        wx_openid,
      </if>
      <if test="integral != null">
        integral,
      </if>
      <if test="signInCount != null">
        sign_in_count,
      </if>
      <if test="lastSignDt != null">
        last_sign_dt,
      </if>
      <if test="createDt != null">
        create_dt,
      </if>
      <if test="lastLoginDt != null">
        last_login_dt,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="fullName != null">
        #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="headPhoto != null">
        #{headPhoto,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        #{phone,jdbcType=VARCHAR},
      </if>
      <if test="userCategory != null">
        #{userCategory,jdbcType=INTEGER},
      </if>
      <if test="duty != null">
        #{duty,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="wxOpenid != null">
        #{wxOpenid,jdbcType=VARCHAR},
      </if>
      <if test="integral != null">
        #{integral,jdbcType=INTEGER},
      </if>
      <if test="signInCount != null">
        #{signInCount,jdbcType=INTEGER},
      </if>
      <if test="lastSignDt != null">
        #{lastSignDt,jdbcType=TIMESTAMP},
      </if>
      <if test="createDt != null">
        #{createDt,jdbcType=TIMESTAMP},
      </if>
      <if test="lastLoginDt != null">
        #{lastLoginDt,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.server.web.common.model.TKzyUserExample" resultType="java.lang.Long">
    select count(*) from t_kzy_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update t_kzy_user
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.fullName != null">
        full_name = #{record.fullName,jdbcType=VARCHAR},
      </if>
      <if test="record.headPhoto != null">
        head_photo = #{record.headPhoto,jdbcType=VARCHAR},
      </if>
      <if test="record.phone != null">
        phone = #{record.phone,jdbcType=VARCHAR},
      </if>
      <if test="record.userCategory != null">
        user_category = #{record.userCategory,jdbcType=INTEGER},
      </if>
      <if test="record.duty != null">
        duty = #{record.duty,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.wxOpenid != null">
        wx_openid = #{record.wxOpenid,jdbcType=VARCHAR},
      </if>
      <if test="record.integral != null">
        integral = #{record.integral,jdbcType=INTEGER},
      </if>
      <if test="record.signInCount != null">
        sign_in_count = #{record.signInCount,jdbcType=INTEGER},
      </if>
      <if test="record.lastSignDt != null">
        last_sign_dt = #{record.lastSignDt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createDt != null">
        create_dt = #{record.createDt,jdbcType=TIMESTAMP},
      </if>
      <if test="record.lastLoginDt != null">
        last_login_dt = #{record.lastLoginDt,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update t_kzy_user
    set id = #{record.id,jdbcType=BIGINT},
      full_name = #{record.fullName,jdbcType=VARCHAR},
      head_photo = #{record.headPhoto,jdbcType=VARCHAR},
      phone = #{record.phone,jdbcType=VARCHAR},
      user_category = #{record.userCategory,jdbcType=INTEGER},
      duty = #{record.duty,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=INTEGER},
      wx_openid = #{record.wxOpenid,jdbcType=VARCHAR},
      integral = #{record.integral,jdbcType=INTEGER},
      sign_in_count = #{record.signInCount,jdbcType=INTEGER},
      last_sign_dt = #{record.lastSignDt,jdbcType=TIMESTAMP},
      create_dt = #{record.createDt,jdbcType=TIMESTAMP},
      last_login_dt = #{record.lastLoginDt,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TKzyUser">
    update t_kzy_user
    <set>
      <if test="fullName != null">
        full_name = #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="headPhoto != null">
        head_photo = #{headPhoto,jdbcType=VARCHAR},
      </if>
      <if test="phone != null">
        phone = #{phone,jdbcType=VARCHAR},
      </if>
      <if test="userCategory != null">
        user_category = #{userCategory,jdbcType=INTEGER},
      </if>
      <if test="duty != null">
        duty = #{duty,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="wxOpenid != null">
        wx_openid = #{wxOpenid,jdbcType=VARCHAR},
      </if>
      <if test="integral != null">
        integral = #{integral,jdbcType=INTEGER},
      </if>
      <if test="signInCount != null">
        sign_in_count = #{signInCount,jdbcType=INTEGER},
      </if>
      <if test="lastSignDt != null">
        last_sign_dt = #{lastSignDt,jdbcType=TIMESTAMP},
      </if>
      <if test="createDt != null">
        create_dt = #{createDt,jdbcType=TIMESTAMP},
      </if>
      <if test="lastLoginDt != null">
        last_login_dt = #{lastLoginDt,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TKzyUser">
    update t_kzy_user
    set full_name = #{fullName,jdbcType=VARCHAR},
      head_photo = #{headPhoto,jdbcType=VARCHAR},
      phone = #{phone,jdbcType=VARCHAR},
      user_category = #{userCategory,jdbcType=INTEGER},
      duty = #{duty,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      wx_openid = #{wxOpenid,jdbcType=VARCHAR},
      integral = #{integral,jdbcType=INTEGER},
      sign_in_count = #{signInCount,jdbcType=INTEGER},
      last_sign_dt = #{lastSignDt,jdbcType=TIMESTAMP},
      create_dt = #{createDt,jdbcType=TIMESTAMP},
      last_login_dt = #{lastLoginDt,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>