WfYcHistoryData2Mapper.xml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.predict.mapper.WfYcHistoryData2Mapper">
  6. <resultMap type="WfYcHistoryData2" id="WfYcHistoryData2Result">
  7. <result property="analogNo" column="analog_no"/>
  8. <result property="dataTime" column="data_time"/>
  9. <result property="ycRawVal" column="yc_raw_val"/>
  10. <result property="ycVal" column="yc_val"/>
  11. <result property="dataFlag" column="data_flag"/>
  12. </resultMap>
  13. <sql id="selectWfYcHistoryData2Vo">
  14. select analog_no, data_time, yc_raw_val, yc_val, data_flag from wf_yc_history_data2
  15. </sql>
  16. <select id="selectWfYcHistoryData2List" parameterType="WfYcHistoryData2" resultMap="WfYcHistoryData2Result">
  17. <include refid="selectWfYcHistoryData2Vo"/>
  18. <where>
  19. <if test="analogNo != null ">and analog_no = #{analogNo}</if>
  20. <if test="ycRawVal != null ">and yc_raw_val = #{ycRawVal}</if>
  21. <if test="ycVal != null ">and yc_val = #{ycVal}</if>
  22. <if test="dataFlag != null ">and data_flag = #{dataFlag}</if>
  23. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  24. and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  25. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  26. </if>
  27. <if test="dataTime != null ">and data_time = #{dataTime}</if>
  28. <if test="condition != null ">and to_char(data_time,'yyyy-MM-dd HH24:MI:SS') LIKE '%00:00:00%'</if>
  29. </where>
  30. order by data_time asc
  31. </select>
  32. <select id="selectWfYcHistoryData2ById" parameterType="Long" resultMap="WfYcHistoryData2Result">
  33. <include refid="selectWfYcHistoryData2Vo"/>
  34. where analog_no = #{analogNo}
  35. </select>
  36. <select id="selectWfYcHistoryData2" parameterType="WfYcHistoryData2" resultMap="WfYcHistoryData2Result">
  37. <include refid="selectWfYcHistoryData2Vo"/>
  38. where analog_no = #{avgApYcNo} and data_time = #{dateTime}
  39. </select>
  40. </mapper>