id, book_id, channel_id, adviser_id, book_qrcode_type, book_qrcode_id, wxwork_qrcode_id, wxwork_qrcode_type, create_time
select from book.book_qrcode_wxwork where id = #{id}
insert into book.book_qrcode_wxwork(book_id, channel_id, adviser_id, book_qrcode_type, book_qrcode_id, wxwork_qrcode_id, wxwork_qrcode_type, create_time) values (#{bookId}, #{channelId}, #{adviserId}, #{bookQrcodeType}, #{bookQrcodeId}, #{wxworkQrcodeId}, #{wxworkQrcodeType}, now())
update book.book_qrcode_wxwork book_id = #{bookId}, channel_id = #{channelId}, adviser_id = #{adviserId}, book_qrcode_type = #{bookQrcodeType}, book_qrcode_id = #{bookQrcodeId}, wxwork_qrcode_id = #{wxworkQrcodeId}, wxwork_qrcode_type = #{wxworkQrcodeType}, where id = #{id}
delete from book.book_qrcode_wxwork where id = #{id}
delete from book.book_qrcode_wxwork where book_qrcode_type = #{bookQrcodeType} and book_qrcode_id = #{bookQrcodeId} and wxwork_qrcode_type = #{wxworkQrcodeType}
select from book.book_qrcode_wxwork where book_qrcode_type = #{bookQrcodeType} and book_qrcode_id = #{bookQrcodeId} and wxwork_qrcode_type = #{wxworkQrcodeType}
select from book.book_qrcode_wxwork where book_id = #{bookId} and channel_id = #{channelId} and adviser_id = #{adviserId} and wxwork_qrcode_type = #{wxworkQrcodeType} GROUP BY wxwork_qrcode_type, wxwork_qrcode_id order by wxwork_qrcode_type asc, create_time desc
SELECT DISTINCT wxwork_qrcode_id FROM book_qrcode_wxwork WHERE wxwork_qrcode_type = #{wxworkQrcodeType} AND book_id != #{bookId}
SELECT book_qrcode_id bookQrcodeId, COUNT(id) serveCount, book_id bookId, adviser_id adviserId, channel_id channelId, COUNT(DISTINCT book_qrcode_id) qrcodeCount FROM book_qrcode_wxwork WHERE book_qrcode_type = #{bookQrcodeType} AND book_qrcode_id IN ${item} GROUP BY book_qrcode_id
SELECT CONCAT(book_id,'_',channel_id,'_',adviser_id) bookChannelAdviserId, book_qrcode_id bookQrcodeId,COUNT(id) serveCount, book_id bookId, adviser_id adviserId, channel_id channelId, COUNT(DISTINCT book_qrcode_id) qrcodeCount, GROUP_CONCAT(DISTINCT book_qrcode_id) sceneIdStr FROM book_qrcode_wxwork WHERE book_qrcode_type = #{bookQrcodeType} AND book_qrcode_id IN (${strSceneIds}) AND adviser_id IN ${item} AND book_id IN ${item} AND channel_id IN ${item} GROUP BY book_id, channel_id, adviser_id
SELECT book_qrcode_id FROM book_qrcode_wxwork WHERE book_qrcode_type = 1 AND book_qrcode_id IN ${item}