|
@@ -14,15 +14,17 @@
|
|
<result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
|
|
<result column="UPDATE_USERNAME" jdbcType="VARCHAR" property="updateUsername"/>
|
|
<result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
<result column="UPDATE_TIME" jdbcType="TIMESTAMP" property="updateTime"/>
|
|
<result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
|
|
<result column="INSERT_UPDATE_REMARK" jdbcType="VARCHAR" property="insertUpdateRemark"/>
|
|
|
|
+ <result column="WETHER_TO_STATEMENT" jdbcType="DECIMAL" property="wetherToStatement"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
<sql id="columns">
|
|
<sql id="columns">
|
|
DETAILS_ID, PURCHASE_ORDER_ID, ORDER_ID, DETAILS_NO, DETAILS_TIME, PRICE_ID, DETAILS_AMOUNT,
|
|
DETAILS_ID, PURCHASE_ORDER_ID, ORDER_ID, DETAILS_NO, DETAILS_TIME, PRICE_ID, DETAILS_AMOUNT,
|
|
- INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK
|
|
|
|
|
|
+ INSERT_USERNAME, INSERT_TIME, UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
|
+ WETHER_TO_STATEMENT
|
|
</sql>
|
|
</sql>
|
|
<sql id="columns_alias">
|
|
<sql id="columns_alias">
|
|
t.DETAILS_ID, t.PURCHASE_ORDER_ID, t.ORDER_ID, t.DETAILS_NO, t.DETAILS_TIME, t.PRICE_ID,
|
|
t.DETAILS_ID, t.PURCHASE_ORDER_ID, t.ORDER_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.DETAILS_AMOUNT, t.INSERT_USERNAME, t.INSERT_TIME, t.UPDATE_USERNAME, t.UPDATE_TIME,
|
|
- t.INSERT_UPDATE_REMARK
|
|
|
|
|
|
+ t.INSERT_UPDATE_REMARK, t.WETHER_TO_STATEMENT
|
|
</sql>
|
|
</sql>
|
|
<sql id="select">
|
|
<sql id="select">
|
|
SELECT
|
|
SELECT
|
|
@@ -72,6 +74,9 @@
|
|
<if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
<if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
and INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="wetherToStatement != null">
|
|
|
|
+ and WETHER_TO_STATEMENT = #{wetherToStatement}
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
</sql>
|
|
</sql>
|
|
<sql id="whereLike">
|
|
<sql id="whereLike">
|
|
@@ -112,6 +117,9 @@
|
|
<if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
<if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
|
|
and INSERT_UPDATE_REMARK LIKE '%${insertUpdateRemark}%'
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="wetherToStatement != null">
|
|
|
|
+ and WETHER_TO_STATEMENT = #{wetherToStatement}
|
|
|
|
+ </if>
|
|
</where>
|
|
</where>
|
|
</sql>
|
|
</sql>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
<delete id="deleteByPrimaryKey" parameterType="java.math.BigDecimal">
|
|
@@ -155,17 +163,22 @@
|
|
<if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
<if test="insertUpdateRemark != null and insertUpdateRemark != ''">
|
|
or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
or INSERT_UPDATE_REMARK = #{insertUpdateRemark}
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="wetherToStatement != null">
|
|
|
|
+ or WETHER_TO_STATEMENT = #{wetherToStatement}
|
|
|
|
+ </if>
|
|
</delete>
|
|
</delete>
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
<insert id="insert" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
insert into BMSTRUCK_DETAILS_ORDER (DETAILS_ID, PURCHASE_ORDER_ID, ORDER_ID,
|
|
insert into BMSTRUCK_DETAILS_ORDER (DETAILS_ID, PURCHASE_ORDER_ID, ORDER_ID,
|
|
DETAILS_NO, DETAILS_TIME, PRICE_ID,
|
|
DETAILS_NO, DETAILS_TIME, PRICE_ID,
|
|
DETAILS_AMOUNT, INSERT_USERNAME, INSERT_TIME,
|
|
DETAILS_AMOUNT, INSERT_USERNAME, INSERT_TIME,
|
|
- UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK)
|
|
|
|
|
|
+ UPDATE_USERNAME, UPDATE_TIME, INSERT_UPDATE_REMARK,
|
|
|
|
+ WETHER_TO_STATEMENT)
|
|
values (#{detailsId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{orderId,jdbcType=DECIMAL},
|
|
values (#{detailsId,jdbcType=DECIMAL}, #{purchaseOrderId,jdbcType=DECIMAL}, #{orderId,jdbcType=DECIMAL},
|
|
#{detailsNo,jdbcType=VARCHAR}, #{detailsTime,jdbcType=TIMESTAMP}, #{priceId,jdbcType=DECIMAL},
|
|
#{detailsNo,jdbcType=VARCHAR}, #{detailsTime,jdbcType=TIMESTAMP}, #{priceId,jdbcType=DECIMAL},
|
|
#{detailsAmount,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
#{detailsAmount,jdbcType=DECIMAL}, #{insertUsername,jdbcType=VARCHAR}, #{insertTime,jdbcType=TIMESTAMP},
|
|
#{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
#{updateUsername,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
|
|
- #{insertUpdateRemark,jdbcType=VARCHAR})
|
|
|
|
|
|
+ #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
|
+ #{wetherToStatement,jdbcType=DECIMAL})
|
|
</insert>
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
<insert id="insertSelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
insert into BMSTRUCK_DETAILS_ORDER
|
|
insert into BMSTRUCK_DETAILS_ORDER
|
|
@@ -206,6 +219,9 @@
|
|
<if test="insertUpdateRemark != null">
|
|
<if test="insertUpdateRemark != null">
|
|
INSERT_UPDATE_REMARK,
|
|
INSERT_UPDATE_REMARK,
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="wetherToStatement != null">
|
|
|
|
+ WETHER_TO_STATEMENT,
|
|
|
|
+ </if>
|
|
</trim>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="detailsId != null">
|
|
<if test="detailsId != null">
|
|
@@ -244,6 +260,9 @@
|
|
<if test="insertUpdateRemark != null">
|
|
<if test="insertUpdateRemark != null">
|
|
#{insertUpdateRemark,jdbcType=VARCHAR},
|
|
#{insertUpdateRemark,jdbcType=VARCHAR},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="wetherToStatement != null">
|
|
|
|
+ #{wetherToStatement,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
</trim>
|
|
</trim>
|
|
</insert>
|
|
</insert>
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
<update id="updateByPrimaryKey" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
@@ -258,7 +277,8 @@
|
|
INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
INSERT_TIME = #{insertTime,jdbcType=TIMESTAMP},
|
|
UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
UPDATE_USERNAME = #{updateUsername,jdbcType=VARCHAR},
|
|
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
|
|
- INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR}
|
|
|
|
|
|
+ INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
|
|
+ WETHER_TO_STATEMENT = #{wetherToStatement,jdbcType=DECIMAL}
|
|
where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
</update>
|
|
</update>
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.dil.model.BmstruckDetailsOrder">
|
|
@@ -297,6 +317,9 @@
|
|
<if test="insertUpdateRemark != null">
|
|
<if test="insertUpdateRemark != null">
|
|
INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
INSERT_UPDATE_REMARK = #{insertUpdateRemark,jdbcType=VARCHAR},
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="wetherToStatement != null">
|
|
|
|
+ WETHER_TO_STATEMENT = #{wetherToStatement,jdbcType=DECIMAL},
|
|
|
|
+ </if>
|
|
</set>
|
|
</set>
|
|
where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
where DETAILS_ID = #{detailsId,jdbcType=DECIMAL}
|
|
</update>
|
|
</update>
|
|
@@ -319,7 +342,8 @@
|
|
DETAILS_TIME, PRICE_ID, DETAILS_AMOUNT,
|
|
DETAILS_TIME, PRICE_ID, DETAILS_AMOUNT,
|
|
INSERT_USERNAME, INSERT_TIME,
|
|
INSERT_USERNAME, INSERT_TIME,
|
|
UPDATE_USERNAME, UPDATE_TIME,
|
|
UPDATE_USERNAME, UPDATE_TIME,
|
|
- INSERT_UPDATE_REMARK)
|
|
|
|
|
|
+ INSERT_UPDATE_REMARK, WETHER_TO_STATEMENT
|
|
|
|
+ )
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
( <foreach collection="list" item="item" separator="union all">
|
|
select
|
|
select
|
|
#{item.detailsId,jdbcType=DECIMAL},
|
|
#{item.detailsId,jdbcType=DECIMAL},
|
|
@@ -328,7 +352,8 @@
|
|
#{item.detailsAmount,jdbcType=DECIMAL},
|
|
#{item.detailsAmount,jdbcType=DECIMAL},
|
|
#{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
|
|
#{item.insertUsername,jdbcType=VARCHAR}, #{item.insertTime,jdbcType=TIMESTAMP},
|
|
#{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
#{item.updateUsername,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP},
|
|
- #{item.insertUpdateRemark,jdbcType=VARCHAR} from dual
|
|
|
|
|
|
+ #{item.insertUpdateRemark,jdbcType=VARCHAR}, #{item.wetherToStatement,jdbcType=DECIMAL}
|
|
|
|
+ from dual
|
|
</foreach> )
|
|
</foreach> )
|
|
</insert>
|
|
</insert>
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
<update id="batchUpdate" parameterType="java.util.List">
|
|
@@ -382,6 +407,10 @@
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
<foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
when #{item.detailsId,jdbcType=DECIMAL} then #{item.insertUpdateRemark,jdbcType=VARCHAR}
|
|
</foreach>
|
|
</foreach>
|
|
|
|
+ ,WETHER_TO_STATEMENT=
|
|
|
|
+ <foreach collection="list" item="item" index="index" separator=" " open="case DETAILS_ID" close="end">
|
|
|
|
+ when #{item.detailsId,jdbcType=DECIMAL} then #{item.wetherToStatement,jdbcType=DECIMAL}
|
|
|
|
+ </foreach>
|
|
where DETAILS_ID in
|
|
where DETAILS_ID in
|
|
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
<foreach collection="list" index="index" item="item" separator="," open="(" close=")">
|
|
#{item.detailsId,jdbcType=DECIMAL}
|
|
#{item.detailsId,jdbcType=DECIMAL}
|
|
@@ -396,8 +425,7 @@
|
|
</delete>
|
|
</delete>
|
|
<!-- 友情提示!!!-->
|
|
<!-- 友情提示!!!-->
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
<!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
|
|
-
|
|
|
|
- <!-- 展示详单列表 -->
|
|
|
|
|
|
+ <!-- 销售汽运结算详单 -->
|
|
<select id="getTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
|
|
<select id="getTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
|
|
SELECT * FROM(
|
|
SELECT * FROM(
|
|
SELECT DISTINCT
|
|
SELECT DISTINCT
|
|
@@ -434,6 +462,7 @@
|
|
ON twr.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
|
|
ON twr.RESULT_TOTAL_ID = ttl.RESULT_TOTAL_ID
|
|
LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
ON actp.PRICE_ID = bdo.PRICE_ID
|
|
ON actp.PRICE_ID = bdo.PRICE_ID
|
|
|
|
+ WHERE oo.ORDER_TYPE = #{orderType}
|
|
)
|
|
)
|
|
<where>
|
|
<where>
|
|
<if test="purchaseOrderNo!= null">
|
|
<if test="purchaseOrderNo!= null">
|
|
@@ -493,6 +522,195 @@
|
|
</where>
|
|
</where>
|
|
<include refid="orderBy"></include>
|
|
<include refid="orderBy"></include>
|
|
</select>
|
|
</select>
|
|
|
|
+
|
|
|
|
+ <!-- 未转账单的销售详单 -->
|
|
|
|
+ <select id="getUnFinishedTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
|
+ SELECT * FROM(
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ bdo.INSERT_TIME as "insertTime",
|
|
|
|
+ bdo.DETAILS_ID as "detailsId",
|
|
|
|
+ oo.ORDER_ID as "orderId",
|
|
|
|
+ bdo.DETAILS_NO as "detailsNo",
|
|
|
|
+ oo.ORDER_NUMBER as "orderNumber",
|
|
|
|
+ bdo.DETAILS_TIME as "detailsTime",
|
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber",
|
|
|
|
+ rct.CAPACITY_TYPE_NAME as "capacityTypeName",
|
|
|
|
+ rs.SHIPPER_NAME as "shipperName",
|
|
|
|
+ rco.CONSIGNEE_RECEIVE_ADDRESS as "consigneeReceiveAddress",
|
|
|
|
+ actp.PRICE_VALUE as "priceValue",
|
|
|
|
+ bdo.DETAILS_AMOUNT as "detailsAmount"
|
|
|
|
+ FROM BMSTRUCK_DETAILS_ORDER bdo
|
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
|
+ ON oo.ORDER_ID = bdo.ORDER_ID
|
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
|
|
|
|
+ ON oo.ORDER_PLAN_ID = asom.SALE_ORDER_MATERIAL_ID
|
|
|
|
+ LEFT JOIN AMS_SALE_ORDER aso
|
|
|
|
+ ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
|
|
|
|
+ LEFT JOIN RMS_SHIPPER rs
|
|
|
|
+ ON rs.SHIPPER_ID = aso.SHIPPER_ID
|
|
|
|
+ LEFT JOIN RMS_CONSIGNEE rco
|
|
|
|
+ ON rco.CONSIGNEE_ID = aso.RECEIVE_ID
|
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
|
+ ON oo.CAPACITY_ID = rc.CAPACITY_ID
|
|
|
|
+ LEFT JOIN RMS_CAPACITY_TYPE rct
|
|
|
|
+ ON rct.CAPACITY_TYPE_ID = rc.CAPACITY_TYPE_ID
|
|
|
|
+ LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
|
+ ON actp.PRICE_ID = bdo.PRICE_ID
|
|
|
|
+ WHERE oo.ORDER_TYPE = #{orderType}
|
|
|
|
+ AND bdo.WETHER_TO_STATEMENT = 0
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <if test="detailsNo!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
|
|
|
|
+ "detailsNo" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "orderNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="detailsTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
|
|
|
|
+ "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="capacityNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "capacityNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="capacityTypeName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="capacityTypeName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "capacityTypeName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shipperName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="shipperName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "shipperName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="consigneeReceiveAddress!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
|
|
|
|
+ "consigneeReceiveAddress" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="priceValue!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="priceValue" item="item" open="(" separator="," close=")">
|
|
|
|
+ "priceValue" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="detailsAmount!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
|
|
|
|
+ "detailsAmount" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <include refid="orderBy"></include>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 销售汽运结算详单 -->
|
|
|
|
+ <select id="getSaleTruckDetailsOrderList" resultType="java.util.Map" parameterType="java.util.Map">
|
|
|
|
+ SELECT * FROM(
|
|
|
|
+ SELECT DISTINCT
|
|
|
|
+ bdo.INSERT_TIME as "insertTime",
|
|
|
|
+ bdo.DETAILS_ID as "detailsId",
|
|
|
|
+ oo.ORDER_ID as "orderId",
|
|
|
|
+ bdo.DETAILS_NO as "detailsNo",
|
|
|
|
+ oo.ORDER_NUMBER as "orderNumber",
|
|
|
|
+ bdo.DETAILS_TIME as "detailsTime",
|
|
|
|
+ rc.CAPACITY_NUMBER as "capacityNumber",
|
|
|
|
+ rct.CAPACITY_TYPE_NAME as "capacityTypeName",
|
|
|
|
+ rs.SHIPPER_NAME as "shipperName",
|
|
|
|
+ rco.CONSIGNEE_RECEIVE_ADDRESS as "consigneeReceiveAddress",
|
|
|
|
+ actp.PRICE_VALUE as "priceValue",
|
|
|
|
+ bdo.DETAILS_AMOUNT as "detailsAmount"
|
|
|
|
+ FROM BMSTRUCK_DETAILS_ORDER bdo
|
|
|
|
+ LEFT JOIN OMSTRUCK_ORDER oo
|
|
|
|
+ ON oo.ORDER_ID = bdo.ORDER_ID
|
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
|
|
|
|
+ ON oo.ORDER_PLAN_ID = asom.SALE_ORDER_MATERIAL_ID
|
|
|
|
+ LEFT JOIN AMS_SALE_ORDER aso
|
|
|
|
+ ON aso.SALE_ORDER_ID = asom.SALE_ORDER_ID
|
|
|
|
+ LEFT JOIN RMS_SHIPPER rs
|
|
|
|
+ ON rs.SHIPPER_ID = aso.SHIPPER_ID
|
|
|
|
+ LEFT JOIN RMS_CONSIGNEE rco
|
|
|
|
+ ON rco.CONSIGNEE_ID = aso.RECEIVE_ID
|
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
|
+ ON oo.CAPACITY_ID = rc.CAPACITY_ID
|
|
|
|
+ LEFT JOIN RMS_CAPACITY_TYPE rct
|
|
|
|
+ ON rct.CAPACITY_TYPE_ID = rc.CAPACITY_TYPE_ID
|
|
|
|
+ LEFT JOIN AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
|
|
+ ON actp.PRICE_ID = bdo.PRICE_ID
|
|
|
|
+ WHERE oo.ORDER_TYPE = #{orderType}
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <if test="detailsNo!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="detailsNo" item="item" open="(" separator="," close=")">
|
|
|
|
+ "detailsNo" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="orderNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "orderNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="detailsTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="detailsTime" item="item" open="(" separator="," close=")">
|
|
|
|
+ "detailsTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="capacityNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "capacityNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="capacityTypeName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="capacityTypeName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "capacityTypeName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shipperName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="shipperName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "shipperName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="consigneeReceiveAddress!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="consigneeReceiveAddress" item="item" open="(" separator="," close=")">
|
|
|
|
+ "consigneeReceiveAddress" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="priceValue!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="priceValue" item="item" open="(" separator="," close=")">
|
|
|
|
+ "priceValue" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="detailsAmount!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="detailsAmount" item="item" open="(" separator="," close=")">
|
|
|
|
+ "detailsAmount" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <include refid="orderBy"></include>
|
|
|
|
+ </select>
|
|
<!-- 得到最大id -->
|
|
<!-- 得到最大id -->
|
|
<select id="selectMaxId" resultType="DECIMAL">
|
|
<select id="selectMaxId" resultType="DECIMAL">
|
|
SELECT MAX(DETAILS_ID)
|
|
SELECT MAX(DETAILS_ID)
|
|
@@ -511,7 +729,14 @@
|
|
</if>
|
|
</if>
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
- <!-- 展示汽运实绩列表 -->
|
|
|
|
|
|
+ <!-- 根据运单id查询运单类型 -->
|
|
|
|
+ <select id="getOrderType" parameterType="DECIMAL" resultType="DECIMAL">
|
|
|
|
+ SELECT ORDER_TYPE
|
|
|
|
+ FROM OMSTRUCK_ORDER
|
|
|
|
+ WHERE ORDER_ID = #{orderId}
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <!-- 展示采购汽运实绩列表 -->
|
|
<select id="getTruckResultList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
<select id="getTruckResultList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
SELECT *
|
|
SELECT *
|
|
FROM (
|
|
FROM (
|
|
@@ -596,6 +821,179 @@
|
|
<include refid="orderBy"></include>
|
|
<include refid="orderBy"></include>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <!-- 得到销售汽运实绩 -->
|
|
|
|
+ <select id="getSaleTruckResultList" parameterType="java.util.Map" resultType="java.util.Map">
|
|
|
|
+ SELECT *
|
|
|
|
+ FROM (
|
|
|
|
+ SELECT oo.INSERT_TIME as "insertTime",
|
|
|
|
+ oo.ORDER_NUMBER as "orderNumber",
|
|
|
|
+ rca.CAPACITY_NUMBER as "capacityNumber",
|
|
|
|
+ rcd.DRIVER_NAME as "driverName",
|
|
|
|
+ rc.CARRIER_NAME as "carrierName",
|
|
|
|
+ rl.LINE_NO as "lineNo",
|
|
|
|
+ ter.RESULT_ENTRY_GATE_TIME as "resultEntryGateTime",
|
|
|
|
+ rge.GATEPOST_NAME as "enGatepostName",
|
|
|
|
+ twr.RESULT_TARE_WEIGHT_TIME as "resultTareWeightTime",
|
|
|
|
+ twr.RESULT_TARE_WEIGHT as "resultTareWeight",
|
|
|
|
+ rtct.TRUCK_CALCULATE_NUMBER as "tareCalculateNumber",
|
|
|
|
+ tlr.RESULT_LOAD_START_TIME as "resultLoadStartTime",
|
|
|
|
+ tlr.RESULT_MEASURED_TONNAGE as "resultMeasuredTonnage",
|
|
|
|
+ rw.WAREHOUSE_NAME as "warehouseName",
|
|
|
|
+ twr.RESULT_GROSS_WEIGHT_TIME as "resultGrossWeightTime",
|
|
|
|
+ twr.RESULT_GROSS_WEIGHT as "resultGrossWeight",
|
|
|
|
+ rtcg.TRUCK_CALCULATE_NUMBER as "grossCalculateNumber",
|
|
|
|
+ tlfr.RESULT_OUT_GATE_TIME as "resultOutGateTime",
|
|
|
|
+ rgl.GATEPOST_NAME as "leaveGatepostName"
|
|
|
|
+ FROM OMSTRUCK_ORDER oo
|
|
|
|
+ LEFT JOIN RMS_CAPACITY rca
|
|
|
|
+ ON rca.CAPACITY_ID = oo.CAPACITY_ID
|
|
|
|
+ LEFT JOIN AMS_SALE_ORDER_MATERIAL asom
|
|
|
|
+ ON asom.SALE_ORDER_MATERIAL_ID = oo.ORDER_PLAN_ID
|
|
|
|
+ LEFT JOIN RMS_DRIVER_CAPACITY rdc
|
|
|
|
+ ON rdc.DRIVER_CAPACITY_ID = oo.DRIVER_CAPACITY_ID
|
|
|
|
+ LEFT JOIN RMS_CAR_DRIVER rcd
|
|
|
|
+ ON rcd.DRIVER_ID = rdc.DRIVER_ID
|
|
|
|
+ LEFT JOIN AMS_DISPATCH_SALE_ORDER adso
|
|
|
|
+ ON adso.SALE_ORDER_MATERIAL_ID = asom.SALE_ORDER_MATERIAL_ID
|
|
|
|
+ LEFT JOIN RMS_CARRIER rc
|
|
|
|
+ ON rc.CARRIER_ID = adso.CARRIER_ID
|
|
|
|
+ LEFT JOIN RMS_LINE rl
|
|
|
|
+ ON oo.LINE_ID = rl.LINE_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
|
+ ON oo.ORDER_ID = ttr.ORDER_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_ENFACTORY_RESULT ter
|
|
|
|
+ ON ter.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ LEFT JOIN RMS_GATEPOST rge
|
|
|
|
+ ON rge.GATEPOST_ID = ter.GATEPOST_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
|
|
|
|
+ ON twr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ LEFT JOIN RMS_TRUCK_CALCULATE rtct
|
|
|
|
+ ON rtct.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_LOAD_RESULT tlr
|
|
|
|
+ ON tlr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ LEFT JOIN RMS_WAREHOUSE rw
|
|
|
|
+ ON rw.WAREHOUSE_ID = tlr.LOADING_ID
|
|
|
|
+ LEFT JOIN RMS_TRUCK_CALCULATE rtcg
|
|
|
|
+ ON rtcg.TRUCK_CALCULATE_ID = twr.RESULT_TARE_PLACE_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_LEAVE_FACTORY_RESULT tlfr
|
|
|
|
+ ON tlfr.RESULT_TOTAL_ID = ttr.RESULT_TOTAL_ID
|
|
|
|
+ LEFT JOIN RMS_GATEPOST rgl
|
|
|
|
+ ON rgl.GATEPOST_ID = ter.GATEPOST_ID
|
|
|
|
+ WHERE oo.ORDER_ID = #{orderId}
|
|
|
|
+ )
|
|
|
|
+ <where>
|
|
|
|
+ <if test="orderNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="orderNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "orderNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="capacityNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="capacityNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "capacityNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="driverName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="driverName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "driverName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="carrierName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="carrierName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "carrierName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="lineNo!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="lineNo" item="item" open="(" separator="," close=")">
|
|
|
|
+ "lineNo" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultEntryGateTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultEntryGateTime" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultEntryGateTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="enGatepostName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="enGatepostName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "enGatepostName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultTareWeightTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultTareWeightTime" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultTareWeightTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultTareWeight!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultTareWeight" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultTareWeight" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="tareCalculateNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="tareCalculateNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "tareCalculateNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultLoadStartTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultLoadStartTime" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultLoadStartTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultMeasuredTonnage!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultMeasuredTonnage" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultMeasuredTonnage" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="warehouseName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="warehouseName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "warehouseName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultGrossWeightTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultGrossWeightTime" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultGrossWeightTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultGrossWeight!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultGrossWeight" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultGrossWeight" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="grossCalculateNumber!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="grossCalculateNumber" item="item" open="(" separator="," close=")">
|
|
|
|
+ "grossCalculateNumber" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="resultOutGateTime!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="resultOutGateTime" item="item" open="(" separator="," close=")">
|
|
|
|
+ "resultOutGateTime" in to_date('${item}','yyyy-mm-dd hh24:mi:ss')
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="leaveGatepostName!= null">
|
|
|
|
+ and
|
|
|
|
+ <foreach collection="leaveGatepostName" item="item" open="(" separator="," close=")">
|
|
|
|
+ "leaveGatepostName" in #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </where>
|
|
|
|
+ <include refid="orderBy"></include>
|
|
|
|
+ </select>
|
|
|
|
+
|
|
<!-- 得到计算因子 -->
|
|
<!-- 得到计算因子 -->
|
|
<select id="getFormulaMembers" parameterType="DECIMAL" resultType="DECIMAL">
|
|
<select id="getFormulaMembers" parameterType="DECIMAL" resultType="DECIMAL">
|
|
SELECT apo.PURCHASE_ORDER_ID
|
|
SELECT apo.PURCHASE_ORDER_ID
|
|
@@ -606,33 +1004,29 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 得到单价id -->
|
|
<!-- 得到单价id -->
|
|
- <select id="getPriceId" resultType="java.util.Map" >
|
|
|
|
- SELECT
|
|
|
|
- actp.PRICE_ID as "priceId"
|
|
|
|
|
|
+ <select id="getPriceId" resultType="java.util.Map">
|
|
|
|
+ SELECT actp.PRICE_ID as "priceId"
|
|
FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
- LEFT JOIN RMS_CAPACITY rc
|
|
|
|
- ON rc.CAPACITY_ID = actp.CAPACITY_ID
|
|
|
|
|
|
+ LEFT JOIN RMS_CAPACITY rc
|
|
|
|
+ ON rc.CAPACITY_ID = actp.CAPACITY_ID
|
|
WHERE rc.CAPACITY_TYPE_ID = 1
|
|
WHERE rc.CAPACITY_TYPE_ID = 1
|
|
- AND actp.DELETED = 0
|
|
|
|
|
|
+ AND actp.DELETED = 0
|
|
ORDER BY actp.PRICE_DATE DESC
|
|
ORDER BY actp.PRICE_DATE DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getPriceValue" parameterType="DECIMAL" resultType="DECIMAL">
|
|
<select id="getPriceValue" parameterType="DECIMAL" resultType="DECIMAL">
|
|
- SELECT
|
|
|
|
- actp.PRICE_VALUE as "priceValue"
|
|
|
|
|
|
+ SELECT actp.PRICE_VALUE as "priceValue"
|
|
FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
FROM AMS_CONTRACT_TRANSPORT_PRICE actp
|
|
WHERE PRICE_ID = #{priceId}
|
|
WHERE PRICE_ID = #{priceId}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
|
|
+
|
|
<select id="getNetWeight" parameterType="DECIMAL" resultType="DECIMAL">
|
|
<select id="getNetWeight" parameterType="DECIMAL" resultType="DECIMAL">
|
|
- SELECT
|
|
|
|
- twr.RESULT_NET_WEIGHT as "netWeight"
|
|
|
|
|
|
+ SELECT twr.RESULT_NET_WEIGHT as "netWeight"
|
|
FROM OMSTRUCK_ORDER oo
|
|
FROM OMSTRUCK_ORDER oo
|
|
- LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
|
- ON oo.ORDER_ID = ttr.ORDER_ID
|
|
|
|
- LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
|
|
|
|
- ON ttr.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
|
|
|
|
|
|
+ LEFT JOIN TMSTRUCK_TOTAL_RESULT ttr
|
|
|
|
+ ON oo.ORDER_ID = ttr.ORDER_ID
|
|
|
|
+ LEFT JOIN TMSTRUCK_WEIGHT_RESULT twr
|
|
|
|
+ ON ttr.RESULT_TOTAL_ID = twr.RESULT_TOTAL_ID
|
|
WHERE oo.ORDER_ID = #{orderId}
|
|
WHERE oo.ORDER_ID = #{orderId}
|
|
</select>
|
|
</select>
|
|
-
|
|
|
|
</mapper>
|
|
</mapper>
|