Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
d33fab28
Commit
d33fab28
authored
Sep 25, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-wallet-bug-fix' into dev
parents
6c8dfd64
c057585b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
29 deletions
+30
-29
AppUserSellingWaterMapper.xml
...n/src/main/resources/mapper/AppUserSellingWaterMapper.xml
+30
-29
No files found.
ace-modules/ace-admin/src/main/resources/mapper/AppUserSellingWaterMapper.xml
View file @
d33fab28
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
SELECT
SELECT
aur.user_id,
aur.user_id,
aur.bind_time as `leagueTime`,
aur.bind_time as `leagueTime`,
ausww.income
IFNULL(ausww.income,0) AS `income`
FROM
FROM
`app_user_relation` AS `aur`
`app_user_relation` AS `aur`
LEFT JOIN (SELECT DISTINCT
LEFT JOIN (SELECT DISTINCT
`source_id` AS userId,
`source_id` AS userId,
IFNULL(
IFNULL(
(
(
( SELECT
SUM( commission ) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 ) - ( SELECT SUM( commission
) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 )
( SELECT
IFNULL(SUM( commission ),0) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 0 ) - ( SELECT IFNULL(SUM( commission ),0
) FROM `app_user_selling_water` WHERE source_id = ausw.source_id AND `status` = 1 )
),
),
0
0
) AS `income`
) AS `income`
...
@@ -33,44 +33,45 @@ FROM
...
@@ -33,44 +33,45 @@ FROM
</select>
</select>
<select
id=
"selectSellerWalterByUserIdAndWating"
resultType=
"com.github.wxiaoqi.security.admin.vo.SellingWalletVo"
>
<select
id=
"selectSellerWalterByUserIdAndWating"
resultType=
"com.github.wxiaoqi.security.admin.vo.SellingWalletVo"
>
<!-- SELECT
<!-- SELECT
*
*
FROM
FROM
(
(
SELECT
SELECT
ausw.*,
ausw.*,
IFNULL( ausw.commission, 0 ) - IFNULL( auswt.commission, 0 ) AS `commissionnm`,
IFNULL( ausw.commission, 0 ) - IFNULL( auswt.commission, 0 ) AS `commissionnm`,
auswt.status AS sellerStatus,
auswt.status AS sellerStatus,
IFNULL(auswt.status,0) AS `isShow`
IFNULL(auswt.status,0) AS `isShow`
FROM
FROM
( SELECT * FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id`=#{userId} <if test="wating!=null">
( SELECT * FROM `app_user_selling_water` WHERE STATUS = 0 AND `user_id`=#{userId} <if test="wating!=null">
AND `waiting`=#{wating} <!–AND `status`=0–>
AND `waiting`=#{wating} <!–AND `status`=0–>
</if>) AS `ausw`
</if>) AS `ausw`
LEFT JOIN ( SELECT * FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id`=#{userId} <if
LEFT JOIN ( SELECT * FROM `app_user_selling_water` WHERE STATUS = 1 AND `user_id`=#{userId} <if
test="wating!=null">
test="wating!=null">
AND `waiting`=#{wating} <!–AND `status`=0–>
AND `waiting`=#{wating} <!–AND `status`=0–>
</if>) AS `auswt` ON auswt.order_no = ausw.order_no
</if>) AS `auswt` ON auswt.order_no = ausw.order_no
) AS `auswres`
) AS `auswres`
ORDER BY crt_time DESC-->
ORDER BY crt_time DESC-->
SELECT w.*,o.commission as commission ,o.type AS `sellerStatus` FROM (
SELECT w.*,o.commission as commission ,o.type AS `sellerStatus` FROM (
SELECT t.order_no,SUM(t.z)-SUM(t.f) as commission,IF(SUM(t.f)>0,'1',0)as type FROM (
SELECT t.order_no,SUM(t.z)-SUM(t.f) as commission,IF(SUM(t.f)>0,'1',0)as type FROM (
SELECT order_no,commission
as
z,0 as f FROM app_user_selling_water WHERE user_id=#{userId}
SELECT order_no,commission
as
z,0 as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=0
and commission>0
AND `status`=0 and commission>0
UNION
UNION
SELECT order_no,0 as z,commission as
f FROM app_user_selling_water WHERE user_id=#{userId}
SELECT order_no,0 as z,commission as f FROM app_user_selling_water WHERE user_id=#{userId}
AND `status`=1
and commission>0
AND `status`=1 and commission>0
) as t
) as t
GROUP BY t.order_no
GROUP BY t.order_no
) o LEFT JOIN ( SELECT DISTINCT order_no,user_id,source_id,order_type,img,price,title,waiting,`crt_time` FROM app_user_selling_water ) w
) o LEFT JOIN ( SELECT DISTINCT order_no,user_id,source_id,order_type,img,price,title,waiting,`crt_time` FROM
app_user_selling_water ) w
ON o.order_no=w.order_no
ON o.order_no=w.order_no
where 1=1
where 1=1
<if
test=
"wating!=null"
>
<if
test=
"wating!=null"
>
and `waiting`= #{wating} and
<![CDATA[
and `waiting`= #{wating} and
<![CDATA[
o.`type`<>
1 ]]>
o.`type`<>
1 ]]>
</if>
</if>
ORDER BY `crt_time`
ORDER BY `crt_time`
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
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