Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-golf-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f6f65d75
authored
Oct 15, 2018
by
Huang Linyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
排行榜数据更新查询
parent
b60e547d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
7 deletions
src/main/java/com/ctrip/fun/golf/dao/user/ActiveCustomerDao.java
src/main/java/com/ctrip/fun/golf/dao/user/UserExtDao.java
src/main/java/com/ctrip/fun/golf/domain/user/ActiveCustomer.java
src/main/java/com/ctrip/fun/golf/dao/user/ActiveCustomerDao.java
View file @
f6f65d75
...
@@ -21,8 +21,8 @@ public class ActiveCustomerDao extends GenericHibernateDao<ActiveCustomer, Integ
...
@@ -21,8 +21,8 @@ public class ActiveCustomerDao extends GenericHibernateDao<ActiveCustomer, Integ
public
Integer
insertOne
(
ActiveCustomerBean
bean
)
{
public
Integer
insertOne
(
ActiveCustomerBean
bean
)
{
StringBuilder
sql
=
new
StringBuilder
(
"INSERT INTO active_customer (saleMobile,customerName,customerMobile,picUrl,sex,createTime,updateTime)"
)
StringBuilder
sql
=
new
StringBuilder
(
"INSERT INTO active_customer (
productName,
saleMobile,customerName,customerMobile,picUrl,sex,createTime,updateTime)"
)
.
append
(
"VALUES('"
+
bean
.
getSaleMobile
()+
"','"
+
bean
.
getCustomerName
()+
"','"
+
bean
.
getCustomerMobile
()+
"','"
+
bean
.
getPicUrl
()+
"','"
+
bean
.
getSex
()+
"',NOW(),NOW());"
)
.
append
(
"VALUES('"
+
bean
.
get
ProductName
()+
"','"
+
bean
.
get
SaleMobile
()+
"','"
+
bean
.
getCustomerName
()+
"','"
+
bean
.
getCustomerMobile
()+
"','"
+
bean
.
getPicUrl
()+
"','"
+
bean
.
getSex
()+
"',NOW(),NOW());"
)
;
;
Query
query
=
getSession
().
createSQLQuery
(
sql
.
toString
());
Query
query
=
getSession
().
createSQLQuery
(
sql
.
toString
());
return
query
.
executeUpdate
();
return
query
.
executeUpdate
();
...
...
src/main/java/com/ctrip/fun/golf/dao/user/UserExtDao.java
View file @
f6f65d75
...
@@ -1250,12 +1250,23 @@ public class UserExtDao extends GenericHibernateDao<UserExt, Integer> {
...
@@ -1250,12 +1250,23 @@ public class UserExtDao extends GenericHibernateDao<UserExt, Integer> {
public
List
<
RecommendRankBean
>
getRanking980
()
{
public
List
<
RecommendRankBean
>
getRanking980
()
{
StringBuffer
sql
=
new
StringBuffer
(
""
);
StringBuffer
sql
=
new
StringBuffer
(
""
);
sql
.
append
(
"SELECT b.recommendUid inviterUid,c.UserName inviterUserName,COUNT(CASE WHEN a.amount=980 THEN a.orderId END) AS myNum1,"
);
sql
.
append
(
" SELECT DISTINCT q.uid inviterUid,q.username inviterUserName,"
);
sql
.
append
(
" COUNT(CASE WHEN a.amount=360 THEN a.orderId END) AS myNum2"
);
sql
.
append
(
" COUNT(CASE WHEN p.productName='980.00' THEN p.customerMobile END) AS myNum1, "
);
sql
.
append
(
" FROM ord_order a LEFT JOIN ord_communeitem b ON a.orderId = b.orderId "
);
sql
.
append
(
" COUNT(CASE WHEN p.productName='360.00' THEN p.customerMobile END) AS myNum2"
);
sql
.
append
(
" LEFT JOIN bsc_userext c ON b.recommendUid = c.uid"
);
sql
.
append
(
" FROM("
);
sql
.
append
(
" SELECT a.saleMobile,a.customerMobile ,CONCAT(a.productName,'.00') AS productName"
);
sql
.
append
(
" FROM active_customer a"
);
sql
.
append
(
" UNION "
);
sql
.
append
(
" SELECT d.bindedMobilePhone AS customerMobile,c.bindedMobilePhone AS saleMobile,CONCAT(a.amount) AS productName"
);
sql
.
append
(
" FROM ord_order a LEFT JOIN ord_communeitem b ON a.orderId = b.orderId"
);
sql
.
append
(
" LEFT JOIN bsc_userext c ON a.uid = c.uid"
);
sql
.
append
(
" LEFT JOIN bsc_userext d ON b.recommendUid = d.uid"
);
sql
.
append
(
" WHERE a.orderDate >'2018-10-10 23:59:59' AND OrderCategory = 13 AND ProcessStatus & 16=16 AND platform = 'MP'"
);
sql
.
append
(
" WHERE a.orderDate >'2018-10-10 23:59:59' AND OrderCategory = 13 AND ProcessStatus & 16=16 AND platform = 'MP'"
);
sql
.
append
(
" GROUP BY b.recommendUid ORDER BY myNum1 DESC"
);
sql
.
append
(
" ) p "
);
sql
.
append
(
" LEFT JOIN bsc_userext q ON p.saleMobile = q.bindedMobilePhone"
);
sql
.
append
(
" GROUP BY p.saleMobile"
);
sql
.
append
(
" ORDER BY myNum1 DESC"
);
sql
.
append
(
" "
);
Query
query
=
getSession
().
createSQLQuery
(
sql
.
toString
())
Query
query
=
getSession
().
createSQLQuery
(
sql
.
toString
())
...
...
src/main/java/com/ctrip/fun/golf/domain/user/ActiveCustomer.java
View file @
f6f65d75
...
@@ -26,6 +26,7 @@ public class ActiveCustomer implements java.io.Serializable{
...
@@ -26,6 +26,7 @@ public class ActiveCustomer implements java.io.Serializable{
private
Integer
id
;
private
Integer
id
;
private
String
productName
;
private
String
saleMobile
;
private
String
saleMobile
;
private
String
customerName
;
private
String
customerName
;
private
String
customerMobile
;
private
String
customerMobile
;
...
@@ -45,6 +46,13 @@ public class ActiveCustomer implements java.io.Serializable{
...
@@ -45,6 +46,13 @@ public class ActiveCustomer implements java.io.Serializable{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
@Column
(
name
=
"productName"
,
length
=
100
)
public
String
getProductName
()
{
return
productName
;
}
public
void
setProductName
(
String
productName
)
{
this
.
productName
=
productName
;
}
@Column
(
name
=
"saleMobile"
,
length
=
20
)
@Column
(
name
=
"saleMobile"
,
length
=
20
)
public
String
getSaleMobile
()
{
public
String
getSaleMobile
()
{
return
saleMobile
;
return
saleMobile
;
...
...
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