|
|
|
@ -15,7 +15,7 @@
|
|
|
|
|
</collection>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<select id="list" resultMap="referenceMap">
|
|
|
|
|
select t1.*,t2.tagId,t3.title as tagTitle,t4.brandId,t5.name as brandName
|
|
|
|
|
select t1.*,t2.tagId,t3.title as tagTitle,t4.brandId,t5.name as brandName,t6.name as groupName
|
|
|
|
|
<if test='openid!=null'>
|
|
|
|
|
,(SELECT count(*)!=0 from userReference as ur,user as u
|
|
|
|
|
WHERE t1.id = ur.referenceId and ur.userId = u.id and u.openid = #{openid} ) as isCollected
|
|
|
|
@ -23,6 +23,7 @@
|
|
|
|
|
from reference as t1
|
|
|
|
|
LEFT JOIN referenceTag as t2 on t1.id = t2.referenceId LEFT JOIN tag as t3 on t3.id = t2.tagId
|
|
|
|
|
LEFT JOIN referenceBrand as t4 on t1.id = t4.referenceId LEFT JOIN brand as t5 on t5.id = t4.brandId
|
|
|
|
|
LEFT JOIN referenceGroup as t6 on t1.groupId = t6.id
|
|
|
|
|
WHERE t1.id and t1.isDeleted = 0
|
|
|
|
|
<if test="tagIdList !=null and tagIdList.size()!=0 ">
|
|
|
|
|
and t1.id in (SELECT referenceId from referenceTag WHERE referenceTag.tagId in
|
|
|
|
@ -56,6 +57,7 @@
|
|
|
|
|
<result column="duration" property="duration"/>
|
|
|
|
|
<result column="coverUrl" property="coverUrl"/>
|
|
|
|
|
<result column="groupId" property="groupId"/>
|
|
|
|
|
<result column="groupName" property="groupName"/>
|
|
|
|
|
<result column="creatAt" property="creatAt"/>
|
|
|
|
|
<result column="updateAt" property="updateAt"/>
|
|
|
|
|
<result column="isCollected" property="isCollected"/>
|
|
|
|
@ -71,7 +73,7 @@
|
|
|
|
|
</resultMap>
|
|
|
|
|
<select id="referenceDateList" resultMap="referenceDateMap">
|
|
|
|
|
select date_format(t1.creatAt, '%Y-%m-%d') dat,t1.*,t2.tagId,t3.title as tagTitle,t4.brandId,t5.name as
|
|
|
|
|
brandName
|
|
|
|
|
brandName,t6.name as groupName
|
|
|
|
|
<if test='openid!=null'>
|
|
|
|
|
,(SELECT count(*)!=0 from userReference as ur,user as u
|
|
|
|
|
WHERE t1.id = ur.referenceId and ur.userId = u.id and u.openid = #{openid} ) as isCollected
|
|
|
|
@ -79,6 +81,7 @@
|
|
|
|
|
from reference as t1
|
|
|
|
|
LEFT JOIN referenceTag as t2 on t1.id = t2.referenceId LEFT JOIN tag as t3 on t3.id = t2.tagId
|
|
|
|
|
LEFT JOIN referenceBrand as t4 on t1.id = t4.referenceId LEFT JOIN brand as t5 on t5.id = t4.brandId
|
|
|
|
|
LEFT JOIN referenceGroup as t6 on t1.groupId = t6.id
|
|
|
|
|
WHERE t1.id and t1.isDeleted = 0
|
|
|
|
|
<if test="tagIdList !=null and tagIdList.size()!=0 ">
|
|
|
|
|
and t1.id in (SELECT referenceId from referenceTag WHERE referenceTag.tagId in
|
|
|
|
|