TBaseSecondClassMapper.xml 9.35 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.server.web.common.mapper.TBaseSecondClassMapper">
  <resultMap id="BaseResultMap" type="com.server.web.common.model.TBaseSecondClass">
    <constructor>
      <idArg column="id" javaType="java.lang.Long" jdbcType="BIGINT" />
      <arg column="class_name" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="status" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="type" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="pic_url" javaType="java.lang.String" jdbcType="VARCHAR" />
      <arg column="first_id" javaType="java.lang.Long" jdbcType="BIGINT" />
      <arg column="weight" javaType="java.lang.Integer" jdbcType="INTEGER" />
      <arg column="create_dt" javaType="java.util.Date" jdbcType="TIMESTAMP" />
    </constructor>
  </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, class_name, status, type, pic_url, first_id, weight, create_dt
  </sql>
  <select id="selectByExample" parameterType="com.server.web.common.model.TBaseSecondClassExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_base_second_class
    <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.Long" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_base_second_class
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from t_base_second_class
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.server.web.common.model.TBaseSecondClassExample">
    delete from t_base_second_class
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseSecondClass" useGeneratedKeys="true">
    insert into t_base_second_class (class_name, status, type, 
      pic_url, first_id, weight, 
      create_dt)
    values (#{className,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, 
      #{picUrl,jdbcType=VARCHAR}, #{firstId,jdbcType=BIGINT}, #{weight,jdbcType=INTEGER}, 
      #{createDt,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.server.web.common.model.TBaseSecondClass" useGeneratedKeys="true">
    insert into t_base_second_class
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="className != null">
        class_name,
      </if>
      <if test="status != null">
        status,
      </if>
      <if test="type != null">
        type,
      </if>
      <if test="picUrl != null">
        pic_url,
      </if>
      <if test="firstId != null">
        first_id,
      </if>
      <if test="weight != null">
        weight,
      </if>
      <if test="createDt != null">
        create_dt,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="className != null">
        #{className,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=INTEGER},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="picUrl != null">
        #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="firstId != null">
        #{firstId,jdbcType=BIGINT},
      </if>
      <if test="weight != null">
        #{weight,jdbcType=INTEGER},
      </if>
      <if test="createDt != null">
        #{createDt,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.server.web.common.model.TBaseSecondClassExample" resultType="java.lang.Long">
    select count(*) from t_base_second_class
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update t_base_second_class
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.className != null">
        class_name = #{record.className,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        status = #{record.status,jdbcType=INTEGER},
      </if>
      <if test="record.type != null">
        type = #{record.type,jdbcType=INTEGER},
      </if>
      <if test="record.picUrl != null">
        pic_url = #{record.picUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.firstId != null">
        first_id = #{record.firstId,jdbcType=BIGINT},
      </if>
      <if test="record.weight != null">
        weight = #{record.weight,jdbcType=INTEGER},
      </if>
      <if test="record.createDt != null">
        create_dt = #{record.createDt,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update t_base_second_class
    set id = #{record.id,jdbcType=BIGINT},
      class_name = #{record.className,jdbcType=VARCHAR},
      status = #{record.status,jdbcType=INTEGER},
      type = #{record.type,jdbcType=INTEGER},
      pic_url = #{record.picUrl,jdbcType=VARCHAR},
      first_id = #{record.firstId,jdbcType=BIGINT},
      weight = #{record.weight,jdbcType=INTEGER},
      create_dt = #{record.createDt,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.server.web.common.model.TBaseSecondClass">
    update t_base_second_class
    <set>
      <if test="className != null">
        class_name = #{className,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        status = #{status,jdbcType=INTEGER},
      </if>
      <if test="type != null">
        type = #{type,jdbcType=INTEGER},
      </if>
      <if test="picUrl != null">
        pic_url = #{picUrl,jdbcType=VARCHAR},
      </if>
      <if test="firstId != null">
        first_id = #{firstId,jdbcType=BIGINT},
      </if>
      <if test="weight != null">
        weight = #{weight,jdbcType=INTEGER},
      </if>
      <if test="createDt != null">
        create_dt = #{createDt,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.server.web.common.model.TBaseSecondClass">
    update t_base_second_class
    set class_name = #{className,jdbcType=VARCHAR},
      status = #{status,jdbcType=INTEGER},
      type = #{type,jdbcType=INTEGER},
      pic_url = #{picUrl,jdbcType=VARCHAR},
      first_id = #{firstId,jdbcType=BIGINT},
      weight = #{weight,jdbcType=INTEGER},
      create_dt = #{createDt,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>