Files
klp-oa/klp-wms/src/main/resources/mapper/klp/WmsProductBomMapper.xml

38 lines
1.5 KiB
XML
Raw Normal View History

2025-07-18 10:12:48 +08:00
<?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.klp.mapper.WmsProductBomMapper">
<resultMap type="com.klp.domain.WmsProductBom" id="WmsProductBomResult">
<result property="bomId" column="bom_id"/>
<result property="productId" column="product_id"/>
<result property="rawMaterialId" column="raw_material_id"/>
<result property="quantity" column="quantity"/>
<result property="unit" column="unit"/>
<result property="remark" column="remark"/>
</resultMap>
<select id="listByProductId" resultType="com.klp.domain.WmsProductBom">
SELECT bom_id, product_id, raw_material_id, quantity, unit, remark
FROM wms_product_bom
WHERE product_id = #{productId}
and del_flag = 0
</select>
2025-07-19 17:21:33 +08:00
<!-- 分页联查产品和原材料名称编码支持Wrapper动态条件返回Page<WmsProductBomVo> -->
<select id="selectVoPagePlus" resultType="com.klp.domain.vo.WmsProductBomVo">
SELECT
b.*,
p.product_name AS productName,
p.product_code AS productCode,
r.raw_material_name AS rawMaterialName,
r.raw_material_code AS rawMaterialCode
FROM wms_product_bom b
LEFT JOIN wms_product p ON b.product_id = p.product_id
LEFT JOIN wms_raw_material r ON b.raw_material_id = r.raw_material_id
${ew.customSqlSegment}
</select>
2025-07-18 10:12:48 +08:00
</mapper>