insert into book_freeze ( BOOK_ID, FREEZETIME, IS_FREEZE, BOOK_FUND_ID, CREATED_USER, CREATED_DATE, LAST_MODIFIED_USER, LAST_MODIFIED_DATE , PROXY_MODE,TRANSFEROR ) values ( #{bookId,jdbcType=BIGINT}, #{freezetime,jdbcType=TIMESTAMP}, 1, #{bookFundId,jdbcType=BIGINT}, #{createdUser,jdbcType=BIGINT}, now(),#{createdUser,jdbcType=BIGINT},now(),#{proxyMode,jdbcType=BIT},#{transferor,jdbcType=VARCHAR} )
SELECT ID as id, BOOK_ID as bookId, FREEZETIME as freezetime, PROXY_MODE as proxyMode, TRANSFEROR as transferor FROM book_freeze WHERE BOOK_ID = #{bookId,jdbcType=BIGINT} AND IS_FREEZE = 1 LIMIT 1
SELECT ID as id, BOOK_ID as bookId, FREEZETIME as freezetime, PROXY_MODE as proxyMode, TRANSFEROR as transferor FROM book_freeze WHERE BOOK_ID = #{bookId,jdbcType=BIGINT} ORDER BY freezetime DESC LIMIT 1
UPDATE book_freeze SET IS_FREEZE = 2, THAW_TIME = now(), LAST_MODIFIED_USER = #{partyId, jdbcType=BIGINT}, BOOK_FUND_ID = #{bookFundId, jdbcType=BIGINT}, LAST_MODIFIED_DATE = now() WHERE BOOK_ID = #{bookId, jdbcType=BIGINT} AND IS_FREEZE = 1
SELECT count(1) FROM `book_freeze` WHERE BOOK_ID = #{bookId} AND IS_FREEZE = 1 AND FREEZETIME < NOW() ;
SELECT BOOK_ID,IS_FREEZE FROM `book_freeze` WHERE BOOK_ID IN ${item} AND IS_FREEZE = 1
SELECT BOOK_ID,IS_FREEZE,PROXY_MODE,TRANSFEROR FROM `book_freeze` WHERE BOOK_ID IN ${item} AND IS_FREEZE = 1 AND FREEZETIME < NOW() ;
SELECT ID, BOOK_ID, IS_FREEZE, BOOK_FUND_ID,PROXY_MODE,TRANSFEROR FROM `book_freeze` WHERE BOOK_ID = #{bookId, jdbcType=BIGINT} AND IS_FREEZE = 1
SELECT ID, BOOK_ID, IS_FREEZE, BOOK_FUND_ID,PROXY_MODE,TRANSFEROR,THAW_TIME,FREEZETIME FROM `book_freeze` WHERE BOOK_ID IN ${item} AND IS_FREEZE = 1
SELECT distinct BOOK_ID FROM `book_freeze` WHERE BOOK_ID IN ${item} AND IS_FREEZE = 1
SELECT BOOK_ID FROM book_freeze IS_FREEZE = #{bookFreeze} AND FREEZETIME >= #{bookFreezeTimeBegin} AND FREEZETIME <= #{bookFreezeTimeEnd}

SELECT BOOK_ID bookId, DATE_FORMAT( FREEZETIME, '%Y-%m-%d' ) freezeTime, IS_FREEZE freezeStatus, DATE_FORMAT( THAW_TIME, '%Y-%m-%d' ) thawTime FROM book_freeze where BOOK_ID IN #{it}