This commit is contained in:
parent
8008939501
commit
8850f6cf5d
|
|
@ -30,7 +30,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectLeaseApplyDetailsVo">
|
||||
select
|
||||
lad.id, lad.parent_id, mt.type_id, mt.type_name, mt2.type_name as ma_type_name, mt.storage_num,
|
||||
lad.id, lad.parent_id, mt.type_id, mt.type_name, mt2.type_name as ma_type_name,
|
||||
CASE mt.manage_type
|
||||
WHEN 0 THEN
|
||||
IFNULL(subquery0.num, 0)
|
||||
ELSE
|
||||
IFNULL(mt.storage_num, 0)
|
||||
END as storage_num,
|
||||
mt.manage_type as manageType,
|
||||
(lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum,
|
||||
IFNULL(lad.pre_num,0) as pre_num,
|
||||
|
|
@ -44,6 +50,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
ma_type mt on lad.type_id = mt.type_id and mt.`level` = '4' and mt.del_flag = '0'
|
||||
left join
|
||||
ma_type mt2 on mt2.type_id = mt.parent_id and mt2.`level` = '3' and mt2.del_flag = '0'
|
||||
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 (1)
|
||||
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
|
||||
</sql>
|
||||
|
||||
<select id="selectLeaseApplyDetailsList" parameterType="com.bonus.material.lease.domain.LeaseApplyDetails" resultMap="LeaseApplyDetailsResult">
|
||||
|
|
|
|||
Loading…
Reference in New Issue