TDashboarddayMapper.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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.project.aspen.mapper.TDashboarddayMapper">
  6. <resultMap type="TDashboardday" id="TDashboarddayResult">
  7. <result property="id" column="id" />
  8. <result property="delFlag" column="del_flag" />
  9. <result property="createrCode" column="creater_code" />
  10. <result property="createdate" column="createdate" />
  11. <result property="updaterCode" column="updater_code" />
  12. <result property="updatedate" column="updatedate" />
  13. <result property="dailyYixi" column="daily_yixi" />
  14. <result property="dailyBingxi" column="daily_bingxi" />
  15. <result property="lossRate" column="loss_rate" />
  16. <result property="energyConsumption" column="energy_consumption" />
  17. <result property="productPutput" column="product_putput" />
  18. <result property="dataDate" column="data_date" />
  19. <result property="dateDay" column="date_day" />
  20. </resultMap>
  21. <sql id="selectTDashboarddayVo">
  22. select id, del_flag, creater_code, createdate, updater_code, updatedate, daily_yixi, daily_bingxi, loss_rate, energy_consumption, product_putput, data_date, date_day from t_dashboardday
  23. </sql>
  24. <select id="selectTDashboarddayList" parameterType="TDashboardday" resultMap="TDashboarddayResult">
  25. <include refid="selectTDashboarddayVo"/>
  26. <where>
  27. <if test="createrCode != null and createrCode != ''"> and creater_code = #{createrCode}</if>
  28. <if test="createdate != null "> and createdate = #{createdate}</if>
  29. <if test="updaterCode != null and updaterCode != ''"> and updater_code = #{updaterCode}</if>
  30. <if test="updatedate != null "> and updatedate = #{updatedate}</if>
  31. <if test="dailyYixi != null and dailyYixi != ''"> and daily_yixi = #{dailyYixi}</if>
  32. <if test="dailyBingxi != null and dailyBingxi != ''"> and daily_bingxi = #{dailyBingxi}</if>
  33. <if test="lossRate != null and lossRate != ''"> and loss_rate = #{lossRate}</if>
  34. <if test="energyConsumption != null and energyConsumption != ''"> and energy_consumption = #{energyConsumption}</if>
  35. <if test="productPutput != null and productPutput != ''"> and product_putput = #{productPutput}</if>
  36. <if test="dataDate != null "> and data_date = #{dataDate}</if>
  37. and del_flag = 0
  38. </where>
  39. <!-- 数据范围过滤 -->
  40. ${params.dataScope}
  41. </select>
  42. <select id="selectLast" parameterType="TDashboardday" resultMap="TDashboarddayResult">
  43. select * from ( select * from t_dashboardday where del_flag = 0 order by id asc ) WHERE 32 > ROWNUM
  44. </select>
  45. <select id="selectTDashboarddayById" parameterType="Long" resultMap="TDashboarddayResult">
  46. <include refid="selectTDashboarddayVo"/>
  47. where id = #{id}
  48. </select>
  49. <insert id="insertTDashboardday" parameterType="TDashboardday">
  50. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  51. SELECT seq_t_dashboardday.NEXTVAL as id FROM DUAL
  52. </selectKey>
  53. insert into t_dashboardday
  54. <trim prefix="(" suffix=")" suffixOverrides=",">
  55. <if test="id != null">id,</if>
  56. <if test="delFlag != null">del_flag,</if>
  57. <if test="createrCode != null">creater_code,</if>
  58. <if test="createdate != null">createdate,</if>
  59. <if test="updaterCode != null">updater_code,</if>
  60. <if test="updatedate != null">updatedate,</if>
  61. <if test="dailyYixi != null">daily_yixi,</if>
  62. <if test="dailyBingxi != null">daily_bingxi,</if>
  63. <if test="lossRate != null">loss_rate,</if>
  64. <if test="energyConsumption != null">energy_consumption,</if>
  65. <if test="productPutput != null">product_putput,</if>
  66. <if test="dataDate != null">data_date,</if>
  67. </trim>
  68. <trim prefix="values (" suffix=")" suffixOverrides=",">
  69. <if test="id != null">#{id},</if>
  70. <if test="delFlag != null">#{delFlag},</if>
  71. <if test="createrCode != null">#{createrCode},</if>
  72. <if test="createdate != null">#{createdate},</if>
  73. <if test="updaterCode != null">#{updaterCode},</if>
  74. <if test="updatedate != null">#{updatedate},</if>
  75. <if test="dailyYixi != null">#{dailyYixi},</if>
  76. <if test="dailyBingxi != null">#{dailyBingxi},</if>
  77. <if test="lossRate != null">#{lossRate},</if>
  78. <if test="energyConsumption != null">#{energyConsumption},</if>
  79. <if test="productPutput != null">#{productPutput},</if>
  80. <if test="dataDate != null">#{dataDate},</if>
  81. </trim>
  82. </insert>
  83. <update id="updateTDashboardday" parameterType="TDashboardday">
  84. update t_dashboardday
  85. <trim prefix="SET" suffixOverrides=",">
  86. <if test="delFlag != null">del_flag = #{delFlag},</if>
  87. <if test="createrCode != null">creater_code = #{createrCode},</if>
  88. <if test="createdate != null">createdate = #{createdate},</if>
  89. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  90. <if test="updatedate != null">updatedate = #{updatedate},</if>
  91. <if test="dailyYixi != null">daily_yixi = #{dailyYixi},</if>
  92. <if test="dailyBingxi != null">daily_bingxi = #{dailyBingxi},</if>
  93. <if test="lossRate != null">loss_rate = #{lossRate},</if>
  94. <if test="energyConsumption != null">energy_consumption = #{energyConsumption},</if>
  95. <if test="productPutput != null">product_putput = #{productPutput},</if>
  96. <if test="dataDate != null">data_date = #{dataDate},</if>
  97. </trim>
  98. where id = #{id}
  99. </update>
  100. <update id="deleteTDashboarddayById" parameterType="Long">
  101. update t_dashboardday set del_flag = 2 where id = #{id}
  102. </update>
  103. <update id="deleteTDashboarddayByIds" parameterType="String">
  104. update t_dashboardday set del_flag = 2 where id in
  105. <foreach item="id" collection="array" open="(" separator="," close=")">
  106. #{id}
  107. </foreach>
  108. </update>
  109. </mapper>