<?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.weiqi.mis.mapper.WxSgPolluteSdsMapper" >
  <resultMap id="BaseResultMap" type="com.weiqi.mis.domain.WxSgPolluteSds" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="lambda" property="lambda" jdbcType="DOUBLE" />
    <result column="O2" property="o2" jdbcType="DOUBLE" />
    <result column="CO" property="co" jdbcType="DOUBLE" />
    <result column="CO2" property="co2" jdbcType="DOUBLE" />
    <result column="HC" property="hc" jdbcType="DOUBLE" />
    <result column="NO" property="no" jdbcType="DOUBLE" />
    <result column="category" property="category" jdbcType="INTEGER" />
    <result column="wx_order_id" property="wxOrderId" jdbcType="INTEGER" />
    <result column="del_flag" property="delFlag" jdbcType="INTEGER" />
    <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
  </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="Base_Column_List" >
    id, lambda, O2, CO, CO2, HC, NO, category, wx_order_id, del_flag, create_by, create_time, 
    update_by, update_time
  </sql>
  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.weiqi.mis.domain.WxSgPolluteSdsExample" >
    select
    <if test="distinct" >
      distinct
    </if>
    'true' as QUERYID,
    <include refid="Base_Column_List" />
    from wx_sg_pollute_sds
    <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.Integer" >
    select 
    <include refid="Base_Column_List" />
    from wx_sg_pollute_sds
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from wx_sg_pollute_sds
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.weiqi.mis.domain.WxSgPolluteSds" >
    insert into wx_sg_pollute_sds (id, lambda, O2, 
      CO, CO2, HC, NO, 
      category, wx_order_id, del_flag, 
      create_by, create_time, update_by, 
      update_time)
    values (#{id,jdbcType=INTEGER}, #{lambda,jdbcType=DOUBLE}, #{o2,jdbcType=DOUBLE}, 
      #{co,jdbcType=DOUBLE}, #{co2,jdbcType=DOUBLE}, #{hc,jdbcType=DOUBLE}, #{no,jdbcType=DOUBLE}, 
      #{category,jdbcType=INTEGER}, #{wxOrderId,jdbcType=INTEGER}, #{delFlag,jdbcType=INTEGER}, 
      #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, 
      #{updateTime,jdbcType=TIMESTAMP})
  </insert>
  <insert id="insertSelective" parameterType="com.weiqi.mis.domain.WxSgPolluteSds" >
    insert into wx_sg_pollute_sds
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="lambda != null" >
        lambda,
      </if>
      <if test="o2 != null" >
        O2,
      </if>
      <if test="co != null" >
        CO,
      </if>
      <if test="co2 != null" >
        CO2,
      </if>
      <if test="hc != null" >
        HC,
      </if>
      <if test="no != null" >
        NO,
      </if>
      <if test="category != null" >
        category,
      </if>
      <if test="wxOrderId != null" >
        wx_order_id,
      </if>
      <if test="delFlag != null" >
        del_flag,
      </if>
      <if test="createBy != null" >
        create_by,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
      <if test="updateBy != null" >
        update_by,
      </if>
      <if test="updateTime != null" >
        update_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="lambda != null" >
        #{lambda,jdbcType=DOUBLE},
      </if>
      <if test="o2 != null" >
        #{o2,jdbcType=DOUBLE},
      </if>
      <if test="co != null" >
        #{co,jdbcType=DOUBLE},
      </if>
      <if test="co2 != null" >
        #{co2,jdbcType=DOUBLE},
      </if>
      <if test="hc != null" >
        #{hc,jdbcType=DOUBLE},
      </if>
      <if test="no != null" >
        #{no,jdbcType=DOUBLE},
      </if>
      <if test="category != null" >
        #{category,jdbcType=INTEGER},
      </if>
      <if test="wxOrderId != null" >
        #{wxOrderId,jdbcType=INTEGER},
      </if>
      <if test="delFlag != null" >
        #{delFlag,jdbcType=INTEGER},
      </if>
      <if test="createBy != null" >
        #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null" >
        #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null" >
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="com.weiqi.mis.domain.WxSgPolluteSdsExample" resultType="java.lang.Integer" >
    select count(*) from wx_sg_pollute_sds
    <if test="_parameter != null" >
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByPrimaryKeySelective" parameterType="com.weiqi.mis.domain.WxSgPolluteSds" >
    update wx_sg_pollute_sds
    <set >
      <if test="lambda != null" >
        lambda = #{lambda,jdbcType=DOUBLE},
      </if>
      <if test="o2 != null" >
        O2 = #{o2,jdbcType=DOUBLE},
      </if>
      <if test="co != null" >
        CO = #{co,jdbcType=DOUBLE},
      </if>
      <if test="co2 != null" >
        CO2 = #{co2,jdbcType=DOUBLE},
      </if>
      <if test="hc != null" >
        HC = #{hc,jdbcType=DOUBLE},
      </if>
      <if test="no != null" >
        NO = #{no,jdbcType=DOUBLE},
      </if>
      <if test="category != null" >
        category = #{category,jdbcType=INTEGER},
      </if>
      <if test="wxOrderId != null" >
        wx_order_id = #{wxOrderId,jdbcType=INTEGER},
      </if>
      <if test="delFlag != null" >
        del_flag = #{delFlag,jdbcType=INTEGER},
      </if>
      <if test="createBy != null" >
        create_by = #{createBy,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateBy != null" >
        update_by = #{updateBy,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null" >
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.weiqi.mis.domain.WxSgPolluteSds" >
    update wx_sg_pollute_sds
    set lambda = #{lambda,jdbcType=DOUBLE},
      O2 = #{o2,jdbcType=DOUBLE},
      CO = #{co,jdbcType=DOUBLE},
      CO2 = #{co2,jdbcType=DOUBLE},
      HC = #{hc,jdbcType=DOUBLE},
      NO = #{no,jdbcType=DOUBLE},
      category = #{category,jdbcType=INTEGER},
      wx_order_id = #{wxOrderId,jdbcType=INTEGER},
      del_flag = #{delFlag,jdbcType=INTEGER},
      create_by = #{createBy,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_by = #{updateBy,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>