| | |
| | | date(mi.create_time)>=#{startDate} and date(mi.create_time) <= #{endDate} and mi.available_quantity>0 |
| | | |
| | | </where> |
| | | order by mi.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | date(ou.create_time)>=#{startDate} and date(ou.create_time) <= #{endDate} |
| | | |
| | | </where> |
| | | order by ou.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | |
| | | ) |
| | | </insert> |
| | | |
| | | <insert id="updateMaterialOutbound" > |
| | | update mm.material_outbound |
| | | set material_requisition_personnel=#{materialOutbound.materialRequisitionPersonnel}, |
| | | material_requisition_team=#{materialOutbound.materialRequisitionTeam}, |
| | | order_id=#{materialOutbound.orderId}, |
| | | outbound_type=#{materialOutbound.outboundType}, |
| | | warehouse_manager=#{materialOutbound.warehouseManager}, |
| | | material_requisition_date=#{materialOutbound.materialRequisitionDate} |
| | | where material_outbound_id = #{number} |
| | | </insert> |
| | | |
| | | <insert id="insertMaterialOutboundDetail" useGeneratedKeys="true" > |
| | | insert into mm.material_outbound_detail (material_outbound_id,material_outbound_number,material_code,material_name,use_id,inventory_id,inventory_organization,producer,unit,width, |
| | | height,thickness,outbound_quantity,single_piece_area,inventory_area,date_of_manufacture,remarks) |
| | |
| | | update mm.surplus_materials set quantity=quantity+#{surplusMaterials.quantity} where id=#{surplusMaterials.id} |
| | | </update> |
| | | |
| | | <select id="getPrintCreateOutbound" > |
| | | select id, |
| | | material_outbound_id, |
| | | material_requisition_personnel, |
| | | material_requisition_team, |
| | | order_id, |
| | | outbound_type, |
| | | warehouse_manager, |
| | | date(material_requisition_date) as material_requisition_date, |
| | | reviewed, |
| | | date(reviewed_time) as reviewed_time, |
| | | reviewed_state, |
| | | date(create_time) as create_time |
| | | from mm.material_outbound |
| | | where material_outbound_id = #{materialOutboundId} |
| | | </select> |
| | | |
| | | <select id="getPrintCreateOutboundDetail" > |
| | | select |
| | | ou.project_no as projectNo, |
| | | modd.inventory_id as id, |
| | | modd.inventory_organization as inventoryOrganization, |
| | | modd.material_code as materialCode, |
| | | modd.material_name as materialName, |
| | | modd.producer, |
| | | modd.width, |
| | | modd.height, |
| | | modd.thickness, |
| | | modd.unit, |
| | | modd.outbound_quantity as outboundQuantity, |
| | | date(modd.date_of_manufacture) as dateOfManufacture, |
| | | modd.single_piece_area as singlePieceArea, |
| | | modd.inventory_area as inventoryArea, |
| | | modd.remarks, |
| | | ou.use_count as inventoryQuantity, |
| | | if(mo.reviewed_state!=1,modd.outbound_quantity+ou.not_use_count,ou.not_use_count) as availableQuantity, |
| | | ms.json, |
| | | modd.producer |
| | | from mm.material_outbound_detail modd left join pp.optimize_use ou on modd.use_id=ou.id |
| | | left join mm.material_outbound mo on modd.material_outbound_id=mo.material_outbound_id |
| | | left join mm.material_store ms on modd.material_code=ms.id |
| | | where modd.material_outbound_id = #{materialOutboundId} |
| | | </select> |
| | | |
| | | <select id="getMaterialInventoryById" > |
| | | select |
| | | * |
| | | from mm.material_inventory mi |
| | | where mi.id = #{id} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |