|
@@ -28,7 +28,7 @@
|
|
|
<result column="UNLOADING_POINT_ID" jdbcType="DECIMAL" property="unloadingPointId" />
|
|
|
<result column="SEND_UNIT_ID" jdbcType="DECIMAL" property="sendUnitId" />
|
|
|
<result column="SEND_REQUEST" jdbcType="DECIMAL" property="sendRequest" />
|
|
|
- <result column="SEND_DATE" jdbcType="TIMESTAMP" property="sendDate" />
|
|
|
+ <result column="SEND_DATE" jdbcType="VARCHAR" property="sendDate" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
RESULT_ID, PURCHASE_ORDER_RAIL_PLAN_ID, RESULT_WAGON_NO, RESULT_BILLABLE_TONNAGE,
|
|
@@ -328,7 +328,7 @@
|
|
|
#{insertUpdateRemark,jdbcType=VARCHAR}, #{deleted,jdbcType=DECIMAL}, #{sendStationId,jdbcType=DECIMAL},
|
|
|
#{arrivalStationId,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{trainCalculateId,jdbcType=DECIMAL},
|
|
|
#{unloadingPointId,jdbcType=DECIMAL}, #{sendUnitId,jdbcType=DECIMAL}, #{sendRequest,jdbcType=DECIMAL},
|
|
|
- #{sendDate,jdbcType=TIMESTAMP})
|
|
|
+ #{sendDate,jdbcType=VARCHAR})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingResult">
|
|
|
insert into TMSTRAIN_LOADING_RESULT
|
|
@@ -495,7 +495,7 @@
|
|
|
#{sendRequest,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="sendDate != null">
|
|
|
- #{sendDate,jdbcType=TIMESTAMP},
|
|
|
+ #{sendDate,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
@@ -526,7 +526,7 @@
|
|
|
UNLOADING_POINT_ID = #{unloadingPointId,jdbcType=DECIMAL},
|
|
|
SEND_UNIT_ID = #{sendUnitId,jdbcType=DECIMAL},
|
|
|
SEND_REQUEST = #{sendRequest,jdbcType=DECIMAL},
|
|
|
- SEND_DATE = #{sendDate,jdbcType=TIMESTAMP}
|
|
|
+ SEND_DATE = #{sendDate,jdbcType=VARCHAR}
|
|
|
where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.TmstrainLoadingResult">
|
|
@@ -608,7 +608,7 @@
|
|
|
SEND_REQUEST = #{sendRequest,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
<if test="sendDate != null">
|
|
|
- SEND_DATE = #{sendDate,jdbcType=TIMESTAMP},
|
|
|
+ SEND_DATE = #{sendDate,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
</set>
|
|
|
where RESULT_ID = #{resultId,jdbcType=DECIMAL}
|
|
@@ -627,7 +627,7 @@
|
|
|
</select>
|
|
|
<insert id="batchInsert" parameterType="java.util.List">
|
|
|
insert into TMSTRAIN_LOADING_RESULT
|
|
|
- (RESULT_ID,
|
|
|
+ (RESULT_ID,
|
|
|
PURCHASE_ORDER_RAIL_PLAN_ID, RESULT_WAGON_NO,
|
|
|
RESULT_BILLABLE_TONNAGE, RESULT_ISCLEAR,
|
|
|
CAPACITY_ID, MATERIAL_ID, RESULT_MATERIAL_NUMBER,
|
|
@@ -641,8 +641,8 @@
|
|
|
UNLOADING_POINT_ID, SEND_UNIT_ID,
|
|
|
SEND_REQUEST, SEND_DATE)
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
- select
|
|
|
- #{item.resultId,jdbcType=DECIMAL},
|
|
|
+ select
|
|
|
+ #{item.resultId,jdbcType=DECIMAL},
|
|
|
#{item.purchaseOrderRailPlanId,jdbcType=DECIMAL}, #{item.resultWagonNo,jdbcType=VARCHAR},
|
|
|
#{item.resultBillableTonnage,jdbcType=DECIMAL}, #{item.resultIsclear,jdbcType=VARCHAR},
|
|
|
#{item.capacityId,jdbcType=DECIMAL}, #{item.materialId,jdbcType=DECIMAL}, #{item.resultMaterialNumber,jdbcType=DECIMAL},
|
|
@@ -654,7 +654,7 @@
|
|
|
#{item.deleted,jdbcType=DECIMAL}, #{item.sendStationId,jdbcType=DECIMAL}, #{item.arrivalStationId,jdbcType=DECIMAL},
|
|
|
#{item.resultType,jdbcType=DECIMAL}, #{item.trainCalculateId,jdbcType=DECIMAL},
|
|
|
#{item.unloadingPointId,jdbcType=DECIMAL}, #{item.sendUnitId,jdbcType=DECIMAL},
|
|
|
- #{item.sendRequest,jdbcType=DECIMAL}, #{item.sendDate,jdbcType=TIMESTAMP} from dual
|
|
|
+ #{item.sendRequest,jdbcType=DECIMAL}, #{item.sendDate,jdbcType=VARCHAR} from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -766,7 +766,7 @@
|
|
|
</foreach>
|
|
|
,SEND_DATE=
|
|
|
<foreach close="end" collection="list" index="index" item="item" open="case RESULT_ID" separator=" ">
|
|
|
- when #{item.resultId,jdbcType=DECIMAL} then #{item.sendDate,jdbcType=TIMESTAMP}
|
|
|
+ when #{item.resultId,jdbcType=DECIMAL} then #{item.sendDate,jdbcType=VARCHAR}
|
|
|
</foreach>
|
|
|
where RESULT_ID in
|
|
|
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
@@ -1374,4 +1374,70 @@
|
|
|
order by "insertTime" desc
|
|
|
</if>
|
|
|
</select>
|
|
|
+
|
|
|
+<!-- 根据发站名查发站id-->
|
|
|
+ <select id="getSendStationId" parameterType="java.lang.String" resultType="java.math.BigDecimal">
|
|
|
+ SELECT ARRIVAL_ID
|
|
|
+ FROM RMSTRAIN_ARRIVAL_SEND
|
|
|
+ WHERE ARRIVAL_NAME=#{sendStationName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 获取最大发站id-->
|
|
|
+ <select id="getMaxSendStationId" resultType="java.math.BigDecimal">
|
|
|
+ SELECT MAX(ARRIVAL_ID) FROM RMSTRAIN_ARRIVAL_SEND
|
|
|
+ </select>
|
|
|
+
|
|
|
+<!-- 添加发站-->
|
|
|
+ <insert id="addSendStation" parameterType="java.util.Map">
|
|
|
+ INSERT INTO RMSTRAIN_ARRIVAL_SEND
|
|
|
+ (ARRIVAL_ID,ARRIVAL_NAME,INSERT_TIME,UPDATE_TIME)
|
|
|
+ VALUES(#{arrivalId}, #{arrivalName},#{insertTime},#{updateTime})
|
|
|
+ </insert>
|
|
|
+<!-- 根据物资名和外轮船名查询采购订单号-->
|
|
|
+ <select id="getPurchaseOrderList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ *
|
|
|
+ FROM(
|
|
|
+ SELECT
|
|
|
+ apo.INSERT_TIME as "insertTime",
|
|
|
+ apo.PURCHASE_ORDER_NO as "purchaseOrderNo",
|
|
|
+ apo.PURCHASE_ORDER_DATE as "purchaseOrderDate",
|
|
|
+ rm.MATERIAL_NAME as "materialName",
|
|
|
+ rm.MATERIAL_ID as "materialId",
|
|
|
+ db.RESULT_FOREIGN_SHIP_NAME as "resultForeignShipName",
|
|
|
+ rsu.SUPPLIER_NAME as "supplierName",
|
|
|
+ rsu.SUPPLIER_ID as "supplierId",
|
|
|
+ rsb.SHIPPER_NAME as "buyerName",
|
|
|
+ apo.PURCHASE_ORDER_BUYER as "purchaseOrderBuyer",
|
|
|
+ apo.PUCHASE_ORDER_MATERIAL_NUMBER as "purChaseOrderMaterialNumber",
|
|
|
+ rsr.SHIPPER_NAME as "receiverName",
|
|
|
+ rsr.SHIPPER_ID as "receiverUnitId",
|
|
|
+ apo.PUCHASE_ORDER_DELIVERY_DATE as "purchaseOrderDeliveryDate",
|
|
|
+ apo.INSERT_UPDATE_REMARK as "insertUpdateRemark",
|
|
|
+ apo.PURCHASE_ORDER_ID as "purchaseOrderId",
|
|
|
+ apo.PURCHASING_ORGANIZATION_ID "orgId"
|
|
|
+ FROM AMS_PURCHASE_ORDER apo
|
|
|
+ LEFT JOIN DIL_BATCH db
|
|
|
+ ON apo.BATCH_ID = db.BATCH_ID
|
|
|
+ LEFT JOIN RMS_MATERIAL rm
|
|
|
+ ON rm.MATERIAL_ID = db.MATERIAL_ID
|
|
|
+ LEFT JOIN RMS_SUPPLIER rsu
|
|
|
+ ON apo.SUPPLIER_UNIT_ID = rsu.SUPPLIER_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER rsb
|
|
|
+ ON apo.PURCHASING_ORGANIZATION_ID = rsb.SHIPPER_ID
|
|
|
+ LEFT JOIN RMS_SHIPPER rsr
|
|
|
+ ON apo.RECEIVE_UNIT_ID = rsr.SHIPPER_ID
|
|
|
+ where
|
|
|
+ apo.DELETED = 0
|
|
|
+ and rm.MATERIAL_NAME is not null
|
|
|
+ and db.RESULT_FOREIGN_SHIP_NAME is not null
|
|
|
+ and rsu.SUPPLIER_NAME is not null
|
|
|
+ <if test="materialName != null and materialName!=''.toString()" >
|
|
|
+ and rm.MATERIAL_NAME like concat(concat('%',#{materialName}),'%')
|
|
|
+ </if>
|
|
|
+ <if test="resultForeignShipName != null and resultForeignShipName!=''.toString()">
|
|
|
+ and db.RESULT_FOREIGN_SHIP_NAME like concat(concat('%',#{resultForeignShipName}),'%')
|
|
|
+ </if>
|
|
|
+ )
|
|
|
+ </select>
|
|
|
</mapper>
|