fix(mill): 修复换辊记录查询逻辑
- 修正了MesRollChangeMapper.xml中的查询条件,添加del_flag = 0过滤已删除记录 - 修改了排序规则,从change_id改为change_time优先排序,确保获取最新的换辊记录 - 注释掉了服务层中统计信息的相关代码,避免不必要的数据加载和计算 - 确保查询能够返回正确的最新换辊记录,提高数据准确性
This commit is contained in:
@@ -149,12 +149,12 @@ public class MesRollChangeServiceImpl implements IMesRollChangeService
|
|||||||
if (rec != null) {
|
if (rec != null) {
|
||||||
cell.put("rollNo", getRollNoByPos(rec, posType));
|
cell.put("rollNo", getRollNoByPos(rec, posType));
|
||||||
cell.put("onlineTime", rec.getChangeTime());
|
cell.put("onlineTime", rec.getChangeTime());
|
||||||
Map<String, Object> stats = mesRollChangeMapper.selectCoilStats(rec.getChangeTime(), null);
|
// Map<String, Object> stats = mesRollChangeMapper.selectCoilStats(rec.getChangeTime(), null);
|
||||||
MesRollChangeVo tmp = new MesRollChangeVo();
|
// MesRollChangeVo tmp = new MesRollChangeVo();
|
||||||
fillStatsToVo(tmp, stats);
|
// fillStatsToVo(tmp, stats);
|
||||||
cell.put("workLength", tmp.getWorkLength());
|
// cell.put("workLength", tmp.getWorkLength());
|
||||||
cell.put("coilCount", tmp.getCoilCount());
|
// cell.put("coilCount", tmp.getCoilCount());
|
||||||
cell.put("totalWeight", tmp.getTotalWeight());
|
// cell.put("totalWeight", tmp.getTotalWeight());
|
||||||
}
|
}
|
||||||
byStand.put(standNo, cell);
|
byStand.put(standNo, cell);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,15 +168,14 @@
|
|||||||
<!-- 查询指定机架+辊位的最新换辊记录 -->
|
<!-- 查询指定机架+辊位的最新换辊记录 -->
|
||||||
<select id="selectLatestByStandAndPosition" resultMap="MesRollChangeResult">
|
<select id="selectLatestByStandAndPosition" resultMap="MesRollChangeResult">
|
||||||
<include refid="selectMesRollChangeVo"/>
|
<include refid="selectMesRollChangeVo"/>
|
||||||
FROM mes_roll_change
|
WHERE line_id = #{lineId} AND stand_no = #{standNo} AND del_flag = 0
|
||||||
WHERE line_id = #{lineId} AND stand_no = #{standNo}
|
|
||||||
AND (
|
AND (
|
||||||
(#{posType} = 'upperWr' AND upper_wr_no IS NOT NULL)
|
(#{posType} = 'upperWr' AND upper_wr_no IS NOT NULL)
|
||||||
OR (#{posType} = 'lowerWr' AND lower_wr_no IS NOT NULL)
|
OR (#{posType} = 'lowerWr' AND lower_wr_no IS NOT NULL)
|
||||||
OR (#{posType} = 'upperBr' AND upper_br_no IS NOT NULL)
|
OR (#{posType} = 'upperBr' AND upper_br_no IS NOT NULL)
|
||||||
OR (#{posType} = 'lowerBr' AND lower_br_no IS NOT NULL)
|
OR (#{posType} = 'lowerBr' AND lower_br_no IS NOT NULL)
|
||||||
)
|
)
|
||||||
ORDER BY change_id DESC
|
ORDER BY change_time DESC, change_id DESC
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user