Przeglądaj źródła

LY 大屏 30天取值

ly 2 lat temu
rodzic
commit
6085b9ade2

+ 26 - 7
master/src/main/resources/mybatis/aspen/TDashboarddayMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.project.aspen.mapper.TDashboarddayMapper">
-    
+
     <resultMap type="TDashboardday" id="TDashboarddayResult">
         <result property="id"    column="id"    />
         <result property="delFlag"    column="del_flag"    />
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTDashboarddayList" parameterType="TDashboardday" resultMap="TDashboarddayResult">
         <include refid="selectTDashboarddayVo"/>
-        <where>  
+        <where>
             <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
             <if test="createdate != null "> and createdate = #{createdate}</if>
             <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
@@ -44,14 +44,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectLast" parameterType="TDashboardday" resultMap="TDashboarddayResult">
-        select * from ( select * from t_dashboardday where del_flag = 0 order by id asc ) WHERE 32 > ROWNUM
+--         select * from ( select * from t_dashboardday where del_flag = 0 order by id asc ) WHERE 32 > ROWNUM
+        SELECT
+            *
+        FROM
+            (
+                SELECT
+                    id,
+                    LOSS_PERCENTAGE AS loss_rate,
+                    ETHYLEN_PRODUCED AS product_putput,
+                    TOTAL_CRACKER_KGCE AS energy_consumption,
+                    REPORT_DATE,
+                    EXTRACT( DAY FROM REPORT_DATE ) AS date_day
+                FROM
+                    t_daily_production_report
+                ORDER BY
+                    REPORT_DATE DESC
+            )
+        WHERE
+            32 > ROWNUM
+        ORDER BY REPORT_DATE ASC
     </select>
-    
+
     <select id="selectTDashboarddayById" parameterType="Long" resultMap="TDashboarddayResult">
         <include refid="selectTDashboarddayVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertTDashboardday" parameterType="TDashboardday">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_dashboardday.NEXTVAL as id FROM DUAL
@@ -115,5 +134,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </update>
-    
-</mapper>
+
+</mapper>