| | |
| | | ms.json |
| | | from mm.material_inventory mi left join mm.material_store ms on mi.material_code=ms.id |
| | | <where> |
| | | date(mi.create_time)>=#{startDate} and date(mi.create_time) <= #{endDate} and mi.available_quantity>0 |
| | | and mi.available_quantity>0 |
| | | |
| | | </where> |
| | | order by mi.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialInventoryDatePageTotal"> |
| | |
| | | from |
| | | mm.material_inventory mi |
| | | <where> |
| | | date(mi.create_time)>=#{startDate} and date(mi.create_time) <= #{endDate} and mi.available_quantity>0 |
| | | and mi.available_quantity>0 |
| | | |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | |
| | | ou.id as useId, |
| | | ou.project_no as projectNo, |
| | | mi.inventory_quantity AS inventoryQuantity, |
| | | mi.plan_quantity AS availableQuantity, |
| | | mi.available_quantity AS availableQuantity, |
| | | mi.plan_quantity AS planQuantity, |
| | | mi.id, |
| | | mi.inventory_organization as inventoryOrganization, |
| | |
| | | ms.json from pp.optimize_use ou left join mm.material_inventory mi on ou.raw_stock_code=mi.id left join mm.material_store ms on mi.material_code=ms.id |
| | | left join pp.optimize_project op on op.project_no=ou.project_no |
| | | <where> |
| | | mi.plan_quantity>0 and op.state>=100 and |
| | | date(ou.create_time)>=#{startDate} and date(ou.create_time) <= #{endDate} |
| | | mi.plan_quantity>0 and op.state>=100 and ou.state=1 |
| | | |
| | | </where> |
| | | order by ou.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialInventoryEngineeringDatePageTotal"> |
| | | select |
| | | CEILING(count(id)/#{pageSize}) as 'pageTotal', |
| | | count(id) as 'total' |
| | | from |
| | | pp.optimize_use ou |
| | | CEILING(count(ou.id)/#{pageSize}) as 'pageTotal', |
| | | count(ou.id) as 'total' |
| | | from pp.optimize_use ou left join mm.material_inventory mi on ou.raw_stock_code=mi.id left join mm.material_store ms on mi.material_code=ms.id |
| | | left join pp.optimize_project op on op.project_no=ou.project_no |
| | | <where> |
| | | ou.not_use_count>0 and ou.state=1 and |
| | | date(ou.create_time)>=#{startDate} and date(ou.create_time) <= #{endDate} |
| | | mi.plan_quantity>0 and op.state>=100 and ou.state=1 |
| | | |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | |
| | | </if> |
| | | |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialInventoryPageTotal"> |
| | |
| | | |
| | | </where> |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialInventoryEngineering"> |
| | |
| | | |
| | | </where> |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialInventoryEngineeringPageTotal"> |
| | |
| | | |
| | | </where> |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | |
| | | and modd.material_outbound_id regexp #{materialOutboundDetail.materialOutboundId} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialOutboundEngineering" > |
| | |
| | | and modd.material_outbound_id regexp #{materialOutboundDetail.materialOutboundId} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectMaterialOutboundDetailPageTotal"> |
| | |
| | | and modd.material_outbound_id regexp #{materialOutboundDetail.materialOutboundId} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | |
| | | and rwd.returning_id regexp #{returningWarehouseDetail.returningId} |
| | | </if> |
| | | </where> |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getSelectReturningWarehouseDetailPageTotal"> |
| | |
| | | </delete> |
| | | |
| | | <select id="getMaximum" > |
| | | select count(*) from mm.material_outbound where date(create_time)=CURDATE() |
| | | select |
| | | ifnull(SUBSTR(max(right(material_outbound_id,8)) from 7),0) |
| | | from |
| | | mm.material_outbound as a |
| | | where |
| | | date(a.create_time) = curdate() |
| | | |
| | | </select> |
| | | |
| | | <select id="getMaximums" > |
| | | select count(*) from mm.returning_warehouse where date(create_time)=CURDATE() |
| | | select |
| | | ifnull(SUBSTR(max(right(returning_id,8)) from 7),0) |
| | | from |
| | | mm.returning_warehouse as a |
| | | where |
| | | date(a.create_time) = curdate() |
| | | |
| | | </select> |
| | | |
| | | <select id="getMaterialOutboundCount" > |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="deleteMaterialInventory"> |
| | | delete from |
| | | mm.material_inventory mi |
| | | <where> |
| | | <if test="ids != null and ids != ''"> |
| | | and mi.id in |
| | | <foreach item="id" collection="ids" open="(" separator="," close=")"> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |