<?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.linlinjava.jz.db.dao.HmNoticeMapper">
  <resultMap id="BaseResultMap" type="org.linlinjava.jz.db.domain.HmNotice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="content" jdbcType="VARCHAR" property="content" />
    <result column="employ_relation_id" jdbcType="BIGINT" property="employRelationId" />
    <result column="notice_user_type" jdbcType="VARCHAR" property="noticeUserType" />
    <result column="r_type" jdbcType="VARCHAR" property="rType" />
    <result column="r_id" jdbcType="VARCHAR" property="rId" />
    <result column="ticket_id" jdbcType="INTEGER" property="ticketId" />
    <result column="input_json" jdbcType="VARCHAR" property="inputJson" />
    <result column="create_user_id" jdbcType="BIGINT" property="createUserId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="id_delete" jdbcType="INTEGER" property="idDelete" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, title, content, employ_relation_id, notice_user_type, r_type, r_id, ticket_id, 
    input_json, create_user_id, create_time, update_time, id_delete, remark
  </sql>
  <select id="selectByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from hm_notice
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="example != null and example.distinct">
      distinct
    </if>
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from hm_notice
    <if test="example != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example != null and example.orderByClause != null">
      order by ${example.orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from hm_notice
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from hm_notice
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from hm_notice
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from hm_notice
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.linlinjava.jz.db.domain.HmNotice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into hm_notice (title, content, employ_relation_id, 
      notice_user_type, r_type, r_id, 
      ticket_id, input_json, create_user_id, 
      create_time, update_time, id_delete, 
      remark)
    values (#{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, #{employRelationId,jdbcType=BIGINT}, 
      #{noticeUserType,jdbcType=VARCHAR}, #{rType,jdbcType=VARCHAR}, #{rId,jdbcType=VARCHAR}, 
      #{ticketId,jdbcType=INTEGER}, #{inputJson,jdbcType=VARCHAR}, #{createUserId,jdbcType=BIGINT}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{idDelete,jdbcType=INTEGER}, 
      #{remark,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="org.linlinjava.jz.db.domain.HmNotice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into hm_notice
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="title != null">
        title,
      </if>
      <if test="content != null">
        content,
      </if>
      <if test="employRelationId != null">
        employ_relation_id,
      </if>
      <if test="noticeUserType != null">
        notice_user_type,
      </if>
      <if test="rType != null">
        r_type,
      </if>
      <if test="rId != null">
        r_id,
      </if>
      <if test="ticketId != null">
        ticket_id,
      </if>
      <if test="inputJson != null">
        input_json,
      </if>
      <if test="createUserId != null">
        create_user_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="idDelete != null">
        id_delete,
      </if>
      <if test="remark != null">
        remark,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        #{content,jdbcType=VARCHAR},
      </if>
      <if test="employRelationId != null">
        #{employRelationId,jdbcType=BIGINT},
      </if>
      <if test="noticeUserType != null">
        #{noticeUserType,jdbcType=VARCHAR},
      </if>
      <if test="rType != null">
        #{rType,jdbcType=VARCHAR},
      </if>
      <if test="rId != null">
        #{rId,jdbcType=VARCHAR},
      </if>
      <if test="ticketId != null">
        #{ticketId,jdbcType=INTEGER},
      </if>
      <if test="inputJson != null">
        #{inputJson,jdbcType=VARCHAR},
      </if>
      <if test="createUserId != null">
        #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="idDelete != null">
        #{idDelete,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        #{remark,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from hm_notice
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update hm_notice
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.title != null">
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.content != null">
        content = #{record.content,jdbcType=VARCHAR},
      </if>
      <if test="record.employRelationId != null">
        employ_relation_id = #{record.employRelationId,jdbcType=BIGINT},
      </if>
      <if test="record.noticeUserType != null">
        notice_user_type = #{record.noticeUserType,jdbcType=VARCHAR},
      </if>
      <if test="record.rType != null">
        r_type = #{record.rType,jdbcType=VARCHAR},
      </if>
      <if test="record.rId != null">
        r_id = #{record.rId,jdbcType=VARCHAR},
      </if>
      <if test="record.ticketId != null">
        ticket_id = #{record.ticketId,jdbcType=INTEGER},
      </if>
      <if test="record.inputJson != null">
        input_json = #{record.inputJson,jdbcType=VARCHAR},
      </if>
      <if test="record.createUserId != null">
        create_user_id = #{record.createUserId,jdbcType=BIGINT},
      </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.idDelete != null">
        id_delete = #{record.idDelete,jdbcType=INTEGER},
      </if>
      <if test="record.remark != null">
        remark = #{record.remark,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update hm_notice
    set id = #{record.id,jdbcType=BIGINT},
      title = #{record.title,jdbcType=VARCHAR},
      content = #{record.content,jdbcType=VARCHAR},
      employ_relation_id = #{record.employRelationId,jdbcType=BIGINT},
      notice_user_type = #{record.noticeUserType,jdbcType=VARCHAR},
      r_type = #{record.rType,jdbcType=VARCHAR},
      r_id = #{record.rId,jdbcType=VARCHAR},
      ticket_id = #{record.ticketId,jdbcType=INTEGER},
      input_json = #{record.inputJson,jdbcType=VARCHAR},
      create_user_id = #{record.createUserId,jdbcType=BIGINT},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      id_delete = #{record.idDelete,jdbcType=INTEGER},
      remark = #{record.remark,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.jz.db.domain.HmNotice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update hm_notice
    <set>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="content != null">
        content = #{content,jdbcType=VARCHAR},
      </if>
      <if test="employRelationId != null">
        employ_relation_id = #{employRelationId,jdbcType=BIGINT},
      </if>
      <if test="noticeUserType != null">
        notice_user_type = #{noticeUserType,jdbcType=VARCHAR},
      </if>
      <if test="rType != null">
        r_type = #{rType,jdbcType=VARCHAR},
      </if>
      <if test="rId != null">
        r_id = #{rId,jdbcType=VARCHAR},
      </if>
      <if test="ticketId != null">
        ticket_id = #{ticketId,jdbcType=INTEGER},
      </if>
      <if test="inputJson != null">
        input_json = #{inputJson,jdbcType=VARCHAR},
      </if>
      <if test="createUserId != null">
        create_user_id = #{createUserId,jdbcType=BIGINT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="idDelete != null">
        id_delete = #{idDelete,jdbcType=INTEGER},
      </if>
      <if test="remark != null">
        remark = #{remark,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.linlinjava.jz.db.domain.HmNotice">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update hm_notice
    set title = #{title,jdbcType=VARCHAR},
      content = #{content,jdbcType=VARCHAR},
      employ_relation_id = #{employRelationId,jdbcType=BIGINT},
      notice_user_type = #{noticeUserType,jdbcType=VARCHAR},
      r_type = #{rType,jdbcType=VARCHAR},
      r_id = #{rId,jdbcType=VARCHAR},
      ticket_id = #{ticketId,jdbcType=INTEGER},
      input_json = #{inputJson,jdbcType=VARCHAR},
      create_user_id = #{createUserId,jdbcType=BIGINT},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      id_delete = #{idDelete,jdbcType=INTEGER},
      remark = #{remark,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectOneByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <include refid="Base_Column_List" />
    from hm_notice
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
    limit 1
  </select>
  <select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <choose>
      <when test="selective != null and selective.length &gt; 0">
        <foreach collection="selective" item="column" separator=",">
          ${column.aliasedEscapedColumnName}
        </foreach>
      </when>
      <otherwise>
        <include refid="Base_Column_List" />
      </otherwise>
    </choose>
    from hm_notice
    <if test="example != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
    <if test="example != null and example.orderByClause != null">
      order by ${example.orderByClause}
    </if>
    limit 1
  </select>
</mapper>