bug修复
This commit is contained in:
parent
b48fe4c069
commit
cc4a73b0de
|
|
@ -215,7 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
lod.ma_id AS maId,
|
lod.ma_id AS maId,
|
||||||
mt.type_id,
|
mt.type_id AS typeId,
|
||||||
SUM(IFNULL(lod.out_num, 0)) AS outNum,
|
SUM(IFNULL(lod.out_num, 0)) AS outNum,
|
||||||
bpl.lot_name proName
|
bpl.lot_name proName
|
||||||
FROM
|
FROM
|
||||||
|
|
@ -228,28 +228,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
mt.type_id = #{typeId}
|
mt.type_id = #{typeId}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
lod.ma_id, mt.type_id
|
lod.ma_id, mt.type_id, bpl.lot_name
|
||||||
) AS subquery1
|
) AS subquery1
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
bcd.ma_id AS maId,
|
bcd.ma_id AS maId,
|
||||||
mt.type_id,
|
mt.type_id AS typeId,
|
||||||
SUM(IFNULL(bcd.back_num, 0)) AS backNum
|
SUM(IFNULL(bcd.back_num, 0)) AS backNum,
|
||||||
|
bpl.lot_name proName
|
||||||
FROM
|
FROM
|
||||||
back_check_details bcd
|
back_check_details bcd
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id
|
LEFT JOIN ma_type mt ON mt.type_id = bcd.type_id
|
||||||
|
LEFT JOIN back_apply_info ba ON bcd.parent_id = ba.id
|
||||||
|
LEFT JOIN tm_task_agreement tta on ba.task_id = tta.task_id
|
||||||
|
LEFT JOIN bm_agreement_info bai ON tta.agreement_id = bai.agreement_id
|
||||||
|
LEFT JOIN bm_project_lot bpl ON bai.project_id = bpl.lot_id
|
||||||
WHERE
|
WHERE
|
||||||
mt.type_id = #{typeId}
|
mt.type_id = #{typeId}
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bcd.ma_id, mt.type_id
|
bcd.ma_id, mt.type_id,bpl.lot_name
|
||||||
) AS subquery2 ON subquery1.maId = subquery2.maId
|
) AS subquery2 ON subquery1.maId = subquery2.maId
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = subquery1.type_id
|
AND subquery1.typeId = subquery2.typeId
|
||||||
|
AND subquery1.proName = subquery2.proName
|
||||||
|
LEFT JOIN ma_type mt ON mt.type_id = subquery1.typeId
|
||||||
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
|
||||||
LEFT JOIN ma_machine mm ON mm.ma_id = subquery1.maId
|
LEFT JOIN ma_machine mm ON mm.ma_id = subquery1.maId
|
||||||
WHERE
|
WHERE
|
||||||
mt.manage_type = 0
|
mt.del_flag = 0
|
||||||
AND mt.del_flag = 0
|
|
||||||
AND IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) > 0
|
AND IFNULL(subquery1.outNum, 0) - IFNULL(subquery2.backNum, 0) > 0
|
||||||
</select>
|
</select>
|
||||||
<select id="getzk" resultType="java.lang.Integer">
|
<select id="getzk" resultType="java.lang.Integer">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue