|
|
@@ -23,18 +23,21 @@
|
|
|
<result column="PHOTO" jdbcType="VARCHAR" property="photo" />
|
|
|
<result column="REMARK" jdbcType="VARCHAR" property="remark" />
|
|
|
<result column="PRICE_VALUE" jdbcType="DECIMAL" property="priceValue" />
|
|
|
+ <result column="CONSIGNEE_ID" jdbcType="DECIMAL" property="consigneeId" />
|
|
|
+ <result column="WEIGHT_BATCH_ID" jdbcType="DECIMAL" property="weightBatchId" />
|
|
|
</resultMap>
|
|
|
<sql id="columns">
|
|
|
DETAILS_ID, PURCHASE_ORDER_ID, WEIGHT_TASK_RESULT_ID, DETAILS_NO, DETAILS_TIME, PRICE_ID,
|
|
|
DETAILS_AMOUNT, INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
WETHER_TO_STATEMENT, EAS_AMOUNT, ORDER_ID, PRICEIDS, HISTORY_DETAILS_AMOUNT, STATEMENT_ID,
|
|
|
- PHOTO, REMARK, PRICE_VALUE
|
|
|
+ PHOTO, REMARK, PRICE_VALUE, CONSIGNEE_ID, WEIGHT_BATCH_ID
|
|
|
</sql>
|
|
|
<sql id="columns_alias">
|
|
|
t.DETAILS_ID, t.PURCHASE_ORDER_ID, t.WEIGHT_TASK_RESULT_ID, t.DETAILS_NO, t.DETAILS_TIME,
|
|
|
t.PRICE_ID, t.DETAILS_AMOUNT, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME,
|
|
|
t.UPDATE_TIME, t.INSERT_UPDATE_REMARK, t.WETHER_TO_STATEMENT, t.EAS_AMOUNT, t.ORDER_ID,
|
|
|
- t.PRICEIDS, t.HISTORY_DETAILS_AMOUNT, t.STATEMENT_ID, t.PHOTO, t.REMARK, t.PRICE_VALUE
|
|
|
+ t.PRICEIDS, t.HISTORY_DETAILS_AMOUNT, t.STATEMENT_ID, t.PHOTO, t.REMARK, t.PRICE_VALUE,
|
|
|
+ t.CONSIGNEE_ID, t.WEIGHT_BATCH_ID
|
|
|
</sql>
|
|
|
<sql id="select">
|
|
|
SELECT <include refid="columns" /> FROM BMSTRUCK_DETAILS_ORDER
|
|
|
@@ -107,6 +110,12 @@
|
|
|
<if test="priceValue != null">
|
|
|
and PRICE_VALUE = #{priceValue}
|
|
|
</if>
|
|
|
+ <if test="consigneeId != null">
|
|
|
+ and CONSIGNEE_ID = #{consigneeId}
|
|
|
+ </if>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ and WEIGHT_BATCH_ID = #{weightBatchId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<sql id="whereLike">
|
|
|
@@ -174,6 +183,12 @@
|
|
|
<if test="priceValue != null">
|
|
|
and PRICE_VALUE = #{priceValue}
|
|
|
</if>
|
|
|
+ <if test="consigneeId != null">
|
|
|
+ and CONSIGNEE_ID = #{consigneeId}
|
|
|
+ </if>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ and WEIGHT_BATCH_ID = #{weightBatchId}
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</sql>
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
|
@@ -243,6 +258,12 @@
|
|
|
<if test="priceValue != null">
|
|
|
or PRICE_VALUE = #{priceValue}
|
|
|
</if>
|
|
|
+ <if test="consigneeId != null">
|
|
|
+ or CONSIGNEE_ID = #{consigneeId}
|
|
|
+ </if>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ or WEIGHT_BATCH_ID = #{weightBatchId}
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
|
insert into BMSTRUCK_DETAILS_ORDER (DETAILS_ID, PURCHASE_ORDER_ID, WEIGHT_TASK_RESULT_ID,
|
|
|
@@ -251,16 +272,16 @@
|
|
|
UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
WETHER_TO_STATEMENT, EAS_AMOUNT, ORDER_ID,
|
|
|
PRICEIDS, HISTORY_DETAILS_AMOUNT, STATEMENT_ID,
|
|
|
- PHOTO, REMARK, PRICE_VALUE
|
|
|
- )
|
|
|
+ PHOTO, REMARK, PRICE_VALUE,
|
|
|
+ CONSIGNEE_ID, WEIGHT_BATCH_ID)
|
|
|
values (#{detailsId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{weightTaskResultId,jdbcType=DECIMAL},
|
|
|
#{detailsNo,jdbcType=VARCHAR}, #{detailsTime,jdbcType=TIMESTAMP}, #{priceId,jdbcType=DECIMAL},
|
|
|
#{detailsAmount,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
|
#{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
#{wetherToStatement,jdbcType=DECIMAL}, #{easAmount,jdbcType=DECIMAL}, #{orderId,jdbcType=DECIMAL},
|
|
|
#{priceids,jdbcType=VARCHAR}, #{historyDetailsAmount,jdbcType=DECIMAL}, #{statementId,jdbcType=DECIMAL},
|
|
|
- #{photo,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{priceValue,jdbcType=DECIMAL}
|
|
|
- )
|
|
|
+ #{photo,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{priceValue,jdbcType=DECIMAL},
|
|
|
+ #{consigneeId,jdbcType=DECIMAL}, #{weightBatchId,jdbcType=DECIMAL})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
|
insert into BMSTRUCK_DETAILS_ORDER
|
|
|
@@ -328,6 +349,12 @@
|
|
|
<if test="priceValue != null">
|
|
|
PRICE_VALUE,
|
|
|
</if>
|
|
|
+ <if test="consigneeId != null">
|
|
|
+ CONSIGNEE_ID,
|
|
|
+ </if>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ WEIGHT_BATCH_ID,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="detailsId != null">
|
|
|
@@ -393,6 +420,12 @@
|
|
|
<if test="priceValue != null">
|
|
|
#{priceValue,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="consigneeId != null">
|
|
|
+ #{consigneeId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ #{weightBatchId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
|
@@ -416,7 +449,9 @@
|
|
|
STATEMENT_ID = #{statementId,jdbcType=DECIMAL},
|
|
|
PHOTO = #{photo,jdbcType=VARCHAR},
|
|
|
REMARK = #{remark,jdbcType=VARCHAR},
|
|
|
- PRICE_VALUE = #{priceValue,jdbcType=DECIMAL}
|
|
|
+ PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
|
|
|
+ CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
|
|
|
+ WEIGHT_BATCH_ID = #{weightBatchId,jdbcType=DECIMAL}
|
|
|
where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
|
@@ -482,6 +517,12 @@
|
|
|
<if test="priceValue != null">
|
|
|
PRICE_VALUE = #{priceValue,jdbcType=DECIMAL},
|
|
|
</if>
|
|
|
+ <if test="consigneeId != null">
|
|
|
+ CONSIGNEE_ID = #{consigneeId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="weightBatchId != null">
|
|
|
+ WEIGHT_BATCH_ID = #{weightBatchId,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
|
</update>
|
|
|
@@ -508,7 +549,8 @@
|
|
|
WETHER_TO_STATEMENT, EAS_AMOUNT,
|
|
|
ORDER_ID, PRICEIDS, HISTORY_DETAILS_AMOUNT,
|
|
|
STATEMENT_ID, PHOTO, REMARK,
|
|
|
- PRICE_VALUE)
|
|
|
+ PRICE_VALUE, CONSIGNEE_ID, WEIGHT_BATCH_ID
|
|
|
+ )
|
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
|
select
|
|
|
#{item.detailsId,jdbcType=DECIMAL},
|
|
|
@@ -520,7 +562,8 @@
|
|
|
#{item.wetherToStatement,jdbcType=DECIMAL}, #{item.easAmount,jdbcType=DECIMAL},
|
|
|
#{item.orderId,jdbcType=DECIMAL}, #{item.priceids,jdbcType=VARCHAR}, #{item.historyDetailsAmount,jdbcType=DECIMAL},
|
|
|
#{item.statementId,jdbcType=DECIMAL}, #{item.photo,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR},
|
|
|
- #{item.priceValue,jdbcType=DECIMAL} from dual
|
|
|
+ #{item.priceValue,jdbcType=DECIMAL}, #{item.consigneeId,jdbcType=DECIMAL}, #{item.weightBatchId,jdbcType=DECIMAL}
|
|
|
+ from dual
|
|
|
</foreach> )
|
|
|
</insert>
|
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
|
@@ -610,6 +653,14 @@
|
|
|
<foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
|
|
|
when #{item.detailsId,jdbcType=DECIMAL} then #{item.priceValue,jdbcType=DECIMAL}
|
|
|
</foreach>
|
|
|
+ ,CONSIGNEE_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.consigneeId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
+ ,WEIGHT_BATCH_ID=
|
|
|
+ <foreach close="end" collection="list" index="index" item="item" open="case DETAILS_ID" separator=" ">
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.weightBatchId,jdbcType=DECIMAL}
|
|
|
+ </foreach>
|
|
|
where DETAILS_ID in
|
|
|
<foreach close=")" collection="list" index="index" item="item" open="(" separator=",">
|
|
|
#{item.detailsId,jdbcType=DECIMAL}
|
|
|
@@ -2458,6 +2509,10 @@
|
|
|
SELECT COUNT(BDO.DETAILS_ID) FROM BMSTRUCK_DETAILS_ORDER BDO
|
|
|
WHERE BDO.WEIGHT_TASK_RESULT_ID = #{weightTaskResultId}
|
|
|
</select>
|
|
|
+ <select id="getIsHaveDetailsOrderByBatch" resultType="java.lang.Integer" parameterType="java.math.BigDecimal">
|
|
|
+ SELECT COUNT(BDO.DETAILS_ID) FROM BMSTRUCK_DETAILS_ORDER BDO
|
|
|
+ WHERE BDO.WEIGHT_BATCH_ID = #{weightBatchId}
|
|
|
+ </select>
|
|
|
<select id="getSteelWeightTaskResultId" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
TWR.WEIGHT_TASK_RESULT_ID AS "weightTaskResultId",
|
|
|
@@ -2596,4 +2651,28 @@
|
|
|
WHERE ORDER_ID = #{orderId})
|
|
|
AND OO.ORDER_ID != #{orderId}
|
|
|
</select>
|
|
|
+ <select id="getWeightBatchIds" resultType="java.util.Map">
|
|
|
+ SELECT
|
|
|
+ DISTINCT
|
|
|
+ TWB.WEIGHT_BATCH_ID AS "weightBatchId",
|
|
|
+ TWB.BATCH_NET_WEIGHT AS "netWeight"
|
|
|
+ FROM OMSTRUCK_ORDER OO
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL ASOM
|
|
|
+ ON OO.ORDER_PLAN_ID=ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_TRUCKNO_MATERIAL ASTM
|
|
|
+ ON ASTM.SALE_ORDER_MATERIAL_ID = ASOM.SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER ADSO
|
|
|
+ ON ADSO .SALE_ORDER_MATERIAL_ID = ASOM .SALE_ORDER_MATERIAL_ID
|
|
|
+ LEFT JOIN AMS_SALE_MATERIAL ASM
|
|
|
+ ON ASM.SALE_MATERIAL_ID = ASTM.MATERIAL_ID
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT TWR
|
|
|
+ ON TWR.SALE_MATERIAL_ID = ASM.SALE_MATERIAL_ID
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_BATCH TWB
|
|
|
+ ON TWB .WEIGHT_BATCH_ID = ASM .WEIGHT_BATCH_ID
|
|
|
+ WHERE OO.ORDER_NUMBER =
|
|
|
+ (
|
|
|
+ SELECT ORDER_NUMBER FROM OMSTRUCK_ORDER
|
|
|
+ WHERE ORDER_ID = #{orderId}
|
|
|
+ )
|
|
|
+ </select>
|
|
|
</mapper>
|