PvUspPfParaMapper.xml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.PvUspPfParaMapper">
  6. <resultMap type="PvUspPfPara" id="PvUspPfParaResult">
  7. <result property="pvNo" column="pv_no"/>
  8. <result property="modelNo" column="model_no"/>
  9. <result property="pfProcTime" column="pf_proc_time"/>
  10. <result property="pfDayProcTime" column="pf_day_proc_time"/>
  11. <result property="pfMonthProcTime" column="pf_month_proc_time"/>
  12. <result property="pfType" column="pf_type"/>
  13. <result property="para" column="para"/>
  14. <result property="mem" column="mem"/>
  15. <result property="ifModelValid" column="if_model_valid"/>
  16. </resultMap>
  17. <sql id="selectPvUspPfParaVo">
  18. select pv_no, model_no, pf_proc_time, pf_day_proc_time, pf_month_proc_time, pf_type, para, mem, if_model_valid from pv_usp_pf_para
  19. </sql>
  20. <select id="selectPvUspPfParaList" parameterType="PvUspPfPara" resultMap="PvUspPfParaResult">
  21. select
  22. pupp.*,
  23. pps.name as "pvName",
  24. wmi.item_name as "itemName"
  25. from
  26. pv_usp_pf_para pupp
  27. left join pv_power_station pps on pps.pv_station_no = pupp.pv_no
  28. left join enum_menu_item wmi on wmi.item_no = pupp.model_no and wmi.menu_no = 123
  29. <where>
  30. <if test="pvNo != null ">and pupp.pv_no = #{pvNo}</if>
  31. <if test="modelNo != null ">and pupp.model_no = #{modelNo}</if>
  32. <if test="pfProcTime != null ">and pupp.pf_proc_time = #{pfProcTime}</if>
  33. <if test="pfDayProcTime != null ">and pupp.pf_day_proc_time = #{pfDayProcTime}</if>
  34. <if test="pfMonthProcTime != null ">and pupp.pf_month_proc_time = #{pfMonthProcTime}</if>
  35. <if test="pfType != null ">and pupp.pf_type = #{pfType}</if>
  36. <if test="para != null and para != ''">and pupp.para = #{para}</if>
  37. <if test="mem != null and mem != ''">and pupp.mem = #{mem}</if>
  38. <if test="ifModelValid != null ">and pupp.if_model_valid = #{ifModelValid}</if>
  39. </where>
  40. order by pupp.pv_no asc
  41. </select>
  42. <select id="selectPvUspPfParaById" parameterType="Long" resultMap="PvUspPfParaResult">
  43. <include refid="selectPvUspPfParaVo"/>
  44. where pv_no = #{pvNo} and model_no = #{modelNo}
  45. </select>
  46. <insert id="insertPvUspPfPara" parameterType="PvUspPfPara">
  47. insert into pv_usp_pf_para
  48. <trim prefix="(" suffix=")" suffixOverrides=",">
  49. <if test="pvNo != null">pv_no,</if>
  50. <if test="modelNo != null">model_no,</if>
  51. <if test="pfProcTime != null">pf_proc_time,</if>
  52. <if test="pfDayProcTime != null">pf_day_proc_time,</if>
  53. <if test="pfMonthProcTime != null">pf_month_proc_time,</if>
  54. <if test="pfType != null">pf_type,</if>
  55. <if test="para != null">para,</if>
  56. <if test="mem != null">mem,</if>
  57. <if test="ifModelValid != null">if_model_valid,</if>
  58. </trim>
  59. <trim prefix="values (" suffix=")" suffixOverrides=",">
  60. <if test="pvNo != null">#{pvNo},</if>
  61. <if test="modelNo != null">#{modelNo},</if>
  62. <if test="pfProcTime != null">#{pfProcTime},</if>
  63. <if test="pfDayProcTime != null">#{pfDayProcTime},</if>
  64. <if test="pfMonthProcTime != null">#{pfMonthProcTime},</if>
  65. <if test="pfType != null">#{pfType},</if>
  66. <if test="para != null">#{para},</if>
  67. <if test="mem != null">#{mem},</if>
  68. <if test="ifModelValid != null">#{ifModelValid},</if>
  69. </trim>
  70. </insert>
  71. <update id="updatePvUspPfPara" parameterType="PvUspPfPara">
  72. update pv_usp_pf_para
  73. <trim prefix="SET" suffixOverrides=",">
  74. <if test="pfProcTime != null">pf_proc_time = #{pfProcTime},</if>
  75. <if test="pfDayProcTime != null">pf_day_proc_time = #{pfDayProcTime},</if>
  76. <if test="pfMonthProcTime != null">pf_month_proc_time = #{pfMonthProcTime},</if>
  77. <if test="pfType != null">pf_type = #{pfType},</if>
  78. <if test="para != null">para = #{para},</if>
  79. <if test="mem != null">mem = #{mem},</if>
  80. <if test="ifModelValid != null">if_model_valid = #{ifModelValid},</if>
  81. </trim>
  82. where pv_no = #{pvNo} and model_no = #{modelNo}
  83. </update>
  84. <delete id="deletePvUspPfParaById" parameterType="Long">
  85. delete from pv_usp_pf_para where pv_no = #{pvNo} and model_no = #{modelNo}
  86. </delete>
  87. </mapper>