Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
33bab768
Commit
33bab768
authored
Sep 20, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://key@gitlab.egolm.com/key/shop.git
parents
b8265ac0
87647a66
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
286 additions
and
158 deletions
+286
-158
PageController.java
src/main/java/com/egolm/shop/controller/PageController.java
+168
-91
PageService.java
src/main/java/com/egolm/shop/service/PageService.java
+17
-12
PageServiceImpl.java
...ain/java/com/egolm/shop/service/impl/PageServiceImpl.java
+101
-55
No files found.
src/main/java/com/egolm/shop/controller/PageController.java
View file @
33bab768
This diff is collapsed.
Click to expand it.
src/main/java/com/egolm/shop/service/PageService.java
View file @
33bab768
package
com
.
egolm
.
shop
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.egolm.common.jdbc.Page
;
public
interface
PageService
{
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
);
public
List
<
Map
<
String
,
Object
>>
queryIcon
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
package
com
.
egolm
.
shop
.
service
;
import
java.util.List
;
import
java.util.Map
;
import
com.egolm.common.jdbc.Page
;
public
interface
PageService
{
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
);
public
List
<
Map
<
String
,
Object
>>
queryIcon
(
Map
<
String
,
Object
>
params
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
queryBanner
(
Map
<
String
,
Object
>
params
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
queryNews
(
Map
<
String
,
Object
>
params
,
Page
page
);
}
src/main/java/com/egolm/shop/service/impl/PageServiceImpl.java
View file @
33bab768
package
com
.
egolm
.
shop
.
service
.
impl
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
import
com.egolm.shop.service.PageService
;
@Service
public
class
PageServiceImpl
implements
PageService
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
/**
* 查询首页配置
* <p>Title: query</p>
* <p>Description: </p>
* @param params
* @return
* @see com.egolm.shop.service.PageService#query(java.util.Map)
*/
@Override
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
)
{
String
sql
=
"SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+
" FROM tPlatformLayout "
+
"WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC "
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
queryForList
(
sql
);
}
/**
* 查询图标
* <p>Title: queryIcon</p>
* <p>Description: </p>
* @param params
* @param page
* @return
* @see com.egolm.shop.service.PageService#queryIcon(java.util.Map, com.egolm.common.jdbc.Page)
*/
@Override
public
List
<
Map
<
String
,
Object
>>
queryIcon
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
String
iconGroupNO
=
params
.
get
(
"iconGroupNO"
)+
""
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
String
sql
=
" SELECT IconNO = i.sIconNO ,IconPath=i.sIconPath,DefaultTxt=i.sDefaultTxt,DefaultLinkType=i.sDefaultLinkType,DefaultLink=i.sDefaultLink "
+
" FROM tIcon i ,tIconGroup ig"
+
" WHERE i.sGroupNO = ig.sGroupNO AND ig.nTag&1=0 and ig.sGroupNO = ? "
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
iconGroupNO
);
}
}
package
com
.
egolm
.
shop
.
service
.
impl
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.common.jdbc.dialect.SqlServerDialect
;
import
com.egolm.shop.service.PageService
;
@Service
public
class
PageServiceImpl
implements
PageService
{
@Autowired
private
JdbcTemplate
jdbcTemplate
;
/**
* 查询首页配置
* <p>Title: query</p>
* <p>Description: </p>
* @param params
* @return
* @see com.egolm.shop.service.PageService#query(java.util.Map)
*/
@Override
public
List
<
Map
<
String
,
Object
>>
query
(
Map
<
String
,
Object
>
params
)
{
String
sql
=
"SELECT sPlatformNO platformNO,sPlatformName platformName,sLogoPath1 logoPath1 ,sLogoPath2 logoPath2,sLogoPath3 logoPath3,sThemeNO themeNO,sThemeJson themeJson,sMemo memo,dLastUpdateTime lastUpdateTime "
+
" FROM tPlatformLayout "
+
"WHERE nTag &1=0 ORDER BY dLastUpdateTime DESC "
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
return
jdbcTemplate
.
queryForList
(
sql
);
}
/**
* 查询图标
* <p>Title: queryIcon</p>
* <p>Description: </p>
* @param params
* @param page
* @return
* @see com.egolm.shop.service.PageService#queryIcon(java.util.Map, com.egolm.common.jdbc.Page)
*/
@Override
public
List
<
Map
<
String
,
Object
>>
queryIcon
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
String
iconGroupNO
=
params
.
get
(
"iconGroupNO"
)+
""
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
String
sql
=
" SELECT IconNO = i.sIconNO ,IconPath=i.sIconPath,DefaultTxt=i.sDefaultTxt,DefaultLinkType=i.sDefaultLinkType,DefaultLink=i.sDefaultLink "
+
" FROM tIcon i ,tIconGroup ig"
+
" WHERE i.sGroupNO = ig.sGroupNO AND ig.nTag&1=0 and ig.sGroupNO = ? "
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
iconGroupNO
);
}
/**
* 查询banner
* @Title: queryBanner
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public
List
<
Map
<
String
,
Object
>>
queryBanner
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
String
orgNO
=
params
.
get
(
"orgNO"
)+
""
;
String
typeID
=
params
.
get
(
"typeID"
)+
""
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
String
sql
=
"SELECT BannerAdNO = b.sBannerAdNO, BannerAdTitle = b.sBannerAdTitle,OrgNO = b.sOrgNO,AdPostionTypeID = b.sAdPositionTypeID,AdPostionType = b.sAdPositionType,"
+
" LayoutTypeID = b.sLayoutTypeID,LayoutType = b.sLayoutType,JumpTypeID = b.sJumpTypeID,JumpType = b.sJumpType,JumpList = b.sJumpList,Idx = b.nIdx,ImagePath = b.sImagePath,"
+
" LinkPath = b.sLinkPath "
+
" from tBannerAd b "
+
" WHERE sOrgNO = ? AND sAdPositionTypeID =? AND b.dStartTime <=getdate() AND b.dEndTime >= getdate() AND b.nTag&2 = 2 "
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
orgNO
,
typeID
);
}
/**
* 查快报
* @Title: queryNews
* @Description: TODO(这里用一句话描述这个方法的作用)
* @param @param params
* @param @param page
* @param @return 设定文件
* @return 返回类型
* @throws
*/
public
List
<
Map
<
String
,
Object
>>
queryNews
(
Map
<
String
,
Object
>
params
,
Page
page
)
{
String
orgNO
=
params
.
get
(
"orgNO"
)+
""
;
String
msgTypeID
=
params
.
get
(
"msgTypeID"
)+
""
;
jdbcTemplate
.
setDialect
(
new
SqlServerDialect
());
String
sql
=
"SELECT BillBoardID = b.nBillboardID, MsgTypeID = b.sMsgTypeID,MsgType = b.sMsgType,Title = b.sTitle,Content = b.sText,Sort = b.nSort,TradeDate = b.dTradeDate"
+
" FROM tBillboard b "
+
" WHERE b.nTag&2=2 AND b.sMsgTypeID = ? "
;
return
jdbcTemplate
.
limit
(
sql
,
page
,
msgTypeID
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment