|
|
|
@ -22,22 +22,25 @@
|
|
|
|
|
<result column="teachRefeFileUrl" property="teachRefeFileUrl"/>
|
|
|
|
|
<result column="teachRefeType" property="teachRefeType"/>
|
|
|
|
|
</collection>
|
|
|
|
|
<collection property="departmentList" ofType="java.util.Map" autoMapping="false">
|
|
|
|
|
<id column="departmentId" property="departmentId"/>
|
|
|
|
|
<result column="departmentName" property="departmentName"/>
|
|
|
|
|
</collection>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<select id="list" resultMap="taskListMap">
|
|
|
|
|
SELECT
|
|
|
|
|
t1.*,t2.tagId,t3.title as tagTitle,t4.brandId,t5.name as brandName,r1.fileUrl as teachRefeFileUrl,r1.type as teachRefeType
|
|
|
|
|
t1.*,t2.tagId,t3.title as tagTitle,t4.brandId,t5.name as brandName
|
|
|
|
|
<if test='openid!=null'>
|
|
|
|
|
,(SELECT count(*)!=0 from userTask as t4,user as t5
|
|
|
|
|
WHERE t1.id = t4.taskId and t4.userId = t5.id and t5.openid = #{openid} ) as isReceived
|
|
|
|
|
</if>
|
|
|
|
|
from task as t1
|
|
|
|
|
<!-- left JOIN ( SELECT taskTag.*,tag.title from tag,taskTag WHERE taskTag.tagId = tag.id ) AS t2-->
|
|
|
|
|
<!-- on t1.id =t2.taskId-->
|
|
|
|
|
<!-- LEFT JOIN ( SELECT taskBrand.*,brand.name from brand,taskBrand WHERE taskBrand.brandId = brand.id ) as t3-->
|
|
|
|
|
<!-- on t1.id = t3.taskId-->
|
|
|
|
|
<!-- left JOIN ( SELECT taskTag.*,tag.title from tag,taskTag WHERE taskTag.tagId = tag.id ) AS t2-->
|
|
|
|
|
<!-- on t1.id =t2.taskId-->
|
|
|
|
|
<!-- LEFT JOIN ( SELECT taskBrand.*,brand.name from brand,taskBrand WHERE taskBrand.brandId = brand.id ) as t3-->
|
|
|
|
|
<!-- on t1.id = t3.taskId-->
|
|
|
|
|
LEFT JOIN taskTag as t2 on t1.id = t2.taskId LEFT JOIN tag as t3 on t3.id = t2.tagId
|
|
|
|
|
LEFT JOIN taskBrand as t4 on t1.id = t4.taskId LEFT JOIN brand as t5 on t5.id = t4.brandId
|
|
|
|
|
LEFT JOIN taskTeachRefe as r1 on t1.id = r1.taskId
|
|
|
|
|
WHERE t1.id in
|
|
|
|
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">#{item}</foreach>
|
|
|
|
|
<if test="tagIdList !=null and tagIdList.size()!=0 ">
|
|
|
|
@ -62,7 +65,8 @@
|
|
|
|
|
<select id="detailById" resultMap="taskListMap">
|
|
|
|
|
SELECT
|
|
|
|
|
t1.*,t2.tagId,t2.title as tagTitle,t3.brandId,t3.name as brandName,t4.referenceId,t4.title as referenceTitle,
|
|
|
|
|
t4.type as referenceType,t4.fileUrl as referenceFileUrl,t4.coverUrl as referenceCoverUrl
|
|
|
|
|
t4.type as referenceType,t4.fileUrl as referenceFileUrl,t4.coverUrl as referenceCoverUrl,
|
|
|
|
|
r1.fileUrl as teachRefeFileUrl,r1.type as teachRefeType,r2.departmentId,r2.name as departmentName
|
|
|
|
|
<if test='openid!=null'>
|
|
|
|
|
,(SELECT count(*)!=0 from userTask as t4,user as t5
|
|
|
|
|
WHERE t1.id = t4.taskId and t4.userId = t5.id and t5.openid = #{openid} ) as isReceived
|
|
|
|
@ -73,8 +77,10 @@
|
|
|
|
|
LEFT JOIN ( SELECT taskBrand.*,brand.name from brand,taskBrand WHERE taskBrand.brandId = brand.id ) as t3
|
|
|
|
|
on t1.id = t3.taskId
|
|
|
|
|
LEFT JOIN ( SELECT taskReference.*,reference.title,reference.type,reference.fileUrl,reference.coverUrl from
|
|
|
|
|
reference,taskReference WHERE taskReference.referenceId = reference.id ) as t4
|
|
|
|
|
on t1.id = t4.taskId
|
|
|
|
|
reference,taskReference WHERE taskReference.referenceId = reference.id ) as t4 on t1.id = t4.taskId
|
|
|
|
|
LEFT JOIN taskTeachRefe as r1 on t1.id = r1.taskId
|
|
|
|
|
LEFT JOIN (select taskDepartment.*,qywxDepartment.name from taskDepartment,qywxDepartment
|
|
|
|
|
where taskDepartment.departmentId = qywxDepartment.departmentId ) as r2 on t1.id = r2.taskId
|
|
|
|
|
WHERE t1.id =#{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|