| | |
| | | <?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="org.jeecg.modules.lsw.mapper.LswMaterialInventoryMapper"> |
| | | |
| | | <delete id="deleteByMainId" parameterType="java.lang.String"> |
| | | DELETE |
| | | FROM lsw_material_inventory |
| | | WHERE |
| | | material_id = #{mainId} </delete> |
| | | |
| | | <select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.lsw.entity.LswMaterialInventory"> |
| | | SELECT * |
| | | FROM lsw_material_inventory |
| | | WHERE |
| | | material_id = #{mainId} </select> |
| | | <select id="selectLineSideMaterialInventoryByMaterialNumber" |
| | | resultType="org.jeecg.modules.lsw.vo.LswMaterialInventoryVo"> |
| | | SELECT |
| | |
| | | t1.material_number, |
| | | t1.material_name |
| | | </select> |
| | | <select id="statisticsInventory" resultType="org.jeecg.modules.lsw.vo.MaterialInventoryStatisticsVO"> |
| | | select m1.warehouse_id, m2.warehouse_name, m1.materialQuantity |
| | | from (select warehouse_id, SUM(quantity) as materialQuantity |
| | | from lsw_material_inventory |
| | | where material_id = #{materialId} |
| | | and inventory_status = 'NORMAL' |
| | | group by warehouse_id) m1 |
| | | left join base_line_side_warehouse m2 on m1.warehouse_id = m2.id |
| | | |
| | | </select> |
| | | <select id="queryMaterialInventory" resultType="org.jeecg.modules.lsw.vo.MaterialInventoryVO"> |
| | | select t2.material_number, |
| | | t2.material_name, |
| | | t2.material_category, |
| | | t1.batch_number, |
| | | t1.quantity |
| | | from lsw_material_inventory t1 |
| | | left join lsw_material t2 on t1.material_id = t2.id |
| | | where t1.inventory_status = 'NORMAL' |
| | | and t1.warehouse_id = #{warehouseId} |
| | | and t2.material_category in |
| | | <foreach collection="materialCategoryList" item="item" separator="," open="(" close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </select> |
| | | </mapper> |