|
@@ -16,16 +16,20 @@
|
|
|
<result column="OUTBOUNT_ID" jdbcType="DECIMAL" property="outbountId" />
|
|
|
<result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername" />
|
|
|
<result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime" />
|
|
|
+ <result column="INSERT_USERNAME" jdbcType="VARCHAR" property="insertUsername" />
|
|
|
+ <result column="INSERT_TIME" jdbcType="TIMESTAMP" property="insertTime" />
|
|
|
+ <result column="DELETED" jdbcType="DECIMAL" property="deleted" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE, MATERIAL_NAME, SEND_STATION,
|
|
|
ARRIVAL_STATION, SUPPLIER_NAME, SEND_DATE, MAKE_DATE, MINERAL, PURCHASE_ORDER_NO,
|
|
|
- OUTBOUNT_ID, UPDATE_USERNAME, UPDATE_TIME
|
|
|
+ OUTBOUNT_ID, UPDATE_USERNAME, UPDATE_TIME, INSERT_USERNAME, INSERT_TIME, DELETED
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.RESULT_ID, t.RESULT_WAGON_NO, t.RESULT_BILLABLE_TONNAGE, t.MATERIAL_NAME, t.SEND_STATION,
|
|
|
t.ARRIVAL_STATION, t.SUPPLIER_NAME, t.SEND_DATE, t.MAKE_DATE, t.MINERAL, t.PURCHASE_ORDER_NO,
|
|
|
- t.OUTBOUNT_ID, t.UPDATE_USERNAME, t.UPDATE_TIME
|
|
|
+ t.OUTBOUNT_ID, t.UPDATE_USERNAME, t.UPDATE_TIME, t.INSERT_USERNAME, t.INSERT_TIME,
|
|
|
+ t.DELETED
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
SELECT <include refid="columns" /> FROM TMSTRAIN_LOADING_TEMP
|
|
@@ -77,6 +81,15 @@
|
|
|
<if test="updateTime != null">
|
|
|
and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
</if>
|
|
|
+ <if test="insertUsername != null and insertUsername != ''">
|
|
|
+ and INSERT_USERNAME = #{insertUsername}
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">
|
|
|
+ and DELETED = #{deleted}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
@@ -123,6 +136,15 @@
|
|
|
<if test="updateTime != null">
|
|
|
and TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = #{updateTime}
|
|
|
</if>
|
|
|
+ <if test="insertUsername != null and insertUsername != ''">
|
|
|
+ and INSERT_USERNAME LIKE '%${insertUsername}%'
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ and TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = #{insertTime}
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">
|
|
|
+ and DELETED = #{deleted}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Short">
|
|
@@ -171,18 +193,29 @@
|
|
|
<if test="updateTime != null">
|
|
|
or TO_CHAR(UPDATE_TIME,'yyyy-MM-dd') = '#{updateTime}'
|
|
|
</if>
|
|
|
+ <if test="insertUsername != null and insertUsername != ''">
|
|
|
+ or INSERT_USERNAME = #{insertUsername}
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ or TO_CHAR(INSERT_TIME,'yyyy-MM-dd') = '#{insertTime}'
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">
|
|
|
+ or DELETED = #{deleted}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
|
|
|
insert into TMSTRAIN_LOADING_TEMP (RESULT_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE,
|
|
|
MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION,
|
|
|
SUPPLIER_NAME, SEND_DATE, MAKE_DATE,
|
|
|
MINERAL, PURCHASE_ORDER_NO, OUTBOUNT_ID,
|
|
|
- UPDATE_USERNAME, UPDATE_TIME)
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME, INSERT_USERNAME,
|
|
|
+ INSERT_TIME, DELETED)
|
|
|
values (#{resultId,jdbcType=DECIMAL}, #{resultWagonNo,jdbcType=VARCHAR}, #{resultBillableTonnage,jdbcType=DECIMAL},
|
|
|
#{materialName,jdbcType=VARCHAR}, #{sendStation,jdbcType=VARCHAR}, #{arrivalStation,jdbcType=VARCHAR},
|
|
|
#{supplierName,jdbcType=VARCHAR}, #{sendDate,jdbcType=VARCHAR}, #{makeDate,jdbcType=VARCHAR},
|
|
|
#{mineral,jdbcType=VARCHAR}, #{purchaseOrderNo,jdbcType=VARCHAR}, #{outbountId,jdbcType=DECIMAL},
|
|
|
- #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
|
|
|
+ #{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ #{insertTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=DECIMAL})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
|
|
|
insert into TMSTRAIN_LOADING_TEMP
|
|
@@ -229,6 +262,15 @@
|
|
|
<if test="updateTime != null">
|
|
|
UPDATE_TIME,
|
|
|
</if>
|
|
|
+ <if test="insertUsername != null">
|
|
|
+ INSERT_USERNAME,
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ INSERT_TIME,
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">
|
|
|
+ DELETED,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="resultId != null">
|
|
@@ -273,6 +315,15 @@
|
|
|
<if test="updateTime != null">
|
|
|
#{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="insertUsername != null">
|
|
|
+ #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">
|
|
|
+ #{deleted,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
|
|
@@ -289,7 +340,10 @@
|
|
|
PURCHASE_ORDER_NO = #{purchaseOrderNo,jdbcType=VARCHAR},
|
|
|
OUTBOUNT_ID = #{outbountId,jdbcType=DECIMAL},
|
|
|
UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
|
- UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP}
|
|
|
+ UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ DELETED = #{deleted,jdbcType=DECIMAL}
|
|
|
where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingTemp">
|
|
@@ -334,6 +388,15 @@
|
|
|
<if test="updateTime != null">
|
|
|
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="insertUsername != null">
|
|
|
+ INSERT_USERNAME = #{insertUsername,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="insertTime != null">
|
|
|
+ INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="deleted != null">
|
|
|
+ DELETED = #{deleted,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
@@ -356,7 +419,9 @@
|
|
|
MATERIAL_NAME, SEND_STATION, ARRIVAL_STATION,
|
|
|
SUPPLIER_NAME, SEND_DATE, MAKE_DATE,
|
|
|
MINERAL, PURCHASE_ORDER_NO, OUTBOUNT_ID,
|
|
|
- UPDATE_USERNAME, UPDATE_TIME)
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME,
|
|
|
+ INSERT_USERNAME, INSERT_TIME,
|
|
|
+ DELETED)
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.resultId,jdbcType=DECIMAL},
|
|
@@ -364,7 +429,9 @@
|
|
|
#{item.materialName,jdbcType=VARCHAR}, #{item.sendStation,jdbcType=VARCHAR}, #{item.arrivalStation,jdbcType=VARCHAR},
|
|
|
#{item.supplierName,jdbcType=VARCHAR}, #{item.sendDate,jdbcType=VARCHAR}, #{item.makeDate,jdbcType=VARCHAR},
|
|
|
#{item.mineral,jdbcType=VARCHAR}, #{item.purchaseOrderNo,jdbcType=VARCHAR}, #{item.outbountId,jdbcType=DECIMAL},
|
|
|
- #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP} from dual
|
|
|
+ #{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
|
|
|
+ #{item.deleted,jdbcType=DECIMAL} from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -426,12 +493,23 @@
|
|
|
<foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
|
|
|
when #{item.resultId,jdbcType=DECIMAL} then #{item.updateTime,jdbcType=TIMESTAMP}
|
|
|
</foreach>
|
|
|
+ ,INSERT_USERNAME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.insertUsername,jdbcType=VARCHAR}
|
|
|
+ </foreach>
|
|
|
+ ,INSERT_TIME=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.insertTime,jdbcType=TIMESTAMP}
|
|
|
+ </foreach>
|
|
|
+ ,DELETED=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.deleted,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
where RESULT_ID in
|
|
|
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
#{item.resultId,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
</update>
|
|
|
-
|
|
|
<delete id="batchDelete" parameterType="java.util.List">
|
|
|
delete from TMSTRAIN_LOADING_TEMP
|
|
|
where RESULT_ID in
|
|
@@ -476,5 +554,15 @@
|
|
|
from AMS_PURCHASE_ORDER APO
|
|
|
WHERE APO.PURCHASE_ORDER_NO =#{purchaseNo}
|
|
|
</select>
|
|
|
+ <select id="getWagonDetails" resultType="java.util.Map" parameterType="java.math.BigDecimal">
|
|
|
+ select DISTINCT
|
|
|
+ APO.BATCH_ID "batchId",
|
|
|
+ RP.PORT_ID "portId",
|
|
|
+ TLT.RESULT_BILLABLE_TONNAGE "resultMaterialNumber"
|
|
|
+ from TMSTRAIN_LOADING_TEMP TLT
|
|
|
+ LEFT JOIN AMS_PURCHASE_ORDER APO ON TLT.PURCHASE_ORDER_NO=APO.PURCHASE_ORDER_NO,
|
|
|
+ (SELECT PORT_ID FROM RMS_PORT WHERE PORT_NAME='万州港') RP
|
|
|
+ WHERE TLT.RESULT_ID=#{resultId}
|
|
|
+ </select>
|
|
|
|
|
|
</mapper>
|