<?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.ext.ExtOutboxMapper">
  <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" />
  </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>


  <select id="selectByExampleWithBLOBsNoBody" parameterType="com.ruoyi.system.domain.md.NewmsgOutboxExample" resultMap="ResultMapWithBLOBs">
    select `id`,`orginId`,`appId`,`appName`,`msgType`,`userId`,`userType`,`orgId`,`deptId`,`needPush`,`state`,`ctime`,`utime`,`title`,null as `body`,`params`,`ext`
    from md_newmsg_outbox
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>