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
bf007f76
Commit
bf007f76
authored
Aug 28, 2018
by
chang20170705
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
brand
parent
5b865f75
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
BrandService.java
src/main/java/com/egolm/shop/service/BrandService.java
+3
-1
BrandServiceImpl.java
...in/java/com/egolm/shop/service/impl/BrandServiceImpl.java
+35
-1
No files found.
src/main/java/com/egolm/shop/service/BrandService.java
View file @
bf007f76
...
...
@@ -9,5 +9,7 @@ public interface BrandService {
public
List
<
Map
<
String
,
Object
>>
listBanner
(
Map
<
String
,
Object
>
params
,
Page
page
);
public
List
<
Map
<
String
,
Object
>>
getBrandList
(
Map
<
String
,
Object
>
map
);
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
);
}
src/main/java/com/egolm/shop/service/impl/BrandServiceImpl.java
View file @
bf007f76
package
com
.
egolm
.
shop
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -8,7 +9,6 @@ import org.apache.commons.logging.LogFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.egolm.common.StringUtil
;
import
com.egolm.common.jdbc.JdbcTemplate
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.shop.service.BrandService
;
...
...
@@ -32,4 +32,38 @@ public class BrandServiceImpl implements BrandService {
//return jdbcTemplate.limit(sql, page);
}
@Override
public
List
<
Map
<
String
,
Object
>>
getBrandList
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
listMap
=
new
ArrayList
<
Map
<
String
,
Object
>>();
String
sql
=
" SELECT PinyinCode = b.sPinyinCode,BrandNO = acg.sBrandID, "
+
"BrandName = b.sBrandName,ImgPath = b.sLogoUrl "
+
"FROM tAgentContractGoods acg, tBrand b "
+
"WHERE acg.sBrandID = b.sBrandID and acg.sOrgNO = ? "
+
"group by b.sPinyinCode, acg.sBrandID, b.sBrandName, b.sLogoUrl "
+
"ORDER BY b.sPinyinCode "
;
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
listMap
=
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
return
listMap
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
getHotSaleBrands
(
Map
<
String
,
Object
>
map
)
{
List
<
Map
<
String
,
Object
>>
listMap
=
new
ArrayList
<
Map
<
String
,
Object
>>();
String
sql
=
"SELECT TOP 20 "
+
"BrandNO = b.sBrandID, "
+
"BrandName = b.sBrandName, "
+
"ImgPath = b.sLogoUrl, "
+
"SaleQty = sum(a.nSaleQty) "
+
"FROM tAgentGoodsDailyOnline a "
+
"JOIN tGoods g ON a.nGoodsID = g.nGoodsID "
+
"JOIN tBrand b ON g.sBrandID = b.sBrandID "
+
"JOIN tAgentContractGoods acg ON a.sAgentContractNO = acg.sAgentContractNO "
+
"and a.nGoodsID = acg.nGoodsID "
+
"WHERE acg.sOrgNO = ? "
+
"GROUP BY b.sBrandID, b.sBrandName, b.sLogoUrl "
+
"ORDER BY sum(a.nSaleQty) DESC "
;
String
OrgNO
=(
String
)
map
.
get
(
"OrgNO"
);
listMap
=
jdbcTemplate
.
queryForList
(
sql
,
OrgNO
);
return
listMap
;
}
}
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