<?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.ruoyi.system.mapper.md.NewmsgOutboxMapper">
  <resultMap id="BaseResultMap" type="com.ruoyi.system.domain.md.NewmsgOutbox">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="orginId" jdbcType="VARCHAR" property="orginid" />
    <result column="appId" jdbcType="VARCHAR" property="appid" />
    <result column="appName" jdbcType="VARCHAR" property="appname" />
    <result column="msgType" jdbcType="TINYINT" property="msgtype" />
    <result column="userId" jdbcType="VARCHAR" property="userid" />
    <result column="userType" jdbcType="TINYINT" property="usertype" />
    <result column="orgId" jdbcType="VARCHAR" property="orgid" />
    <result column="deptId" jdbcType="VARCHAR" property="deptid" />
    <result column="needPush" jdbcType="TINYINT" property="needpush" />
    <result column="state" jdbcType="TINYINT" property="state" />
    <result column="ctime" jdbcType="BIGINT" property="ctime" />
    <result column="utime" jdbcType="BIGINT" property="utime" />
    <result column="title" jdbcType="VARCHAR" property="title" />
    <result column="ext" jdbcType="VARCHAR" property="ext" />
    <result column="dtime" jdbcType="BIGINT" property="dtime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ruoyi.system.domain.md.NewmsgOutbox">
    <result column="body" jdbcType="LONGVARCHAR" property="body" />
    <result column="params" jdbcType="LONGVARCHAR" property="params" />
  </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, orginId, appId, appName, msgType, userId, userType, orgId, deptId, needPush, 
    state, ctime, utime, title, ext, dtime
  </sql>
  <sql id="Blob_Column_List">
    body, params
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="com.ruoyi.system.domain.md.NewmsgOutboxExample" resultMap="ResultMapWithBLOBs">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from md_newmsg_outbox
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="com.ruoyi.system.domain.md.NewmsgOutboxExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from md_newmsg_outbox
    <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.String" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from md_newmsg_outbox
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from md_newmsg_outbox
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.ruoyi.system.domain.md.NewmsgOutboxExample">
    delete from md_newmsg_outbox
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.ruoyi.system.domain.md.NewmsgOutbox">
    insert into md_newmsg_outbox (id, orginId, appId,
      appName, msgType, userId, 
      userType, orgId, deptId, 
      needPush, state, ctime, 
      utime, title, ext, dtime, 
      body, params)
    values (#{id,jdbcType=VARCHAR}, #{orginid,jdbcType=VARCHAR}, #{appid,jdbcType=VARCHAR}, 
      #{appname,jdbcType=VARCHAR}, #{msgtype,jdbcType=TINYINT}, #{userid,jdbcType=VARCHAR}, 
      #{usertype,jdbcType=TINYINT}, #{orgid,jdbcType=VARCHAR}, #{deptid,jdbcType=VARCHAR}, 
      #{needpush,jdbcType=TINYINT}, #{state,jdbcType=TINYINT}, #{ctime,jdbcType=BIGINT}, 
      #{utime,jdbcType=BIGINT}, #{title,jdbcType=VARCHAR}, #{ext,jdbcType=VARCHAR}, #{dtime,jdbcType=BIGINT}, 
      #{body,jdbcType=LONGVARCHAR}, #{params,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.ruoyi.system.domain.md.NewmsgOutbox">
    insert into md_newmsg_outbox
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="orginid != null">
        orginId,
      </if>
      <if test="appid != null">
        appId,
      </if>
      <if test="appname != null">
        appName,
      </if>
      <if test="msgtype != null">
        msgType,
      </if>
      <if test="userid != null">
        userId,
      </if>
      <if test="usertype != null">
        userType,
      </if>
      <if test="orgid != null">
        orgId,
      </if>
      <if test="deptid != null">
        deptId,
      </if>
      <if test="needpush != null">
        needPush,
      </if>
      <if test="state != null">
        state,
      </if>
      <if test="ctime != null">
        ctime,
      </if>
      <if test="utime != null">
        utime,
      </if>
      <if test="title != null">
        title,
      </if>
      <if test="ext != null">
        ext,
      </if>
      <if test="dtime != null">
        dtime,
      </if>
      <if test="body != null">
        body,
      </if>
      <if test="params != null">
        params,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="orginid != null">
        #{orginid,jdbcType=VARCHAR},
      </if>
      <if test="appid != null">
        #{appid,jdbcType=VARCHAR},
      </if>
      <if test="appname != null">
        #{appname,jdbcType=VARCHAR},
      </if>
      <if test="msgtype != null">
        #{msgtype,jdbcType=TINYINT},
      </if>
      <if test="userid != null">
        #{userid,jdbcType=VARCHAR},
      </if>
      <if test="usertype != null">
        #{usertype,jdbcType=TINYINT},
      </if>
      <if test="orgid != null">
        #{orgid,jdbcType=VARCHAR},
      </if>
      <if test="deptid != null">
        #{deptid,jdbcType=VARCHAR},
      </if>
      <if test="needpush != null">
        #{needpush,jdbcType=TINYINT},
      </if>
      <if test="state != null">
        #{state,jdbcType=TINYINT},
      </if>
      <if test="ctime != null">
        #{ctime,jdbcType=BIGINT},
      </if>
      <if test="utime != null">
        #{utime,jdbcType=BIGINT},
      </if>
      <if test="title != null">
        #{title,jdbcType=VARCHAR},
      </if>
      <if test="ext != null">
        #{ext,jdbcType=VARCHAR},
      </if>
      <if test="dtime != null">
        #{dtime,jdbcType=BIGINT},
      </if>
      <if test="body != null">
        #{body,jdbcType=LONGVARCHAR},
      </if>
      <if test="params != null">
        #{params,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.ruoyi.system.domain.md.NewmsgOutboxExample" resultType="java.lang.Long">
    select count(*) from md_newmsg_outbox
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update md_newmsg_outbox
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.orginid != null">
        orginId = #{record.orginid,jdbcType=VARCHAR},
      </if>
      <if test="record.appid != null">
        appId = #{record.appid,jdbcType=VARCHAR},
      </if>
      <if test="record.appname != null">
        appName = #{record.appname,jdbcType=VARCHAR},
      </if>
      <if test="record.msgtype != null">
        msgType = #{record.msgtype,jdbcType=TINYINT},
      </if>
      <if test="record.userid != null">
        userId = #{record.userid,jdbcType=VARCHAR},
      </if>
      <if test="record.usertype != null">
        userType = #{record.usertype,jdbcType=TINYINT},
      </if>
      <if test="record.orgid != null">
        orgId = #{record.orgid,jdbcType=VARCHAR},
      </if>
      <if test="record.deptid != null">
        deptId = #{record.deptid,jdbcType=VARCHAR},
      </if>
      <if test="record.needpush != null">
        needPush = #{record.needpush,jdbcType=TINYINT},
      </if>
      <if test="record.state != null">
        state = #{record.state,jdbcType=TINYINT},
      </if>
      <if test="record.ctime != null">
        ctime = #{record.ctime,jdbcType=BIGINT},
      </if>
      <if test="record.utime != null">
        utime = #{record.utime,jdbcType=BIGINT},
      </if>
      <if test="record.title != null">
        title = #{record.title,jdbcType=VARCHAR},
      </if>
      <if test="record.ext != null">
        ext = #{record.ext,jdbcType=VARCHAR},
      </if>
      <if test="record.dtime != null">
        dtime = #{record.dtime,jdbcType=BIGINT},
      </if>
      <if test="record.body != null">
        body = #{record.body,jdbcType=LONGVARCHAR},
      </if>
      <if test="record.params != null">
        params = #{record.params,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    update md_newmsg_outbox
    set id = #{record.id,jdbcType=VARCHAR},
      orginId = #{record.orginid,jdbcType=VARCHAR},
      appId = #{record.appid,jdbcType=VARCHAR},
      appName = #{record.appname,jdbcType=VARCHAR},
      msgType = #{record.msgtype,jdbcType=TINYINT},
      userId = #{record.userid,jdbcType=VARCHAR},
      userType = #{record.usertype,jdbcType=TINYINT},
      orgId = #{record.orgid,jdbcType=VARCHAR},
      deptId = #{record.deptid,jdbcType=VARCHAR},
      needPush = #{record.needpush,jdbcType=TINYINT},
      state = #{record.state,jdbcType=TINYINT},
      ctime = #{record.ctime,jdbcType=BIGINT},
      utime = #{record.utime,jdbcType=BIGINT},
      title = #{record.title,jdbcType=VARCHAR},
      ext = #{record.ext,jdbcType=VARCHAR},
      dtime = #{record.dtime,jdbcType=BIGINT},
      body = #{record.body,jdbcType=LONGVARCHAR},
      params = #{record.params,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update md_newmsg_outbox
    set id = #{record.id,jdbcType=VARCHAR},
      orginId = #{record.orginid,jdbcType=VARCHAR},
      appId = #{record.appid,jdbcType=VARCHAR},
      appName = #{record.appname,jdbcType=VARCHAR},
      msgType = #{record.msgtype,jdbcType=TINYINT},
      userId = #{record.userid,jdbcType=VARCHAR},
      userType = #{record.usertype,jdbcType=TINYINT},
      orgId = #{record.orgid,jdbcType=VARCHAR},
      deptId = #{record.deptid,jdbcType=VARCHAR},
      needPush = #{record.needpush,jdbcType=TINYINT},
      state = #{record.state,jdbcType=TINYINT},
      ctime = #{record.ctime,jdbcType=BIGINT},
      utime = #{record.utime,jdbcType=BIGINT},
      title = #{record.title,jdbcType=VARCHAR},
      ext = #{record.ext,jdbcType=VARCHAR},
      dtime = #{record.dtime,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.ruoyi.system.domain.md.NewmsgOutbox">
    update md_newmsg_outbox
    <set>
      <if test="orginid != null">
        orginId = #{orginid,jdbcType=VARCHAR},
      </if>
      <if test="appid != null">
        appId = #{appid,jdbcType=VARCHAR},
      </if>
      <if test="appname != null">
        appName = #{appname,jdbcType=VARCHAR},
      </if>
      <if test="msgtype != null">
        msgType = #{msgtype,jdbcType=TINYINT},
      </if>
      <if test="userid != null">
        userId = #{userid,jdbcType=VARCHAR},
      </if>
      <if test="usertype != null">
        userType = #{usertype,jdbcType=TINYINT},
      </if>
      <if test="orgid != null">
        orgId = #{orgid,jdbcType=VARCHAR},
      </if>
      <if test="deptid != null">
        deptId = #{deptid,jdbcType=VARCHAR},
      </if>
      <if test="needpush != null">
        needPush = #{needpush,jdbcType=TINYINT},
      </if>
      <if test="state != null">
        state = #{state,jdbcType=TINYINT},
      </if>
      <if test="ctime != null">
        ctime = #{ctime,jdbcType=BIGINT},
      </if>
      <if test="utime != null">
        utime = #{utime,jdbcType=BIGINT},
      </if>
      <if test="title != null">
        title = #{title,jdbcType=VARCHAR},
      </if>
      <if test="ext != null">
        ext = #{ext,jdbcType=VARCHAR},
      </if>
      <if test="dtime != null">
        dtime = #{dtime,jdbcType=BIGINT},
      </if>
      <if test="body != null">
        body = #{body,jdbcType=LONGVARCHAR},
      </if>
      <if test="params != null">
        params = #{params,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ruoyi.system.domain.md.NewmsgOutbox">
    update md_newmsg_outbox
    set orginId = #{orginid,jdbcType=VARCHAR},
      appId = #{appid,jdbcType=VARCHAR},
      appName = #{appname,jdbcType=VARCHAR},
      msgType = #{msgtype,jdbcType=TINYINT},
      userId = #{userid,jdbcType=VARCHAR},
      userType = #{usertype,jdbcType=TINYINT},
      orgId = #{orgid,jdbcType=VARCHAR},
      deptId = #{deptid,jdbcType=VARCHAR},
      needPush = #{needpush,jdbcType=TINYINT},
      state = #{state,jdbcType=TINYINT},
      ctime = #{ctime,jdbcType=BIGINT},
      utime = #{utime,jdbcType=BIGINT},
      title = #{title,jdbcType=VARCHAR},
      ext = #{ext,jdbcType=VARCHAR},
      dtime = #{dtime,jdbcType=BIGINT},
      body = #{body,jdbcType=LONGVARCHAR},
      params = #{params,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.ruoyi.system.domain.md.NewmsgOutbox">
    update md_newmsg_outbox
    set orginId = #{orginid,jdbcType=VARCHAR},
      appId = #{appid,jdbcType=VARCHAR},
      appName = #{appname,jdbcType=VARCHAR},
      msgType = #{msgtype,jdbcType=TINYINT},
      userId = #{userid,jdbcType=VARCHAR},
      userType = #{usertype,jdbcType=TINYINT},
      orgId = #{orgid,jdbcType=VARCHAR},
      deptId = #{deptid,jdbcType=VARCHAR},
      needPush = #{needpush,jdbcType=TINYINT},
      state = #{state,jdbcType=TINYINT},
      ctime = #{ctime,jdbcType=BIGINT},
      utime = #{utime,jdbcType=BIGINT},
      title = #{title,jdbcType=VARCHAR},
      ext = #{ext,jdbcType=VARCHAR},
      dtime = #{dtime,jdbcType=BIGINT}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>