TOlapXmlnodeMapper.xml 6.9 KB
<?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.tianbo.mapper.TOlapXmlnodeMapper" >
  <resultMap id="BaseResultMap" type="com.tianbo.model.TOlapXmlnode" >
    <id column="NODEID" property="nodeid" jdbcType="DECIMAL" />
    <result column="DOCID" property="docid" jdbcType="DECIMAL" />
    <result column="COLUMNID" property="columnid" jdbcType="DECIMAL" />
  </resultMap>
  <sql id="Example_Where_Clause" >
    <where >
      <foreach collection="oredCriteria" item="criteria" separator="or" >
        <if test="criteria.valid" >
          <trim prefix="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" 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="(" suffix=")" prefixOverrides="and" >
            <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 collection="criterion.value" item="listItem" open="(" close=")" separator="," >
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List" >
    NODEID, DOCID, COLUMNID
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.tianbo.model.TOlapXmlnodeExample" >
    <include refid="OracleDialectPrefix" />
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from T_OLAP_XMLNODE
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
    <include refid="OracleDialectSuffix" />
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.math.BigDecimal" >
    select 
    <include refid="Base_Column_List" />
    from T_OLAP_XMLNODE
    where NODEID = #{nodeid,jdbcType=DECIMAL}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal" >
    delete from T_OLAP_XMLNODE
    where NODEID = #{nodeid,jdbcType=DECIMAL}
  </delete>
  <delete id="deleteByExample" parameterType="com.tianbo.model.TOlapXmlnodeExample" >
    delete from T_OLAP_XMLNODE
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.tianbo.model.TOlapXmlnode" >
    insert into T_OLAP_XMLNODE (NODEID, DOCID, COLUMNID
      )
    values (#{nodeid,jdbcType=DECIMAL}, #{docid,jdbcType=DECIMAL}, #{columnid,jdbcType=DECIMAL}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.tianbo.model.TOlapXmlnode" >
    insert into T_OLAP_XMLNODE
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="nodeid != null" >
        NODEID,
      </if>
      <if test="docid != null" >
        DOCID,
      </if>
      <if test="columnid != null" >
        COLUMNID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="nodeid != null" >
        #{nodeid,jdbcType=DECIMAL},
      </if>
      <if test="docid != null" >
        #{docid,jdbcType=DECIMAL},
      </if>
      <if test="columnid != null" >
        #{columnid,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.tianbo.model.TOlapXmlnodeExample" resultType="java.lang.Integer" >
    select count(*) from T_OLAP_XMLNODE
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update T_OLAP_XMLNODE
    <set >
      <if test="record.nodeid != null" >
        NODEID = #{record.nodeid,jdbcType=DECIMAL},
      </if>
      <if test="record.docid != null" >
        DOCID = #{record.docid,jdbcType=DECIMAL},
      </if>
      <if test="record.columnid != null" >
        COLUMNID = #{record.columnid,jdbcType=DECIMAL},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update T_OLAP_XMLNODE
    set NODEID = #{record.nodeid,jdbcType=DECIMAL},
      DOCID = #{record.docid,jdbcType=DECIMAL},
      COLUMNID = #{record.columnid,jdbcType=DECIMAL}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.tianbo.model.TOlapXmlnode" >
    update T_OLAP_XMLNODE
    <set >
      <if test="docid != null" >
        DOCID = #{docid,jdbcType=DECIMAL},
      </if>
      <if test="columnid != null" >
        COLUMNID = #{columnid,jdbcType=DECIMAL},
      </if>
    </set>
    where NODEID = #{nodeid,jdbcType=DECIMAL}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.tianbo.model.TOlapXmlnode" >
    update T_OLAP_XMLNODE
    set DOCID = #{docid,jdbcType=DECIMAL},
      COLUMNID = #{columnid,jdbcType=DECIMAL}
    where NODEID = #{nodeid,jdbcType=DECIMAL}
  </update>
  <sql id="OracleDialectPrefix" >
    <if test="page != null" >
      select * from ( select row_.*, rownum rownum_ from ( 
    </if>
  </sql>
  <sql id="OracleDialectSuffix" >
    <if test="page != null" >
      <![CDATA[ ) row_ ) where rownum_ > #{page.begin} and rownum_ <= #{page.end} ]]>
    </if>
  </sql>
</mapper>