<?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.dataVue.mapper.MockMapper">
    <resultMap id="Ltd" type="org.jeecg.modules.warning.entity.Ltd" >
    </resultMap>

    <select id="querySqlA" parameterType="String" resultType="java.util.Map">
        ${sqlStr}
    </select>
    <select id="queryCountA" parameterType="String" resultType="int">
        ${sqlStr}
    </select>

    <select id="queryOneBySql" parameterType="String" resultType="jtznyj.common.api.vo.AFocusWarn">
        ${sql}
    </select>

    <select id="selectList" parameterType="java.util.Map" 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="selectNotNullList" resultType="org.jeecg.modules.dataVue.entity.Ajh">
        select * from A_JH where JH IS NOT NULL
    </select>
    <select id="selectYData" parameterType="java.util.Map" resultMap="Ltd">
        select TIME from ${table} ORDER BY TIME
    </select>
    <select id="selectDate" parameterType="java.util.Map" resultMap="Ltd">
        select TIME from (select TIME from ${table} order by TIME desc) t where rownum=1
    </select>
    <select id="selectAllDate"  parameterType="java.util.Map" resultType="java.util.Map">
        select distinct SUBSTR(TIME, 1, 10) as TIME from ${table} order by TIME desc
    </select>
    <update id="updateAjhWarnByJh">
        update A_jh
        set WARNTIME = #{warnTime} , WARNCOUNT = #{count}
            where jh = #{jh,jdbcType=VARCHAR}
    </update>


</mapper>