|
|
@@ -19,25 +19,27 @@
|
|
|
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
<result column="METER_NUM" jdbcType="DECIMAL" property="meterNum" />
|
|
|
<result column="METER_WEIGHT" jdbcType="DECIMAL" property="meterWeight" />
|
|
|
+ <result column="SPOT_AREA_NO" jdbcType="VARCHAR" property="spotAreaNo" />
|
|
|
+ <result column="SPOT_AREA_NAME" jdbcType="VARCHAR" property="spotAreaName" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME, CAR_NO, METER_NAME, METER_TIME, START_TIME,
|
|
|
END_TIME, WARN_TIME, UP_WEIGHT, AVG_WEIGHT, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
- CREATE_TIME, METER_NUM, METER_WEIGHT
|
|
|
+ CREATE_TIME, METER_NUM, METER_WEIGHT, SPOT_AREA_NO, SPOT_AREA_NAME
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.DATA_NO, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.CAR_NO, t.METER_NAME, t.METER_TIME,
|
|
|
t.START_TIME, t.END_TIME, t.WARN_TIME, t.UP_WEIGHT, t.AVG_WEIGHT, t.VALUE_FLAG, t.CREATE_MAN_NO,
|
|
|
- t.CREATE_MAN_NAME, t.CREATE_TIME, t.METER_NUM, t.METER_WEIGHT
|
|
|
+ t.CREATE_MAN_NAME, t.CREATE_TIME, t.METER_NUM, t.METER_WEIGHT, t.SPOT_AREA_NO, t.SPOT_AREA_NAME
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
- SELECT <include refid="columns"/> FROM METER_BASE_TERM_TARE_DATA
|
|
|
+ SELECT <include refid="columns" /> FROM METER_BASE_TERM_TARE_DATA
|
|
|
</sql>
|
|
|
<sql id="select_alias">
|
|
|
- SELECT <include refid="columns_alias"/> FROM METER_BASE_TERM_TARE_DATA t
|
|
|
+ SELECT <include refid="columns_alias" /> FROM METER_BASE_TERM_TARE_DATA t
|
|
|
</sql>
|
|
|
<sql id="where">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="dataNo != null and dataNo != ''">
|
|
|
and DATA_NO = #{dataNo}
|
|
|
</if>
|
|
|
@@ -89,10 +91,16 @@
|
|
|
<if test="meterWeight != null">
|
|
|
and METER_WEIGHT = #{meterWeight}
|
|
|
</if>
|
|
|
+ <if test="spotAreaNo != null and spotAreaNo != ''">
|
|
|
+ and SPOT_AREA_NO = #{spotAreaNo}
|
|
|
+ </if>
|
|
|
+ <if test="spotAreaName != null and spotAreaName != ''">
|
|
|
+ and SPOT_AREA_NAME = #{spotAreaName}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="dataNo != null and dataNo != ''">
|
|
|
and DATA_NO LIKE '%${dataNo}%'
|
|
|
</if>
|
|
|
@@ -144,6 +152,12 @@
|
|
|
<if test="meterWeight != null">
|
|
|
and METER_WEIGHT = #{meterWeight}
|
|
|
</if>
|
|
|
+ <if test="spotAreaNo != null and spotAreaNo != ''">
|
|
|
+ and SPOT_AREA_NO LIKE '%${spotAreaNo}%'
|
|
|
+ </if>
|
|
|
+ <if test="spotAreaName != null and spotAreaName != ''">
|
|
|
+ and SPOT_AREA_NAME LIKE '%${spotAreaName}%'
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
@@ -201,6 +215,12 @@
|
|
|
<if test="meterWeight != null">
|
|
|
or METER_WEIGHT = #{meterWeight}
|
|
|
</if>
|
|
|
+ <if test="spotAreaNo != null and spotAreaNo != ''">
|
|
|
+ or SPOT_AREA_NO = #{spotAreaNo}
|
|
|
+ </if>
|
|
|
+ <if test="spotAreaName != null and spotAreaName != ''">
|
|
|
+ or SPOT_AREA_NAME = #{spotAreaName}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
|
|
|
insert into METER_BASE_TERM_TARE_DATA (DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME,
|
|
|
@@ -208,13 +228,15 @@
|
|
|
START_TIME, END_TIME, WARN_TIME,
|
|
|
UP_WEIGHT, AVG_WEIGHT, VALUE_FLAG,
|
|
|
CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
|
|
|
- METER_NUM, METER_WEIGHT)
|
|
|
+ METER_NUM, METER_WEIGHT, SPOT_AREA_NO,
|
|
|
+ SPOT_AREA_NAME)
|
|
|
values (#{dataNo,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR},
|
|
|
#{carNo,jdbcType=VARCHAR}, #{meterName,jdbcType=VARCHAR}, #{meterTime,jdbcType=TIMESTAMP},
|
|
|
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{warnTime,jdbcType=TIMESTAMP},
|
|
|
#{upWeight,jdbcType=DECIMAL}, #{avgWeight,jdbcType=DECIMAL}, #{valueFlag,jdbcType=VARCHAR},
|
|
|
#{createManNo,jdbcType=VARCHAR}, #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
|
|
- #{meterNum,jdbcType=DECIMAL}, #{meterWeight,jdbcType=DECIMAL})
|
|
|
+ #{meterNum,jdbcType=DECIMAL}, #{meterWeight,jdbcType=DECIMAL}, #{spotAreaNo,jdbcType=VARCHAR},
|
|
|
+ #{spotAreaName,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
|
|
|
insert into METER_BASE_TERM_TARE_DATA
|
|
|
@@ -270,6 +292,12 @@
|
|
|
<if test="meterWeight != null">
|
|
|
METER_WEIGHT,
|
|
|
</if>
|
|
|
+ <if test="spotAreaNo != null">
|
|
|
+ SPOT_AREA_NO,
|
|
|
+ </if>
|
|
|
+ <if test="spotAreaName != null">
|
|
|
+ SPOT_AREA_NAME,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="dataNo != null">
|
|
|
@@ -323,6 +351,12 @@
|
|
|
<if test="meterWeight != null">
|
|
|
#{meterWeight,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="spotAreaNo != null">
|
|
|
+ #{spotAreaNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="spotAreaName != null">
|
|
|
+ #{spotAreaName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
|
|
|
@@ -342,7 +376,9 @@
|
|
|
CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
|
|
|
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
|
|
|
METER_NUM = #{meterNum,jdbcType=DECIMAL},
|
|
|
- METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL}
|
|
|
+ METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL},
|
|
|
+ SPOT_AREA_NO = #{spotAreaNo,jdbcType=VARCHAR},
|
|
|
+ SPOT_AREA_NAME = #{spotAreaName,jdbcType=VARCHAR}
|
|
|
where DATA_NO = #{dataNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasetermtaredata.model.MeterBaseTermTareData">
|
|
|
@@ -396,22 +432,26 @@
|
|
|
<if test="meterWeight != null">
|
|
|
METER_WEIGHT = #{meterWeight,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="spotAreaNo != null">
|
|
|
+ SPOT_AREA_NO = #{spotAreaNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="spotAreaName != null">
|
|
|
+ SPOT_AREA_NAME = #{spotAreaName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where DATA_NO = #{dataNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
- <include refid="select"/>
|
|
|
+ <include refid="select" />
|
|
|
where DATA_NO = #{dataNo,jdbcType=VARCHAR}
|
|
|
</select>
|
|
|
<select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
- <include refid="select"/>
|
|
|
- <include refid="where"/>
|
|
|
- order by CREATE_TIME desc
|
|
|
+ <include refid="select" />
|
|
|
+ <include refid="where" />
|
|
|
</select>
|
|
|
<select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
- <include refid="select"/>
|
|
|
- <include refid="whereLike"/>
|
|
|
- order by CREATE_TIME desc
|
|
|
+ <include refid="select" />
|
|
|
+ <include refid="whereLike" />
|
|
|
</select>
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
insert into METER_BASE_TERM_TARE_DATA
|
|
|
@@ -421,7 +461,8 @@
|
|
|
END_TIME, WARN_TIME, UP_WEIGHT,
|
|
|
AVG_WEIGHT, VALUE_FLAG, CREATE_MAN_NO,
|
|
|
CREATE_MAN_NAME, CREATE_TIME,
|
|
|
- METER_NUM, METER_WEIGHT)
|
|
|
+ METER_NUM, METER_WEIGHT, SPOT_AREA_NO,
|
|
|
+ SPOT_AREA_NAME)
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.dataNo,jdbcType=VARCHAR},
|
|
|
@@ -430,89 +471,98 @@
|
|
|
#{item.endTime,jdbcType=TIMESTAMP}, #{item.warnTime,jdbcType=TIMESTAMP}, #{item.upWeight,jdbcType=DECIMAL},
|
|
|
#{item.avgWeight,jdbcType=DECIMAL}, #{item.valueFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR},
|
|
|
#{item.createManName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=TIMESTAMP},
|
|
|
- #{item.meterNum,jdbcType=DECIMAL}, #{item.meterWeight,jdbcType=DECIMAL} from dual
|
|
|
+ #{item.meterNum,jdbcType=DECIMAL}, #{item.meterWeight,jdbcType=DECIMAL}, #{item.spotAreaNo,jdbcType=VARCHAR},
|
|
|
+ #{item.spotAreaName,jdbcType=VARCHAR} from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
|
update METER_BASE_TERM_TARE_DATA
|
|
|
set
|
|
|
DATA_NO=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.dataNo,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,BASE_SPOT_NO=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.baseSpotNo,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,BASE_SPOT_NAME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.baseSpotName,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,CAR_NO=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.carNo,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,METER_NAME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterName,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,METER_TIME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterTime,jdbcType=TIMESTAMP}
|
|
|
</foreach>
|
|
|
,START_TIME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.startTime,jdbcType=TIMESTAMP}
|
|
|
</foreach>
|
|
|
,END_TIME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.endTime,jdbcType=TIMESTAMP}
|
|
|
</foreach>
|
|
|
,WARN_TIME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.warnTime,jdbcType=TIMESTAMP}
|
|
|
</foreach>
|
|
|
,UP_WEIGHT=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.upWeight,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
,AVG_WEIGHT=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.avgWeight,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
,VALUE_FLAG=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.valueFlag,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,CREATE_MAN_NO=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManNo,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,CREATE_MAN_NAME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.createManName,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
,CREATE_TIME=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.createTime,jdbcType=TIMESTAMP}
|
|
|
</foreach>
|
|
|
,METER_NUM=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterNum,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
,METER_WEIGHT=
|
|
|
- <foreach collection="list" item="item" index="index" separator=" " open="case DATA_NO" close="end">
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
when #{item.dataNo,jdbcType=VARCHAR} then #{item.meterWeight,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
+ ,SPOT_AREA_NO=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
+ when #{item.dataNo,jdbcType=VARCHAR} then #{item.spotAreaNo,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,SPOT_AREA_NAME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
+ when #{item.dataNo,jdbcType=VARCHAR} then #{item.spotAreaName,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
where DATA_NO in
|
|
|
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
|
+ <foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
#{item.dataNo,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
<delete id="batchDelete" parameterType="java.util.List">
|
|
|
delete from METER_BASE_TERM_TARE_DATA
|
|
|
where DATA_NO in
|
|
|
- <foreach collection="list" item="id" open="(" close=")" separator=",">
|
|
|
+ <foreach close=")" collection="list" item="id" open="(" separator=",">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
@@ -605,6 +655,12 @@
|
|
|
<select id="selectWhereCarNo" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
select * from METER_BASE_TERM_TARE_DATA
|
|
|
where CAR_NO = '${carNo}'
|
|
|
+ <if test="spotAreaNo != null and spotAreaNo != ''">
|
|
|
+ and SPOT_AREA_NO = #{spotAreaNo}
|
|
|
+ </if>
|
|
|
+ <if test="spotAreaName != null and spotAreaName != ''">
|
|
|
+ and SPOT_AREA_NAME = #{spotAreaName}
|
|
|
+ </if>
|
|
|
ORDER BY CREATE_TIME desc
|
|
|
</select>
|
|
|
|
|
|
@@ -619,12 +675,13 @@
|
|
|
<select id = "getTermTareData" parameterType="java.util.HashMap" resultMap="BaseResultMap">
|
|
|
<include refid="select" />
|
|
|
where 1 = 1
|
|
|
- <if test="carNo != null and carNo != ''">
|
|
|
- and car_No = #{carNo}
|
|
|
- </if>
|
|
|
- and rownum = 1
|
|
|
- and value_flag = '0'
|
|
|
- and end_time >= sysdate
|
|
|
+ <if test="carNo != null and carNo != ''">
|
|
|
+ and car_No = #{carNo}
|
|
|
+ </if>
|
|
|
+ and rownum = 1
|
|
|
+ and value_flag = '0'
|
|
|
+ and end_time >= sysdate
|
|
|
order by create_time desc
|
|
|
</select>
|
|
|
+
|
|
|
</mapper>
|