手持机搜索原料供应商

This commit is contained in:
sxu 2025-05-01 12:06:47 +08:00
parent 5dc4ba5602
commit d7c1485d47
1 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bonus.canteen.core.drp.mapper.DrpInventoryMapper">
<!-- AI电子秤原料搜索 -->
<select id="selectAndroidMaterialList"
resultType="com.bonus.canteen.core.drp.vo.AndroidSearchMaterialVO">
select
mm.material_id,
mm.material_name,
mm.material_code,
mmc.category_name,
ds.supplier_id,
ds.supplier_name,
mm.unit_id,
du.unit_name,
du.weigh_type,
du.rate,
did.unit_price
from
menu_material mm
left join (
select
a.*
from
drp_into_detail as a,
( select b.material_id, max( b.id ) as id from drp_into_detail as b group by b.material_id ) as c
where
a.material_id = c.material_id
and a.id = c.id
) did on mm.material_id = did.material_id
left join menu_material_category mmc on mm.category_id = mmc.category_id
left join drp_supplier ds on did.supplier_id = ds.supplier_id
left join drp_unit du on mm.unit_id = du.unit_id
where
mm.del_flag = #{delFlag}
<if test="content.materialCode != null and content.materialCode != ''">
and mm.material_code = #{content.materialCode}
</if>
<if test="content.materialName != null and content.materialName != ''">
and (
mm.material_name like concat(concat('%', #{content.materialName}), '%')
or mm.pinyin_initials like concat(concat('%', #{pinyinInitials}), '%')
or mm.pinyin_full like concat(concat('%', #{pinyinFull}), '%')
)
</if>
<if test="content.categoryIdList != null and content.categoryIdList.size() > 0">
and mm.category_id in
<foreach collection="content.categoryIdList" item="categoryId" separator="," open="(" close=")">
#{categoryId}
</foreach>
</if>
<if test="content.barCode != null and content.barCode != ''">
and mm.bar_code = #{content.areaId}
</if>
<if test="content.areaId != null and content.areaId != 0">
and ds.area_id = #{content.areaId}
</if>
</select>
</mapper>