id, keyword_id, keyword_detail_id, adviser_id, use_num, create_user, create_time, update_user, update_time, is_delete
select from book_keyword_use_record where id = #{id,jdbcType=BIGINT}
select id, keyword_id, keyword_detail_id, adviser_id, use_num from book_keyword_use_record where adviser_id = #{adviserId,jdbcType=BIGINT} and keyword_detail_id = #{keywordDetailId,jdbcType=BIGINT}
insert into book_keyword_use_record (id, keyword_id, keyword_detail_id, adviser_id, use_num, create_user, create_time, update_user, update_time, is_delete ) values (#{id,jdbcType=BIGINT}, #{keywordId,jdbcType=BIGINT}, #{keywordDetailId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT}, #{useNum,jdbcType=INTEGER}, #{createUser,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=INTEGER} )
insert into book_keyword_use_record id, keyword_id, keyword_detail_id, adviser_id, use_num, create_user, create_time, update_user, update_time, is_delete, #{id,jdbcType=BIGINT}, #{keywordId,jdbcType=BIGINT}, #{keywordDetailId,jdbcType=BIGINT}, #{adviserId,jdbcType=BIGINT}, #{useNum,jdbcType=INTEGER}, #{createUser,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=BIGINT}, #{updateTime,jdbcType=TIMESTAMP}, #{isDelete,jdbcType=INTEGER},
SELECT a.keyword_id as keywordId, a.keyword_detail_id as keywordDetailId, b.description, b.link_url as linkUrl, b.pic_url as picUrl, b.product_id as productId, b.product_type as productType, b.type_code as typeCode, b.content, c.matching_rule as matchingRule, a.use_num as useNum, c.guide FROM book_keyword_use_record a LEFT JOIN book_keyword_warehouse_detail b ON a.keyword_detail_id = b.id LEFT JOIN book_keyword_warehouse c ON a.keyword_id = c.id WHERE b.is_delete = 0 AND a.adviser_id = #{adviserId} and b.depth_label_id = #{depthLabelId} order by a.use_num DESC, a.create_time DESC
update book_keyword_use_record set use_num = use_num + 1, update_user = #{adviserId}, update_time = NOW() where id = #{id,jdbcType=BIGINT}
update book_keyword_use_record keyword_id = #{keywordId,jdbcType=BIGINT}, keyword_detail_id = #{keywordDetailId,jdbcType=BIGINT}, adviser_id = #{adviserId,jdbcType=BIGINT}, use_num = #{useNum,jdbcType=INTEGER}, create_user = #{createUser,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_user = #{updateUser,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=TIMESTAMP}, is_delete = #{isDelete,jdbcType=INTEGER}, where id = #{id,jdbcType=BIGINT}
update book_keyword_use_record set keyword_id = #{keywordId,jdbcType=BIGINT}, keyword_detail_id = #{keywordDetailId,jdbcType=BIGINT}, adviser_id = #{adviserId,jdbcType=BIGINT}, use_num = #{useNum,jdbcType=INTEGER}, create_user = #{createUser,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_user = #{updateUser,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=TIMESTAMP}, is_delete = #{isDelete,jdbcType=INTEGER} where id = #{id,jdbcType=BIGINT}