Browse Source

1.干线开单逻辑优化

dist.1.2.0^2
zhenghaoyu 4 months ago
parent
commit
f4e36b37b6
  1. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -53,8 +53,7 @@
IFNULL(sum(ltad.volume),0) volume
from logpm_trunkline_advance_detail ltad
left join logpm_basicdata_factory_category lbfc on lbfc.brand = ltad.brand and type=1
and IFNULL(lbfc.firsts,1) = IFNULL(ltad.first_pack_name,1) and IFNULL(lbfc.seconds,2) = IFNULL(ltad.second_pack_name,2) and IFNULL(lbfc.thirds,3) = IFNULL(ltad.third_pack_name,3) and IFNULL(lbfc.materiel_name,4)=IFNULL(ltad.material_name,4)
left join logpm_basicdata_category lbc on lbc.id = lbfc.category_id
and IFNULL(lbfc.firsts,1) = IFNULL(ltad.first_pack_name,1) and IFNULL(lbfc.seconds,2) = IFNULL(ltad.second_pack_name,2) and IFNULL(lbfc.thirds,3) = IFNULL(ltad.third_pack_name,3) and IFNULL(lbfc.materiel_name,4)=IFNULL(ltad.material_name,4) AND lbfc.is_delete = 0
where ltad.is_deleted = 0
and ltad.advance_id in
<foreach collection="list" item="item" open="(" separator="," close=")">
@ -387,8 +386,8 @@
lbfc2.category_id costCategoryId,
IFNULL(lbfc2.category,'其他') costCategoryName
from logpm_trunkline_advance_detail ltad
left join logpm_basicdata_factory_category lbfc1 on lbfc1.brand = ltad.brand and IFNULL(lbfc1.firsts,1) = IFNULL(ltad.first_pack_name,1) and IFNULL(lbfc1.seconds,2) = IFNULL(ltad.second_pack_name,2) and IFNULL(lbfc1.thirds,3) = IFNULL(ltad.third_pack_name,3) and lbfc1.type = 1 AND IFNULL(lbfc1.materiel_name,4) = IFNULL(ltad.material_name,4)
left join logpm_basicdata_factory_category lbfc2 on lbfc2.brand = ltad.brand and IFNULL(lbfc2.firsts,1) = IFNULL(ltad.first_pack_name,1) and IFNULL(lbfc2.seconds,2) = IFNULL(ltad.second_pack_name,2) and IFNULL(lbfc2.thirds,3) = IFNULL(ltad.third_pack_name,3) and lbfc1.type = 2 AND IFNULL(lbfc2.materiel_name,4) = IFNULL(ltad.material_name,4)
left join logpm_basicdata_factory_category lbfc1 on lbfc1.brand = ltad.brand and IFNULL(lbfc1.firsts,1) = IFNULL(ltad.first_pack_name,1) and IFNULL(lbfc1.seconds,2) = IFNULL(ltad.second_pack_name,2) and IFNULL(lbfc1.thirds,3) = IFNULL(ltad.third_pack_name,3) and lbfc1.type = 1 AND IFNULL(lbfc1.materiel_name,4) = IFNULL(ltad.material_name,4) AND lbfc1.is_deleted = 0
left join logpm_basicdata_factory_category lbfc2 on lbfc2.brand = ltad.brand and IFNULL(lbfc2.firsts,1) = IFNULL(ltad.first_pack_name,1) and IFNULL(lbfc2.seconds,2) = IFNULL(ltad.second_pack_name,2) and IFNULL(lbfc2.thirds,3) = IFNULL(ltad.third_pack_name,3) and lbfc1.type = 2 AND IFNULL(lbfc2.materiel_name,4) = IFNULL(ltad.material_name,4) AND lbfc2.is_deleted = 0
where ltad.is_deleted = 0
<if test="param.advanceIds != null and param.advanceIds.size() > 0">
and ltad.advance_id in

Loading…
Cancel
Save