<?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.AlumniOrganizeMapper">
  <resultMap id="BaseResultMap" type="com.dgtis.dorm.manager.db.domain.AlumniOrganize">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="organize_name" jdbcType="VARCHAR" property="organizeName" />
    <result column="organize_type" jdbcType="VARCHAR" property="organizeType" />
    <result column="organize_content" jdbcType="VARCHAR" property="organizeContent" />
    <result column="organize_user_id" jdbcType="INTEGER" property="organizeUserId" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="is_delete" jdbcType="BIT" property="isDelete" />
    <result column="organize_memo" jdbcType="VARCHAR" property="organizeMemo" />
    <result column="auth_user_id" jdbcType="INTEGER" property="authUserId" />
    <result column="auth_date" jdbcType="TIMESTAMP" property="authDate" />
    <result column="modify_user_id" jdbcType="INTEGER" property="modifyUserId" />
    <result column="modify_date" jdbcType="TIMESTAMP" property="modifyDate" />
    <result column="url" jdbcType="VARCHAR" property="url" />
    <result column="weight" jdbcType="INTEGER" property="weight" />
    <result column="auth_status" jdbcType="INTEGER" property="authStatus" />
    <result column="is_remove" jdbcType="VARCHAR" property="isRemove" />

  </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, organize_name, organize_type, organize_content,organize_user_id, create_date, is_delete, organize_memo,
    auth_user_id, auth_date, modify_user_id, modify_date, url,weight,auth_status, is_remove
  </sql>
  <select id="selectByExample" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from zhll_organize
    <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
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from zhll_organize
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <delete id="deleteByExample" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeExample">
    delete from zhll_organize
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganize">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into zhll_organize (organize_name, organize_type, organize_content,organize_user_id,
      create_date, is_delete, organize_memo, 
      auth_user_id, auth_date, modify_user_id, 
      modify_date, url,auth_status, is_remove)
    values (#{organizeName,jdbcType=VARCHAR}, #{organizeType,jdbcType=VARCHAR}, #{organizeContent,jdbcType=VARCHAR},#{organizeUserId,jdbcType=INTEGER},
      #{createDate,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=BIT}, #{organizeMemo,jdbcType=VARCHAR},
      #{authUserId,jdbcType=INTEGER}, #{authDate,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=INTEGER}, 
      #{modifyDate,jdbcType=TIMESTAMP}, #{url,jdbcType=VARCHAR},#{auth_status,jdbcType=INTEGER}, #{isRemove,jdbcType=VARCHAR})
  </insert>

  <insert id="insertSelective" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganize">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into zhll_organize
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="organizeName != null">
        organize_name,
      </if>
      <if test="organizeType != null">
        organize_type,
      </if>
       <if test="organizeContent != null">
         organize_content,
      </if>
      <if test="organizeUserId != null">
        organize_user_id,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
      <if test="organizeMemo != null">
        organize_memo,
      </if>
      <if test="authUserId != null">
        auth_user_id,
      </if>
      <if test="authDate != null">
        auth_date,
      </if>
      <if test="modifyUserId != null">
        modify_user_id,
      </if>
      <if test="modifyDate != null">
        modify_date,
      </if>
      <if test="url != null">
        url,
      </if>
      <if test="weight != null">
        weight,
      </if>
      <if test="authStatus != null">
        auth_status,
      </if>
      is_delete,

      is_remove
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="organizeName != null">
        #{organizeName,jdbcType=VARCHAR},
      </if>
      <if test="organizeType != null">
        #{organizeType,jdbcType=VARCHAR},
      </if>
       <if test="organizeContent != null">
        #{organizeContent,jdbcType=VARCHAR},
      </if>
      <if test="organizeUserId != null">
        #{organizeUserId,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="organizeMemo != null">
        #{organizeMemo,jdbcType=VARCHAR},
      </if>
      <if test="authUserId != null">
        #{authUserId,jdbcType=INTEGER},
      </if>
      <if test="authDate != null">
        #{authDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyUserId != null">
        #{modifyUserId,jdbcType=INTEGER},
      </if>
      <if test="modifyDate != null">
        #{modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="url != null">
        #{url,jdbcType=VARCHAR},
      </if>
      <if test="weight != null">
        #{weight,jdbcType=INTEGER},
      </if>
      <if test="authStatus != null">
        #{authStatus,jdbcType=INTEGER},
      </if>
      1,
      0
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganizeExample" resultType="java.lang.Long">
    select count(*) from zhll_organize
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <select id="countOrganize" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganize" resultType="java.lang.Integer">
    select count(*) from zhll_organize
      where 1=1
    <if test="authStatus != null">
      and auth_status = 0
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update zhll_organize
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=INTEGER},
      </if>
      <if test="record.organizeName != null">
        organize_name = #{record.organizeName,jdbcType=VARCHAR},
      </if>
      <if test="record.organizeType != null">
        organize_type = #{record.organizeType,jdbcType=VARCHAR},
      </if>
      <if test="record.weight != null">
        weight = #{record.weight,jdbcType=INTEGER},
      </if>
      <if test="record.organizeUserId != null">
        organize_user_id = #{record.organizeUserId,jdbcType=INTEGER},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.isDelete != null">
        is_delete = #{record.isDelete,jdbcType=INTEGER},
      </if>
      <if test="record.organizeMemo != null">
        organize_memo = #{record.organizeMemo,jdbcType=VARCHAR},
      </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.modifyUserId != null">
        modify_user_id = #{record.modifyUserId,jdbcType=INTEGER},
      </if>
      <if test="record.modifyDate != null">
        modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="record.url != null">
        url = #{record.url,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
    set id = #{record.id,jdbcType=INTEGER},
      organize_name = #{record.organizeName,jdbcType=VARCHAR},
      organize_type = #{record.organizeType,jdbcType=VARCHAR},
    organize_content = #{record.organizeContent,jdbcType=VARCHAR},
      organize_user_id = #{record.organizeUserId,jdbcType=INTEGER},
      create_date = #{record.createDate,jdbcType=TIMESTAMP},
      is_delete = #{record.isDelete,jdbcType=BIT},
      organize_memo = #{record.organizeMemo,jdbcType=VARCHAR},
      auth_user_id = #{record.authUserId,jdbcType=INTEGER},
      auth_date = #{record.authDate,jdbcType=TIMESTAMP},
      modify_user_id = #{record.modifyUserId,jdbcType=INTEGER},
      modify_date = #{record.modifyDate,jdbcType=TIMESTAMP},
      url = #{record.url,jdbcType=VARCHAR},
      weight = #{record.weight,jdbcType=INTEGER},
      auth_status = #{record.authStatus,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganize">
    update zhll_organize
    <set>
      <if test="organizeName != null">
        organize_name = #{organizeName,jdbcType=VARCHAR},
      </if>
      <if test="organizeType != null">
        organize_type = #{organizeType,jdbcType=VARCHAR},
      </if>
      <if test="organizeContent != null">
        organize_content = #{organizeContent,jdbcType=VARCHAR},
      </if>
      <if test="organizeUserId != null">
        organize_user_id = #{organizeUserId,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="isDelete != null">
        is_delete = #{isDelete,jdbcType=BIT},
      </if>
      <if test="organizeMemo != null">
        organize_memo = #{organizeMemo,jdbcType=VARCHAR},
      </if>
      <if test="authUserId != null">
        auth_user_id = #{authUserId,jdbcType=INTEGER},
      </if>
      <if test="authDate != null">
        auth_date = #{authDate,jdbcType=TIMESTAMP},
      </if>
      <if test="modifyUserId != null">
        modify_user_id = #{modifyUserId,jdbcType=INTEGER},
      </if>
      <if test="modifyDate != null">
        modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      </if>
      <if test="url != null">
        url = #{url,jdbcType=VARCHAR},
      </if>
      <if test="weight != null">
        weight = #{weight,jdbcType=INTEGER},
      </if>
      <if test="authStatus != null">
        auth_status = #{authStatus,jdbcType=INTEGER},
      </if>
      <if test="isRemove != null">
        is_remove = #{isRemove,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dgtis.dorm.manager.db.domain.AlumniOrganize">
    update zhll_organize
    set organize_name = #{organizeName,jdbcType=VARCHAR},
      organize_type = #{organizeType,jdbcType=VARCHAR},
      organize_content = #{organizeContent,jdbcType=VARCHAR},
      organize_user_id = #{organizeUserId,jdbcType=INTEGER},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      is_delete = #{isDelete,jdbcType=BIT},
      organize_memo = #{organizeMemo,jdbcType=VARCHAR},
      auth_user_id = #{authUserId,jdbcType=INTEGER},
      auth_date = #{authDate,jdbcType=TIMESTAMP},
      modify_user_id = #{modifyUserId,jdbcType=INTEGER},
      modify_date = #{modifyDate,jdbcType=TIMESTAMP},
      url = #{url,jdbcType=VARCHAR},
      weight = #{weight,jdbcType=INTEGER},
      auth_status = #{authStatus,jdbcType=INTEGER},
      is_remove = #{isRemove,jdbcType=VARCHAR},
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>