|
|
@@ -22,7 +22,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectElectric" parameterType="DvMachineryData" resultType="java.util.HashMap">
|
|
|
- select min(parser_data) as min_data, max(parser_data) as max_data, max(parser_data)-min(parser_data) as parser_data from dv_machinery_data
|
|
|
+ select min(CAST(parser_data AS DECIMAL(10, 2))) as min_data
|
|
|
+ , max(CAST(parser_data AS DECIMAL(10, 2))) as max_data
|
|
|
+ , max(CAST(parser_data AS DECIMAL(10, 2)))-min(CAST(parser_data AS DECIMAL(10, 2))) as parser_data
|
|
|
+ from dv_machinery_data
|
|
|
<where>
|
|
|
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
|
|
|
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
|
|
|
@@ -37,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<select id="selectElectricByWeek" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
DATE(create_time) AS day,
|
|
|
- COALESCE(MAX(parser_data) - MIN(parser_data), 0) AS parser_data
|
|
|
+ COALESCE(MAX(CAST(parser_data AS DECIMAL(10, 2))) - MIN(CAST(parser_data AS DECIMAL(10, 2))), 0) AS parser_data
|
|
|
FROM
|
|
|
dv_machinery_data
|
|
|
WHERE
|
|
|
@@ -47,4 +50,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
ORDER BY
|
|
|
day ASC ;
|
|
|
</select>
|
|
|
-</mapper>
|
|
|
+</mapper>
|