<?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.chinaitop.depot.intelligent.grainsituation.mapper.TLqdataMapper" >
  <resultMap id="BaseResultMap" type="com.chinaitop.depot.intelligent.grainsituation.model.TLqdata" >
    <id column="id" property="id" jdbcType="VARCHAR" />
    <result column="v_cf_code" property="vCfCode" jdbcType="VARCHAR" />
    <result column="v_data_time" property="vDataTime" jdbcType="TIMESTAMP" />
    <result column="v_dec_data" property="vDecData" jdbcType="VARCHAR" />
    <result column="v_enc_data" property="vEncData" jdbcType="VARCHAR" />
    <result column="f_wd_out" property="fWdOut" jdbcType="DECIMAL" />
    <result column="f_sd_out" property="fSdOut" jdbcType="DECIMAL" />
    <result column="f_wd_in" property="fWdIn" jdbcType="DECIMAL" />
    <result column="f_sd_in" property="fSdIn" jdbcType="DECIMAL" />
    <result column="f_max" property="fMax" jdbcType="DECIMAL" />
    <result column="f_min" property="fMin" jdbcType="DECIMAL" />
    <result column="f_avg" property="fAvg" jdbcType="DECIMAL" />
    <result column="f_avg_zbc" property="fAvgZbc" jdbcType="DECIMAL" />
    <result column="f_avg_dnc" property="fAvgDnc" 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" >
    id, v_cf_code, v_data_time, v_dec_data, v_enc_data, f_wd_out, f_sd_out, f_wd_in, 
    f_sd_in, f_max, f_min, f_avg, f_avg_zbc, f_avg_dnc
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TLqdataExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    <include refid="Base_Column_List" />
    from t_lqdata
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null" >
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
    select 
    <include refid="Base_Column_List" />
    from t_lqdata
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
    delete from t_lqdata
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TLqdataExample" >
    delete from t_lqdata
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TLqdata" >
    insert into t_lqdata (id, v_cf_code, v_data_time, 
      v_dec_data, v_enc_data, f_wd_out, 
      f_sd_out, f_wd_in, f_sd_in, 
      f_max, f_min, f_avg, f_avg_zbc, 
      f_avg_dnc)
    values (#{id,jdbcType=VARCHAR}, #{vCfCode,jdbcType=VARCHAR}, #{vDataTime,jdbcType=TIMESTAMP}, 
      #{vDecData,jdbcType=VARCHAR}, #{vEncData,jdbcType=VARCHAR}, #{fWdOut,jdbcType=DECIMAL}, 
      #{fSdOut,jdbcType=DECIMAL}, #{fWdIn,jdbcType=DECIMAL}, #{fSdIn,jdbcType=DECIMAL}, 
      #{fMax,jdbcType=DECIMAL}, #{fMin,jdbcType=DECIMAL}, #{fAvg,jdbcType=DECIMAL}, #{fAvgZbc,jdbcType=DECIMAL}, 
      #{fAvgDnc,jdbcType=DECIMAL})
  </insert>
  <insert id="insertSelective" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TLqdata" >
    insert into t_lqdata
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="vCfCode != null" >
        v_cf_code,
      </if>
      <if test="vDataTime != null" >
        v_data_time,
      </if>
      <if test="vDecData != null" >
        v_dec_data,
      </if>
      <if test="vEncData != null" >
        v_enc_data,
      </if>
      <if test="fWdOut != null" >
        f_wd_out,
      </if>
      <if test="fSdOut != null" >
        f_sd_out,
      </if>
      <if test="fWdIn != null" >
        f_wd_in,
      </if>
      <if test="fSdIn != null" >
        f_sd_in,
      </if>
      <if test="fMax != null" >
        f_max,
      </if>
      <if test="fMin != null" >
        f_min,
      </if>
      <if test="fAvg != null" >
        f_avg,
      </if>
      <if test="fAvgZbc != null" >
        f_avg_zbc,
      </if>
      <if test="fAvgDnc != null" >
        f_avg_dnc,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="vCfCode != null" >
        #{vCfCode,jdbcType=VARCHAR},
      </if>
      <if test="vDataTime != null" >
        #{vDataTime,jdbcType=TIMESTAMP},
      </if>
      <if test="vDecData != null" >
        #{vDecData,jdbcType=VARCHAR},
      </if>
      <if test="vEncData != null" >
        #{vEncData,jdbcType=VARCHAR},
      </if>
      <if test="fWdOut != null" >
        #{fWdOut,jdbcType=DECIMAL},
      </if>
      <if test="fSdOut != null" >
        #{fSdOut,jdbcType=DECIMAL},
      </if>
      <if test="fWdIn != null" >
        #{fWdIn,jdbcType=DECIMAL},
      </if>
      <if test="fSdIn != null" >
        #{fSdIn,jdbcType=DECIMAL},
      </if>
      <if test="fMax != null" >
        #{fMax,jdbcType=DECIMAL},
      </if>
      <if test="fMin != null" >
        #{fMin,jdbcType=DECIMAL},
      </if>
      <if test="fAvg != null" >
        #{fAvg,jdbcType=DECIMAL},
      </if>
      <if test="fAvgZbc != null" >
        #{fAvgZbc,jdbcType=DECIMAL},
      </if>
      <if test="fAvgDnc != null" >
        #{fAvgDnc,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TLqdataExample" resultType="java.lang.Integer" >
    select count(*) from t_lqdata
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map" >
    update t_lqdata
    <set >
      <if test="record.id != null" >
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.vCfCode != null" >
        v_cf_code = #{record.vCfCode,jdbcType=VARCHAR},
      </if>
      <if test="record.vDataTime != null" >
        v_data_time = #{record.vDataTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.vDecData != null" >
        v_dec_data = #{record.vDecData,jdbcType=VARCHAR},
      </if>
      <if test="record.vEncData != null" >
        v_enc_data = #{record.vEncData,jdbcType=VARCHAR},
      </if>
      <if test="record.fWdOut != null" >
        f_wd_out = #{record.fWdOut,jdbcType=DECIMAL},
      </if>
      <if test="record.fSdOut != null" >
        f_sd_out = #{record.fSdOut,jdbcType=DECIMAL},
      </if>
      <if test="record.fWdIn != null" >
        f_wd_in = #{record.fWdIn,jdbcType=DECIMAL},
      </if>
      <if test="record.fSdIn != null" >
        f_sd_in = #{record.fSdIn,jdbcType=DECIMAL},
      </if>
      <if test="record.fMax != null" >
        f_max = #{record.fMax,jdbcType=DECIMAL},
      </if>
      <if test="record.fMin != null" >
        f_min = #{record.fMin,jdbcType=DECIMAL},
      </if>
      <if test="record.fAvg != null" >
        f_avg = #{record.fAvg,jdbcType=DECIMAL},
      </if>
      <if test="record.fAvgZbc != null" >
        f_avg_zbc = #{record.fAvgZbc,jdbcType=DECIMAL},
      </if>
      <if test="record.fAvgDnc != null" >
        f_avg_dnc = #{record.fAvgDnc,jdbcType=DECIMAL},
      </if>
    </set>
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map" >
    update t_lqdata
    set id = #{record.id,jdbcType=VARCHAR},
      v_cf_code = #{record.vCfCode,jdbcType=VARCHAR},
      v_data_time = #{record.vDataTime,jdbcType=TIMESTAMP},
      v_dec_data = #{record.vDecData,jdbcType=VARCHAR},
      v_enc_data = #{record.vEncData,jdbcType=VARCHAR},
      f_wd_out = #{record.fWdOut,jdbcType=DECIMAL},
      f_sd_out = #{record.fSdOut,jdbcType=DECIMAL},
      f_wd_in = #{record.fWdIn,jdbcType=DECIMAL},
      f_sd_in = #{record.fSdIn,jdbcType=DECIMAL},
      f_max = #{record.fMax,jdbcType=DECIMAL},
      f_min = #{record.fMin,jdbcType=DECIMAL},
      f_avg = #{record.fAvg,jdbcType=DECIMAL},
      f_avg_zbc = #{record.fAvgZbc,jdbcType=DECIMAL},
      f_avg_dnc = #{record.fAvgDnc,jdbcType=DECIMAL}
    <if test="_parameter != null" >
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TLqdata" >
    update t_lqdata
    <set >
      <if test="vCfCode != null" >
        v_cf_code = #{vCfCode,jdbcType=VARCHAR},
      </if>
      <if test="vDataTime != null" >
        v_data_time = #{vDataTime,jdbcType=TIMESTAMP},
      </if>
      <if test="vDecData != null" >
        v_dec_data = #{vDecData,jdbcType=VARCHAR},
      </if>
      <if test="vEncData != null" >
        v_enc_data = #{vEncData,jdbcType=VARCHAR},
      </if>
      <if test="fWdOut != null" >
        f_wd_out = #{fWdOut,jdbcType=DECIMAL},
      </if>
      <if test="fSdOut != null" >
        f_sd_out = #{fSdOut,jdbcType=DECIMAL},
      </if>
      <if test="fWdIn != null" >
        f_wd_in = #{fWdIn,jdbcType=DECIMAL},
      </if>
      <if test="fSdIn != null" >
        f_sd_in = #{fSdIn,jdbcType=DECIMAL},
      </if>
      <if test="fMax != null" >
        f_max = #{fMax,jdbcType=DECIMAL},
      </if>
      <if test="fMin != null" >
        f_min = #{fMin,jdbcType=DECIMAL},
      </if>
      <if test="fAvg != null" >
        f_avg = #{fAvg,jdbcType=DECIMAL},
      </if>
      <if test="fAvgZbc != null" >
        f_avg_zbc = #{fAvgZbc,jdbcType=DECIMAL},
      </if>
      <if test="fAvgDnc != null" >
        f_avg_dnc = #{fAvgDnc,jdbcType=DECIMAL},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.intelligent.grainsituation.model.TLqdata" >
    update t_lqdata
    set v_cf_code = #{vCfCode,jdbcType=VARCHAR},
      v_data_time = #{vDataTime,jdbcType=TIMESTAMP},
      v_dec_data = #{vDecData,jdbcType=VARCHAR},
      v_enc_data = #{vEncData,jdbcType=VARCHAR},
      f_wd_out = #{fWdOut,jdbcType=DECIMAL},
      f_sd_out = #{fSdOut,jdbcType=DECIMAL},
      f_wd_in = #{fWdIn,jdbcType=DECIMAL},
      f_sd_in = #{fSdIn,jdbcType=DECIMAL},
      f_max = #{fMax,jdbcType=DECIMAL},
      f_min = #{fMin,jdbcType=DECIMAL},
      f_avg = #{fAvg,jdbcType=DECIMAL},
      f_avg_zbc = #{fAvgZbc,jdbcType=DECIMAL},
      f_avg_dnc = #{fAvgDnc,jdbcType=DECIMAL}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>