物料管理倒序查询

This commit is contained in:
liumingxiy 2024-11-13 15:35:29 +08:00
parent 90a7648905
commit a284ef3fa3

View File

@ -66,55 +66,56 @@
</if>
<if test="itemTypeId != null and itemTypeId != 0">
AND (item_type_id = #{itemTypeId} OR item_type_id in (select item_type_id
from md_item_type
where find_in_set(#{itemTypeId}, ancestors)))
from md_item_type
where find_in_set(#{itemTypeId}, ancestors)))
</if>
<if test="itemName != null and itemName != ''">
AND item_name like concat('%', #{itemName}, '%')
</if>
<if test="itemOrProduct != null and itemOrProduct != ''">
AND item_or_product = #{itemOrProduct}
AND item_or_product = #{itemOrProduct}
</if>
<if test="enableFlag != null and enableFlag != ''">
AND enable_flag = #{enableFlag}
</if>
</where>
ORDER BY CREATE_TIME DESC
</select>
<select id="getExeportList" parameterType="MdItem" resultMap="MdItemResult">
select i.item_id,
i.item_code,
i.item_name,
i.specification,
i.model_number,
i.unit_of_measure,
i.unit_name,
i.item_or_product,
i.item_type_id,
i.item_type_code,
i.enable_flag,
i.safe_stock_flag,
i.min_stock,
i.max_stock,
i.high_value,
i.create_by,
i.create_time,
i.remark,
CONCAT((select group_concat(item_type_name separator '/')
from md_item_type b
where FIND_IN_SET(CAST(item_type_id as CHAR), a.ancestors) > 0), '/',
a.item_type_name) as item_type_name
i.item_code,
i.item_name,
i.specification,
i.model_number,
i.unit_of_measure,
i.unit_name,
i.item_or_product,
i.item_type_id,
i.item_type_code,
i.enable_flag,
i.safe_stock_flag,
i.min_stock,
i.max_stock,
i.high_value,
i.create_by,
i.create_time,
i.remark,
CONCAT((select group_concat(item_type_name separator '/')
from md_item_type b
where FIND_IN_SET(CAST(item_type_id as CHAR), a.ancestors) > 0), '/',
a.item_type_name) as item_type_name
from md_item i
left join md_item_type a
on i.item_type_id = a.item_type_id
left join md_item_type a
on i.item_type_id = a.item_type_id
<where>
<if test="itemCode != null and itemCode != ''">
AND i.item_code like concat('%', #{itemCode}, '%')
</if>
<if test="itemTypeId != null and itemTypeId != 0">
AND (i.item_type_id = #{itemTypeId} OR i.item_type_id in (select item_type_id
from md_item_type
where find_in_set(#{itemTypeId}, ancestors)))
from md_item_type
where find_in_set(#{itemTypeId}, ancestors)))
</if>
<if test="itemName != null and itemName != ''">
AND i.item_name like concat('%', #{itemName}, '%')
@ -153,12 +154,14 @@
</select>
<select id="getMdItemCount" resultType="java.lang.Integer">
select count(*) from base_knife where mbb_bd_mrl_id = #{itemId}
select count(*)
from base_knife
where mbb_bd_mrl_id = #{itemId}
</select>
<insert id="insertMdItem" parameterType="MdItem" useGeneratedKeys="true" keyProperty="itemId">
insert into md_item(item_code,
item_name,
item_name,
<if test="specification != null and specification != ''">
specification,
</if>
@ -210,7 +213,7 @@
</if>
create_time)
values (#{itemCode},
#{itemName},
#{itemName},
<if test="specification != null and specification != ''">
#{specification},
</if>