TDashboarddayMapper.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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. *
  46. FROM
  47. (
  48. SELECT
  49. id,
  50. LOSS_PERCENTAGE AS loss_rate,
  51. ETHYLEN_PRODUCED AS product_putput,
  52. TOTAL_CRACKER_KGCE AS energy_consumption,
  53. REPORT_DATE,
  54. EXTRACT( DAY FROM REPORT_DATE ) AS date_day
  55. FROM
  56. t_daily_production_report
  57. ORDER BY
  58. REPORT_DATE DESC
  59. )
  60. WHERE
  61. 32 > ROWNUM
  62. ORDER BY REPORT_DATE ASC
  63. </select>
  64. <select id="selectTDashboarddayById" parameterType="Long" resultMap="TDashboarddayResult">
  65. <include refid="selectTDashboarddayVo"/>
  66. where id = #{id}
  67. </select>
  68. <insert id="insertTDashboardday" parameterType="TDashboardday">
  69. <selectKey keyProperty="id" resultType="long" order="BEFORE">
  70. SELECT seq_t_dashboardday.NEXTVAL as id FROM DUAL
  71. </selectKey>
  72. insert into t_dashboardday
  73. <trim prefix="(" suffix=")" suffixOverrides=",">
  74. <if test="id != null">id,</if>
  75. <if test="delFlag != null">del_flag,</if>
  76. <if test="createrCode != null">creater_code,</if>
  77. <if test="createdate != null">createdate,</if>
  78. <if test="updaterCode != null">updater_code,</if>
  79. <if test="updatedate != null">updatedate,</if>
  80. <if test="dailyYixi != null">daily_yixi,</if>
  81. <if test="dailyBingxi != null">daily_bingxi,</if>
  82. <if test="lossRate != null">loss_rate,</if>
  83. <if test="energyConsumption != null">energy_consumption,</if>
  84. <if test="productPutput != null">product_putput,</if>
  85. <if test="dataDate != null">data_date,</if>
  86. </trim>
  87. <trim prefix="values (" suffix=")" suffixOverrides=",">
  88. <if test="id != null">#{id},</if>
  89. <if test="delFlag != null">#{delFlag},</if>
  90. <if test="createrCode != null">#{createrCode},</if>
  91. <if test="createdate != null">#{createdate},</if>
  92. <if test="updaterCode != null">#{updaterCode},</if>
  93. <if test="updatedate != null">#{updatedate},</if>
  94. <if test="dailyYixi != null">#{dailyYixi},</if>
  95. <if test="dailyBingxi != null">#{dailyBingxi},</if>
  96. <if test="lossRate != null">#{lossRate},</if>
  97. <if test="energyConsumption != null">#{energyConsumption},</if>
  98. <if test="productPutput != null">#{productPutput},</if>
  99. <if test="dataDate != null">#{dataDate},</if>
  100. </trim>
  101. </insert>
  102. <update id="updateTDashboardday" parameterType="TDashboardday">
  103. update t_dashboardday
  104. <trim prefix="SET" suffixOverrides=",">
  105. <if test="delFlag != null">del_flag = #{delFlag},</if>
  106. <if test="createrCode != null">creater_code = #{createrCode},</if>
  107. <if test="createdate != null">createdate = #{createdate},</if>
  108. <if test="updaterCode != null">updater_code = #{updaterCode},</if>
  109. <if test="updatedate != null">updatedate = #{updatedate},</if>
  110. <if test="dailyYixi != null">daily_yixi = #{dailyYixi},</if>
  111. <if test="dailyBingxi != null">daily_bingxi = #{dailyBingxi},</if>
  112. <if test="lossRate != null">loss_rate = #{lossRate},</if>
  113. <if test="energyConsumption != null">energy_consumption = #{energyConsumption},</if>
  114. <if test="productPutput != null">product_putput = #{productPutput},</if>
  115. <if test="dataDate != null">data_date = #{dataDate},</if>
  116. </trim>
  117. where id = #{id}
  118. </update>
  119. <update id="deleteTDashboarddayById" parameterType="Long">
  120. update t_dashboardday set del_flag = 2 where id = #{id}
  121. </update>
  122. <update id="deleteTDashboarddayByIds" parameterType="String">
  123. update t_dashboardday set del_flag = 2 where id in
  124. <foreach item="id" collection="array" open="(" separator="," close=")">
  125. #{id}
  126. </foreach>
  127. </update>
  128. </mapper>