insert into business_repair_type_user( operate,type_user_id,repair_type,remark,state,staff_name,b_id,community_id,staff_id ) values ( #{operate},#{typeUserId},#{repairType},#{remark},#{state},#{staffName},#{bId},#{communityId}, #{staffId} ) insert into r_repair_type_user( type_user_id,repair_type,remark,status_cd,state,staff_name,b_id,community_id,staff_id ) select t.type_user_id,t.repair_type,t.remark,'0',t.state,t.staff_name,t.b_id,t.community_id,t.staff_id from business_repair_type_user t where 1=1 and t.operate= 'ADD' and t.type_user_id= #{typeUserId} and t.repair_type= #{repairType} and t.remark= #{remark} and t.state= #{state} and t.staff_name= #{staffName} and t.b_id= #{bId} and t.community_id= #{communityId} and t.staff_id= #{staffId} update r_repair_type_user t set t.status_cd = #{statusCd} ,t.b_id = #{newBId} , t.repair_type= #{repairType} , t.remark= #{remark} , t.state= #{state} , t.staff_name= #{staffName} , t.community_id= #{communityId} , t.staff_id= #{staffId} where 1=1 and t.type_user_id= #{typeUserId} and t.b_id= #{bId}