Commit 764d3bd1 authored by 李秀明's avatar 李秀明

fix: BUG#24036 消防器材,备品备件名称应该修改成“备品物资”,备品物资下应统计备品备件的总数和库存器材的总数

parent d0013ad6
......@@ -15,8 +15,14 @@
<if test="dto.name != null and dto.name != ''">
AND `name` LIKE CONCAT('%', #{dto.name}, '%')
</if>
<if test="dto.code != null and dto.code != ''">
AND `equip_model_code` LIKE concat('%', #{dto.code}, '%')
<!-- <if test="dto.code != null and dto.code != ''">-->
<!-- AND `equip_model_code` LIKE concat('%', #{dto.code}, '%')-->
<!-- </if>-->
<if test="dto.code == 'BPBJ'">
AND LEFT(equip_model_code, 1) = '4'
</if>
<if test="dto.code == 'KCQC'">
AND LEFT(equip_model_code, 1) != '4'
</if>
<if test="codeHead != null and codeHead != ''">
AND LEFT (equip_model_code, #{hierarchy}) = #{codeHead}
......@@ -35,26 +41,37 @@
</select>
<select id="countSpareEquip" resultType="java.util.Map">
select
a.equip_model_name AS `name`,
sum( a.stock_num ) AS `value`,
a.unit AS unit,
IFNULL( ifnull( b.img, b.shbz_img ), '' ) AS icon,
a.equip_model_id AS equipmentModelId,
a.equip_model_code AS equipmentModelCode
SELECT
'备品备件' AS name,
'BPBJ' AS code,
count( 1 ) AS value
FROM
wl_spare_equipment a
LEFT JOIN wl_equipment b ON b.id = a.equip_model_id
<where>
LEFT JOIN wl_equipment b ON b.id = a.equip_model_id
WHERE
a.is_delete = 0
AND a.stock_num != 0
AND LEFT(a.equip_model_code, 1) = '4'
<if test="bizOrgCode != '' and bizOrgCode != null">
AND a.`biz_org_code` LIKE concat(#{bizOrgCode}, '%')
</if>
UNION ALL
SELECT
'库存器材' AS name,
'KCQC' AS code,
count(1) AS value
FROM
wl_spare_equipment a
LEFT JOIN wl_equipment b ON b.id = a.equip_model_id
WHERE
a.is_delete = 0
AND a.stock_num != 0
AND LEFT(a.equip_model_code, 1) != '4'
<if test="bizOrgCode != '' and bizOrgCode != null">
AND a.`biz_org_code` LIKE concat(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY
a.equip_model_id
HAVING
sum( a.stock_num ) != 0
</select>
<select id="exportList" resultType="com.yeejoin.equipmanage.common.entity.WlSpareEquipment">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment