如果登录人为空获取对应负责人的值
This commit is contained in:
parent
a679a68465
commit
f6eb2f9901
|
@ -251,7 +251,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectAchievementsByParam" parameterType="com.microservices.dms.achievementLibrary.domain.AchQueryVo" resultType="com.microservices.dms.achievementLibrary.domain.Achievements">
|
||||
<if test="source == '' or source == null">
|
||||
select a.id, a.achievement_name,a.summary,a.create_time,a.owner_name,a.tags,a.field_1,a.field_2,a.field_3,a.source,a.source_id,
|
||||
u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
|
||||
u.login as "userLogin",
|
||||
IFNULL(u.nickname,a.owner_name) as "userNickName",
|
||||
ue.gender as "gender",
|
||||
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = id) as watcherSum,
|
||||
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = id) as favoriteSum
|
||||
from achievements a
|
||||
|
@ -264,7 +266,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test='source=="1"'>
|
||||
select a.id, a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
|
||||
c.name as "field1Name",u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
|
||||
c.name as "field1Name",u.login as "userLogin",
|
||||
IFNULL(u.nickname,a.owner_name) as "userNickName",
|
||||
ue.gender as "gender",
|
||||
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
|
||||
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
|
||||
from achievements a
|
||||
|
@ -282,7 +286,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</if>
|
||||
<if test='source=="2" or source=="3" or source=="4" '>
|
||||
select a.id, a.achievement_name, a.summary, a.create_time, a.owner_name, a.tags, a.field_1, a.field_2, a.field_3, a.source, a.source_id,
|
||||
c.name as "field1Name",u.login as "userLogin",u.nickname as "userNickName",ue.gender as "gender",
|
||||
c.name as "field1Name",u.login as "userLogin",
|
||||
IFNULL(u.nickname,a.owner_name) as "userNickName",
|
||||
ue.gender as "gender",
|
||||
(select IFNULL(count(*), 0) from favorites where favorite_type = 'Achievements' and favorite_id = a.id) as watcherSum,
|
||||
(select IFNULL(count(*), 0) from watchers where watchable_type = 'Achievements' and watchable_id = a.id) as favoriteSum
|
||||
from achievements a
|
||||
|
|
Loading…
Reference in New Issue