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

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

修改 admin

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