Commit a7237540 by wangxin

咨询评论

parent cde6b12a
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
COALESCE(COUNT(nc.id), 0) as commentCount COALESCE(COUNT(nc.id), 0) as commentCount
FROM data_classification dcl FROM data_classification dcl
LEFT JOIN information i ON dcl.id = i.type_two AND i.state = 2 LEFT JOIN information i ON dcl.id = i.type_two AND i.state = 2
LEFT JOIN cloud_trainning_project.tp_comment nc ON i.id = nc.training_project_id and nc.audit_status = 0 LEFT JOIN cloud_trainning_project.tp_comment nc ON i.id = nc.training_project_id and nc.audit_status = 0 AND nc.create_time >= DATE_SUB(NOW(), INTERVAL 24 HOUR)
WHERE dcl.id IN WHERE dcl.id IN
<foreach item="id" collection="classificationIds" open="(" separator="," close=")"> <foreach item="id" collection="classificationIds" open="(" separator="," close=")">
#{id} #{id}
......
...@@ -92,7 +92,9 @@ ...@@ -92,7 +92,9 @@
<select id="informationTwoList" resultType="com.yizhi.site.application.domain.Information"> <select id="informationTwoList" resultType="com.yizhi.site.application.domain.Information">
<!-- select a.* from information a left join data_classification b on a.type_two=b.id <!-- select a.* from information a left join data_classification b on a.type_two=b.id
where 1=1 and a.site_id=#{siteId} and b.site_id=#{siteId} and b.name=#{name} --> where 1=1 and a.site_id=#{siteId} and b.site_id=#{siteId} and b.name=#{name} -->
select a.* from information a where 1=1 and a.site_id=#{siteId} and a.type_two=#{typeId} select a.*,COALESCE(COUNT(nc.id), 0) as commentCount from information a
LEFT JOIN cloud_trainning_project.tp_comment nc ON a.id = nc.training_project_id and nc.audit_status = 0 AND nc.create_time >= DATE_SUB(NOW(), INTERVAL 24 HOUR)
where 1=1 and a.site_id=#{siteId} and a.type_two=#{typeId}
<if test="fileName != null and fileName != ''"> <if test="fileName != null and fileName != ''">
and (a.file_name like CONCAT('%', '${fileName}', '%' ) or a.key_words like CONCAT('%', '${fileName}', '%' ) ) and (a.file_name like CONCAT('%', '${fileName}', '%' ) or a.key_words like CONCAT('%', '${fileName}', '%' ) )
</if> </if>
...@@ -111,7 +113,8 @@ ...@@ -111,7 +113,8 @@
<if test="state != null"> <if test="state != null">
and a.state = #{state} and a.state = #{state}
</if> </if>
order by a.is_top desc, a.update_time desc GROUP BY a.id
order by commentCount desc,a.is_top desc, a.update_time desc
</select> </select>
<select id="informationAllList" resultType="com.yizhi.site.application.domain.Information"> <select id="informationAllList" resultType="com.yizhi.site.application.domain.Information">
......
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