|
@@ -17,12 +17,12 @@
|
|
|
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
|
|
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
<sql id="columns">
|
|
|
- ACTUAL_FIRST_NO, START_TIME, METER_START_TIME, METER_END_TIME, END_TIME, TOTAL_NUM,
|
|
|
|
|
|
|
+ ACTUAL_FIRST_NO, START_TIME, METER_START_TIME, METER_END_TIME, END_TIME, TOTAL_NUM,
|
|
|
UP_NUM, METER_NUM, DOWN_NUM, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME
|
|
UP_NUM, METER_NUM, DOWN_NUM, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME
|
|
|
</sql>
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
<sql id="columns_alias">
|
|
|
- t.ACTUAL_FIRST_NO, t.START_TIME, t.METER_START_TIME, t.METER_END_TIME, t.END_TIME,
|
|
|
|
|
- t.TOTAL_NUM, t.UP_NUM, t.METER_NUM, t.DOWN_NUM, t.VALUE_FLAG, t.CREATE_MAN_NO, t.CREATE_MAN_NAME,
|
|
|
|
|
|
|
+ t.ACTUAL_FIRST_NO, t.START_TIME, t.METER_START_TIME, t.METER_END_TIME, t.END_TIME,
|
|
|
|
|
+ t.TOTAL_NUM, t.UP_NUM, t.METER_NUM, t.DOWN_NUM, t.VALUE_FLAG, t.CREATE_MAN_NO, t.CREATE_MAN_NAME,
|
|
|
t.CREATE_TIME
|
|
t.CREATE_TIME
|
|
|
</sql>
|
|
</sql>
|
|
|
<sql id="select">
|
|
<sql id="select">
|
|
@@ -32,7 +32,7 @@
|
|
|
SELECT <include refid="columns_alias"/> FROM METER_WORK_CAR_METER_TIME t
|
|
SELECT <include refid="columns_alias"/> FROM METER_WORK_CAR_METER_TIME t
|
|
|
</sql>
|
|
</sql>
|
|
|
<sql id="where">
|
|
<sql id="where">
|
|
|
- <where>
|
|
|
|
|
|
|
+ <where>
|
|
|
<if test="actualFirstNo != null and actualFirstNo != ''">
|
|
<if test="actualFirstNo != null and actualFirstNo != ''">
|
|
|
and ACTUAL_FIRST_NO = #{actualFirstNo}
|
|
and ACTUAL_FIRST_NO = #{actualFirstNo}
|
|
|
</if>
|
|
</if>
|
|
@@ -75,7 +75,7 @@
|
|
|
</where>
|
|
</where>
|
|
|
</sql>
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
<sql id="whereLike">
|
|
|
- <where>
|
|
|
|
|
|
|
+ <where>
|
|
|
<if test="actualFirstNo != null and actualFirstNo != ''">
|
|
<if test="actualFirstNo != null and actualFirstNo != ''">
|
|
|
and ACTUAL_FIRST_NO LIKE '%${actualFirstNo}%'
|
|
and ACTUAL_FIRST_NO LIKE '%${actualFirstNo}%'
|
|
|
</if>
|
|
</if>
|
|
@@ -123,7 +123,7 @@
|
|
|
</delete>
|
|
</delete>
|
|
|
<delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
<delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
|
|
|
delete from METER_WORK_CAR_METER_TIME
|
|
delete from METER_WORK_CAR_METER_TIME
|
|
|
- where 1!=1
|
|
|
|
|
|
|
+ where 1!=1
|
|
|
<if test="startTime != null">
|
|
<if test="startTime != null">
|
|
|
or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
|
|
or TO_CHAR(START_TIME,'yyyy-MM-dd') = '#{startTime}'
|
|
|
</if>
|
|
</if>
|
|
@@ -162,15 +162,15 @@
|
|
|
</if>
|
|
</if>
|
|
|
</delete>
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.meterwork.meterworkcarmetertime.model.MeterWorkCarMeterTime">
|
|
<insert id="insert" parameterType="com.steerinfo.meterwork.meterworkcarmetertime.model.MeterWorkCarMeterTime">
|
|
|
- insert into METER_WORK_CAR_METER_TIME (ACTUAL_FIRST_NO, START_TIME, METER_START_TIME,
|
|
|
|
|
- METER_END_TIME, END_TIME, TOTAL_NUM,
|
|
|
|
|
- UP_NUM, METER_NUM, DOWN_NUM,
|
|
|
|
|
- VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
|
|
|
|
+ insert into METER_WORK_CAR_METER_TIME (ACTUAL_FIRST_NO, START_TIME, METER_START_TIME,
|
|
|
|
|
+ METER_END_TIME, END_TIME, TOTAL_NUM,
|
|
|
|
|
+ UP_NUM, METER_NUM, DOWN_NUM,
|
|
|
|
|
+ VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
CREATE_TIME)
|
|
CREATE_TIME)
|
|
|
- values (#{actualFirstNo,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{meterStartTime,jdbcType=TIMESTAMP},
|
|
|
|
|
- #{meterEndTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{totalNum,jdbcType=DECIMAL},
|
|
|
|
|
- #{upNum,jdbcType=DECIMAL}, #{meterNum,jdbcType=DECIMAL}, #{downNum,jdbcType=DECIMAL},
|
|
|
|
|
- #{valueFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR},
|
|
|
|
|
|
|
+ values (#{actualFirstNo,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{meterStartTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ #{meterEndTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{totalNum,jdbcType=DECIMAL},
|
|
|
|
|
+ #{upNum,jdbcType=DECIMAL}, #{meterNum,jdbcType=DECIMAL}, #{downNum,jdbcType=DECIMAL},
|
|
|
|
|
+ #{valueFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR},
|
|
|
#{createTime,jdbcType=TIMESTAMP})
|
|
#{createTime,jdbcType=TIMESTAMP})
|
|
|
</insert>
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkcarmetertime.model.MeterWorkCarMeterTime">
|
|
<insert id="insertSelective" parameterType="com.steerinfo.meterwork.meterworkcarmetertime.model.MeterWorkCarMeterTime">
|
|
@@ -329,21 +329,21 @@
|
|
|
<include refid="whereLike"/>
|
|
<include refid="whereLike"/>
|
|
|
</select>
|
|
</select>
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
- insert into METER_WORK_CAR_METER_TIME
|
|
|
|
|
- (ACTUAL_FIRST_NO,
|
|
|
|
|
- START_TIME, METER_START_TIME,
|
|
|
|
|
- METER_END_TIME, END_TIME, TOTAL_NUM,
|
|
|
|
|
- UP_NUM, METER_NUM, DOWN_NUM,
|
|
|
|
|
- VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
|
|
|
|
+ insert into METER_WORK_CAR_METER_TIME
|
|
|
|
|
+ (ACTUAL_FIRST_NO,
|
|
|
|
|
+ START_TIME, METER_START_TIME,
|
|
|
|
|
+ METER_END_TIME, END_TIME, TOTAL_NUM,
|
|
|
|
|
+ UP_NUM, METER_NUM, DOWN_NUM,
|
|
|
|
|
+ VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
CREATE_TIME)
|
|
CREATE_TIME)
|
|
|
- ( <foreach collection="list" item="item" separator="union all">
|
|
|
|
|
- select
|
|
|
|
|
- #{item.actualFirstNo,jdbcType=VARCHAR},
|
|
|
|
|
- #{item.startTime,jdbcType=TIMESTAMP}, #{item.meterStartTime,jdbcType=TIMESTAMP},
|
|
|
|
|
- #{item.meterEndTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.totalNum,jdbcType=DECIMAL},
|
|
|
|
|
- #{item.upNum,jdbcType=DECIMAL}, #{item.meterNum,jdbcType=DECIMAL}, #{item.downNum,jdbcType=DECIMAL},
|
|
|
|
|
- #{item.valueFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR},
|
|
|
|
|
- #{item.createTime,jdbcType=TIMESTAMP} from dual
|
|
|
|
|
|
|
+ ( <foreach collection="list" item="item" separator="union all">
|
|
|
|
|
+ select
|
|
|
|
|
+ #{item.actualFirstNo,jdbcType=VARCHAR},
|
|
|
|
|
+ #{item.startTime,jdbcType=TIMESTAMP}, #{item.meterStartTime,jdbcType=TIMESTAMP},
|
|
|
|
|
+ #{item.meterEndTime,jdbcType=TIMESTAMP}, #{item.endTime,jdbcType=TIMESTAMP}, #{item.totalNum,jdbcType=DECIMAL},
|
|
|
|
|
+ #{item.upNum,jdbcType=DECIMAL}, #{item.meterNum,jdbcType=DECIMAL}, #{item.downNum,jdbcType=DECIMAL},
|
|
|
|
|
+ #{item.valueFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR},
|
|
|
|
|
+ #{item.createTime,jdbcType=TIMESTAMP} from dual
|
|
|
</foreach> )
|
|
</foreach> )
|
|
|
</insert>
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -401,19 +401,37 @@
|
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_FIRST_NO" close="end">
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case ACTUAL_FIRST_NO" close="end">
|
|
|
when #{item.actualFirstNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
|
|
when #{item.actualFirstNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
- where ACTUAL_FIRST_NO in
|
|
|
|
|
|
|
+ where ACTUAL_FIRST_NO in
|
|
|
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
#{item.actualFirstNo,jdbcType=VARCHAR}
|
|
#{item.actualFirstNo,jdbcType=VARCHAR}
|
|
|
- </foreach>
|
|
|
|
|
|
|
+ </foreach>
|
|
|
</update>
|
|
</update>
|
|
|
<delete id="batchDelete" parameterType="java.util.List">
|
|
<delete id="batchDelete" parameterType="java.util.List">
|
|
|
delete from METER_WORK_CAR_METER_TIME
|
|
delete from METER_WORK_CAR_METER_TIME
|
|
|
- where ACTUAL_FIRST_NO in
|
|
|
|
|
|
|
+ where ACTUAL_FIRST_NO in
|
|
|
<foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
<foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
#{id}
|
|
#{id}
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</delete>
|
|
</delete>
|
|
|
<!-- 友情提示!!!-->
|
|
<!-- 友情提示!!!-->
|
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
-
|
|
|
|
|
-</mapper>
|
|
|
|
|
|
|
+ <select id="selectGroupByTime"
|
|
|
|
|
+ resultType="com.steerinfo.meterwork.meterworkcarmetertime.model.GroupTimeVo">
|
|
|
|
|
+ select
|
|
|
|
|
+ t1.BASE_SPOT_NO baseSpotNo,
|
|
|
|
|
+ t1.BASE_SPOT_NAME baseSpotName,
|
|
|
|
|
+ avg(t.TOTAL_NUM) avgTotal,
|
|
|
|
|
+ avg(t.UP_NUM) avgUp,
|
|
|
|
|
+ avg(t.METER_NUM) avgMeter,
|
|
|
|
|
+ avg(t.DOWN_NUM) avgDown
|
|
|
|
|
+ from METER_WORK_CAR_METER_TIME t
|
|
|
|
|
+ left join meter_work_car_actual_first t1
|
|
|
|
|
+ on t.actual_first_no =t1.actual_first_no
|
|
|
|
|
+ <where>
|
|
|
|
|
+ <if test="startTime != null and endTime != null and startTime != '' and endTime != ''">
|
|
|
|
|
+ and t.create_time >= TO_DATE(#{startTime}, 'yyyy-MM-dd HH24:mi:ss') and t.create_time <= TO_DATE(#{endTime}, 'yyyy-MM-dd HH24:mi:ss')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ </where>
|
|
|
|
|
+ group by t1.BASE_SPOT_NO,t1.BASE_SPOT_NAME
|
|
|
|
|
+ </select>
|
|
|
|
|
+</mapper>
|