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

Commit 6713598e authored by 胡佳晨's avatar 胡佳晨

修改 admin

parent a7226c48
......@@ -13,31 +13,45 @@
</resultMap>
<select id="list" parameterType="java.util.Map" resultMap="StoneScoreListDtoResult">
select hu.*,
(case when score <![CDATA[>]]> 0 then sum(score) else 0 END) as 'score_all',
(case when score <![CDATA[<]]> 0 then sum(score) else 0 END) as 'score_use',
('score_all' - 'score_use') as 'score_rest'
from (select nickname,
mobile,
au.uid,
IFNULL(ssu.status,1) as 'status'
from adam_user as au
select aut.uid,
aut.mobile,
aut.nickname,
ssut.status,
ssut.score_all,
ssut.score_use
from (
select au.uid, au.mobile, aui.nickname
from adam_user au
inner join adam_user_info aui on au.uid = aui.uid
left join stone_score_user ssu on ssu.uid = aui.uid
where au.state = 1
<where>
<if test="mobile!=''">
AND mobile LIKE concat('%', #{mobile}, '%')
AND au.mobile LIKE concat('%', #{mobile}, '%')
</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!='-999'">
AND status = #{status} OR status is null
AND ssu.status = #{status} OR ssu.status is null
</if>
<if test="uid!='-999'">
AND au.uid = #{uid}
<if test="status!='-999'">
AND ssu.uid =#{uid} OR ssu.status is null
</if>
</where>
) as hu
left join stone_score_logs sslog on sslog.uid = hu.uid
group by hu.uid;
</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