id, book_id, edition_year, edition, create_time, update_time, update_user
select from book_edition where id = #{id,jdbcType=BIGINT}
delete from book_edition where id = #{id,jdbcType=BIGINT}
insert into book_edition (book_id, edition_year, edition, create_time, update_time, update_user) values (#{bookId,jdbcType=BIGINT}, #{editionYear,jdbcType=VARCHAR}, #{edition,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}) ON DUPLICATE KEY UPDATE edition_year = ifnull(VALUES(edition_year),edition_year), edition = ifnull(VALUES(edition),edition), update_user = ifnull(VALUES(update_user),update_user), update_time = NOW()
insert into edition_record (book_id, edition_year, edition, create_time, update_time,update_user ) values (#{item.bookId,jdbcType=BIGINT}, #{item.editionYear,jdbcType=VARCHAR}, #{item.edition,jdbcType=INTEGER}, now(),now(),#{item.updateUser} ) ON DUPLICATE KEY UPDATE edition_year = ifnull(VALUES(edition_year),edition_year), edition = ifnull(VALUES(edition),edition), update_user = ifnull(VALUES(update_user),update_user), update_time = NOW()
insert into book_edition id, book_id, edition_year, edition, create_time, update_time, update_user, #{id,jdbcType=BIGINT}, #{bookId,jdbcType=INTEGER}, #{editionYear,jdbcType=VARCHAR}, #{edition,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER},
update book_edition book_id = #{bookId,jdbcType=INTEGER}, edition_year = #{editionYear,jdbcType=VARCHAR}, edition = #{edition,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP}, update_user = #{updateUser,jdbcType=INTEGER}, where id = #{id,jdbcType=BIGINT}
update book_edition set book_id = #{bookId,jdbcType=BIGINT}, edition_year = #{editionYear,jdbcType=VARCHAR}, edition = #{edition,jdbcType=INTEGER}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP}, update_user = #{updateUser,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}
select a.edition edition, a.edition_year editionDate, ifnull(count(1),0) projectCount from book_edition a inner join book_adviser b on a.book_id=b.book_id and a.update_user=b.adviser_id where a.update_user=#{adviserId} and b.IS_DELETE=0 GROUP BY a.edition,a.edition_year ORDER BY a.edition_year
select a.edition edition, a.edition_year editionDate, ifnull(count(1),0) projectCount from book_edition a inner join book_adviser b on a.book_id=b.book_id and a.update_user=b.adviser_id where a.update_user=#{adviserId} and b.IS_DELETE=0 GROUP BY a.edition_year ORDER BY projectCount desc