<?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.HmNoticeUserMapper">
  <resultMap id="BaseResultMap" type="org.linlinjava.jz.db.domain.HmNoticeUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="notice_id" jdbcType="BIGINT" property="noticeId" />
    <result column="notice_content" jdbcType="VARCHAR" property="noticeContent" />
    <result column="ticket_status" jdbcType="VARCHAR" property="ticketStatus" />
    <result column="app_user_id" jdbcType="BIGINT" property="appUserId" />
    <result column="is_read" jdbcType="INTEGER" property="isRead" />
    <result column="read_time" jdbcType="TIMESTAMP" property="readTime" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  </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, notice_id, notice_content, ticket_status, app_user_id, is_read, read_time, create_time
  </sql>
  <select id="selectByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeUserExample" 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_user
    <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_user
    <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_user
    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_user
    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_user
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeUserExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from hm_notice_user
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="org.linlinjava.jz.db.domain.HmNoticeUser">
    <!--
      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_user (notice_id, notice_content, ticket_status, 
      app_user_id, is_read, read_time, 
      create_time)
    values (#{noticeId,jdbcType=BIGINT}, #{noticeContent,jdbcType=VARCHAR}, #{ticketStatus,jdbcType=VARCHAR}, 
      #{appUserId,jdbcType=BIGINT}, #{isRead,jdbcType=INTEGER}, #{readTime,jdbcType=TIMESTAMP}, 
      #{createTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="org.linlinjava.jz.db.domain.HmNoticeUser">
    <!--
      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_user
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="noticeId != null">
        notice_id,
      </if>
      <if test="noticeContent != null">
        notice_content,
      </if>
      <if test="ticketStatus != null">
        ticket_status,
      </if>
      <if test="appUserId != null">
        app_user_id,
      </if>
      <if test="isRead != null">
        is_read,
      </if>
      <if test="readTime != null">
        read_time,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="noticeId != null">
        #{noticeId,jdbcType=BIGINT},
      </if>
      <if test="noticeContent != null">
        #{noticeContent,jdbcType=VARCHAR},
      </if>
      <if test="ticketStatus != null">
        #{ticketStatus,jdbcType=VARCHAR},
      </if>
      <if test="appUserId != null">
        #{appUserId,jdbcType=BIGINT},
      </if>
      <if test="isRead != null">
        #{isRead,jdbcType=INTEGER},
      </if>
      <if test="readTime != null">
        #{readTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeUserExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from hm_notice_user
    <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_user
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.noticeId != null">
        notice_id = #{record.noticeId,jdbcType=BIGINT},
      </if>
      <if test="record.noticeContent != null">
        notice_content = #{record.noticeContent,jdbcType=VARCHAR},
      </if>
      <if test="record.ticketStatus != null">
        ticket_status = #{record.ticketStatus,jdbcType=VARCHAR},
      </if>
      <if test="record.appUserId != null">
        app_user_id = #{record.appUserId,jdbcType=BIGINT},
      </if>
      <if test="record.isRead != null">
        is_read = #{record.isRead,jdbcType=INTEGER},
      </if>
      <if test="record.readTime != null">
        read_time = #{record.readTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </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_user
    set id = #{record.id,jdbcType=BIGINT},
      notice_id = #{record.noticeId,jdbcType=BIGINT},
      notice_content = #{record.noticeContent,jdbcType=VARCHAR},
      ticket_status = #{record.ticketStatus,jdbcType=VARCHAR},
      app_user_id = #{record.appUserId,jdbcType=BIGINT},
      is_read = #{record.isRead,jdbcType=INTEGER},
      read_time = #{record.readTime,jdbcType=TIMESTAMP},
      create_time = #{record.createTime,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="org.linlinjava.jz.db.domain.HmNoticeUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update hm_notice_user
    <set>
      <if test="noticeId != null">
        notice_id = #{noticeId,jdbcType=BIGINT},
      </if>
      <if test="noticeContent != null">
        notice_content = #{noticeContent,jdbcType=VARCHAR},
      </if>
      <if test="ticketStatus != null">
        ticket_status = #{ticketStatus,jdbcType=VARCHAR},
      </if>
      <if test="appUserId != null">
        app_user_id = #{appUserId,jdbcType=BIGINT},
      </if>
      <if test="isRead != null">
        is_read = #{isRead,jdbcType=INTEGER},
      </if>
      <if test="readTime != null">
        read_time = #{readTime,jdbcType=TIMESTAMP},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="org.linlinjava.jz.db.domain.HmNoticeUser">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update hm_notice_user
    set notice_id = #{noticeId,jdbcType=BIGINT},
      notice_content = #{noticeContent,jdbcType=VARCHAR},
      ticket_status = #{ticketStatus,jdbcType=VARCHAR},
      app_user_id = #{appUserId,jdbcType=BIGINT},
      is_read = #{isRead,jdbcType=INTEGER},
      read_time = #{readTime,jdbcType=TIMESTAMP},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectOneByExample" parameterType="org.linlinjava.jz.db.domain.HmNoticeUserExample" 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_user
    <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_user
    <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>
  
   <select id="getNotice" parameterType="java.lang.Long" resultMap="BaseResultMap2">
    select
     id, title, content, employ_relation_id, r_type, r_id, built_id, input_json,   remark
      from hm_notice   where id = #{notice_id,jdbcType=INTEGER}
  </select>
  <resultMap id="BaseResultMap2" type="org.linlinjava.jz.db.domain.CustomerClient">
     <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="r_type" jdbcType="VARCHAR" property="rType" />
    <result column="r_id" jdbcType="BIGINT" property="rId" />
    <result column="built_id" jdbcType="INTEGER" property="builtId" />
    <result column="input_json" jdbcType="VARCHAR" property="inputJson" />
    <result column="remark" jdbcType="VARCHAR" property="remark" />
  </resultMap>
</mapper>