티스토리 뷰
저장 프로시저
/*********************************************************************
Name : [up_st_room_facilities_list]
Auth : 장정훈
Date : 2014-04-09
Desc : 관리자 > 부대시설 목록
declare @totalCount bigint
exec up_st_room_facilities_list 'name', '', @totalCount output
print @totalCount
-----------------------------------------------------------------------------------------------------------------------------------------*/
alter proc [dbo].[up_st_room_facilities_list]
@searchType varchar(10),
@searchWord varchar(20),
@totalCount bigint output
as
begin
select @totalCount = count(*)
from tb_st_facilities_info with(nolock)
select idx as IDX
, division as Division
, s_idx as sIDX
, name as Name
, descr as Description
, charge as Charge
, isvalid as isUse
from tb_st_facilities_info with(nolock)
where 1=1 and
(
@searchType like 'name' and @searchWord is not null and name like '%'+@searchWord+'%'
or
@searchWord is null and 1=1
)
/************************************************************
0. 결과처리
************************************************************/
if ( @@error > 0 )--//실패
begin
return 0
end
else --//성공
begin
return -1
end
end
select
a.idx,
a.personal_key,
c.member_reg_date,
a.member_id,
isnull(d.member_name,'') as member_name,
isnull(d.member_hp,'') as member_hp,
c.member_client_ip as memberClientIP
from tb_cmp_join a with(nolock)
inner join t_personal b with(nolock)
on a.personal_key = b.personal_key
inner join t_member c with(nolock)
on a.member_id = c.member_id
left outer join tb_cmp_apply d with(nolock) on a.personal_key = d.personal_key
where 1=1
and
(
@searchWord = '' and 1=1
or
@searchWord <> '' and @searchType like 'id' and c.member_id like '%'+@searchWord+'%'
or
@searchWord <> '' and @searchType like 'hp' and d.member_hp like '%'+@searchWord+'%'
or
@searchWord <> '' and @searchType like 'name' and d.member_name like '%'+@searchWord+'%'
)
페이징 추가
/*********************************************************************
name : [up_data_request_private_list]
auth : jang jeong-hun
date : 2014-01-20
desc : 내 자료 요청 목록
exec up_data_request_private_list 'jjh5400823', 0, 1, 15
*********************************************************************/
alter proc up_data_request_private_list
@user_id varchar(12),
@category_code int,
@currentPageNumber int,
@pageSize int
as
begin
-- 총 갯수
declare @totalCount int
select @totalCount=count(*)
from tb_data_request_list as a
left join tb_data_request_category_info as b
on a.category_code = b.category_code
where a.del_yn = 'N' and a.user_id = @user_id
-- 시작 커서Seq와 끝Seq 설정
declare @startNumber int
declare @endNumber int
set @startNumber = @totalCount - ((@currentPageNumber-1)*@pageSize)
set @endNumber = @totalCount - @pageSize
select *, @totalCount as totalItem
from (
select
a.seq
, a.user_id
, a.memo
, a.reg_date
, b.category_name
, a.state
, row_number() over(order by a.seq asc) as rowNumber
from tb_data_request_list as a
left join tb_data_request_category_info as b
on a.category_code = b.category_code
where a.del_yn = 'N' and a.user_id = @user_id and (
@category_code = 0 and 1=1
or
@category_code <> 0 and a.category_code = @category_code
)) as temp
where temp.rowNumber < @startNumber and temp.rowNumber >= @endNumber
order by rowNumber desc
end
- Total
- Today
- Yesterday
- .submit()
- System.Diagnostics
- java 키워드 정리
- 스프링 프레임워크(spring framework)
- 진수 변환
- jsp 오픈 소스
- 스프링 시큐리티(spring security)-http basic 인증
- await
- 람다식(lambda expression)
- 특정 문자를 기준으로 자르기
- jstl(java standard tag library)
- 스프링 시큐리티(spring security)
- nl2br
- React
- In App Purchase
- MainActor
- docker
- 인텔리제이(intellij)
- jstl(java standard tag library)-core
- 메이븐(maven)
- 제품 등록
- error-java
- 문자 자르기
- system.io
- java.sql
- 표현 언어(expression language)
- java-개발 환경 설정하기
- java web-mvc
- 스프링 프레임워크(spring framewordk)
- 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 |