编码设备库存查询修改
This commit is contained in:
parent
51452ce3a3
commit
20ead6e3a6
|
|
@ -90,29 +90,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</select>
|
||||
<!--设备类型树-->
|
||||
<select id="getDeviceTypeTree" resultType="com.bonus.sgzb.system.domain.TreeNode">
|
||||
SELECT type_id AS id,
|
||||
type_name AS label,
|
||||
parent_id AS parentId,
|
||||
unit_name AS unitName,
|
||||
company_id AS companyId,
|
||||
code,
|
||||
num,
|
||||
model_code AS modelCode,
|
||||
manage_type AS manageType
|
||||
FROM ma_type
|
||||
WHERE del_flag = '0'
|
||||
SELECT mt.type_id AS id,
|
||||
mt.type_name AS label,
|
||||
mt.parent_id AS parentId,
|
||||
mt.unit_name AS unitName,
|
||||
mt.company_id AS companyId,
|
||||
mt.code,
|
||||
CASE mt.manage_type
|
||||
WHEN 0 THEN
|
||||
IFNULL(subquery0.num, 0)
|
||||
ELSE
|
||||
IFNULL(mt.num, 0)
|
||||
END as num,
|
||||
mt.model_code AS modelCode,
|
||||
mt.manage_type AS manageType
|
||||
FROM ma_type mt
|
||||
left join (SELECT mt.type_id,
|
||||
mt2.type_name AS typeName,
|
||||
mt.type_name AS typeModelName,
|
||||
count(mm.ma_id) num
|
||||
FROM ma_machine mm
|
||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||
WHERE mm.ma_code is not null and mm.ma_status in (15)
|
||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||
WHERE mt.del_flag = '0'
|
||||
<if test="level!=null and level!=''">
|
||||
<if test="level == 2">
|
||||
AND level IN ('1','2')
|
||||
AND mt.level IN ('1','2')
|
||||
</if>
|
||||
<if test="level == 3">
|
||||
AND level IN ('1','2','3')
|
||||
AND mt.level IN ('1','2','3')
|
||||
</if>
|
||||
<if test="level == 4">
|
||||
AND level IN ('1','2','3','4')
|
||||
AND mt.level IN ('1','2','3','4')
|
||||
</if>
|
||||
</if>
|
||||
ORDER BY create_time
|
||||
ORDER BY mt.create_time
|
||||
</select>
|
||||
<!--资产属性-->
|
||||
<select id="getAssetAttributesCbx" resultType="com.bonus.sgzb.system.domain.SelectVo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue