<?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.devplatform.admin.modules.sys.dao.SysSystemParamsDao">
	<!-- Result Map -->
	<resultMap id="BaseResultMap" type="com.devplatform.admin.modules.sys.bean.SysSystemParams">
	    <result column="id" property="id"/>
	    <result column="type" property="type"/>
	    <result column="system_running_time" property="systemRunningTime"/>
	    <result column="sd_system_running_time" property="sdSystemRunningTime"/>
	    <result column="jn_system_running_time" property="jnSystemRunningTime"/>
	    <result column="sd_system_running_time_day" property="sdSystemRunningTimeDay"/>
	    <result column="jn_system_running_time_day" property="jnSystemRunningTimeDay"/>
	    <result column="sd_system_running_time_month" property="sdSystemRunningTimeMonth"/>
	    <result column="jn_system_running_time_month" property="jnSystemRunningTimeMonth"/>
	    <result column="update_user_id" property="updateUserId"/>
	    <result column="update_time" property="updateTime"/>
	    <result column="station_id" property="stationId"/>
	    <result column="sun" property="sun"/>
	    <result column="fan" property="fan"/>
	    <result column="nan" property="nan"/>
	    <result column="temperature" property="temperature"/>
	</resultMap>

	<!-- sys_system_params table all fields -->
	<sql id="Base_Column_List">
		id,type,system_running_time,sd_system_running_time,jn_system_running_time,sd_system_running_time_day,jn_system_running_time_day,
		sd_system_running_time_month,jn_system_running_time_month,update_user_id,update_time,station_id,sun,fan,nan,temperature
	</sql>

	<!-- 公共查询条件 -->
	<sql id="Example_Where_Clause">
		where t.deleted=0
		<if test="id!=null and id!=''">and t.id = #{id}</if>
		<if test="type!=null ">and t.type = #{type}</if>
		<if test="systemRunningTime!=null and systemRunningTime!=''">and t.system_running_time = #{systemRunningTime}</if>
		<if test="sdSystemRunningTime!=null and sdSystemRunningTime!=''">and t.sd_system_running_time = #{sdSystemRunningTime}</if>
		<if test="jnSystemRunningTime!=null and jnSystemRunningTime!=''">and t.jn_system_running_time = #{jnSystemRunningTime}</if>
		<if test="sdSystemRunningTimeDay!=null and sdSystemRunningTimeDay!=''">and t.sd_system_running_time_day = #{sdSystemRunningTimeDay}</if>
		<if test="jnSystemRunningTimeDay!=null and jnSystemRunningTimeDay!=''">and t.jn_system_running_time_day = #{jnSystemRunningTimeDay}</if>
		<if test="sdSystemRunningTimeMonth!=null and sdSystemRunningTimeMonth!=''">and t.sd_system_running_time_month = #{sdSystemRunningTimeMonth}</if>
		<if test="jnSystemRunningTimeMonth!=null and jnSystemRunningTimeMonth!=''">and t.jn_system_running_time_month = #{jnSystemRunningTimeMonth}</if>
		<if test="updateUserId!=null and updateUserId!=''">and t.update_user_id = #{updateUserId}</if>
		<if test="updateTime!=null ">and t.update_time = #{updateTime}</if>
		<if test="stationId!=null and stationId!=''">and t.station_id = #{stationId}</if>
		<if test="sun!=null ">and t.sun = #{sun}</if>
		<if test="fan!=null ">and t.fan = #{fan}</if>
		<if test="nan!=null ">and t.nan = #{nan}</if>
		<if test="temperature!=null and temperature!=''">and t.temperature = #{temperature}</if>
	</sql>

	<select id="queryPageByCount" parameterType="Object" resultType="java.lang.Integer">
	select count(1) from sys_system_params t
	<include refid="Example_Where_Clause"/>
	</select>

	<select id="queryPageList" parameterType="Object" resultMap="BaseResultMap">
	select t.* from sys_system_params t
	<include refid="Example_Where_Clause"/>
	<if test="pager.orderCondition != null and pager.orderCondition != ''">
		${pager.orderCondition}
	</if>
	<if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''">
		${pager.mysqlQueryCondition}
	</if>
	</select>

</mapper>


