insert into business_repair_user( operate,context,repair_id,ru_id,state,community_id,b_id,user_id ) values ( #{operate},#{context},#{repairId},#{ruId},#{state},#{communityId},#{bId},#{userId} ) insert into r_repair_user( context,repair_id,status_cd,ru_id,state,community_id,b_id,user_id ) select t.context,t.repair_id,'0',t.ru_id,t.state,t.community_id,t.b_id,t.user_id from business_repair_user t where 1=1 and t.operate= 'ADD' and t.context= #{context} and t.repair_id= #{repairId} and t.ru_id= #{ruId} and t.state= #{state} and t.community_id= #{communityId} and t.b_id= #{bId} and t.user_id= #{userId} update r_repair_user t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.context= #{context} , t.repair_id= #{repairId} , t.state= #{state} , t.community_id= #{communityId} , t.user_id= #{userId} where 1=1 and t.ru_id= #{ruId} and t.b_id= #{bId}