EqpVirtualParkRecordStatisticMapper.xml 11.6 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.zteits.park.mapper.EqpVirtualParkRecordStatisticMapper">
  <resultMap id="BaseResultMap" type="com.zteits.park.domain.EqpVirtualParkRecordStatistic">
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="statistic_date" jdbcType="DATE" property="statisticDate" />
    <result column="pl_no" jdbcType="VARCHAR" property="plNo" />
    <result column="pl_name" jdbcType="VARCHAR" property="plName" />
    <result column="eqp_num" jdbcType="INTEGER" property="eqpNum" />
    <result column="eqp_type" jdbcType="INTEGER" property="eqpType" />
    <result column="park_num" jdbcType="INTEGER" property="parkNum" />
    <result column="free_park_num" jdbcType="INTEGER" property="freeParkNum" />
    <result column="eqp_avg_income" jdbcType="INTEGER" property="eqpAvgIncome" />
    <result column="income" jdbcType="INTEGER" property="income" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
  </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, statistic_date, pl_no, pl_name, eqp_num, eqp_type, park_num, free_park_num, eqp_avg_income, 
    income, create_date
  </sql>
  <select id="selectByExample" parameterType="com.zteits.park.domain.EqpVirtualParkRecordStatisticExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from eqp_virtual_park_record_statistic
    <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 eqp_virtual_park_record_statistic
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    delete from eqp_virtual_park_record_statistic
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="com.zteits.park.domain.EqpVirtualParkRecordStatisticExample">
    delete from eqp_virtual_park_record_statistic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.zteits.park.domain.EqpVirtualParkRecordStatistic">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into eqp_virtual_park_record_statistic (statistic_date, pl_no, pl_name, 
      eqp_num, eqp_type, park_num, 
      free_park_num, eqp_avg_income, income, 
      create_date)
    values (#{statisticDate,jdbcType=DATE}, #{plNo,jdbcType=VARCHAR}, #{plName,jdbcType=VARCHAR}, 
      #{eqpNum,jdbcType=INTEGER}, #{eqpType,jdbcType=INTEGER}, #{parkNum,jdbcType=INTEGER}, 
      #{freeParkNum,jdbcType=INTEGER}, #{eqpAvgIncome,jdbcType=INTEGER}, #{income,jdbcType=INTEGER}, 
      #{createDate,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.zteits.park.domain.EqpVirtualParkRecordStatistic">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into eqp_virtual_park_record_statistic
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="statisticDate != null">
        statistic_date,
      </if>
      <if test="plNo != null">
        pl_no,
      </if>
      <if test="plName != null">
        pl_name,
      </if>
      <if test="eqpNum != null">
        eqp_num,
      </if>
      <if test="eqpType != null">
        eqp_type,
      </if>
      <if test="parkNum != null">
        park_num,
      </if>
      <if test="freeParkNum != null">
        free_park_num,
      </if>
      <if test="eqpAvgIncome != null">
        eqp_avg_income,
      </if>
      <if test="income != null">
        income,
      </if>
      <if test="createDate != null">
        create_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="statisticDate != null">
        #{statisticDate,jdbcType=DATE},
      </if>
      <if test="plNo != null">
        #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        #{plName,jdbcType=VARCHAR},
      </if>
      <if test="eqpNum != null">
        #{eqpNum,jdbcType=INTEGER},
      </if>
      <if test="eqpType != null">
        #{eqpType,jdbcType=INTEGER},
      </if>
      <if test="parkNum != null">
        #{parkNum,jdbcType=INTEGER},
      </if>
      <if test="freeParkNum != null">
        #{freeParkNum,jdbcType=INTEGER},
      </if>
      <if test="eqpAvgIncome != null">
        #{eqpAvgIncome,jdbcType=INTEGER},
      </if>
      <if test="income != null">
        #{income,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        #{createDate,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.zteits.park.domain.EqpVirtualParkRecordStatisticExample" resultType="java.lang.Long">
    select count(*) from eqp_virtual_park_record_statistic
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update eqp_virtual_park_record_statistic
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.statisticDate != null">
        statistic_date = #{record.statisticDate,jdbcType=DATE},
      </if>
      <if test="record.plNo != null">
        pl_no = #{record.plNo,jdbcType=VARCHAR},
      </if>
      <if test="record.plName != null">
        pl_name = #{record.plName,jdbcType=VARCHAR},
      </if>
      <if test="record.eqpNum != null">
        eqp_num = #{record.eqpNum,jdbcType=INTEGER},
      </if>
      <if test="record.eqpType != null">
        eqp_type = #{record.eqpType,jdbcType=INTEGER},
      </if>
      <if test="record.parkNum != null">
        park_num = #{record.parkNum,jdbcType=INTEGER},
      </if>
      <if test="record.freeParkNum != null">
        free_park_num = #{record.freeParkNum,jdbcType=INTEGER},
      </if>
      <if test="record.eqpAvgIncome != null">
        eqp_avg_income = #{record.eqpAvgIncome,jdbcType=INTEGER},
      </if>
      <if test="record.income != null">
        income = #{record.income,jdbcType=INTEGER},
      </if>
      <if test="record.createDate != null">
        create_date = #{record.createDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update eqp_virtual_park_record_statistic
    set id = #{record.id,jdbcType=BIGINT},
      statistic_date = #{record.statisticDate,jdbcType=DATE},
      pl_no = #{record.plNo,jdbcType=VARCHAR},
      pl_name = #{record.plName,jdbcType=VARCHAR},
      eqp_num = #{record.eqpNum,jdbcType=INTEGER},
      eqp_type = #{record.eqpType,jdbcType=INTEGER},
      park_num = #{record.parkNum,jdbcType=INTEGER},
      free_park_num = #{record.freeParkNum,jdbcType=INTEGER},
      eqp_avg_income = #{record.eqpAvgIncome,jdbcType=INTEGER},
      income = #{record.income,jdbcType=INTEGER},
      create_date = #{record.createDate,jdbcType=TIMESTAMP}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.zteits.park.domain.EqpVirtualParkRecordStatistic">
    update eqp_virtual_park_record_statistic
    <set>
      <if test="statisticDate != null">
        statistic_date = #{statisticDate,jdbcType=DATE},
      </if>
      <if test="plNo != null">
        pl_no = #{plNo,jdbcType=VARCHAR},
      </if>
      <if test="plName != null">
        pl_name = #{plName,jdbcType=VARCHAR},
      </if>
      <if test="eqpNum != null">
        eqp_num = #{eqpNum,jdbcType=INTEGER},
      </if>
      <if test="eqpType != null">
        eqp_type = #{eqpType,jdbcType=INTEGER},
      </if>
      <if test="parkNum != null">
        park_num = #{parkNum,jdbcType=INTEGER},
      </if>
      <if test="freeParkNum != null">
        free_park_num = #{freeParkNum,jdbcType=INTEGER},
      </if>
      <if test="eqpAvgIncome != null">
        eqp_avg_income = #{eqpAvgIncome,jdbcType=INTEGER},
      </if>
      <if test="income != null">
        income = #{income,jdbcType=INTEGER},
      </if>
      <if test="createDate != null">
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zteits.park.domain.EqpVirtualParkRecordStatistic">
    update eqp_virtual_park_record_statistic
    set statistic_date = #{statisticDate,jdbcType=DATE},
      pl_no = #{plNo,jdbcType=VARCHAR},
      pl_name = #{plName,jdbcType=VARCHAR},
      eqp_num = #{eqpNum,jdbcType=INTEGER},
      eqp_type = #{eqpType,jdbcType=INTEGER},
      park_num = #{parkNum,jdbcType=INTEGER},
      free_park_num = #{freeParkNum,jdbcType=INTEGER},
      eqp_avg_income = #{eqpAvgIncome,jdbcType=INTEGER},
      income = #{income,jdbcType=INTEGER},
      create_date = #{createDate,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>