代码提交
This commit is contained in:
parent
6ba1e886f3
commit
f8fc86dc2c
|
|
@ -457,32 +457,42 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
<select id="getNumsDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
<select id="getNumsDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
||||||
SELECT
|
SELECT
|
||||||
mt.type_id as typeId,
|
mt.type_id as typeId,
|
||||||
mt2.type_name as typeName,
|
mt2.type_name as typeName,
|
||||||
mt.type_name as typeModelName,
|
mt.type_name as typeModelName,
|
||||||
mt.unit_name as unit,
|
mt.unit_name as unit,
|
||||||
mm.assets_code as assetsCode,
|
mm.assets_code as assetsCode,
|
||||||
ifnull(mt.lease_price,0) as rentPrice,
|
ifnull(mt.lease_price,0) as rentPrice,
|
||||||
CASE mt.manage_type
|
CASE mt.manage_type
|
||||||
WHEN 0 THEN
|
WHEN 0 THEN
|
||||||
IFNULL(count(mm.ma_id), 0)
|
IFNULL(count(mm.ma_id), 0)
|
||||||
ELSE
|
ELSE
|
||||||
IFNULL(mt.storage_num, 0)
|
IFNULL(mt.storage_num, 0)
|
||||||
END AS num,
|
END AS num,
|
||||||
'在库' AS status
|
'在库' AS status
|
||||||
FROM ma_machine mm
|
FROM
|
||||||
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
|
ma_type mt
|
||||||
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
LEFT JOIN ma_machine mm ON mt.type_id = mm.type_id
|
||||||
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
|
||||||
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
LEFT JOIN ma_type mt3 ON mt3.type_id = mt2.parent_id
|
||||||
WHERE mm.ma_code is not null and mm.ma_status in (1) and mt.`level` = 4
|
LEFT JOIN ma_type mt4 ON mt4.type_id = mt3.parent_id
|
||||||
|
WHERE
|
||||||
|
mt.LEVEL = 4
|
||||||
<if test="typeName != null and typeName !=''">
|
<if test="typeName != null and typeName !=''">
|
||||||
AND mt2.type_name like concat ('%', #{typeName}, '%')
|
AND mt2.type_name like concat ('%', #{typeName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="typeModelName != null and typeModelName !=''">
|
<if test="typeModelName != null and typeModelName !=''">
|
||||||
AND mt.type_name like concat ('%', #{typeModelName}, '%')
|
AND mt.type_name like concat ('%', #{typeModelName}, '%')
|
||||||
</if>
|
</if>
|
||||||
GROUP BY mt.type_id
|
AND (
|
||||||
|
mt.manage_type != 0
|
||||||
|
OR (
|
||||||
|
mt.manage_type = 0
|
||||||
|
AND mm.ma_code IS NOT NULL
|
||||||
|
AND mm.ma_status IN (1)
|
||||||
|
))
|
||||||
|
GROUP BY
|
||||||
|
mt.type_id
|
||||||
</select>
|
</select>
|
||||||
<select id="getAllMacheDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
<select id="getAllMacheDetails" resultType="com.bonus.material.push.domain.MachineInfoBean">
|
||||||
( SELECT
|
( SELECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue