and a.loc_no like '%' + #{loc_no} + '%'
and a.mat_no like '%' + #{mat_no} + '%'
and a.mat_name like '%' + #{mat_name} + '%'
and a.str3 like '%'+#{str3}+'%'
and a.qty = #{qty}
and a.unit like '%' + #{unit} + '%'
and a.modi_time between #{startTime} and #{endTime}
and mat_no like '%' + #{mat_no} + '%'
and mat_name like '%' + #{mat_name} + '%'
and str3 like '%'+#{str3}+'%'
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})
order by supplier,modi_time,loc_no
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 * from
(
select ROW_NUMBER() over (order by a.mat_no) as row,
a.mat_name,a.mat_no,a.supplier,a.str3,sum(a.qty) qty from
(
select
mat_name,mat_no,supplier,str3,qty
from asr_loc_detl c
where 1=1
) a
group by a.mat_no,a.mat_name,a.supplier,a.str3
) d
where 1=1
and row between ((#{pageNumber}-1)*#{pageSize}+1) and (#{pageNumber}*#{pageSize})
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,a.supplier
, sum(a.qty) as qty
from asr_loc_detl a
where 1=1
group by a.mat_no,a.mat_name,a.supplier