代码提交

This commit is contained in:
liang.chao 2025-03-08 18:22:12 +08:00
parent b00153f18c
commit 39e569160e
2 changed files with 33 additions and 9 deletions

View File

@ -15,6 +15,8 @@ public class SelectVo {
/** 名称*/
private String name;
// 库存
private Integer num;
/**
* 单位

View File

@ -52,15 +52,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getMaTypeDataById" resultType="com.bonus.sgzb.material.domain.SelectVo">
SELECT type_id AS id,
type_name AS `name`,
unit_name as unit,
lease_price AS leasePrice,
is_replace as isReplace
FROM ma_type
WHERE del_flag = '0'
AND parent_id = #{id}
and level = '4'
SELECT mt.type_id AS id,
mt.type_name AS `name`,
mt.unit_name as unit,
mt.lease_price AS leasePrice,
CASE mt.manage_type
WHEN 0 THEN
IFNULL(subquery0.num, 0)
ELSE
IFNULL(mt.num, 0)
END as num,
mt.is_replace as isReplace
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'
AND mt.parent_id = #{id}
and mt.level = '4'
</select>
<!--数据字典下拉选-->
<select id="getDictByPidCbx" resultType="com.bonus.sgzb.material.domain.SelectVo">