Browse Source

[feat]

工程管理 物料信息
新增按料号前缀匹配查找列表的方法;
dev
王晓迪 4 months ago
parent
commit
69d022870d
  1. 3
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java
  2. 17
      ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

3
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpMaterialMapper.java

@ -114,4 +114,7 @@ public interface ErpMaterialMapper
//查询所有通过审核的半成品和成品物料的信息
List<ErpMaterialVo> selectCateErpMaterialList();
//根据料号前缀查询匹配物料
List<ErpMaterialVo> searchMaterialsByPrefix(String prefix);
}

17
ruoyi-admin/src/main/resources/mapper/erp/ErpMaterialMapper.xml

@ -325,4 +325,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateMaterialBomNo" parameterType="ErpMaterial">
update erp_material set bomNo = #{bomNo} where material_no = #{materialNo}
</update>
<select id="searchMaterialsByPrefix" parameterType="String" resultMap="ErpMaterialResult">
select erp.id, erp.del_flag, erp.create_by, erp.remark,erp.bomNo, erp.material_no,
erp.material_name, erp.audit_status, erp.use_status, erp.hava_product_tem,
erp.material_type, erp.process_method, erp.unit, erp.brand, erp.`describe`,
erp.warehouse_dept,erp.business_members,cate.parent_id,cate.name as material_type_name
from erp_material erp
left join (
select code,name,parent_id from sys_category
where parent_id in(
select id from sys_category
where parent_id = (select id from sys_category where code = 'materialType') )
)cate on erp.material_type = cate.code
where cate.parent_id in (select id from sys_category where code in ('cp','bcp'))
and erp.del_flag = '0' and erp.audit_status = '1'
and material_no like concat(#{prefix}, '%') escape '\\'
</select>
</mapper>
Loading…
Cancel
Save