WtgTheorypowerDataMapper.xml 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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.WtgTheorypowerDataMapper">
  6. <resultMap type="WtgTheorypowerData" id="WtgTheorypowerDataResult">
  7. <result property="wturNo" column="wtur_no" />
  8. <result property="dataTime" column="data_time" />
  9. <result property="theorypower" column="theorypower" />
  10. <result property="isLimit" column="is_limit" />
  11. <result property="wtgstate" column="wtgstate" />
  12. <result property="dataFlag" column="data_flag" />
  13. </resultMap>
  14. <sql id="selectWtgTheorypowerDataVo">
  15. select wtur_no, data_time, theorypower, is_limit, wtgstate, data_flag from wtg_theorypower_data
  16. </sql>
  17. <select id="selectWtgTheorypowerDataList" parameterType="WtgTheorypowerData" resultMap="WtgTheorypowerDataResult">
  18. <include refid="selectWtgTheorypowerDataVo"/>
  19. <where>
  20. <if test="wturNo != null ">and wtur_no = #{wturNo}</if>
  21. <if test="theorypower != null "> and theorypower = #{theorypower}</if>
  22. <if test="isLimit != null "> and is_limit = #{isLimit}</if>
  23. <if test="wtgstate != null "> and wtgstate = #{wtgstate}</if>
  24. <if test="dataFlag != null "> and data_flag = #{dataFlag}</if>
  25. <if test="params.beginDataTime != null and params.beginDataTime != '' and params.endDataTime != null and params.endDataTime != ''">
  26. and data_time between to_date(#{params.beginDataTime},'yyyy-MM-dd HH24:MI:SS') and
  27. to_date(#{params.endDataTime},'yyyy-MM-dd HH24:MI:SS')
  28. </if>
  29. <if test="dataTime != null ">and data_time = #{dataTime}</if>
  30. </where>
  31. </select>
  32. <select id="selectWtgTheorypowerDataById" parameterType="Long" resultMap="WtgTheorypowerDataResult">
  33. <include refid="selectWtgTheorypowerDataVo"/>
  34. where wtur_no = #{wturNo}
  35. </select>
  36. <insert id="insertWtgTheorypowerData" parameterType="WtgTheorypowerData">
  37. <selectKey keyProperty="wturNo" resultType="long" order="BEFORE">
  38. SELECT seq_wtg_theorypower_data.NEXTVAL as wturNo FROM DUAL
  39. </selectKey>
  40. insert into wtg_theorypower_data
  41. <trim prefix="(" suffix=")" suffixOverrides=",">
  42. <if test="wturNo != null">wtur_no,</if>
  43. <if test="dataTime != null">data_time,</if>
  44. <if test="theorypower != null">theorypower,</if>
  45. <if test="isLimit != null">is_limit,</if>
  46. <if test="wtgstate != null">wtgstate,</if>
  47. <if test="dataFlag != null">data_flag,</if>
  48. </trim>
  49. <trim prefix="values (" suffix=")" suffixOverrides=",">
  50. <if test="wturNo != null">#{wturNo},</if>
  51. <if test="dataTime != null">#{dataTime},</if>
  52. <if test="theorypower != null">#{theorypower},</if>
  53. <if test="isLimit != null">#{isLimit},</if>
  54. <if test="wtgstate != null">#{wtgstate},</if>
  55. <if test="dataFlag != null">#{dataFlag},</if>
  56. </trim>
  57. </insert>
  58. <update id="updateWtgTheorypowerData" parameterType="WtgTheorypowerData">
  59. update wtg_theorypower_data
  60. <trim prefix="SET" suffixOverrides=",">
  61. <if test="dataTime != null">data_time = #{dataTime},</if>
  62. <if test="theorypower != null">theorypower = #{theorypower},</if>
  63. <if test="isLimit != null">is_limit = #{isLimit},</if>
  64. <if test="wtgstate != null">wtgstate = #{wtgstate},</if>
  65. <if test="dataFlag != null">data_flag = #{dataFlag},</if>
  66. </trim>
  67. where wtur_no = #{wturNo}
  68. </update>
  69. <delete id="deleteWtgTheorypowerDataById" parameterType="Long">
  70. delete from wtg_theorypower_data where wtur_no = #{wturNo}
  71. </delete>
  72. <delete id="deleteWtgTheorypowerDataByIds" parameterType="String">
  73. delete from wtg_theorypower_data where wtur_no in
  74. <foreach item="wturNo" collection="array" open="(" separator="," close=")">
  75. #{wturNo}
  76. </foreach>
  77. </delete>
  78. </mapper>