select psv_id, price_set_id, price_type, version_no, version_seq, effective_time, expire_time, status, price_build_mode, is_del, created_by, create_time, updated_by, update_time from prc_price_set_version insert into prc_price_set_version ( price_set_id, price_type, version_no, version_seq, effective_time, expire_time, status, price_build_mode, created_by, create_time ) values ( #{priceSetId}, #{priceType}, #{versionNo}, #{versionSeq}, #{effectiveTime}, #{expireTime}, #{status}, #{priceBuildMode}, #{createBy}, sysdate() ) update prc_price_set_version price_type = #{priceType}, version_no = #{versionNo}, version_seq = #{versionSeq}, effective_time = #{effectiveTime}, expire_time = #{expireTime}, status = #{status}, price_build_mode = #{priceBuildMode}, updated_by = #{updateBy}, update_time = sysdate() where psv_id = #{psvId} delete from prc_price_set_version where psv_id in #{psvId} delete from prc_price_set_version where price_set_id = #{priceSetId} and price_type = 'SALES' update prc_price_set_version set is_del = '1', updated_by = #{updateBy}, update_time = sysdate() where psv_id = #{psvId} and ifnull(is_del, '0') = '0' update prc_price_set_version set status = case when expire_time is not null and expire_time <= now() then '2' when effective_time is not null and effective_time > now() then '3' when effective_time is null then '0' else '1' end, update_time = sysdate() where price_type = #{priceType} and price_set_id is null and ifnull(is_del, '0') = '0' and status in ('0','1','2','3')