INSERT INTO `BOOK` ( ISBN, TYPE_CODE, BOOK_NAME,BOOK_PRICE, REMARK, AUTHOR, PUBLISH, PUBLISH_DATE, COVER_IMG, DETAIL, SPONSOR, ORGANIZER, CN, RELEASE_CYCLE, BOOK_NUM, PROGRAMA, MAIL_CODE, ADDRESS, TELEPHONE, MAIL, PURPOSE, ORIGIN_NAME, CREATED_USER, CREATED_DATE, LAST_MODIFIED_USER, LAST_MODIFIED_DATE, ISSN, SERIAL_NUMBER, AD_IMG,unique_number,edition ,FROM_ERP ) VALUES ( #{isbn, jdbcType=VARCHAR}, #{typeCode, jdbcType=VARCHAR}, #{bookName, jdbcType=VARCHAR}, #{bookPrice, jdbcType=VARCHAR}, #{remark, jdbcType=VARCHAR}, #{author, jdbcType=VARCHAR}, #{publish, jdbcType=VARCHAR}, #{publishDate, jdbcType=VARCHAR}, #{coverImg, jdbcType=VARCHAR}, #{detail, jdbcType=VARCHAR}, #{sponsor, jdbcType=VARCHAR}, #{organizer, jdbcType=VARCHAR}, #{cn, jdbcType=VARCHAR}, #{releaseCycle, jdbcType=VARCHAR}, #{bookNum, jdbcType=VARCHAR}, #{programa, jdbcType=VARCHAR}, #{mailCode, jdbcType=VARCHAR}, #{address, jdbcType=VARCHAR}, #{telephone, jdbcType=VARCHAR}, #{mail, jdbcType=VARCHAR}, #{purpose, jdbcType=VARCHAR}, #{originName, jdbcType=VARCHAR}, #{createdUser, jdbcType=BIGINT}, NOW(), #{createdUser, jdbcType=BIGINT}, NOW(),#{issn, jdbcType=VARCHAR},#{serialNumber, jdbcType=VARCHAR},#{adImg, jdbcType=VARCHAR},#{uniqueNumber},#{edition} , #{fromErp} ) ON DUPLICATE KEY UPDATE IS_DELETE = 0
UPDATE BOOK SET BOOK_NAME = #{bookName, jdbcType=VARCHAR}, BOOK_PRICE = #{bookPrice, jdbcType=VARCHAR}, REMARK = #{remark, jdbcType=VARCHAR}, ISSN = #{issn, jdbcType=VARCHAR}, AUTHOR = #{author, jdbcType=VARCHAR}, PUBLISH = #{publish, jdbcType=VARCHAR}, PUBLISH_DATE = #{publishDate, jdbcType=VARCHAR}, COVER_IMG = #{coverImg, jdbcType=VARCHAR}, DETAIL = #{detail, jdbcType=VARCHAR}, SPONSOR = #{sponsor, jdbcType=VARCHAR}, ORGANIZER = #{organizer, jdbcType=VARCHAR}, CN = #{cn, jdbcType=VARCHAR}, RELEASE_CYCLE = #{releaseCycle, jdbcType=VARCHAR}, BOOK_NUM = #{bookNum, jdbcType=VARCHAR}, PROGRAMA = #{programa, jdbcType=VARCHAR}, MAIL_CODE = #{mailCode, jdbcType=VARCHAR}, ADDRESS = #{address, jdbcType=VARCHAR}, TELEPHONE = #{telephone, jdbcType=VARCHAR}, MAIL = #{mail, jdbcType=VARCHAR}, PURPOSE = #{purpose, jdbcType=VARCHAR}, ORIGIN_NAME = #{originName, jdbcType=VARCHAR}, LAST_MODIFIED_USER = #{lastModifiedUser, jdbcType=BIGINT}, AD_IMG = #{adImg, jdbcType=VARCHAR}, IS_DELETE = #{isDelete, jdbcType=BIT}, edition = #{edition}, LAST_MODIFIED_DATE = NOW(), VERSION = VERSION + 1 WHERE BOOK_ID = #{bookId, jdbcType=BIGINT} AND VERSION = #{version, jdbcType=BIGINT}
UPDATE BOOK SET COVER_IMG = #{coverImg, jdbcType=VARCHAR}, LAST_MODIFIED_USER = #{lastModifiedUser, jdbcType=BIGINT}, LAST_MODIFIED_DATE = NOW() WHERE BOOK_ID = #{bookId, jdbcType=BIGINT}
UPDATE `BOOK` SET IS_DELETE = 1, LAST_MODIFIED_USER = #{lastModifiedUser, jdbcType=BIGINT}, LAST_MODIFIED_DATE = NOW() WHERE BOOK_ID = #{bookId, jdbcType=BIGINT}
UPDATE `BOOK` SET IS_DELETE = 1, LAST_MODIFIED_USER = #{lastModifiedUser, jdbcType=BIGINT}, LAST_MODIFIED_DATE = NOW() WHERE BOOK_ID IN ${item}
SELECT BOOK_ID, ISBN,TYPE_CODE, BOOK_NAME, REMARK, AUTHOR, PUBLISH, PUBLISH_DATE, COVER_IMG, DETAIL,BOOK_PRICE,ISSN, CREATED_USER, CREATED_DATE, VERSION,SERIAL_NUMBER,AD_IMG,ORIGIN_NAME, SPONSOR, ORGANIZER, CN, RELEASE_CYCLE, BOOK_NUM, PROGRAMA, MAIL_CODE, ADDRESS, TELEPHONE, MAIL, PURPOSE,edition FROM BOOK WHERE BOOK_ID = #{bookId, jdbcType=BIGINT}
SELECT BOOK_ID, ISBN, BOOK_NAME,TYPE_CODE,AUTHOR,PUBLISH,PUBLISH_DATE, COVER_IMG, REMARK,ORIGIN_NAME,BOOK_PRICE,ISSN,VERSION,AD_IMG,edition FROM BOOK WHERE ISBN = #{isbn} AND (SERIAL_NUMBER IS NULL OR SERIAL_NUMBER = '') AND SERIAL_NUMBER = #{serialNumber} ORDER BY CREATED_DATE DESC LIMIT 1
SELECT ISBN, TYPE_CODE, BOOK_NAME, AUTHOR, PUBLISH, PUBLISH_DATE, COVER_IMG,AD_IMG,REMARK,ORIGIN_NAME,BOOK_PRICE,ISSN,SERIAL_NUMBER,VERSION, SPONSOR, ORGANIZER, CN, RELEASE_CYCLE, BOOK_NUM, PROGRAMA, MAIL_CODE, ADDRESS, TELEPHONE, MAIL, PURPOSE,edition FROM BOOK WHERE ISBN = #{_parameter} ORDER BY CREATED_DATE DESC LIMIT 1
SELECT BOOK_ID, ISBN, TYPE_CODE, BOOK_NAME, AUTHOR, PUBLISH, PUBLISH_DATE, COVER_IMG, AD_IMG, REMARK, ORIGIN_NAME,BOOK_PRICE,ISSN,SERIAL_NUMBER, SPONSOR, ORGANIZER, CN, RELEASE_CYCLE, BOOK_NUM, PROGRAMA, MAIL_CODE, ADDRESS, TELEPHONE, MAIL, PURPOSE, VERSION, IS_DELETE,edition FROM BOOK WHERE ISBN = #{isbn} AND (SERIAL_NUMBER IS NULL OR SERIAL_NUMBER ='') AND SERIAL_NUMBER = #{serialNumber} AND IS_DELETE = 0 LIMIT 1
SELECT B.BOOK_ID, B.TYPE_CODE,B.ISBN, B.BOOK_NAME,T.TYPE_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.AD_IMG, B.DETAIL, B.`VERSION`,B.BOOK_PRICE,B.ISSN,B.SERIAL_NUMBER,BA.IS_MAIN_EDITOR, IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT,START_TIME,END_TIME,BA.TEMPLET_ID,BA.SECOND_TEMPLET_ID,BA.third_templet_id, BA.GRA_LABEL_ID,BA.SUB_LABEL_ID,BA.VER_LABEL_ID,BA.AREA_LABEL_ID, BA.IS_PRINT isPrint, BA.pro_label_id, BA.dep_label_id,BA.pur_label_id,BA.vol_label_id,if(G.ID IS NULL, 0, 1) isBookGroup, G.id BOOK_GROUP_ID,G.join_group_type, BA.is_open_robot_process,BA.vol_label_id,b.unique_number,BA.CREATED_DATE,b.edition FROM BOOK_ADVISER BA INNER JOIN BOOK B ON B.BOOK_ID = BA.BOOK_ID AND B.BOOK_ID = #{bookId} AND BA.CHANNEL_ID = #{channelId} AND BA.ADVISER_ID = #{adviserId} AND BA.IS_DELETE = 0 INNER JOIN BOOK_TYPE T ON T.TYPE_CODE = B.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = B.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN book_group G on G.BOOK_ID = BA.BOOK_ID AND G.CHANNEL_ID = BA.CHANNEL_ID AND G.CREATE_USER = BA.ADVISER_ID AND G.IS_DELETE = 0 LIMIT 1
SELECT BOOK_ID, ISBN, ISSN, BOOK_NAME, REMARK, AUTHOR, PUBLISH, PUBLISH_DATE, COVER_IMG,AD_IMG,ORIGIN_NAME,BOOK_PRICE,TYPE_CODE,SERIAL_NUMBER,CREATED_DATE,unique_number FROM BOOK WHERE BOOK_ID IN ${item}
SELECT BOOK_ID, ISBN,BOOK_NAME, COVER_IMG,SERIAL_NUMBER,unique_number FROM BOOK WHERE BOOK_ID IN ${item}
SELECT b.BOOK_ID, b.ISBN, b.BOOK_NAME, b.COVER_IMG, b.SERIAL_NUMBER, b.unique_number, b.BOOK_NAME, ba.adviser_id, ba.channel_id, bg.id BOOK_GROUP_ID, IFNULL(bg.join_group_type, 0) join_group_type FROM book b INNER JOIN book_adviser ba ON ba.BOOK_ID = b.BOOK_ID AND ba.IS_DELETE = 0 LEFT JOIN book_group bg ON bg.BOOK_ID = ba.BOOK_ID AND bg.create_user = ba.adviser_id AND bg.channel_id = ba.channel_id WHERE ba.BOOK_ID IN ${item} AND ba.CHANNEL_ID IN ${item} AND ba.ADVISER_ID IN ${item}

SELECT b.BOOK_ID,b.BOOK_NAME,ba.TEMPLET_ID,ba.CHANNEL_ID FROM book b LEFT JOIN book_adviser ba ON b.BOOK_ID = ba.BOOK_ID WHERE b.BOOK_ID IN ${item} AND ba.CHANNEL_ID in ${item} AND ba.ADVISER_ID = #{adviserId}

SELECT B.BOOK_ID, B.TYPE_CODE, B.ISBN, B.BOOK_NAME, B.AUTHOR, B.PUBLISH, B.COVER_IMG, B.BOOK_PRICE, B.SERIAL_NUMBER, B.AD_IMG FROM BOOK B JOIN ( SELECT DISTINCT BOOK_ID FROM BOOK_FUND WHERE 1=1 AND DATE_FORMAT(START_TIME, '%Y-%m') <= DATE_FORMAT(CURRENT_DATE(), '%Y-%m') AND DATE_FORMAT(END_TIME, '%Y-%m') >= DATE_FORMAT(CURRENT_DATE(), '%Y-%m') AND FUND_NAME LIKE CONCAT('%', #{fundName},'%') ) BF ON B.BOOK_ID = BF.BOOK_ID WHERE IS_DELETE = 0 AND B.SERIAL_NUMBER LIKE CONCAT('%', #{serialNumber},'%') AND ( B.BOOK_NAME LIKE CONCAT('%', #{bookName},'%') B.BOOK_NAME LIKE CONCAT('%', #{item},'%') ) AND B.ISBN LIKE CONCAT(#{isbn},'%') AND B.PUBLISH LIKE CONCAT('%', #{publish},'%') LIMIT #{currentPage},#{numPerPage}
SELECT COUNT(1) FROM BOOK
SELECT COUNT(1) FROM ( SELECT B.BOOK_ID FROM BOOK B JOIN ( SELECT DISTINCT BOOK_ID FROM BOOK_FUND WHERE 1=1 AND DATE_FORMAT(START_TIME, '%Y-%m') <= DATE_FORMAT(CURRENT_DATE(), '%Y-%m') AND DATE_FORMAT(END_TIME, '%Y-%m') >= DATE_FORMAT(CURRENT_DATE(), '%Y-%m') AND FUND_NAME LIKE CONCAT('%', #{fundName},'%') ) BF ON B.BOOK_ID = BF.BOOK_ID WHERE IS_DELETE = 0 AND B.SERIAL_NUMBER LIKE CONCAT('%', #{serialNumber},'%') AND ( B.BOOK_NAME LIKE CONCAT('%', #{bookName},'%') B.BOOK_NAME LIKE CONCAT('%', #{item},'%') ) AND (B.ISBN LIKE CONCAT(#{isbn},'%')) AND B.PUBLISH LIKE CONCAT('%', #{publish},'%') ) a
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT,A.TEMPLET_ID, if(G.ID IS NULL, A.LAST_MODIFIED_DATE, G.UPDATE_TIME) LAST_MODIFIED_DATE, A.BOOK_ADVISER_ID,I.BOOK_STATUS, CONCAT('BK',A.BOOK_ID) uniqueNumber, if(G.ID IS NULL, 0, 1) isBookGroup, A.IS_PRINT isPrint, G.id BOOK_GROUP_ID, G.group_qrcode_url groupQrcodeUrl,G.group_qrcode_name groupQrcodeName, G.join_group_type,a.is_open_robot_process,G.single_group singleGroup, G.related_book_group_id relatedBookGroupId, IF(ISNULL(s.id),0,1) minimumSupport FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN book_auth_info I ON I.BOOK_ID = A.BOOK_ID AND I.ADVISER_ID = #{adviserId} LEFT JOIN book_group G on G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID AND G.IS_DELETE = 0 LEFT JOIN book_freeze f ON B.BOOK_ID = f.BOOK_ID LEFT JOIN book_minimum_support s ON B.BOOK_ID=s.book_id AND s.end_time > NOW() AND s.start_time < NOW() WHERE 1=1 AND A.BOOK_ID = #{bookId} AND B.TYPE_CODE = #{typeCode} AND A.CHANNEL_ID = #{channelId} AND B.BOOK_NAME LIKE CONCAT('%', #{bookName}, '%') AND B.ISBN LIKE CONCAT(#{isbn},'%') AND (B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name}) AND A.IS_MAIN_EDITOR = 1 AND ( BF.BOOK_FUND_ID IS NOT NULL OR f.IS_FREEZE = 1 ) AND s.id is NOT NULL AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID in ${item} AND A.third_TEMPLET_ID in ${item} AND B.ISBN <> ${isbns} AND I.book_status = #{bookStatus} AND A.IS_PRINT = #{isPrint} A.BOOK_ID = ${item.bookId} AND A.CHANNEL_ID = ${item.channelId} GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY LAST_MODIFIED_DATE DESC LIMIT ${num}
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, B.ISBN, B.BOOK_NAME, B.TYPE_CODE, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, A.TEMPLET_ID,A.SECOND_TEMPLET_ID, A.LAST_MODIFIED_DATE, A.BOOK_ADVISER_ID, CONCAT('BK',A.BOOK_ID) uniqueNumber, A.GRA_LABEL_ID,A.SUB_LABEL_ID,A.VER_LABEL_ID,A.AREA_LABEL_ID,A.pro_label_id, A.dep_label_id,A.pur_label_id FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0 WHERE A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND (B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name}) GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.LAST_MODIFIED_DATE DESC
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, a.is_open_robot_process,T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT, A.TEMPLET_ID, A.BOOK_ADVISER_ID, CONCAT('BK',A.BOOK_ID) uniqueNumber, G.update_time LAST_MODIFIED_DATE, G.create_time CREATED_DATE, G.id BOOK_GROUP_ID, G.group_qrcode_url groupQrcodeUrl, G.group_qrcode_name groupQrcodeName, G.dep_label_id bookGroupDepLabelId, G.join_group_type, G.book_group_cipher, G.short_book_name , if(IFNULL(case G.join_group_type WHEN 1 then bk.id WHEN 2 THEN bgs.id WHEN 3 THEN srk.id WHEN 4 THEN bgs.id else null END,0)=0,0,1)as has_serve, A.IS_PRINT isPrint, G.open_weapp openWeapp, G.single_group singleGroup, G.related_book_group_id relatedBookGroupId, G.group_qrcode_link groupQrcodeLink, G.jump_type jumpType, G.jump_url jumpUrl FROM book_group G LEFT JOIN BOOK_ADVISER A ON G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID LEFT JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN BOOK_GROUP_SERVE bgs on G.id=bgs.book_group_id LEFT JOIN BOOK_KEYWORD bk on G.id=bk.book_group_id and bk.is_delete=0 LEFT JOIN self_robot_keyword srk ON G.id = srk.book_group_id WHERE G.create_user = #{adviserId} AND G.is_delete = 0 AND ( A.BOOK_ADVISER_ID IS NULL OR A.IS_DELETE = 0 ) AND ( B.BOOK_ID IS NULL OR B.IS_DELETE = 0 ) AND A.BOOK_ID = #{bookId} AND B.TYPE_CODE = #{typeCode} AND A.CHANNEL_ID = #{channelId} AND B.BOOK_NAME LIKE CONCAT('%', #{bookName}, '%') AND B.ISBN LIKE CONCAT(#{isbn},'%') AND (B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR G.group_qrcode_name LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name} OR G.short_book_name LIKE CONCAT('%', #{name}, '%')) AND A.IS_MAIN_EDITOR = 1 AND BF.BOOK_FUND_ID IS NOT NULL AND G.create_time BETWEEN #{startDate} AND #{endDate} AND G.join_group_type in ${item} GROUP BY G.id having has_serve=1 having has_serve=0 AND A.IS_PRINT = #{isPrint} ORDER BY G.UPDATE_TIME DESC
SELECT b.BOOK_ID bookId,b.COVER_IMG coverImg, bg.id bookGroupId ,b.ISBN isbn,b.BOOK_NAME bookName,CONCAT('BK',b.BOOK_ID) bookNumber FROM `book_group` bg LEFT JOIN book b ON bg.book_id = b.BOOK_ID LEFT JOIN book_fund bf ON bg.book_id = bf.BOOK_ID AND bf.END_TIME > NOW() AND bf.START_TIME < NOW() LEFT JOIN book_group_classify bgc ON bg.id = bgc.book_group_id LEFT JOIN book_adviser ba ON b.BOOK_ID =ba.book_id WHERE bg.channel_id = #{channelId} and ba.IS_PRINT=1 AND (b.ISBN like CONCAT('%',#{keywords},'%') OR b.BOOK_NAME like CONCAT('%',#{keywords},'%') OR bg.group_qrcode_name like CONCAT('%',#{keywords},'%')) AND bf.BOOK_FUND_ID IS NOT NULL AND bg.create_time >= #{startTime} AND bg.create_time <= #{endTime} AND bgc.id is not null AND b.BOOK_ID is not null AND b.IS_DELETE = 0 AND bg.IS_DELETE = 0 AND bgc.is_delete = 0 AND b.BOOK_NAME NOT LIKE CONCAT('%','红榜','%') AND CHAR_LENGTH(b.BOOK_NAME)>=8 GROUP BY b.BOOK_ID ORDER BY bg.create_time DESC
SELECT b.BOOK_ID bookId,b.COVER_IMG coverImg, bg.id bookGroupId ,b.ISBN isbn,b.BOOK_NAME bookName,CONCAT('BK',b.BOOK_ID) bookNumber FROM `book_group` bg LEFT JOIN book b ON bg.book_id = b.BOOK_ID LEFT JOIN book_fund bf ON bg.book_id = bf.BOOK_ID LEFT JOIN book_group_classify bgc ON bg.id = bgc.book_group_id WHERE bg.id in ${item} AND b.BOOK_ID is not null AND b.IS_DELETE = 0 AND bg.IS_DELETE = 0 GROUP BY b.BOOK_ID
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, B.ISBN, B.BOOK_NAME, B.COVER_IMG, B.SERIAL_NUMBER, CONCAT('BK', A.BOOK_ID) uniqueNumber, G.ID book_group_id FROM BOOK_ADVISER A INNER JOIN book_group G ON G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID AND G.IS_DELETE = 0 INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0 WHERE A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND (B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR G.group_qrcode_name LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name}) GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY G.UPDATE_TIME DESC
SELECT a.BOOK_ID, a.CHANNEL_ID, a.ADVISER_ID, a.IS_MAIN_EDITOR, b.ISBN, b.BOOK_NAME, b.REMARK, b.AUTHOR, b.PUBLISH, b.PUBLISH_DATE, b.COVER_IMG, b.ORIGIN_NAME, b.BOOK_PRICE, b.ISSN, b.BOOK_NUM, b.SERIAL_NUMBER, a.TEMPLET_ID, a.CREATED_DATE, a.LAST_MODIFIED_DATE, a.BOOK_ADVISER_ID, IF ( adp.is_open = 0 OR ( adp.is_open IS NULL AND ap.is_open = 0 ), 0, 1 ) isOpen FROM BOOK_ADVISER a INNER JOIN BOOK b ON a.BOOK_ID = b.BOOK_ID AND a.ADVISER_ID = #{adviserId} AND a.IS_DELETE = 0 AND b.IS_DELETE = 0 LEFT JOIN advertising_agent_permission ap ON ap.agent_id = #{agentId} LEFT JOIN advertising_adviser_permission adp ON adp.adviser_id = a.ADVISER_ID AND adp.channel_id = a.CHANNEL_ID AND adp.book_id = a.BOOK_ID WHERE a.IS_MAIN_EDITOR = 1 AND (b.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR b.ISBN LIKE CONCAT(#{name},'%')) GROUP BY a.BOOK_ID, a.CHANNEL_ID ORDER BY a.LAST_MODIFIED_DATE DESC
SELECT a.BOOK_ID, a.CHANNEL_ID, a.ADVISER_ID, db.agent_id agentId, b.ISBN, b.BOOK_NAME, b.COVER_IMG, db.distribution_time distributionTime, IF ( adp.is_open = 0 OR ( adp.is_open IS NULL AND ap.is_open = 0 ), 0, 1 ) isOpen FROM BOOK_ADVISER a INNER JOIN BOOK b ON a.BOOK_ID = b.BOOK_ID AND a.IS_DELETE = 0 AND b.IS_DELETE = 0 INNER JOIN advertising_distribution_book db ON db.book_id = a.BOOK_ID AND db.channel_id = a.CHANNEL_ID AND db.adviser_id = a.ADVISER_ID AND db.ad_id = #{adId} LEFT JOIN advertising_agent_permission ap ON ap.agent_id = db.agent_id LEFT JOIN advertising_adviser_permission adp ON adp.adviser_id = a.ADVISER_ID AND adp.channel_id = a.CHANNEL_ID AND adp.book_id = a.BOOK_ID WHERE 1 = 1 AND (b.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR b.ISBN LIKE CONCAT(#{name},'%')) GROUP BY a.BOOK_ID, a.CHANNEL_ID ORDER BY db.distribution_time DESC
SELECT a.BOOK_ID, a.CHANNEL_ID, a.ADVISER_ID, db.agent_id agentId, b.ISBN, b.BOOK_NAME, b.COVER_IMG, count(DISTINCT db.id) advertisingSpaceNum, IF ( adp.is_open = 0 OR ( adp.is_open IS NULL AND ap.is_open = 0 ), 0, 1 ) isOpen FROM BOOK_ADVISER a INNER JOIN BOOK b ON a.BOOK_ID = b.BOOK_ID AND a.IS_DELETE = 0 AND b.IS_DELETE = 0 INNER JOIN advertising_distribution_book db ON db.book_id = a.BOOK_ID AND db.channel_id = a.CHANNEL_ID AND db.adviser_id = a.ADVISER_ID AND db.qrcode_id IS NULL LEFT JOIN advertising_agent_permission ap ON ap.agent_id = db.agent_id LEFT JOIN advertising_adviser_permission adp ON adp.adviser_id = a.ADVISER_ID AND adp.channel_id = a.CHANNEL_ID AND adp.book_id = a.BOOK_ID WHERE 1 = 1 AND (b.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR b.ISBN LIKE CONCAT(#{name},'%')) GROUP BY a.BOOK_ID, a.CHANNEL_ID ORDER BY db.id ASC
SELECT a.BOOK_ID, a.CHANNEL_ID, a.ADVISER_ID, a.IS_MAIN_EDITOR, b.ISBN, b.BOOK_NAME, b.REMARK, b.AUTHOR, b.PUBLISH, b.PUBLISH_DATE, b.COVER_IMG, b.ORIGIN_NAME, b.BOOK_PRICE, b.ISSN, b.BOOK_NUM, b.SERIAL_NUMBER, a.TEMPLET_ID, a.CREATED_DATE, a.LAST_MODIFIED_DATE, a.BOOK_ADVISER_ID FROM BOOK_ADVISER a INNER JOIN BOOK b ON a.BOOK_ID = b.BOOK_ID AND a.IS_DELETE = 0 AND b.IS_DELETE = 0 INNER JOIN book_group g ON g.BOOK_ID = a.BOOK_ID AND g.CHANNEL_ID = a.CHANNEL_ID AND g.CREATE_USER = a.ADVISER_ID AND g.IS_DELETE = 0 LEFT JOIN advertising_adviser_permission adp ON a.BOOK_ID = adp.book_id AND a.ADVISER_ID = adp.adviser_id AND a.CHANNEL_ID = adp.channel_id WHERE a.IS_MAIN_EDITOR = 1 AND ( adp.is_open IS NULL OR adp.is_open = 1 ) AND a.ADVISER_ID = #{adviserId} AND (b.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR b.ISBN LIKE CONCAT(#{name},'%')) GROUP BY a.BOOK_ID, a.CHANNEL_ID ORDER BY g.create_time DESC ORDER BY a.CREATED_DATE DESC
SELECT a.BOOK_ID, a.CHANNEL_ID FROM BOOK_ADVISER a INNER JOIN BOOK b ON a.BOOK_ID = b.BOOK_ID AND a.ADVISER_ID = #{adviserId} AND a.IS_DELETE = 0 AND b.IS_DELETE = 0 WHERE a.IS_MAIN_EDITOR = 1 GROUP BY a.BOOK_ID, a.CHANNEL_ID
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER,A.TEMPLET_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE ORDER BY A.CREATED_DATE DESC LIMIT #{number}
SELECT BOOK_ID FROM BOOK WHERE BOOK_NAME LIKE '%${_parameter}%'
SELECT A.BOOK_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 WHERE B.BOOK_NAME LIKE CONCAT('%',#{bookName},'%')
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, B.BOOK_NAME, B.REMARK, B.COVER_IMG,B.ORIGIN_NAME,B.BOOK_PRICE,A.TEMPLET_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 WHERE 1=1 AND B.BOOK_NAME LIKE CONCAT('%',#{bookName},'%') ORDER BY A.CREATED_DATE DESC
SELECT BOOK_ID, ISBN, TYPE_CODE, BOOK_NAME, AUTHOR, PUBLISH, PUBLISH_DATE, COVER_IMG, AD_IMG, REMARK,ORIGIN_NAME,BOOK_PRICE,ISSN,SERIAL_NUMBER FROM BOOK WHERE SERIAL_NUMBER = #{_parameter}
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID,A.IS_MAIN_EDITOR,B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG,B.ORIGIN_NAME,B.BOOK_PRICE, B.ISSN,B.SERIAL_NUMBER,A.TEMPLET_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 WHERE A.IS_MAIN_EDITOR = 1 AND B.TYPE_CODE = #{typeCode} AND A.CHANNEL_ID = #{channelId} AND B.ISBN = #{isbn} ORDER BY B.SERIAL_NUMBER DESC
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID,B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG,B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN,B.SERIAL_NUMBER,B.TYPE_CODE,A.TEMPLET_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 WHERE A.CHANNEL_ID = #{channelId} AND A.IS_MAIN_EDITOR = 1 ORDER BY A.CREATED_DATE DESC
SELECT B.BOOK_ID, B.ISBN, B.BOOK_NAME, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, ( SELECT COUNT(1) FROM BOOK_APP WHERE BOOK_ID = B.BOOK_ID AND IS_DELETE = 0 ) APP_COUNT, ( SELECT COUNT(1) FROM BOOK_PRODUCT WHERE BOOK_ID = B.BOOK_ID ) PRODUCT_COUNT FROM BOOK B WHERE B.ISBN = #{isbn} AND (B.SERIAL_NUMBER IS NULL OR B.SERIAL_NUMBER = '') AND B.SERIAL_NUMBER = #{serialNumber} LIMIT 1
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT, A.TEMPLET_ID, A.IS_PRINT isPrint, IF(ISNULL(s.id),0,1) minimumSupport FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 AND A.ADVISER_ID IN ${item} AND A.IS_MAIN_EDITOR = 1 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN book_minimum_support s ON B.BOOK_ID=s.book_id AND s.end_time > NOW() AND s.start_time < NOW() WHERE 1=1 AND B.TYPE_CODE = #{typeCode} AND A.CHANNEL_ID = #{channelId} AND (B.BOOK_NAME LIKE CONCAT('%',#{bookName},'%') OR B.ISBN LIKE CONCAT(#{bookName},'%') OR A.ADVISER_ID in ${item} ) AND B.ISBN LIKE CONCAT(#{isbn},'%') AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID in ${item} AND A.third_TEMPLET_ID in ${item} AND BF.BOOK_FUND_ID IS NOT NULL AND A.IS_PRINT = #{isPrint} AND s.id is NOT NULL GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.CREATED_DATE DESC
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR,A.TEMPLET_ID, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.COVER_IMG, B.ISSN, B.SERIAL_NUMBER FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE WHERE BOOK_NAME LIKE CONCAT('%',#{bookName},'%') ORDER BY A.CREATED_DATE DESC
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID,B.ISBN, B.BOOK_NAME, B.COVER_IMG,B.ISSN,B.SERIAL_NUMBER,B.TYPE_CODE FROM (SELECT BOOK_ID, CHANNEL_ID, CREATED_USER AS ADVISER_ID FROM BOOK_APP WHERE APP_ID = #{appId} AND CHANNEL_ID = #{channelId} AND IS_DELETE = 0) A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, IF(ISNULL(BF.BOOK_FUND_ID),0,1) IS_FUND_SUPPORT,A.TEMPLET_ID,A.LAST_MODIFIED_DATE FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 1 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.LAST_MODIFIED_DATE DESC
SELECT COUNT(1) FROM (SELECT BOOK_ID, ADVISER_ID, CHANNEL_ID FROM BOOK_ADVISER WHERE ADVISER_ID IN ${item} AND IS_DELETE = 0 AND BOOK_ID != #{bookId} ) A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0
SELECT A.BOOK_ID,A.ADVISER_ID,A.CHANNEL_ID,B.BOOK_NAME,B.ISBN,B.SERIAL_NUMBER FROM (SELECT BOOK_ID, ADVISER_ID, CHANNEL_ID, CREATED_DATE FROM BOOK_ADVISER WHERE ADVISER_ID IN ${item} AND IS_DELETE = 0 AND BOOK_ID != #{bookId} ) A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0 ORDER BY A.CREATED_DATE limit #{currentPage},#{numPerPage}
SELECT BOOK_ID, ISBN, BOOK_NAME,TYPE_CODE,AUTHOR,PUBLISH,PUBLISH_DATE,SERIAL_NUMBER, COVER_IMG FROM BOOK WHERE ISBN = #{isbn}
SELECT b.BOOK_ID, b.BOOK_NAME, b.COVER_IMG, b.ISBN,b.SERIAL_NUMBER, b.PUBLISH, ba.ADVISER_ID, ba.TEMPLET_ID, ba.CHANNEL_ID, ba.CREATED_DATE, bt.TYPE_NAME, ba.IS_PRINT isPrint, ba.SECOND_TEMPLET_ID, ba.GRA_LABEL_ID,ba.SUB_LABEL_ID,ba.VER_LABEL_ID,ba.AREA_LABEL_ID,ba.vol_label_id, la1.`name` graLabelName,la2.`name` subLabelName,la3.`name` verLabelName,la4.`name` areaLabelName,la5.`name` volLabelName, ba.third_TEMPLET_ID FROM BOOK_ADVISER ba JOIN BOOK b ON b.BOOK_ID = ba.BOOK_ID LEFT JOIN BOOK_TYPE bt ON b.TYPE_CODE = bt.TYPE_CODE LEFT JOIN book_label la1 ON ba.GRA_LABEL_ID=la1.id AND la1.type=1 LEFT JOIN book_label la2 ON ba.SUB_LABEL_ID=la2.id AND la2.type=2 LEFT JOIN book_label la3 ON ba.VER_LABEL_ID=la3.id AND la3.type=3 LEFT JOIN book_label la4 ON ba.AREA_LABEL_ID=la4.id AND la4.type=4 LEFT JOIN book_label la5 ON ba.vol_label_id=la5.id AND la5.type=5 WHERE ba.IS_DELETE = 0 AND b.IS_DELETE = 0 AND b.TYPE_CODE = #{typeCode, jdbcType=VARCHAR} AND ba.TEMPLET_ID = #{templetId} AND ba.SECOND_TEMPLET_ID in ${item} AND ba.third_TEMPLET_ID in ${item} AND ba.CREATED_DATE > #{startDate} AND ba.CREATED_DATE < #{endDate} AND ( (b.BOOK_NAME LIKE CONCAT('%', #{bookName},'%') or b.ISBN LIKE CONCAT('%', #{bookName},'%') or b.SERIAL_NUMBER LIKE CONCAT('%', #{bookName},'%') OR b.BOOK_NAME LIKE CONCAT('%', '${item}','%') ) ) AND b.PUBLISH LIKE CONCAT('%', #{publish},'%') AND ba.IS_PRINT = #{isPrint} ORDER BY ba.CREATED_DATE DESC
SELECT count(1) FROM BOOK_ADVISER ba JOIN BOOK b ON b.BOOK_ID = ba.BOOK_ID LEFT JOIN BOOK_TYPE bt ON b.TYPE_CODE = bt.TYPE_CODE WHERE ba.IS_DELETE = 0 AND b.TYPE_CODE = #{typeCode, jdbcType=VARCHAR} AND ba.TEMPLET_ID = #{templetId} AND ba.SECOND_TEMPLET_ID in ${item} AND A.third_TEMPLET_ID in ${item} AND ba.CREATED_DATE > #{startDate} AND ba.CREATED_DATE < #{endDate} AND ( (b.BOOK_NAME LIKE CONCAT('%', #{bookName},'%') or b.ISBN LIKE CONCAT('%', #{bookName},'%') or b.SERIAL_NUMBER LIKE CONCAT('%', #{bookName},'%') OR b.BOOK_NAME LIKE CONCAT('%', '${item}','%') ) ) AND b.PUBLISH LIKE CONCAT('%', #{publish},'%') AND ba.IS_PRINT = #{isPrint}
SELECT b.BOOK_ID, b.BOOK_NAME, b.COVER_IMG, b.ISBN, b.PUBLISH, ba.ADVISER_ID, ba.TEMPLET_ID,ba.SECOND_TEMPLET_ID, ba.CHANNEL_ID, ba.CREATED_DATE, bt.TYPE_NAME FROM BOOK_ADVISER ba LEFT JOIN BOOK b ON ba.BOOK_ID = b.BOOK_ID LEFT JOIN BOOK_TYPE bt ON b.TYPE_CODE = bt.TYPE_CODE WHERE ba.IS_DELETE = 0 AND b.IS_DELETE = 0 AND ba.BOOK_ID != #{bookId} limit #{currentPage},#{numPerPage}
SELECT COUNT(1) FROM (SELECT BOOK_ID, ADVISER_ID, CHANNEL_ID FROM BOOK_ADVISER WHERE IS_DELETE = 0 AND BOOK_ID != #{bookId} ) A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID WHERE B.IS_DELETE = 0
SELECT TEMPLET_ID FROM BOOK_ADVISER WHERE BOOK_ID = #{bookId, jdbcType=BIGINT} AND CHANNEL_ID = #{channelId} AND CREATED_USER = #{adviserId}
UPDATE BOOK SET BOOK_NAME = #{bookName, jdbcType=VARCHAR}, BOOK_PRICE = #{bookPrice, jdbcType=VARCHAR}, AUTHOR = #{author, jdbcType=VARCHAR}, PUBLISH = #{publish, jdbcType=VARCHAR}, COVER_IMG = #{coverImg, jdbcType=VARCHAR}, LAST_MODIFIED_USER = #{lastModifiedUser, jdbcType=BIGINT}, SERIAL_NUMBER = #{serialNumber, jdbcType=VARCHAR}, edition = #{edition}, LAST_MODIFIED_DATE = NOW(), VERSION = VERSION + 1 WHERE BOOK_ID = #{bookId, jdbcType=BIGINT}
UPDATE BOOK SET LAST_MODIFIED_DATE = NOW() WHERE BOOK_ID = #{bookId, jdbcType=BIGINT}
UPDATE BOOK SET LAST_MODIFIED_DATE = NOW() , LAST_MODIFIED_USER = #{adviserId, jdbcType=BIGINT}, is_show_qualify_info = #{isShowQualifyInfo} where BOOK_ID in #{item}
UPDATE BOOK_ADVISER SET LAST_MODIFIED_DATE = NOW() WHERE ADVISER_ID = #{adviserId} and CHANNEL_ID = #{channelId} AND BOOK_ID = #{bookId} AND BOOK_ID in #{item}
SELECT ba.BOOK_ID bookId, b.BOOK_NAME bookName, b.ISBN isbn, ba.ADVISER_ID adviserId, ba.IS_MAIN_EDITOR isMainEditor, ba.CHANNEL_ID channelId, ba.CREATED_DATE createdDate, ba.TEMPLET_ID templetId, IF ( ISNULL(BF.BOOK_FUND_ID), 0, 1 ) isFundSupport FROM `book_adviser` ba LEFT JOIN book b ON ba.BOOK_ID = b.BOOK_ID LEFT JOIN book_fund bf ON ba.BOOK_ID = bf.BOOK_ID AND bf.END_TIME > DATE_FORMAT(#{statisTime},'yyyy-MM') AND bf.START_TIME < DATE_FORMAT(#{statisTime},'yyyy-MM') BF.END_TIME > NOW() AND BF.START_TIME < NOW() WHERE ba.IS_DELETE = 0 AND b.IS_DELETE = 0 AND (b.BOOK_NAME LIKE CONCAT('%',#{bookName},'%') OR b.ISBN LIKE CONCAT('%',#{bookName},'%')) AND ba.TEMPLET_ID = #{templetId} AND ba.CHANNEL_ID in ${channelId} AND ba.ADVISER_ID in ${adviserId} AND bf.BOOK_FUND_ID IS NOT NULL ORDER BY ba.CREATED_DATE DESC
SELECT ba.BOOK_ID bookId, b.BOOK_NAME bookName, b.ISBN isbn, ba.ADVISER_ID adviserId, ba.CHANNEL_ID channelId, ba.CREATED_DATE createdDate, ba.TEMPLET_ID templetId, IF ( ISNULL(BF.BOOK_FUND_ID), 0, 1 ) isFundSupport FROM `book_adviser` ba LEFT JOIN book b ON ba.BOOK_ID = b.BOOK_ID LEFT JOIN book_fund bf ON ba.BOOK_ID = bf.BOOK_ID AND DATE_FORMAT(bf.START_TIME ,'%Y-%m') <= #{statisTime} bf.START_TIME < NOW() WHERE ba.IS_DELETE = 0 AND b.IS_DELETE = 0 AND ba.CHANNEL_ID in #{item} AND ba.ADVISER_ID in #{item} AND ba.BOOK_ID in #{item}
SELECT b.BOOK_ID bookId, b.BOOK_NAME bookName, b.ISBN isbn, b.CREATED_DATE createdDate, IF ( ISNULL(bf.BOOK_FUND_ID), 0, 1 ) isFundSupport FROM book b LEFT JOIN book_fund bf ON b.BOOK_ID = bf.BOOK_ID AND DATE_FORMAT(bf.START_TIME ,'%Y-%m') <= #{monthDate} bf.START_TIME < NOW() WHERE b.IS_DELETE = 0 AND b.BOOK_ID in #{item} group by b.BOOK_ID
SELECT B.BOOK_ID, B.TYPE_CODE, B.ISBN, B.BOOK_NAME, B.AUTHOR, B.PUBLISH, B.COVER_IMG, B.BOOK_PRICE, B.SERIAL_NUMBER, B.AD_IMG FROM book b WHERE b.BOOK_ID IN ( SELECT ba.BOOK_ID FROM book_adviser ba GROUP BY ba.BOOK_ID ) AND B.IS_DELETE = 0 AND (B.BOOK_NAME LIKE CONCAT('%', #{name},'%') OR B.ISBN LIKE CONCAT(#{name},'%') OR B.BOOK_ID LIKE CONCAT(#{name},'%'))
SELECT A.BOOK_ID as bookId, A.CHANNEL_ID as channelId, A.ADVISER_ID as adviserId, B.TYPE_CODE as typeCode, T.TYPE_NAME as typeName, B.ISBN, B.BOOK_NAME as bookName, B.COVER_IMG coverImg, B.SERIAL_NUMBER serialNumber, A.TEMPLET_ID templetId FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN book_auth_info I ON I.BOOK_ID = B.BOOK_ID AND I.ADVISER_ID = #{adviserId} AND I.is_paper_book = 1 WHERE I.ID IS NULL AND B.TYPE_CODE = #{typeCode} AND A.CHANNEL_ID = #{channelId} AND (B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%')) AND A.IS_MAIN_EDITOR = 1 AND BF.BOOK_FUND_ID IS NOT NULL AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID in ${item} AND A.third_TEMPLET_ID in ${item} GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.LAST_MODIFIED_DATE DESC , A.BOOK_ADVISER_ID DESC
SELECT A.BOOK_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 WHERE B.BOOK_NAME LIKE CONCAT('%',#{keyword},'%') or B.ISBN LIKE CONCAT('%',#{keyword},'%')
SELECT A.book_id AS bookId, A.channel_id AS channelId, A.adviser_id AS adviserId, B.type_code AS typeCode, T.type_name AS typeName, B.isbn, B.book_name AS bookName, B.cover_img AS coverImg, B.serial_number AS serialNumber, A.templet_id AS templetId FROM book_group G INNER JOIN book B ON G.book_id = B.book_id AND G.create_user = #{adviserId} AND G.is_delete = 0 AND B.is_delete = 0 INNER JOIN BOOK_ADVISER A ON A.BOOK_ID = B.BOOK_ID AND A.ADVISER_ID = #{adviserId} AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN book_auth_info I ON I.BOOK_ID = B.BOOK_ID AND I.ADVISER_ID = #{adviserId} AND I.is_group_book = 1 WHERE I.ID IS NULL AND B.TYPE_CODE = #{typeCode} AND G.CHANNEL_ID = #{channelId} AND (B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%')) AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID in ${item} AND A.third_TEMPLET_ID in ${item} GROUP BY G.book_id, G.channel_id ORDER BY G.update_time DESC , G.id DESC
SELECT b.BOOK_ID bookId, b.ISBN isbn, b.BOOK_NAME bookName, a.ADVISER_ID adviserId, g.agent_id agentId, g.id bookGroupId FROM book_group g INNER JOIN book_adviser a ON g.book_id = a.BOOK_ID AND a.IS_DELETE = 0 AND g.channel_id = a.CHANNEL_ID AND g.create_user = a.ADVISER_ID INNER JOIN book b ON b.BOOK_ID = a.BOOK_ID AND b.IS_DELETE = 0 WHERE g.is_delete = 0 AND g.join_group_type in ${item} AND (b.BOOK_NAME LIKE CONCAT('%', #{name},'%') OR b.ISBN LIKE CONCAT(#{name},'%')) AND a.ADVISER_ID = #{adviserId} and a.GRA_LABEL_ID =#{graLabelId} and a.SUB_LABEL_ID =#{subLabelId} and a.VER_LABEL_ID =#{verLabelId} and a.AREA_LABEL_ID =#{areaLabelId} ORDER BY g.create_time DESC
SELECT A.BOOK_ID bookId, B.BOOK_NAME bookName, A.CHANNEL_ID channelId, B.ISBN isbn, A.ADVISER_ID adviserId, IF(ISNULL(BF.BOOK_FUND_ID),0,1) isFundSupport FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 AND A.ADVISER_ID IN ${item} AND A.IS_MAIN_EDITOR = 1 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN book_minimum_support s ON B.BOOK_ID=s.book_id AND s.end_time > NOW() AND s.start_time < NOW() WHERE 1=1 AND B.TYPE_CODE = #{typeCode} AND A.CHANNEL_ID = #{channelId} AND (B.BOOK_NAME LIKE CONCAT('%',#{keyWord},'%') OR B.ISBN LIKE CONCAT(#{keyWord},'%') OR A.ADVISER_ID in ${item} ) AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID in ${item} AND A.third_TEMPLET_ID in ${item} AND BF.BOOK_FUND_ID IS NOT NULL AND s.id is NOT NULL GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.CREATED_DATE DESC
SELECT count(1) FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 AND A.ADVISER_ID IN ${item} AND A.IS_MAIN_EDITOR = 1 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() WHERE 1=1 AND B.TYPE_CODE = #{typeCode} AND A.CHANNEL_ID = #{channelId} AND (B.BOOK_NAME LIKE CONCAT('%',#{keyWord},'%') OR B.ISBN LIKE CONCAT(#{keyWord},'%') OR A.ADVISER_ID in ${item} ) AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID in ${item} AND A.third_TEMPLET_ID in ${item} AND BF.BOOK_FUND_ID IS NOT NULL
SELECT DISTINCT a.BOOK_ID FROM book_adviser a INNER JOIN book b ON a.BOOK_ID = b.BOOK_ID AND a.IS_DELETE = 0 AND b.IS_DELETE = 0 WHERE b.BOOK_NAME LIKE CONCAT('%',#{bookName},'%') LIMIT 0,50
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber, A.THIRD_TEMPLET_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE WHERE 1=1 AND A.IS_MAIN_EDITOR = 1 AND B.TYPE_CODE = #{typeCode} AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%') OR B.ISBN LIKE CONCAT(#{keyword},'%') OR CONCAT('BK',A.BOOK_ID) = #{keyword} OR A.ADVISER_ID in ${item} ) AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID=#{secondTempletId} AND A.third_TEMPLET_ID=#{thirdTempletId} AND A.ADVISER_ID in ${item} GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.LAST_MODIFIED_DATE DESC
SELECT COUNT(1) FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND B.IS_DELETE = 0 WHERE A.IS_MAIN_EDITOR = 1 AND A.IS_DELETE = 0 AND B.TYPE_CODE = #{typeCode} AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%') OR B.ISBN LIKE CONCAT(#{keyword},'%') OR CONCAT('BK',A.BOOK_ID) = #{keyword} OR A.ADVISER_ID in ${item} ) AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID=#{secondTempletId} AND A.third_TEMPLET_ID=#{thirdTempletId} AND A.ADVISER_ID in ${item}
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE WHERE 1=1 AND A.IS_MAIN_EDITOR = 1 AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%') or B.ISBN LIKE CONCAT(#{keyword},'%')) AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID=#{secondTempletId} AND A.third_TEMPLET_ID=#{thirdTempletId} GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.LAST_MODIFIED_DATE DESC
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE WHERE B.BOOK_NAME=#{bookName} AND A.IS_MAIN_EDITOR = 1 limit 1
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() WHERE 1=1 AND A.CHANNEL_ID = #{channelId} AND A.IS_MAIN_EDITOR = 1 AND (B.BOOK_NAME LIKE CONCAT('%',#{name},'%') OR B.ISBN LIKE CONCAT(#{name},'%')) AND A.CREATED_DATE > #{startDate} AND A.CREATED_DATE < #{endDate} AND bf.BOOK_FUND_ID IS NOT NULL GROUP BY A.BOOK_ID, A.ADVISER_ID ORDER BY A.LAST_MODIFIED_DATE DESC
select DISTINCT book_id from BOOK where isbn like concat('%', #{isbn},'%')
select a.BOOK_ID bookId,a.COVER_IMG coverImg,a.BOOK_NAME bookName,a.ISBN isbn,b.id bookGroupId ,d.resourceCount from book a LEFT JOIN book_group b on a.book_id=b.book_id LEFT JOIN (select book_group_id as bookGroupId,COUNT(1) as resourceCount from book_group_serve GROUP BY book_group_id ) d on b.id=d.bookGroupId left join book_adviser c on a.book_id=c.book_id where a.IS_DELETE=0 and b.is_delete=0 AND b.join_group_type =4 and c.adviser_id=#{adviserId} AND (a.BOOK_NAME LIKE CONCAT('%',#{name},'%') OR a.ISBN LIKE CONCAT(#{name},'%')) AND A.is_show_qualify_info =#{isShowQualifyInfo} ORDER BY A.LAST_MODIFIED_DATE DESC
select a.id bookGroupId,b.book_id bookId ,b.book_name bookName,b.publish , b.author,b.COVER_IMG coverImg,b.isbn,b.is_show_qualify_info isShowQualifyInfo,c.ADVISER_ID adviserId,a.agent_id agentId,a.channel_id channelId from book_group a LEFT JOIN book b on a.book_id=b.book_id left join book_adviser c on a.book_id=c.book_id where b.is_delete=0 and c.is_delete=0 and a.id=#{bookGroupId} AND a.join_group_type =4 limit 1
select count(1) from BOOK
SELECT B.BOOK_ID bookId, B.ISBN isbn, B.BOOK_NAME bookName, B.BOOK_NAME ikBookName, B.IS_DELETE isBookDelete, B.TYPE_CODE typeCode, IF(A.IS_DELETE is NULL, 0, A.IS_DELETE) isBookAdviserDelete, IF(A.CHANNEL_ID is NULL, 0, A.CHANNEL_ID) channelId, IF(A.ADVISER_ID is NULL, 0, A.ADVISER_ID) adviserId, IF(A.IS_MAIN_EDITOR is NULL, "", A.IS_MAIN_EDITOR) isMainEditor, IF(A.TEMPLET_ID is NULL, 0, A.TEMPLET_ID) templetId, IF(A.SECOND_TEMPLET_ID is NULL, 0, A.SECOND_TEMPLET_ID) secondTempletId, IF(A.LAST_MODIFIED_DATE is NULL, "2001-01-01 00:00:00", A.LAST_MODIFIED_DATE) lastModifiedDate, IF(A.CREATED_DATE is NULL, "2001-01-01 00:00:00", A.CREATED_DATE) createdDate, IF(A.BOOK_ADVISER_ID is NULL, 0, A.BOOK_ADVISER_ID) bookAdviserId, IF(A.BOOK_ADVISER_ID is NULL, 0, 1) isAdviserBook, IF(A.GRA_LABEL_ID is NULL, 0, A.GRA_LABEL_ID) graLabelId, IF(A.SUB_LABEL_ID is NULL, 0, A.SUB_LABEL_ID) subLabelId, IF(A.AREA_LABEL_ID is NULL, 0, A.AREA_LABEL_ID) areaLabelId, IF(A.VER_LABEL_ID is NULL, 0, A.VER_LABEL_ID) verLabelId, IF(A.vol_label_id is NULL, 0, A.vol_label_id) volLabelId, G.id bookGroupId, G.join_group_type joinGroupType, IF((BF.BOOK_FUND_ID>0 OR f.IS_FREEZE = 1),1,0) isFundSupport, b.SERIAL_NUMBER serialNumber FROM BOOK B LEFT JOIN BOOK_ADVISER A ON A.BOOK_ID = B.BOOK_ID and A.IS_MAIN_EDITOR=1 LEFT JOIN book_group G on G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID AND G.IS_DELETE = 0 LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN book_freeze f ON B.BOOK_ID = f.BOOK_ID WHERE B.BOOK_ID>#{maxId} GROUP BY B.BOOK_ID limit #{offset}
SELECT B.BOOK_ID bookId, B.ISBN isbn, B.BOOK_NAME bookName, B.BOOK_NAME ikBookName, B.IS_DELETE isBookDelete, B.TYPE_CODE typeCode, IF(A.IS_DELETE is NULL, 0, A.IS_DELETE) isBookAdviserDelete, IF(A.CHANNEL_ID is NULL, 0, A.CHANNEL_ID) channelId, IF(A.ADVISER_ID is NULL, 0, A.ADVISER_ID) adviserId, IF(A.IS_MAIN_EDITOR is NULL, "", A.IS_MAIN_EDITOR) isMainEditor, IF(A.TEMPLET_ID is NULL, 0, A.TEMPLET_ID) templetId, IF(A.SECOND_TEMPLET_ID is NULL, 0, A.SECOND_TEMPLET_ID) secondTempletId, IF(A.third_TEMPLET_ID is NULL, 0, A.third_TEMPLET_ID) thirdTempletId, IF(A.LAST_MODIFIED_DATE is NULL, "2001-01-01 00:00:00", A.LAST_MODIFIED_DATE) lastModifiedDate, IF(A.BOOK_ADVISER_ID is NULL, 0, A.BOOK_ADVISER_ID) bookAdviserId, IF(A.BOOK_ADVISER_ID is NULL, 0, 1) isAdviserBook, IF(A.GRA_LABEL_ID is NULL, 0, A.GRA_LABEL_ID) graLabelId, IF(A.SUB_LABEL_ID is NULL, 0, A.SUB_LABEL_ID) subLabelId, IF(A.AREA_LABEL_ID is NULL, 0, A.AREA_LABEL_ID) areaLabelId, IF(A.VER_LABEL_ID is NULL, 0, A.VER_LABEL_ID) verLabelId, IF(A.vol_label_id is NULL, 0, A.vol_label_id) volLabelId, G.id bookGroupId, G.join_group_type joinGroupType, IF((BF.BOOK_FUND_ID>0 OR f.IS_FREEZE = 1),1,0) isFundSupport, b.SERIAL_NUMBER serialNumber FROM BOOK B LEFT JOIN BOOK_ADVISER A ON A.BOOK_ID = B.BOOK_ID and A.IS_MAIN_EDITOR=1 LEFT JOIN book_group G on G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID AND G.IS_DELETE = 0 LEFT JOIN BOOK_FUND BF ON BF.BOOK_ID = A.BOOK_ID AND BF.END_TIME > NOW() AND BF.START_TIME < NOW() LEFT JOIN book_freeze f ON B.BOOK_ID = f.BOOK_ID WHERE B.BOOK_ID in ${item} GROUP BY B.BOOK_ID
SELECT b.BOOK_ID, b.ISBN, b.ISSN, b.BOOK_NAME, b.REMARK, b.AUTHOR, b.PUBLISH, b.PUBLISH_DATE, b.COVER_IMG, b.AD_IMG, b.ORIGIN_NAME, b.BOOK_PRICE, b.TYPE_CODE, b.SERIAL_NUMBER, b.CREATED_DATE, t.TYPE_NAME FROM BOOK b INNER JOIN BOOK_TYPE t ON b.TYPE_CODE = t.TYPE_CODE WHERE b.BOOK_ID IN ${item}
SELECT ISBN, TYPE_CODE, BOOK_NAME, AUTHOR, PUBLISH, PUBLISH_DATE, COVER_IMG,AD_IMG,REMARK,ORIGIN_NAME,BOOK_PRICE,ISSN,SERIAL_NUMBER,VERSION, SPONSOR, ORGANIZER, CN, RELEASE_CYCLE, BOOK_NUM, PROGRAMA, MAIL_CODE, ADDRESS, TELEPHONE, MAIL, PURPOSE FROM BOOK WHERE BOOK_NAME = #{bookName} AND IS_DELETE = 0 LIMIT 1
SELECT b.BOOK_ID bookId, b.ISBN isbn, b.BOOK_NAME bookName, a.ADVISER_ID adviserId FROM book_adviser a INNER JOIN book b ON b.BOOK_ID = a.BOOK_ID AND b.IS_DELETE = 0 WHERE b.BOOK_ID in #{item} group by b.BOOK_ID
update book_adviser set is_open_robot_process=#{isOpenRobotProcess}, LAST_MODIFIED_DATE = NOW() where book_id=#{bookId} and adviser_id=#{adviserId} and is_delete=0
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, T.TYPE_CODE, T.TYPE_NAME, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, A.TEMPLET_ID,A.SECOND_TEMPLET_ID,A.LAST_MODIFIED_DATE LAST_MODIFIED_DATE,A.BOOK_ADVISER_ID,CONCAT('BK',A.BOOK_ID) uniqueNumber, A.GRA_LABEL_ID, A.SUB_LABEL_ID, A.VER_LABEL_ID, A.AREA_LABEL_ID, A.pro_label_id, A.dep_label_id, A.pur_label_id, A.vol_label_id, A.third_TEMPLET_ID FROM BOOK_ADVISER A INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 LEFT JOIN BOOK_TYPE T ON B.TYPE_CODE = T.TYPE_CODE WHERE 1=1 AND A.IS_MAIN_EDITOR = 1 AND B.TYPE_CODE = #{typeCode} AND (B.BOOK_NAME LIKE CONCAT('%', #{keyword}, '%') OR B.ISBN LIKE CONCAT(#{keyword},'%') OR CONCAT('BK',A.BOOK_ID) = #{keyword} OR A.ADVISER_ID in ${item} ) AND A.TEMPLET_ID = #{templetId} AND A.SECOND_TEMPLET_ID=#{secondTempletId} AND A.third_TEMPLET_ID=#{thirdTempletId} AND A.ADVISER_ID in ${item} and A.BOOK_ID not in ${item} GROUP BY A.BOOK_ID, A.CHANNEL_ID ORDER BY A.LAST_MODIFIED_DATE DESC
update book set unique_number = #{item.uniqueNumber}, LAST_MODIFIED_DATE = NOW() where book_id = #{item.bookId}
SELECT A.BOOK_ID, A.CHANNEL_ID, A.ADVISER_ID, A.IS_MAIN_EDITOR, a.is_open_robot_process, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.ORIGIN_NAME, B.BOOK_PRICE, B.ISSN, B.BOOK_NUM, B.SERIAL_NUMBER, A.TEMPLET_ID, A.BOOK_ADVISER_ID, CONCAT('BK',A.BOOK_ID) uniqueNumber, G.update_time LAST_MODIFIED_DATE, G.create_time CREATED_DATE, G.id BOOK_GROUP_ID, G.group_qrcode_url groupQrcodeUrl, G.group_qrcode_name groupQrcodeName, G.dep_label_id bookGroupDepLabelId, G.join_group_type, G.related_book_group_id relatedBookGroupId, A.IS_PRINT isPrint, G.group_qrcode_link groupQrcodeLink FROM book_group G INNER JOIN BOOK_ADVISER A ON G.BOOK_ID = A.BOOK_ID AND G.CHANNEL_ID = A.CHANNEL_ID AND G.CREATE_USER = A.ADVISER_ID INNER JOIN BOOK B ON A.BOOK_ID = B.BOOK_ID WHERE G.agent_id = #{agentId} AND G.is_delete = 0 AND A.IS_DELETE = 0 AND B.IS_DELETE = 0 AND G.create_user = #{adviserId} AND (B.BOOK_NAME LIKE CONCAT('%', #{name}, '%') OR G.group_qrcode_name LIKE CONCAT('%', #{name}, '%') OR B.ISBN LIKE CONCAT(#{name},'%') OR CONCAT('BK',A.BOOK_ID) = #{name} ) AND G.join_group_type = #{joinGroupType} GROUP BY B.BOOK_ID ORDER BY G.UPDATE_TIME DESC
update book LAST_MODIFIED_DATE = NOW(), created_user = #{createdUser}, last_modified_user = #{lastModifiedUser}, where book_id = #{bookId}
select BOOK_ID from book
SELECT ifnull(count(1),0) FROM book_group WHERE book_id = #{bookId} AND is_delete = 0
select B.BOOK_ID, B.TYPE_CODE, B.ISBN, B.BOOK_NAME, B.REMARK, B.AUTHOR, B.PUBLISH, B.PUBLISH_DATE, B.COVER_IMG, B.AD_IMG, B.DETAIL, B.`VERSION`, B.BOOK_PRICE, B.ISSN, B.SERIAL_NUMBER, BA.IS_MAIN_EDITOR, BA.TEMPLET_ID, BA.SECOND_TEMPLET_ID, BA.GRA_LABEL_ID, BA.SUB_LABEL_ID, BA.VER_LABEL_ID, BA.AREA_LABEL_ID, BA.IS_PRINT isPrint, BA.pro_label_id, BA.dep_label_id, BA.pur_label_id, BA.vol_label_id, BA.is_open_robot_process, B.unique_number, BA.CREATED_DATE from book B left join book_adviser BA on B.book_id = BA.book_id where B.book_id = #{bookId} and BA.adviser_id = #{adviserId} and BA.channel_id = #{channelId} limit 1
SELECT book_id FROM book WHERE book_id IN #{bookId}
SELECT B.BOOK_ID, B.TYPE_CODE, B.ISBN, B.BOOK_NAME, B.AUTHOR, B.PUBLISH, B.COVER_IMG, B.BOOK_PRICE, B.SERIAL_NUMBER, B.AD_IMG, a.ADVISER_ID FROM book_adviser a INNER JOIN book B ON a.BOOK_ID = B.BOOK_ID JOIN ( SELECT DISTINCT BOOK_ID FROM book_minimum_support WHERE 1=1 AND DATE_FORMAT(START_TIME, '%Y-%m-%d') <= DATE_FORMAT(CURRENT_DATE(), '%Y-%m-%d') AND DATE_FORMAT(END_TIME, '%Y-%m-%d') >= DATE_FORMAT(CURRENT_DATE(), '%Y-%m-%d') GROUP BY book_id HAVING DATE_FORMAT(MAX(end_time), '%Y-%m-%d') < DATE_FORMAT(CURRENT_DATE(), '%Y-%m-%d') ) bm ON B.BOOK_ID = bm.BOOK_ID LEFT JOIN ( SELECT BOOK_FUND_ID, BOOK_ID FROM book_fund GROUP BY BOOK_ID ) bf ON B.BOOK_ID = bf.BOOK_ID WHERE a.IS_DELETE = 0 AND B.IS_DELETE = 0 AND bf.BOOK_FUND_ID IS NULL AND a.ADVISER_ID in ${item} AND B.SERIAL_NUMBER LIKE CONCAT('%', #{serialNumber},'%') AND ( B.BOOK_NAME LIKE CONCAT('%', #{bookName},'%') ) AND B.ISBN LIKE CONCAT(#{isbn},'%') AND B.PUBLISH LIKE CONCAT('%', #{publish},'%') GROUP BY a.BOOK_ID ORDER BY a.CREATED_DATE DESC LIMIT #{currentPage},#{numPerPage}
SELECT COUNT(1) FROM ( SELECT B.BOOK_ID FROM book_adviser a INNER JOIN book B ON a.BOOK_ID = B.BOOK_ID JOIN ( SELECT DISTINCT BOOK_ID FROM book_minimum_support WHERE 1=1 AND DATE_FORMAT(START_TIME, '%Y-%m-%d') <= DATE_FORMAT(CURRENT_DATE(), '%Y-%m-%d') AND DATE_FORMAT(END_TIME, '%Y-%m-%d') >= DATE_FORMAT(CURRENT_DATE(), '%Y-%m-%d') GROUP BY book_id HAVING DATE_FORMAT(MAX(end_time), '%Y-%m-%d') < DATE_FORMAT(CURRENT_DATE(), '%Y-%m-%d') ) bm ON B.BOOK_ID = bm.BOOK_ID LEFT JOIN ( SELECT BOOK_FUND_ID, BOOK_ID FROM book_fund GROUP BY BOOK_ID ) bf ON B.BOOK_ID = bf.BOOK_ID WHERE a.IS_DELETE = 0 AND B.IS_DELETE = 0 AND bf.BOOK_FUND_ID IS NULL AND a.ADVISER_ID in ${item} AND B.SERIAL_NUMBER LIKE CONCAT('%', #{serialNumber},'%') AND ( B.BOOK_NAME LIKE CONCAT('%', #{bookName},'%') ) AND B.ISBN LIKE CONCAT(#{isbn},'%') AND B.PUBLISH LIKE CONCAT('%', #{publish},'%') GROUP BY a.BOOK_ID ) a