|
|
@@ -77,16 +77,14 @@
|
|
|
l.settle_price as ledgerSettlePrice,
|
|
|
l.url as attachmentUrl,
|
|
|
|
|
|
- lu.unit_type as unitType,
|
|
|
+ lu2.unit_type as unitType,
|
|
|
lu2.firm_name as firmName,
|
|
|
|
|
|
<include refid="Join_Column_List"/>
|
|
|
from kwp_settlement_logistics s
|
|
|
inner join kwp_ledger_logistics l on s.l_ledger_id = l.id
|
|
|
- inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id and
|
|
|
- lu.unit_type = #{settlementReq.unitType,jdbcType=INTEGER}
|
|
|
- inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id and lu2.unit_type =
|
|
|
- #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
|
|
|
+ inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
|
|
|
+ inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id
|
|
|
</sql>
|
|
|
<!-- 连表筛选准备 -->
|
|
|
<sql id="settlementLogisticsSelectSum">
|
|
|
@@ -95,9 +93,8 @@
|
|
|
sum(s.actual_price) as currentReceipt
|
|
|
from kwp_settlement_logistics s
|
|
|
inner join kwp_ledger_logistics l on s.l_ledger_id = l.id
|
|
|
- inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id and lu.unit_type = #{settlementReq.unitType,jdbcType=INTEGER}
|
|
|
- inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id and lu2.unit_type =
|
|
|
- #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
|
|
|
+ inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
|
|
|
+ inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id
|
|
|
</sql>
|
|
|
|
|
|
<!-- 根据连表,查询条件准备 -->
|
|
|
@@ -106,15 +103,17 @@
|
|
|
and s.status = #{settlementReq.status}
|
|
|
</if>
|
|
|
|
|
|
-<!-- <if test="settlementReq.unitType != null">-->
|
|
|
-<!-- and lu.unit_type = #{settlementReq.unitType}-->
|
|
|
-<!-- </if>-->
|
|
|
-
|
|
|
+ <if test="settlementReq.unitType != null">
|
|
|
+ and lu.unit_type = #{settlementReq.unitType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="settlementReq.unitTypeTwo != null">
|
|
|
+ and lu2.unit_type = #{settlementReq.unitTypeTwo,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
<if test="settlementReq.entId != null">
|
|
|
- and lu2.top_ent_id =#{settlementReq.entId,jdbcType=INTEGER}
|
|
|
+ and lu2.top_ent_id = #{settlementReq.entId,jdbcType=INTEGER}
|
|
|
</if>
|
|
|
<if test="settlementReq.trading != null and settlementReq.trading != ''">
|
|
|
- and klt.trading = #{settlementReq.trading,jdbcType=VARCHAR}
|
|
|
+ and l.trading = #{settlementReq.trading,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
<if test="settlementReq.startCreateTime != null and settlementReq.endCreateTime != null">
|
|
|
and s.create_time between #{settlementReq.startCreateTime,jdbcType=TIMESTAMP} and #{settlementReq.endCreateTime,jdbcType=TIMESTAMP}
|
|
|
@@ -140,6 +139,7 @@
|
|
|
l.del_flag = 0
|
|
|
and s.del_flag = 0
|
|
|
and lu.del_flag = 0
|
|
|
+ and lu2.del_flag = 0
|
|
|
<include refid="settlementLogisticsSelectWhere"/>
|
|
|
</where>
|
|
|
order by s.update_time desc
|
|
|
@@ -153,6 +153,7 @@
|
|
|
l.del_flag = 0
|
|
|
and s.del_flag = 0
|
|
|
and lu.del_flag = 0
|
|
|
+ and lu2.del_flag = 0
|
|
|
<include refid="settlementLogisticsSelectWhere"/>
|
|
|
</where>
|
|
|
) a
|
|
|
@@ -164,10 +165,12 @@
|
|
|
from kwp_settlement_logistics s
|
|
|
inner join kwp_ledger_logistics l on s.l_ledger_id = l.id
|
|
|
inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
|
|
|
+ inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id
|
|
|
<where>
|
|
|
l.del_flag = 0
|
|
|
and s.del_flag = 0
|
|
|
and lu.del_flag = 0
|
|
|
+ and lu2.del_flag = 0
|
|
|
<include refid="settlementLogisticsSelectWhere"/>
|
|
|
</where>
|
|
|
</select>
|
|
|
@@ -186,14 +189,15 @@
|
|
|
<include refid="Join_Column_List"/>
|
|
|
from kwp_settlement_logistics s
|
|
|
inner join kwp_ledger_logistics l on s.l_ledger_id = l.id
|
|
|
- inner join kwp_ledger_logistics_unit lu
|
|
|
- on s.l_ledger_id = lu.l_ledger_id and lu.unit_type = #{unitType,jdbcType=INTEGER}
|
|
|
- inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id and lu2.unit_type =
|
|
|
- #{unitTypeTwo,jdbcType=INTEGER}
|
|
|
+ inner join kwp_ledger_logistics_unit lu on s.l_ledger_id = lu.l_ledger_id
|
|
|
+ inner join kwp_ledger_logistics_unit lu2 on s.l_ledger_id = lu2.l_ledger_id
|
|
|
where s.id = #{id,jdbcType=BIGINT}
|
|
|
- <!-- <if test="unitType != null">-->
|
|
|
- <!-- and lu.unit_type = #{unitType}-->
|
|
|
- <!-- </if>-->
|
|
|
+ <if test="unitType != null">
|
|
|
+ and lu.unit_type = #{unitType,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
+ <if test="unitTypeTwo != null">
|
|
|
+ and lu2.unit_type = #{unitTypeTwo,jdbcType=INTEGER}
|
|
|
+ </if>
|
|
|
</select>
|
|
|
|
|
|
<!-- 根据多个结算运费物流订单id查订单,用于导出 -->
|