|
|
@@ -16,24 +16,30 @@
|
|
|
<result column="CREATE_MAN_NO" jdbcType="VARCHAR" property="createManNo" />
|
|
|
<result column="CREATE_MAN_NAME" jdbcType="VARCHAR" property="createManName" />
|
|
|
<result column="CREATE_TIME" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="UPDATE_MAN_NO" jdbcType="VARCHAR" property="updateManNo" />
|
|
|
+ <result column="UPDATE_MAN_NAME" jdbcType="VARCHAR" property="updateManName" />
|
|
|
+ <result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ <result column="NOTE" jdbcType="VARCHAR" property="note" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME, CAR_NO, METER_WEIGHT, METER_NAME, METER_TIME,
|
|
|
- UP_WEIGHT, AVG_WEIGHT, METER_NUM, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME
|
|
|
+ UP_WEIGHT, AVG_WEIGHT, METER_NUM, VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME, CREATE_TIME,
|
|
|
+ UPDATE_MAN_NO, UPDATE_MAN_NAME, UPDATE_TIME, NOTE
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.DATA_NO, t.BASE_SPOT_NO, t.BASE_SPOT_NAME, t.CAR_NO, t.METER_WEIGHT, t.METER_NAME,
|
|
|
t.METER_TIME, t.UP_WEIGHT, t.AVG_WEIGHT, t.METER_NUM, t.VALUE_FLAG, t.CREATE_MAN_NO,
|
|
|
- t.CREATE_MAN_NAME, t.CREATE_TIME
|
|
|
+ t.CREATE_MAN_NAME, t.CREATE_TIME, t.UPDATE_MAN_NO, t.UPDATE_MAN_NAME, t.UPDATE_TIME,
|
|
|
+ t.NOTE
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
- SELECT <include refid="columns"/> FROM METER_BASE_HIS_TARE_DATA
|
|
|
+ SELECT <include refid="columns" /> FROM METER_BASE_HIS_TARE_DATA
|
|
|
</sql>
|
|
|
<sql id="select_alias">
|
|
|
- SELECT <include refid="columns_alias"/> FROM METER_BASE_HIS_TARE_DATA t
|
|
|
+ SELECT <include refid="columns_alias" /> FROM METER_BASE_HIS_TARE_DATA t
|
|
|
</sql>
|
|
|
<sql id="where">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="dataNo != null and dataNo != ''">
|
|
|
and DATA_NO = #{dataNo}
|
|
|
</if>
|
|
|
@@ -76,10 +82,22 @@
|
|
|
<if test="createTime != null">
|
|
|
and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
|
|
|
</if>
|
|
|
+ <if test="updateManNo != null and updateManNo != ''">
|
|
|
+ and UPDATE_MAN_NO = #{updateManNo}
|
|
|
+ </if>
|
|
|
+ <if test="updateManName != null and updateManName != ''">
|
|
|
+ and UPDATE_MAN_NAME = #{updateManName}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="note != null and note != ''">
|
|
|
+ and NOTE = #{note}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="dataNo != null and dataNo != ''">
|
|
|
and DATA_NO LIKE '%${dataNo}%'
|
|
|
</if>
|
|
|
@@ -122,6 +140,18 @@
|
|
|
<if test="createTime != null">
|
|
|
and TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = #{createTime}
|
|
|
</if>
|
|
|
+ <if test="updateManNo != null and updateManNo != ''">
|
|
|
+ and UPDATE_MAN_NO LIKE '%${updateManNo}%'
|
|
|
+ </if>
|
|
|
+ <if test="updateManName != null and updateManName != ''">
|
|
|
+ and UPDATE_MAN_NAME LIKE '%${updateManName}%'
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
+ </if>
|
|
|
+ <if test="note != null and note != ''">
|
|
|
+ and NOTE LIKE '%${note}%'
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
@@ -170,18 +200,34 @@
|
|
|
<if test="createTime != null">
|
|
|
or TO_CHAR(CREATE_TIME,'yyyy-MM-dd') = '#{createTime}'
|
|
|
</if>
|
|
|
+ <if test="updateManNo != null and updateManNo != ''">
|
|
|
+ or UPDATE_MAN_NO = #{updateManNo}
|
|
|
+ </if>
|
|
|
+ <if test="updateManName != null and updateManName != ''">
|
|
|
+ or UPDATE_MAN_NAME = #{updateManName}
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
|
|
|
+ </if>
|
|
|
+ <if test="note != null and note != ''">
|
|
|
+ or NOTE = #{note}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
|
|
|
insert into METER_BASE_HIS_TARE_DATA (DATA_NO, BASE_SPOT_NO, BASE_SPOT_NAME,
|
|
|
CAR_NO, METER_WEIGHT, METER_NAME,
|
|
|
METER_TIME, UP_WEIGHT, AVG_WEIGHT,
|
|
|
METER_NUM, VALUE_FLAG, CREATE_MAN_NO,
|
|
|
- CREATE_MAN_NAME, CREATE_TIME)
|
|
|
+ CREATE_MAN_NAME, CREATE_TIME, UPDATE_MAN_NO,
|
|
|
+ UPDATE_MAN_NAME, UPDATE_TIME, NOTE
|
|
|
+ )
|
|
|
values (#{dataNo,jdbcType=VARCHAR}, #{baseSpotNo,jdbcType=VARCHAR}, #{baseSpotName,jdbcType=VARCHAR},
|
|
|
#{carNo,jdbcType=VARCHAR}, #{meterWeight,jdbcType=DECIMAL}, #{meterName,jdbcType=VARCHAR},
|
|
|
#{meterTime,jdbcType=TIMESTAMP}, #{upWeight,jdbcType=DECIMAL}, #{avgWeight,jdbcType=DECIMAL},
|
|
|
#{meterNum,jdbcType=DECIMAL}, #{valueFlag,jdbcType=VARCHAR}, #{createManNo,jdbcType=VARCHAR},
|
|
|
- #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
|
|
|
+ #{createManName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateManNo,jdbcType=VARCHAR},
|
|
|
+ #{updateManName,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{note,jdbcType=VARCHAR}
|
|
|
+ )
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
|
|
|
insert into METER_BASE_HIS_TARE_DATA
|
|
|
@@ -228,6 +274,18 @@
|
|
|
<if test="createTime != null">
|
|
|
CREATE_TIME,
|
|
|
</if>
|
|
|
+ <if test="updateManNo != null">
|
|
|
+ UPDATE_MAN_NO,
|
|
|
+ </if>
|
|
|
+ <if test="updateManName != null">
|
|
|
+ UPDATE_MAN_NAME,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ UPDATE_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="note != null">
|
|
|
+ NOTE,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="dataNo != null">
|
|
|
@@ -272,6 +330,18 @@
|
|
|
<if test="createTime != null">
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="updateManNo != null">
|
|
|
+ #{updateManNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateManName != null">
|
|
|
+ #{updateManName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="note != null">
|
|
|
+ #{note,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
|
|
|
@@ -288,7 +358,11 @@
|
|
|
VALUE_FLAG = #{valueFlag,jdbcType=VARCHAR},
|
|
|
CREATE_MAN_NO = #{createManNo,jdbcType=VARCHAR},
|
|
|
CREATE_MAN_NAME = #{createManName,jdbcType=VARCHAR},
|
|
|
- CREATE_TIME = #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
|
|
|
+ UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ NOTE = #{note,jdbcType=VARCHAR}
|
|
|
where DATA_NO = #{dataNo,jdbcType=VARCHAR}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.baseinfo.meterbasehistaredata.model.MeterBaseHisTareData">
|
|
|
@@ -333,22 +407,32 @@
|
|
|
<if test="createTime != null">
|
|
|
CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="updateManNo != null">
|
|
|
+ UPDATE_MAN_NO = #{updateManNo,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateManName != null">
|
|
|
+ UPDATE_MAN_NAME = #{updateManName,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null">
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="note != null">
|
|
|
+ NOTE = #{note,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_HIS_TARE_DATA
|
|
|
@@ -357,7 +441,8 @@
|
|
|
METER_WEIGHT, METER_NAME, METER_TIME,
|
|
|
UP_WEIGHT, AVG_WEIGHT, METER_NUM,
|
|
|
VALUE_FLAG, CREATE_MAN_NO, CREATE_MAN_NAME,
|
|
|
- CREATE_TIME)
|
|
|
+ CREATE_TIME, UPDATE_MAN_NO, UPDATE_MAN_NAME,
|
|
|
+ UPDATE_TIME, NOTE)
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.dataNo,jdbcType=VARCHAR},
|
|
|
@@ -365,84 +450,101 @@
|
|
|
#{item.meterWeight,jdbcType=DECIMAL}, #{item.meterName,jdbcType=VARCHAR}, #{item.meterTime,jdbcType=TIMESTAMP},
|
|
|
#{item.upWeight,jdbcType=DECIMAL}, #{item.avgWeight,jdbcType=DECIMAL}, #{item.meterNum,jdbcType=DECIMAL},
|
|
|
#{item.valueFlag,jdbcType=VARCHAR}, #{item.createManNo,jdbcType=VARCHAR}, #{item.createManName,jdbcType=VARCHAR},
|
|
|
- #{item.createTime,jdbcType=TIMESTAMP} from dual
|
|
|
+ #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateManNo,jdbcType=VARCHAR}, #{item.updateManName,jdbcType=VARCHAR},
|
|
|
+ #{item.updateTime,jdbcType=TIMESTAMP}, #{item.note,jdbcType=VARCHAR} from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
|
update METER_BASE_HIS_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_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>
|
|
|
,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>
|
|
|
,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>
|
|
|
,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>
|
|
|
,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>
|
|
|
+ ,UPDATE_MAN_NO=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
+ when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManNo,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_MAN_NAME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
+ when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateManName,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,UPDATE_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
+ when #{item.dataNo,jdbcType=VARCHAR} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,NOTE=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DATA_NO" separator=" ">
|
|
|
+ when #{item.dataNo,jdbcType=VARCHAR} then #{item.note,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_HIS_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>
|
|
|
<!-- 友情提示!!!-->
|
|
|
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
|
<select id="getNewID" parameterType="java.lang.String" resultType="java.lang.String">
|
|
|
SELECT LPAD(NVL(MAX(TO_NUMBER(SUBSTR(DATA_NO, LENGTH(DATA_NO) - 3))),0) + 1,4,'0') DATA_NO
|
|
|
FROM METER_BASE_HIS_TARE_DATA where instr(DATA_NO,#{afl,jdbcType=VARCHAR})>0
|
|
|
</select>
|
|
|
+
|
|
|
</mapper>
|