提交 78f18233 authored 作者: 任建彩's avatar 任建彩

feat:作者

1.resource
上级 ef3fdc6e
......@@ -33,15 +33,15 @@ public interface EbookMapper extends BaseMapper<Ebook> {
*/
@Select("<script>"
+ "SELECT DISTINCT "
+ " bb.id,bb.name,ba.author,bb.isbn, "
+ " bb.id,bb.name,bb.author,bb.isbn, "
+ " be.cover,be.realprice,be.createdTime,be.updateTime,be.status "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookid"
+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
//+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " WHERE 1 = 1 "
+ "<if test='form.option == 1'>"
+ " AND (ba.author IS NULL OR ba.author = '') "
+ " AND (bb.author IS NULL OR bb.author = '') "
+ "</if>"
+ "<if test='form.option == 2'>"
+ " AND (be.cover IS NULL OR be.cover = '') "
......@@ -75,12 +75,12 @@ public interface EbookMapper extends BaseMapper<Ebook> {
@Select("<script>"
+ "SELECT DISTINCT "
+ " bb.id,bb.name,ba.author,bb.isbn,bb.resourceType, "
+ " bb.id,bb.name,bb.author,bb.isbn,bb.resourceType, "
+ " be.cover,be.price,be.realPrice,be.createdTime,be.updateTime,be.status "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookid"
+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
//+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " WHERE 1 = 1 AND be.status = 1 "
+ " rlike(bdt.code,form.diyTypeCode) "
+ " LIKE(bb.name,form.name) "
......@@ -150,11 +150,11 @@ public interface EbookMapper extends BaseMapper<Ebook> {
* @date: 2019年2月18日 下午1:49:56
*/
@Select("<script>"
+ "select DISTINCT bb.id, bb.name, bb.translatorId, bb.translator,a.authorId,a.author, "
+ "select DISTINCT bb.id, bb.name, bb.translatorId, bb.translator,bb.author, "
+ "bb.publisher,DATE_FORMAT(bb.publishTime,'%Y-%m-%d') publishTime, be.price, be.priceOption, be.realPrice, be.cover, be.synopsis, be.status, be.browseNum, bb.resourceType "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
//+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
+ "WHERE be.status = 1 "
+ "<if test = 'id != null' >"
+ "and bb.id != #{id} "
......@@ -164,10 +164,10 @@ public interface EbookMapper extends BaseMapper<Ebook> {
@Select("<script>"
+ "select DISTINCT bb.id, bb.name, "
+ "bb.publisher,DATE_FORMAT(bb.publishTime,'%Y-%m-%d') publishTime,a.authorId,a.author, be.priceOption, be.price, be.realPrice, be.cover, be.status, be.browseNum,bb.resourceType "
+ "bb.publisher,DATE_FORMAT(bb.publishTime,'%Y-%m-%d') publishTime,bb.author, be.priceOption, be.price, be.realPrice, be.cover, be.status, be.browseNum,bb.resourceType "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
//+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
+ "where be.status = 1 "
+ "<if test='" + MapperConstants.LIST_NOT_EMPTY + "(isBuyIds)' >"
+ "and bb.id not in "
......@@ -185,11 +185,11 @@ public interface EbookMapper extends BaseMapper<Ebook> {
* @return
*/
@Select("<script>"
+ "select rb.id,rb.name,rb.resourceType, re.priceOption, re.realPrice,re.price,re.cover,re.synopsis,a.author,a.authorId, re.browseNum "
+ "select rb.id,rb.name,rb.resourceType, re.priceOption, re.realPrice,re.price,re.cover,re.synopsis,bb.author, re.browseNum "
+ "from res_book rb "
+ "left join res_ebook re on rb.id = re.id "
+ "left join res_resource_relation rr on rb.id = rr.resourceId "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on rb.id = a.resourceId "
//+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on rb.id = a.resourceId "
+ "where re.status = 1 "
+ "eq(rr.objectId, resourceId) "
+ "</script>")
......@@ -204,11 +204,11 @@ public interface EbookMapper extends BaseMapper<Ebook> {
* @date: 2019年2月18日 下午1:49:56
*/
@Select("<script>"
+ "select DISTINCT bb.id, bb.name, bb.translatorId, bb.translator,a.authorId,a.author, "
+ "select DISTINCT bb.id, bb.name, bb.translatorId, bb.translator,bb.author, "
+ "bb.publisher,DATE_FORMAT(bb.publishTime,'%Y-%m-%d') publishTime, be.price, be.priceOption, be.realPrice, be.cover, be.synopsis, be.status, be.browseNum, bb.resourceType "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
//+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
+ "WHERE be.status = 1 "
+ "eq(id,form.id) "
+ "</script>")
......@@ -223,14 +223,14 @@ public interface EbookMapper extends BaseMapper<Ebook> {
* @date 2019年1月24日 下午3:33:32
*/
@Select("<script>"
+ "select DISTINCT bb.id, bb.name, a.authorId, a.author, bb.translatorId, bb.translator, "
+ "select DISTINCT bb.id, bb.name, bb.author, bb.translatorId, bb.translator, "
+ "bb.publisher,DATE_FORMAT(bb.publishTime,'%Y-%m-%d') publishTime, bb.resourceType, be.priceOption, be.price,be.realPrice, be.cover, be.synopsis, be.status, be.browseNum"
+ ",qr.qrCode "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "LEFT JOIN res_ebook_diy_type diy ON be.id = diy.ebookId "
+ "LEFT JOIN res_qr_code qr ON be.id = qr.resourceId "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
// + "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
+ "where be.status = 1 "
+ "<if test = '" + MapperConstants.NOT_BLANK + "(form.diyTypeCode)' >"
+ "and diy.code like concat(#{form.diyTypeCode}, '%') "
......@@ -259,14 +259,14 @@ public interface EbookMapper extends BaseMapper<Ebook> {
* @date 2018年12月20日 下午2:33:32
*/
@Select("<script>"
+ "select DISTINCT bb.id, bb.name, a.authorId, a.author, bb.translatorId, bb.translator, "
+ "select DISTINCT bb.id, bb.name, bb.author, bb.translatorId, bb.translator, "
+ "bb.publisher,DATE_FORMAT(bb.publishTime,'%Y-%m-%d') publishTime, bb.resourceType, be.priceOption, be.realPrice,be.price,be.cover, be.synopsis, be.status, be.browseNum,be.createdTime "
+ ",qr.qrCode "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "LEFT JOIN res_ebook_diy_type diy ON be.id = diy.ebookId "
+ "LEFT JOIN res_qr_code qr ON be.id = qr.resourceId "
+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
//+ "LEFT JOIN (SELECT resourceId,authorId,author FROM res_relation_author GROUP BY resourceId) a on be.id = a.resourceId "
+ "where be.status = 1 "
+ " rlike(diy.code,form.diyTypeCode) "
+ "<if test='form.ids != null and form.ids.size > 0' >"
......@@ -311,23 +311,23 @@ public interface EbookMapper extends BaseMapper<Ebook> {
*/
@Select("<script>"
+ "SELECT DISTINCT "
+ " bb.id,2 as resourceType,be.cover,bb.name,ba.author,be.price,be.realPrice,be.synopsis,be.browseNum,be.sales "
+ " bb.id,2 as resourceType,be.cover,bb.name,bb.author,be.price,be.realPrice,be.synopsis,be.browseNum,be.sales "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookId"
+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
//+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " WHERE be.status = 1 "
+ " eq(be.priceOption,form.priceOption)"
+"</script>")
List<ResourceListInfoVO> queryResourcePageInfoList(@Param("form") ResourceQueryForm form);
@Select("<script>"
+ "SELECT DISTINCT "
+ " bb.id,2 as resourceType,t1.cover,bb.name,ba.author,t1.synopsis,t1.browseNum,t1.price,t1.realPrice,bb.publishTime,bb.publisher,rr.projectId "
+ " bb.id,2 as resourceType,t1.cover,bb.name,bb.author,t1.synopsis,t1.browseNum,t1.price,t1.realPrice,bb.publishTime,bb.publisher,rr.projectId "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook t1 ON bb.id = t1.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON t1.id = bdt.ebookId"
+ " LEFT JOIN res_ebook_label_content_diy_type ld ON t1.id = ld.ebookId"
+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
// + " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " LEFT JOIN res_project_model_resource rr ON bb.id = rr.resourceId "
+ " WHERE t1.status = 1 "
+ " like(bb.name,form.keyWord)"
......@@ -359,11 +359,11 @@ public interface EbookMapper extends BaseMapper<Ebook> {
List<EbookListVO> getBookNameList(@Param("form") QueryEbookInfoForm form);
@Select("<script>"
+ "SELECT DISTINCT "
+ " bb.id,2 as resourceType,be.cover,bb.name,ba.author,be.price,be.realPrice,be.synopsis,be.browseNum,be.sales "
+ " bb.id,2 as resourceType,be.cover,bb.name,bb.author,be.price,be.realPrice,be.synopsis,be.browseNum,be.sales "
+ " FROM res_book bb "
+ " LEFT JOIN res_ebook be ON bb.id = be.id "
+ " LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookId"
+ " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
// + " LEFT JOIN ( SELECT resourceId,author,authorId FROM res_relation_author GROUP BY resourceId HAVING MIN(id)) ba ON bb.id = ba.resourceId "
+ " WHERE be.status = 1 "
+ " ne(bb.id,bookid) "
+"</script>")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论