SqlServer分页工具类
无详细内容 无 public String findArticle(TArticle article, Integer pageNo,Integer pageSize, String sortName, String sortOrder, Integer num) {StringBuffer sql = new StringBuffer("select top 5 a.id,a.title,a.cate_one,m.parent_id,a.cate_two,m.n
public String findArticle(TArticle article, Integer pageNo, Integer pageSize, String sortName, String sortOrder, Integer num) { StringBuffer sql = new StringBuffer( "select top 5 a.id,a.title,a.cate_one,m.parent_id,a.cate_two,m.name as cate_two_name," + "a.content,a.rank,a.check_status,a.check_time,a.creator,a.create_time,a.updator,a.update_time " + "from t_article a left join t_menu m on a.cate_two = m.id"); if (!CommonUtils.isNullOrLessThanOne(pageNo) && !CommonUtils.isNullOrLessThanOne(pageSize)) { int start = (pageNo-1)*pageSize; int limit = pageSize; String tableName = "t_article a left join t_menu m on a.cate_two = m.id"; String fields = "a.id,a.title,a.cate_one,m.parent_id,a.cate_two,m.name as cate_two_name," + "a.content,a.rank,a.check_status,a.check_time,a.creator,a.create_time,a.updator,a.update_time"; StringBuffer filter = new StringBuffer("1 = 1"); if(article != null){ if (StringUtils.hasLength(article.getTitle())) filter.append(" and a.title like '%").append(article.getTitle()) .append("%'"); if (article.getCateOne() != null && article.getCateOne() != 0) filter.append(" and a.cate_one=").append(article.getCateOne()); if (article.getCateTwo() != null && article.getCateTwo() != 0) filter.append(" and a.cate_two=").append(article.getCateTwo()); if (article.getCreator() != null) filter.append(" and a.creator=").append(article.getCreator()); if (article.getCheckStatus() != null){ if(article.getCheckStatus() == -1) filter.append(" and a.check_status in (0,1,2)"); else{ filter.append(" and a.check_status=").append( article.getCheckStatus()); } } } StringBuffer orderBy = new StringBuffer(""); if (StringUtils.hasLength(sortName) && StringUtils.hasLength(sortOrder)) { orderBy.append("a.").append(this.getColumnPropertyMap().get(sortName)) .append(" ").append(sortOrder); } sql = SqlString.getPaginationSql(start,limit,tableName,fields,filter.toString(),orderBy.toString()); }else{ if (article != null) { sql.append(" where 1=1 "); if (StringUtils.hasLength(article.getTitle())) sql.append(" and a.title like '%").append(article.getTitle()) .append("%'"); if (article.getCateOne() != null) sql.append(" and a.cate_one=").append(article.getCateOne()); if (article.getCateTwo() != null) sql.append(" and a.cate_two=").append(article.getCateTwo()); if (article.getCreator() != null) sql.append(" and a.creator=").append(article.getCreator()); if (article.getCheckStatus() != null) sql.append(" and a.check_status=").append( article.getCheckStatus()); } if (StringUtils.hasLength(sortName) && StringUtils.hasLength(sortOrder)) { sql.append(" order by rank desc,") .append(this.getColumnPropertyMap().get(sortName)) .append(" ").append(sortOrder); } } return sql; }

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











GiteEpages 정적 웹 사이트 배포 실패 : 404 오류 문제 해결 및 해결시 Gitee ...

코드 취약점, 브라우저 호환성, 성능 최적화, 보안 업데이트 및 사용자 경험 개선과 같은 요소로 인해 H5 페이지를 지속적으로 유지해야합니다. 효과적인 유지 관리 방법에는 완전한 테스트 시스템 설정, 버전 제어 도구 사용, 페이지 성능을 정기적으로 모니터링하고 사용자 피드백 수집 및 유지 관리 계획을 수립하는 것이 포함됩니다.

카드 쿠폰 레이아웃의 갭 효과를 실현하십시오. 카드 쿠폰 레이아웃을 설계 할 때 특히 배경이 그라디언트 일 때 카드 쿠폰에 간격을 추가 해야하는 경우가 종종 있습니다.

어떤 경우에는 부정적인 마진이 적용되지 않는 이유는 무엇입니까? 프로그래밍 중에 CSS의 부정적인 마진 (음수 ...

플렉스 레이아웃의 보라색 슬래시 영역에 대한 질문 플렉스 레이아웃을 사용할 때 개발자 도구 (d ...)와 같은 혼란스러운 현상이 발생할 수 있습니다.

크롤링하는 동안 58.com 작업 페이지의 동적 데이터를 얻는 방법은 무엇입니까? Crawler 도구를 사용하여 58.com의 작업 페이지를 크롤링 할 때는이 문제가 발생할 수 있습니다.

H5 페이지 자료의 주요 출처는 다음과 같습니다. 1. Professional Material 웹 사이트 (유료, 고품질, 명확한 저작권); 2. 수제 재료 (높은 독창성이지만 시간 소모); 3. 오픈 소스 자료 라이브러리 (무료, 신중하게 스크리닝해야 함); 4. 사진/비디오 웹 사이트 (저작권 확인이 필요합니다). 또한 통합 재료 스타일, 크기 적응, 압축 처리 및 저작권 보호는주의를 기울여야하는 핵심 포인트입니다.

JavaScript 코드 라인 브레이킹 기술에 대한 자세한 설명 JavaScript 코드를 작성할 때 종종 코드의 가독성에 영향을 줄뿐만 아니라 너무 긴 코드 라인이 발생합니다.
