SELECT a.*
FROM man_action a
AND a.deleted = 0
AND a.id = #{param.id}
AND a.seq_num = #{param.seqNum}
AND a.task_id = #{param.taskId}
AND a.action_type = #{param.actionType}
AND a.action_sts = #{param.actionSts}
AND a.status = #{param.status}
AND (
a.memo LIKE CONCAT('%', #{param.keywords}, '%')
OR a.memo LIKE CONCAT('%', #{param.keywords}, '%')
)
order by a.create_time desc
update man_action set action_sts = #{actionSts} where group_id = #{groupId}
SELECT
magv.uuid AS agvNo,
mat.name
FROM man_action ma
LEFT JOIN man_action_type mat ON ma.action_type = mat.id
LEFT JOIN man_agv magv ON ma.agv_id = magv.id
WHERE 1=1
AND mat.uuid IN ('ReadyTakeFromShelvesLoc', 'ReadyTakeFromAgvSite', 'ReadyReleaseToShelvesLoc', 'ReadyReleaseToAgvSite')
ORDER BY ma.id DESC
LIMIT 0, 10
SELECT
mat.uuid,
mat.name,
COUNT(ma.action_type) AS count
FROM man_action_type mat
LEFT JOIN man_action ma ON ma.`action_type` = mat.`id`
WHERE 1=1
GROUP BY mat.uuid, mat.name
ORDER BY count DESC
SELECT group_id
FROM man_action
WHERE 1=1
AND action_sts = #{actionSts}
AND group_id IS NOT NULL
GROUP BY group_id
SELECT ma.group_id
FROM man_action ma
JOIN man_action_sts mas ON ma.action_sts = mas.id
WHERE mas.UUID = 'PREPARE'
AND ma.group_id IS NOT NULL
GROUP BY ma.group_id
SELECT
DISTINCT task_id
FROM man_action
WHERE 1=1
AND group_id = #{groupId}
AND task_id IS NOT NULL
SELECT
ma.code
FROM man_action ma
WHERE 1=1
AND ma.action_sts IN (
SELECT id FROM man_action_sts WHERE UUID IN ('PREPARE', 'ISSUED')
)
AND ma.agv_id = #{agvId}
ORDER BY ma.priority DESC
SELECT *
FROM man_action a
JOIN (
SELECT group_id, MAX(io_time) AS max_io_time
FROM man_action
WHERE agv_id = #{agvId} AND action_sts = #{actionSts}
GROUP BY group_id
) b ON a.group_id = b.group_id AND a.io_time = b.max_io_time
WHERE a.agv_id = #{agvId}
AND a.action_sts = #{actionSts}
ORDER BY a.priority DESC