<?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.huatek.busi.mapper.PhotoThresholdMapper">
  <resultMap id="BaseResultMap" type="com.huatek.busi.vo.PhotoThresholdVo">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 09 11:06:29 CST 2019.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="site_id" jdbcType="VARCHAR" property="siteId" />
    <result column="main_tree_id" jdbcType="VARCHAR" property="mainTreeId" />
    <result column="sensor_code" jdbcType="VARCHAR" property="sensorCode" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="work_status" jdbcType="VARCHAR" property="workStatus" />
    <result column="threshold" jdbcType="VARCHAR" property="threshold" />
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime" />
    <result column="creator" jdbcType="VARCHAR" property="creator" />
    <result column="modified_time" jdbcType="TIMESTAMP" property="modifiedTime" />
    <result column="modifier_id" jdbcType="VARCHAR" property="modifierId" />
  </resultMap>
  <sql id="Base_Column_List">
    id, site_id, main_tree_id, sensor_code, type, work_status, threshold, created_time, 
    creator, modified_time, modifier_id
  </sql>
  <select id="queryPhotoThreshold" parameterType="java.lang.String" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from photo_threshold
    <where> 
	    <if test="sensorCode != null and sensorCode != ''">
	         sensor_code=#{sensorCode}
	    </if> 
	     <if test="workStatus != null and workStatus != ''">
	       and  work_status=#{workStatus}
	    </if> 
    </where>  
  </select>
</mapper>