<?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.newWarning.mapper.DrillingConditionsLogMapper">
    <select id="selectList" resultType="org.jeecg.modules.newWarning.entity.DrillingConditionsLog">
        select * from DRILLING_CONDITIONS_LOG
        <where>
            <if test="timeStart != null and timeStart != ''">
                and TIME >= to_date(#{timeStart},'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="timeEnd != null and timeEnd !=''">
                and TIME &lt;= to_date(#{timeEnd},'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="jh != null and jh !=''">
                and JH = #{jh}
            </if>
        </where>
    </select>

    <select id="selectByTimeAndJh" resultType="org.jeecg.modules.newWarning.entity.DrillingConditionsLog">
        select
        *
        from drilling_conditions_log
        where
        TIME = to_date(#{time},'YYYY-MM-DD HH24:MI:SS')
        AND jh = #{jh} and rownum = 1
    </select>
</mapper>
