<?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="org.jeecg.modules.warning.mapper.LtdMapper">

	<resultMap id="Ltd" type="org.jeecg.modules.warning.entity.Ltd" >
	</resultMap>

	<select id="selectList" parameterType="hashMap" resultMap="Ltd">
        select * from ${table}
        <where>
			<if test="timeStart != null and timeStart != ''">
				and TO_DATE(SUBSTR(TIME, 1, 19), 'yyyy-MM-dd HH24:mi:ss') &gt; to_date(#{timeStart},'yyyy-mm-dd hh24:mi:ss')
			</if>
			<if test="timeEnd != null and timeEnd !=''">
				and TO_DATE(SUBSTR(TIME, 1, 19), 'yyyy-MM-dd HH24:mi:ss') &lt;= to_date(#{timeEnd},'yyyy-mm-dd hh24:mi:ss')
			</if>
		</where>
		ORDER BY TIME
	</select>

	<select id="selectNewOne" parameterType="String" resultMap="Ltd">
		select * from ${table}
		where TIME = (SELECT MAX(TIME) FROM ${table})
	</select>

	<select id="selectYData" parameterType="hashMap" resultMap="Ltd">
		select TIME from ${table} ORDER BY TIME
	</select>
	<select id="selectDate" parameterType="hashMap" resultMap="Ltd">
		select TIME from (select TIME from ${table} order by TIME desc) t where rownum=1
	</select>
	<select id="selectAllDate" parameterType="hashMap" resultType="java.util.Map">
		select distinct SUBSTR(TIME, 1, 10) as TIME from ${table} order by TIME desc
	</select>

	<select id="selectNewTable" resultType="java.lang.String">
		select TABLE_NAME from WELL_NEW_TABLE
	</select>
</mapper>