| | |
| | | <if test="height != 0"> |
| | | and t.height = #{height} |
| | | </if> |
| | | <if test="cell == 2"> |
| | | and t.thickness < #{maxThickness} |
| | | </if> |
| | | </where> |
| | | order by total_count desc, glass_count, abs(t.slot - #{currentSlot}) |
| | | ) |
| | |
| | | AND t1.state = 100 |
| | | AND t1.device_id = #{deviceId} |
| | | <if test="width != 0"> |
| | | and t.width = #{width} |
| | | and t1.width = #{width} |
| | | </if> |
| | | <if test="height != 0"> |
| | | and t.height = #{height} |
| | | and t1.height = #{height} |
| | | </if> |
| | | <if test="cell == 1"> |
| | | and #{minOneFirstLength} <= GREATEST(t.width, t.width) |
| | | and #{minOneSecondLength} <= least(t.width, t.width) |
| | | and #{minOneFirstLength} <= GREATEST(t1.width, t1.height) |
| | | and #{minOneSecondLength} <= least(t1.width, t1.height) |
| | | </if> |
| | | <if test="cell == 2"> |
| | | and #{maxTwoFirstLength} >= GREATEST(t.width, t.width) |
| | | and #{maxTwoSecondLength} >= least(t.width, t.width) |
| | | and #{maxTwoFirstLength} >= GREATEST(t1.width, t1.height) |
| | | and #{maxTwoSecondLength} >= least(t1.width, t1.height) |
| | | and t1.thickness < #{maxThickness} |
| | | </if> |
| | | </where> |
| | | ORDER BY abs(t.slot - #{currentCell}) |