diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml index 0748dc4b7..bc233580b 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml +++ b/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 @@ -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 and ltad.advance_id in