| | |
| | | WHERE |
| | | t3.production_id = #{productionId} |
| | | </select> |
| | | |
| | | <!--刀具寿命列表--> |
| | | <select id="toolLifeList" resultType="org.jeecg.modules.screen.dto.ToolLifeDto"> |
| | | SELECT |
| | | t.* |
| | | FROM |
| | | ( |
| | | SELECT |
| | | a.EquipmentID equipmentId, |
| | | t1.equipment_name equipmentName, |
| | | a.TId tId, |
| | | a.InitLife initLife, |
| | | a.CurrentLife currentLife, |
| | | row_number( ) OVER ( partition BY EquipmentID, TId ORDER BY CollectTime DESC ) rw |
| | | FROM |
| | | Basi_CuttingToolCraftLife a |
| | | LEFT JOIN mdc_equipment t1 ON t1.equipment_id = a.EquipmentID |
| | | LEFT JOIN mdc_production_equipment t2 ON t1.id = t2.equipment_id |
| | | WHERE |
| | | t2.production_id = #{productionId} |
| | | ) t |
| | | WHERE |
| | | t.rw = 1; |
| | | </select> |
| | | </mapper> |