提交 55dc8580 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 0bcb5519
......@@ -53,18 +53,15 @@ public interface DiyTypeMapper extends BaseMapper<DiyType> {
* @param oid
* @return
*/
@Select("SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-resource`.res_author_library_diy_type a "
+ " LEFT JOIN `hxkf-resource`.res_author_library b ON a.authorlibraryid = b.id "
+ " WHERE b.status=1 and a.dtid = #{oid} " + " UNION "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-resource`.res_course_library_diy_type a "
@Select(" SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType,b.browseNum FROM `hxkf-resource`.res_course_library_diy_type a "
+ " LEFT JOIN `hxkf-resource`.res_course_library b ON a.courselibraryid = b.id "
+ " WHERE b.status=1 and a.dtid = #{oid} " + " UNION "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-resource`.res_video_library_diy_type a "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType,b.browseNum FROM `hxkf-resource`.res_video_library_diy_type a "
+ " LEFT JOIN `hxkf-resource`.res_video_library b ON a.vlid = b.id "
+ " WHERE b.status=1 and b.salesType = 1 and a.dtid = #{oid} " + " UNION "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-live`.l_live_diy_type a "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType,b.browseNum FROM `hxkf-live`.l_live_diy_type a "
+ " LEFT JOIN `hxkf-live`.l_live b ON a.liveId = b.id "
+ " WHERE b.status=1 and a.dtid = #{oid} " + " ORDER BY sort ASC,createTime DESC ")
+ " WHERE b.status=1 and a.dtid = #{oid} " + " ORDER BY sort ASC,browseNum desc,createTime DESC ")
List<DiyTypeResourceVo> getResourceById(Integer oid);
/**
......@@ -187,15 +184,12 @@ public interface DiyTypeMapper extends BaseMapper<DiyType> {
*/
@Select("<script>"
+ "SELECT COUNT(id) FROM ("
+ "SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-resource`.res_author_library_diy_type a "
+ " LEFT JOIN `hxkf-resource`.res_author_library b ON a.authorlibraryid = b.id "
+ " WHERE b.status=1 and a.dtid = #{oid} " + " UNION "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-resource`.res_course_library_diy_type a "
+ " LEFT JOIN `hxkf-resource`.res_course_library b ON a.courselibraryid = b.id "
+ " WHERE b.status=1 and a.dtid = #{oid} " + " UNION "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-resource`.res_video_library_diy_type a "
+ " LEFT JOIN `hxkf-resource`.res_video_library b ON a.vlid = b.id "
+ " WHERE b.status=1 and a.dtid = #{oid} " + " UNION "
+ " WHERE b.status=1 and b.salesType = 1 and a.dtid = #{oid} " + " UNION "
+ " SELECT b.id,b.img,b.name,a.sort,a.creater,a.createTime,b.resourceType FROM `hxkf-live`.l_live_diy_type a "
+ " LEFT JOIN `hxkf-live`.l_live b ON a.liveId = b.id "
+ " WHERE b.status=1 and a.dtid = #{oid} " + " ORDER BY sort ASC,createTime DESC) a "
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论