and a.loc_no like '%' + #{loc_no} + '%'
and a.mat_no like '%' + #{mat_no} + '%'
and a.mat_name like '%' + #{mat_name} + '%'
and a.qty = #{qty}
and a.unit like '%' + #{unit} + '%'
and a.modi_time between #{startTime} and #{endTime}
select * from
(
select
ROW_NUMBER() over (order by a.appe_time,a.mat_no,a.loc_no) as row,
a.*
from asr_loc_detl a
left join asr_loc_mast b on a.loc_no = b.loc_no
where 1=1
and b.loc_sts = 'F'
) t where t.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
select
count(1)
from asr_loc_detl a
left join asr_loc_mast b on a.loc_no = b.loc_no
where 1=1
and b.loc_sts = 'F'
select a.*
from asr_loc_detl a
left join asr_loc_mast b on a.loc_no = b.loc_no
where 1=1
and b.loc_sts = 'F' and a.mat_no= #{mat_no}
order by a.appe_time
select SUM(qty) qty
from asr_loc_detl
where loc_no=#{locNo}
select a.mat_name,a.mat_no,sum(a.qty) qty from
(
select
ROW_NUMBER() over (order by c.appe_time,c.mat_no,c.loc_no) as row,
c.*
from asr_loc_detl c
) a where a.row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
group by a.mat_no,a.mat_name
select
count(1)
from asr_loc_detl a
select
ROW_NUMBER() over (order by a.mat_no, sum(a.qty) desc) as row
, a.mat_no, a.mat_name
, sum(a.qty) as qty
from asr_loc_detl a
where 1=1
group by a.mat_no,a.mat_name