티스토리 뷰
728x90
반응형
declare
@picking_no bigint = ''
, @pl_cd varchar(10) = ''
, @date_type int = 1
, @start_date datetime = '2020-5-31'
, @end_date datetime = '2020-5-31'
, @search_type int = 0
, @search_value varchar(25) = ''
, @picking_status char(1) = 'A'
begin
declare @sql nvarchar(max)
, @paramlist nvarchar(4000)
set @sql = N'
set nocount on
declare @datetime_min_value datetime = ''1753-01-01''
if @end_date > @datetime_min_value
begin
set @end_date = dateadd(millisecond, -3, dateadd(day, 1, @end_date))
end
select
pl.picking_no
, max(pl.op_id) as op_id
, max(pl.picking_yn) as picking_yn
, max(pl.reg_id) as reg_id
, max(pl.reg_dt) as reg_dt
, max(pl.cart_no) as cart_no
, max(cb.cd_nm) as picking_status
from
inner join
on ps.picking_no = pl.picking_no
left join
on cb.cd_type = ''WMS007''
and cb.svc_nation_cd = ''SG''
and ps.picking_yn = cb.cd
where pl.pl_cd = @pl_cd
'
if @picking_no > 0
begin
set @sql = @sql + N' and pl.picking_no = @picking_no '
end
if @date_type = 1
begin
set @sql = @sql + N' and pl.reg_dt between @start_date and @end_date '
end
if @search_type = 1
begin
set @sql = @sql + N' and pl.op_id = @search_value '
end
if @search_type = 2
begin
set @sql = @sql + N' and ps.sku_no = @search_value '
end
if @picking_status <> 'A'
begin
set @sql = @sql + N' and pl.picking_yn = @picking_status '
end
set @sql = @sql + N'
group by pl.picking_no
order by pl.picking_no desc
'
set @paramlist = N'
@picking_no bigint
, @pl_cd varchar(10)
, @date_type int
, @start_date datetime
, @end_date datetime
, @search_type int
, @search_value varchar(25)
, @picking_status char(1)
'
exec sp_executesql @sql
, @paramlist
, @picking_no = @picking_no
, @pl_cd = @pl_cd
, @date_type = @date_type
, @start_date = @start_date
, @end_date = @end_date
, @search_type = @search_type
, @search_value = @search_value
, @picking_status = @picking_status
end
728x90
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 상품 등록
- 스프링 프레임워크(spring framewordk)
- jstl(java standard tag library)-core
- java web-mvc
- jsp 오픈 소스
- 제품 등록
- 스프링 시큐리티(spring security)
- jstl(java standard tag library)
- 스프링 프레임워크(spring framework)
- system.io
- java.sql
- MainActor
- error-java
- .submit()
- React
- 표현 언어(expression language)
- await
- java 키워드 정리
- 스프링 시큐리티(spring security)-http basic 인증
- 특정 문자를 기준으로 자르기
- nl2br
- In App Purchase
- System.Diagnostics
- java-개발 환경 설정하기
- 진수 변환
- 문자 자르기
- 인텔리제이(intellij)
- 메이븐(maven)
- 람다식(lambda expression)
- REST API
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함