MvPointMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.MvPointMapper">
  6. <resultMap type="MvPoint" id="MvPointResult">
  7. <result property="windplantNo" column="windplant_no"/>
  8. <result property="mvNo" column="mv_no"/>
  9. <result property="saveTime" column="save_time"/>
  10. <result property="statSaveTime1" column="stat_save_time1"/>
  11. <result property="statSaveTime2" column="stat_save_time2"/>
  12. <result property="statSaveTime3" column="stat_save_time3"/>
  13. <result property="dayStatSaveTime1" column="day_stat_save_time1"/>
  14. <result property="dayStatSaveTime2" column="day_stat_save_time2"/>
  15. <result property="dayStatSaveTime3" column="day_stat_save_time3"/>
  16. <result property="monthStatSaveTime1" column="month_stat_save_time1"/>
  17. <result property="monthStatSaveTime2" column="month_stat_save_time2"/>
  18. <result property="monthStatSaveTime3" column="month_stat_save_time3"/>
  19. <result property="period" column="period"/>
  20. </resultMap>
  21. <sql id="selectMvPointVo">
  22. select windplant_no, mv_no, save_time, stat_save_time1, stat_save_time2, stat_save_time3, day_stat_save_time1, day_stat_save_time2, day_stat_save_time3, month_stat_save_time1, month_stat_save_time2, month_stat_save_time3, period from mv_point
  23. </sql>
  24. <select id="selectMvPointList" parameterType="MvPoint" resultMap="MvPointResult">
  25. select
  26. mp.*,
  27. w.name as "windplantName",
  28. m.name as "mvName"
  29. from
  30. mv_point mp
  31. left join windplant w on w.windplant_no = mp.windplant_no
  32. left join mv m on m.mv_no = mp.mv_no
  33. <where>
  34. <if test="windplantNo != null ">and mp.windplant_no = #{windplantNo}</if>
  35. <if test="mvNo != null ">and mp.mv_no = #{mvNo}</if>
  36. <if test="saveTime != null ">and mp.save_time = #{saveTime}</if>
  37. <if test="statSaveTime1 != null ">and mp.stat_save_time1 = #{statSaveTime1}</if>
  38. <if test="statSaveTime2 != null ">and mp.stat_save_time2 = #{statSaveTime2}</if>
  39. <if test="statSaveTime3 != null ">and mp.stat_save_time3 = #{statSaveTime3}</if>
  40. <if test="dayStatSaveTime1 != null ">and mp.day_stat_save_time1 = #{dayStatSaveTime1}</if>
  41. <if test="dayStatSaveTime2 != null ">and mp.day_stat_save_time2 = #{dayStatSaveTime2}</if>
  42. <if test="dayStatSaveTime3 != null ">and mp.day_stat_save_time3 = #{dayStatSaveTime3}</if>
  43. <if test="monthStatSaveTime1 != null ">and mp.month_stat_save_time1 = #{monthStatSaveTime1}</if>
  44. <if test="monthStatSaveTime2 != null ">and mp.month_stat_save_time2 = #{monthStatSaveTime2}</if>
  45. <if test="monthStatSaveTime3 != null ">and mp.month_stat_save_time3 = #{monthStatSaveTime3}</if>
  46. <if test="period != null ">and mp.period = #{period}</if>
  47. <if test="mvName != null and mvName != ''">and m.name like concat(concat('%', #{mvName}), '%')</if>
  48. </where>
  49. order by mp.windplant_no asc
  50. </select>
  51. <select id="selectMvPointById" parameterType="Long" resultMap="MvPointResult">
  52. <include refid="selectMvPointVo"/>
  53. where windplant_no = #{windplantNo} and mv_no = #{mvNo}
  54. </select>
  55. </mapper>