记得上下班打卡 | git大法好,push需谨慎

Commit 699431b4 authored by 胡佳晨's avatar 胡佳晨

admin

parent 6a35bb92
...@@ -55,7 +55,7 @@ public class StoneLogsController extends BaseController { ...@@ -55,7 +55,7 @@ public class StoneLogsController extends BaseController {
@PostMapping("list") @PostMapping("list")
@ResponseBody @ResponseBody
public TableDataInfo list(StoneScoreListParam listParam) { public TableDataInfo list(StoneScoreListParam listParam) {
startPage(); // startPage();
List<StoneScoreListDto> result = iScoreService.list(listParam); List<StoneScoreListDto> result = iScoreService.list(listParam);
return this.getDataTable(result); return this.getDataTable(result);
} }
......
...@@ -13,45 +13,32 @@ ...@@ -13,45 +13,32 @@
</resultMap> </resultMap>
<select id="list" parameterType="java.util.Map" resultMap="StoneScoreListDtoResult"> <select id="list" parameterType="java.util.Map" resultMap="StoneScoreListDtoResult">
select aut.uid, select hu.*,
aut.mobile, (case when score <![CDATA[>]]> 0 then sum(score) else 0 END) as 'score_all',
aut.nickname, (case when score <![CDATA[<]]> 0 then sum(score) else 0 END) as 'score_use',
ssut.status, ('score_all' - 'score_use') as 'score_rest'
ssut.score_all, from (select nickname,
ssut.score_use mobile,
from ( au.uid,
select au.uid, au.mobile, aui.nickname IFNULL(ssu.status,1) as 'status'
from adam_user au from adam_user as au
inner join adam_user_info aui on au.uid = aui.uid inner join adam_user_info aui on au.uid = aui.uid
where au.state = 1 left join stone_score_user ssu on ssu.uid = aui.uid
<where> <where>
<if test="mobile!=''"> <if test="mobile!=''">
AND au.mobile LIKE concat('%', #{mobile}, '%') AND mobile LIKE concat('%', #{mobile}, '%')
</if> </if>
</where>
) aut
left join (
select ssu.uid,
IFNULL(ssu.status, 1) as `status`,
ssls.score_all,
ssls.score_use
from stone_score_user ssu
inner join (
select uid,
sum(case when score <![CDATA[>]]> 0 then score else 0 end) score_all,
sum(case when score <![CDATA[<]]> 0 then score else 0 end) score_use
from stone_score_logs
group by uid
) ssls
) ssut on ssut.uid = aut.uid
<where>
<if test="status!=''"> <if test="status!=''">
AND ssut.status = #{status} OR ssut.status is null AND status = #{status} OR status is null
</if> </if>
<if test="uid!=-999"> <if test="uid!='-999'">
AND ssut.uid =#{uid} OR ssut.status is null AND au.uid = #{uid}
</if> </if>
</where> </where>
limit 50
) as hu
left join stone_score_logs sslog on sslog.uid = hu.uid
group by hu.uid;
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment