mybits传入id字符串,查询并插入

 insert into trouble_rectify_task(id,rectify_id,trouble_id,trouble_code,
                trouble_area,point,question_briefly,trouble_des,trouble_photo,trouble_type,
                trouble_origin,rectify_status,review_status)
                select  a.id,a.rectify_id,a.trouble_id,a.trouble_code, a.trouble_area,point,
                a.question_briefly,a.trouble_des,a.trouble_photo,a.trouble_type, a.trouble_origin,
                a.rectify_status,a.review_status
                from 
                
                
                    select  replace(uuid(),'-','') as id,#{rectifyId} as rectify_id,id as trouble_id,trouble_code,
                    trouble_area,point,question_briefly,trouble_des,trouble_photo,trouble_type,
                    trouble_origin, '1' as rectify_status,'0' as review_status from trouble_list where id=#{item}
                

你可能感兴趣的:(Mybatis,mysql)