<?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.dgtis.dorm.manager.db.dao.AlumniOrganizeUserMapper">
  <resultMap id="BaseResultMap" type="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUser">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="fk_organize_id" jdbcType="INTEGER" property="fkOrganizeId" />
    <result column="fk_user_id" jdbcType="INTEGER" property="fkUserId" />
    <result column="is_normal" jdbcType="VARCHAR" property="isNormal" />
    <result column="pri_type" jdbcType="VARCHAR" property="priType" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="auth_user_id" jdbcType="INTEGER" property="authUserId" />
    <result column="auth_date" jdbcType="TIMESTAMP" property="authDate" />
    <result column="auth_memo" jdbcType="VARCHAR" property="authMemo" />
    <result column="is_delete" jdbcType="BIT" property="isDelete" />
    <result column="delete_memo" jdbcType="VARCHAR" property="deleteMemo" />
    <result column="delete_date" jdbcType="TIMESTAMP" property="deleteDate" />
    <result column="is_forbidden" jdbcType="BIT" property="isForbidden" />
    <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
    <result column="modify_user_id" jdbcType="INTEGER" property="modifyUserId" />
    <result column="user_memo" jdbcType="VARCHAR" property="userMemo" />
  </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, fk_organize_id, fk_user_id, is_normal, pri_type, create_date, auth_user_id, auth_date, 
    auth_memo, is_delete, delete_memo, delete_date, is_forbidden, modify_date, modify_user_id, 
    user_memo
  </sql>
  <select id="selectByExample" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUserExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from zhll_organize_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.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from zhll_organize_user
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from zhll_organize_user
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUserExample">
    delete from zhll_organize_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUser">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into zhll_organize_user (fk_organize_id, fk_user_id, is_normal,
      pri_type, create_date, auth_user_id, 
      auth_date, auth_memo, is_delete, 
      delete_memo, delete_date, is_forbidden, 
      modify_date, modify_user_id, user_memo
      )
    values (#{fkOrganizeId,jdbcType=INTEGER}, #{fkUserId,jdbcType=INTEGER}, #{isNormal,jdbcType=VARCHAR}, 
      #{priType,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{authUserId,jdbcType=INTEGER}, 
      #{authDate,jdbcType=TIMESTAMP}, #{authMemo,jdbcType=VARCHAR}, #{isDelete,jdbcType=BIT}, 
      #{deleteMemo,jdbcType=VARCHAR}, #{deleteDate,jdbcType=TIMESTAMP}, #{isForbidden,jdbcType=BIT}, 
      #{modifyDate,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=INTEGER}, #{userMemo,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUser">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into zhll_organize_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="fkOrganizeId != null">
        fk_organize_id,
      </if>
      <if test="fkUserId != null">
        fk_user_id,
      </if>
      <if test="isNormal != null">
        is_normal,
      </if>
      <if test="priType != null">
        pri_type,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="authUserId != null">
        auth_user_id,
      </if>
      <if test="authDate != null">
        auth_date,
      </if>
      <if test="authMemo != null">
        auth_memo,
      </if>
      <if test="isDelete != null">
        is_delete,
      </if>
      <if test="deleteMemo != null">
        delete_memo,
      </if>
      <if test="deleteDate != null">
        delete_date,
      </if>
      <if test="isForbidden != null">
        is_forbidden,
      </if>
      <if test="modifyDate != null">
        modify_date,
      </if>
      <if test="modifyUserId != null">
        modify_user_id,
      </if>
      <if test="userMemo != null">
        user_memo,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="fkOrganizeId != null">
        #{fkOrganizeId,jdbcType=INTEGER},
      </if>
      <if test="fkUserId != null">
        #{fkUserId,jdbcType=INTEGER},
      </if>
      <if test="isNormal != null">
        #{isNormal,jdbcType=VARCHAR},
      </if>
      <if test="priType != null">
        #{priType,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="authUserId != null">
        #{authUserId,jdbcType=INTEGER},
      </if>
      <if test="authDate != null">
        #{authDate,jdbcType=TIMESTAMP},
      </if>
      <if test="authMemo != null">
        #{authMemo,jdbcType=VARCHAR},
      </if>
      <if test="isDelete != null">
        #{isDelete,jdbcType=BIT},
      </if>
      <if test="deleteMemo != null">
        #{deleteMemo,jdbcType=VARCHAR},
      </if>
      <if test="deleteDate != null">
        #{deleteDate,jdbcType=TIMESTAMP},
      </if>
      <if test="isForbidden != null">
        #{isForbidden,jdbcType=BIT},
      </if>
      <if test="modifyDate != null">
        #{modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyUserId != null">
        #{modifyUserId,jdbcType=INTEGER},
      </if>
      <if test="userMemo != null">
        #{userMemo,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUserExample" resultType="java.lang.Long">
    select count(*) from zhll_organize_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update zhll_organize_user
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.fkOrganizeId != null">
        fk_organize_id = #{record.fkOrganizeId,jdbcType=INTEGER},
      </if>
      <if test="record.fkUserId != null">
        fk_user_id = #{record.fkUserId,jdbcType=INTEGER},
      </if>
      <if test="record.isNormal != null">
        is_normal = #{record.isNormal,jdbcType=VARCHAR},
      </if>
      <if test="record.priType != null">
        pri_type = #{record.priType,jdbcType=VARCHAR},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.authUserId != null">
        auth_user_id = #{record.authUserId,jdbcType=INTEGER},
      </if>
      <if test="record.authDate != null">
        auth_date = #{record.authDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.authMemo != null">
        auth_memo = #{record.authMemo,jdbcType=VARCHAR},
      </if>
      <if test="record.isDelete != null">
        is_delete = #{record.isDelete,jdbcType=BIT},
      </if>
      <if test="record.deleteMemo != null">
        delete_memo = #{record.deleteMemo,jdbcType=VARCHAR},
      </if>
      <if test="record.deleteDate != null">
        delete_date = #{record.deleteDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.isForbidden != null">
        is_forbidden = #{record.isForbidden,jdbcType=BIT},
      </if>
      <if test="record.modifyDate != null">
        modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.modifyUserId != null">
        modify_user_id = #{record.modifyUserId,jdbcType=INTEGER},
      </if>
      <if test="record.userMemo != null">
        user_memo = #{record.userMemo,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update zhll_organize_user
    set id = #{record.id,jdbcType=INTEGER},
      fk_organize_id = #{record.fkOrganizeId,jdbcType=INTEGER},
      fk_user_id = #{record.fkUserId,jdbcType=INTEGER},
      is_normal = #{record.isNormal,jdbcType=VARCHAR},
      pri_type = #{record.priType,jdbcType=VARCHAR},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      auth_user_id = #{record.authUserId,jdbcType=INTEGER},
      auth_date = #{record.authDate,jdbcType=TIMESTAMP},
      auth_memo = #{record.authMemo,jdbcType=VARCHAR},
      is_delete = #{record.isDelete,jdbcType=BIT},
      delete_memo = #{record.deleteMemo,jdbcType=VARCHAR},
      delete_date = #{record.deleteDate,jdbcType=TIMESTAMP},
      is_forbidden = #{record.isForbidden,jdbcType=BIT},
      modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
      modify_user_id = #{record.modifyUserId,jdbcType=INTEGER},
      user_memo = #{record.userMemo,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUser">
    update zhll_organize_user
    <set>
      <if test="fkOrganizeId != null">
        fk_organize_id = #{fkOrganizeId,jdbcType=INTEGER},
      </if>
      <if test="fkUserId != null">
        fk_user_id = #{fkUserId,jdbcType=INTEGER},
      </if>
      <if test="isNormal != null">
        is_normal = #{isNormal,jdbcType=VARCHAR},
      </if>
      <if test="priType != null">
        pri_type = #{priType,jdbcType=VARCHAR},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="authUserId != null">
        auth_user_id = #{authUserId,jdbcType=INTEGER},
      </if>
      <if test="authDate != null">
        auth_date = #{authDate,jdbcType=TIMESTAMP},
      </if>
      <if test="authMemo != null">
        auth_memo = #{authMemo,jdbcType=VARCHAR},
      </if>
      <if test="isDelete != null">
        is_delete = #{isDelete,jdbcType=BIT},
      </if>
      <if test="deleteMemo != null">
        delete_memo = #{deleteMemo,jdbcType=VARCHAR},
      </if>
      <if test="deleteDate != null">
        delete_date = #{deleteDate,jdbcType=TIMESTAMP},
      </if>
      <if test="isForbidden != null">
        is_forbidden = #{isForbidden,jdbcType=BIT},
      </if>
      <if test="modifyDate != null">
        modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyUserId != null">
        modify_user_id = #{modifyUserId,jdbcType=INTEGER},
      </if>
      <if test="userMemo != null">
        user_memo = #{userMemo,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeUser">
    update zhll_organize_user
    set fk_organize_id = #{fkOrganizeId,jdbcType=INTEGER},
      fk_user_id = #{fkUserId,jdbcType=INTEGER},
      is_normal = #{isNormal,jdbcType=VARCHAR},
      pri_type = #{priType,jdbcType=VARCHAR},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      auth_user_id = #{authUserId,jdbcType=INTEGER},
      auth_date = #{authDate,jdbcType=TIMESTAMP},
      auth_memo = #{authMemo,jdbcType=VARCHAR},
      is_delete = #{isDelete,jdbcType=BIT},
      delete_memo = #{deleteMemo,jdbcType=VARCHAR},
      delete_date = #{deleteDate,jdbcType=TIMESTAMP},
      is_forbidden = #{isForbidden,jdbcType=BIT},
      modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      modify_user_id = #{modifyUserId,jdbcType=INTEGER},
      user_memo = #{userMemo,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>