select top 1 * from wcs_task_wrk
where 1=1
and task_no = #{taskNo}
select top 1 * from wcs_task_wrk
where 1=1
and io_type=3
and start_point = #{startPoint}
select top 1 * from wcs_task_wrk
where 1=1
and wrk_no = #{wrkNo}
select top 1 * from dbo.wcs_task_wrk
where status=1
and crn_no=#{crnNo}
and wrk_no=#{workNo}
and start_point=#{startPoint}
and io_type=1
order by io_pri desc,create_time,wrk_no ASC
select * from wcs_task_wrk
where 1=1
and status = 1
select * from dbo.wcs_task_wrk
where crn_no=#{crnNo}
and io_type = 3
order by io_pri desc,create_time,wrk_no ASC
select * from dbo.wcs_task_wrk
where crn_no=#{crnNo}
and target_point=#{targetPoint}
and wrk_sts=13
and io_type = 2
order by io_pri desc,create_time,wrk_no ASC
select * from dbo.wcs_task_wrk
where crn_no=#{crnNo}
and target_point=#{targetPoint}
and wrk_sts=11
and io_type = 2
order by io_pri desc,create_time,wrk_no ASC
select * from dbo.wcs_task_wrk
where crn_no=#{crnNo}
-- and target_point=#{targetPoint}
and wrk_sts=11
and io_type = 3
order by io_pri desc,create_time ASC
select top 1 * from dbo.wcs_task_wrk
where 1=1
and (wrk_sts=3 or wrk_sts=12)
and crn_no=#{crnNo}
order by io_pri desc,create_time,wrk_no ASC
select top 1 * from dbo.wcs_task_wrk
where 1=1
and (wrk_sts=3 or wrk_sts=12)
and crn_no=#{crnNo}
and wrk_no=#{workNo}
order by io_pri desc,create_time,wrk_no ASC
select * from dbo.wcs_task_wrk
where 1=1
and ((wrk_sts=14 and status=5) or status=7 or status=4 or (wrk_sts=4 and status=5))
order by io_pri desc,create_time,wrk_no ASC
insert into wcs_task_wrk_log select * from wcs_task_wrk where task_no = #{taskNo} and (status=5 or status=4 or status=6)
insert into wcs_task_wrk_log select * from wcs_task_wrk where task_no = #{taskNo}
select * from dbo.wcs_task_wrk
where (wrk_sts=3 and io_type = 1)
or (wrk_sts=12 and io_type = 2)
order by io_pri desc,create_time,wrk_no ASC