feat(wms): 添加钢卷物料改判记录查询功能
- 在IWmsMaterialCoilService中新增queryPageListWithRejudge方法 - 实现批量查询钢卷最新改判记录的Mapper方法 - 添加SQL映射查询每个钢卷的最新一条改判记录 - 创建WmsMaterialCoilRejudgeVo视图对象包含改判信息 - 实现控制器listWithRejudge接口供前端调用 - 在服务实现中批量关联钢卷与其最新改判记录
This commit is contained in:
@@ -23,4 +23,31 @@
|
||||
${sql}
|
||||
</select>
|
||||
|
||||
<!-- 批量根据钢卷ID列表查询每个钢卷的最新一条改判记录 -->
|
||||
<select id="selectLatestByCoilIds" resultType="com.klp.domain.vo.WmsCoilQualityRejudgeVo">
|
||||
SELECT
|
||||
r.rejudge_id AS rejudgeId,
|
||||
r.coil_id AS coilId,
|
||||
r.before_quality AS beforeQuality,
|
||||
r.after_quality AS afterQuality,
|
||||
r.rejudge_reason AS rejudgeReason,
|
||||
r.remark,
|
||||
r.create_by AS createBy,
|
||||
r.create_time AS createTime,
|
||||
r.update_by AS updateBy,
|
||||
r.update_time AS updateTime
|
||||
FROM wms_coil_quality_rejudge r
|
||||
INNER JOIN (
|
||||
SELECT coil_id, MAX(create_time) AS max_create_time
|
||||
FROM wms_coil_quality_rejudge
|
||||
WHERE del_flag = '0'
|
||||
AND coil_id IN
|
||||
<foreach collection="coilIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
GROUP BY coil_id
|
||||
) latest ON r.coil_id = latest.coil_id AND r.create_time = latest.max_create_time
|
||||
WHERE r.del_flag = '0'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user