insert into business_resource_store_use_record( unit_price,create_user_id,quantity,rsur_id,repair_id,create_user_name,remark,store_id,res_id,operate,b_id,community_id ) values ( #{unitPrice},#{createUserId},#{quantity},#{rsurId},#{repairId},#{createUserName},#{remark},#{storeId},#{resId},#{operate},#{bId},#{communityId} ) insert into resource_store_use_record( unit_price,create_user_id,quantity,rsur_id,repair_id,create_user_name,status_cd,remark,store_id,res_id,b_id,community_id ) select t.unit_price,t.create_user_id,t.quantity,t.rsur_id,t.repair_id,t.create_user_name,'0',t.remark,t.store_id,t.res_id,t.b_id,t.community_id from business_resource_store_use_record t where 1=1 and t.unit_price= #{unitPrice} and t.create_user_id= #{createUserId} and t.quantity= #{quantity} and t.rsur_id= #{rsurId} and t.repair_id= #{repairId} and t.create_user_name= #{createUserName} and t.remark= #{remark} and t.store_id= #{storeId} and t.res_id= #{resId} and t.operate= 'ADD' and t.b_id= #{bId} and t.community_id= #{communityId} update resource_store_use_record t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.unit_price= #{unitPrice} , t.create_user_id= #{createUserId} , t.quantity= #{quantity} , t.repair_id= #{repairId} , t.create_user_name= #{createUserName} , t.remark= #{remark} , t.store_id= #{storeId} , t.res_id= #{resId} , t.community_id= #{communityId} where 1=1 and t.rsur_id= #{rsurId} and t.b_id= #{bId}