select tether_id, tether_name, show_time, create_by, create_time, update_by, update_time, total, status, remark ,sell_status,del_flag,image,exchange ,grounding,cochain ,tether_id from po_tether insert into po_tether tether_name, show_time, create_by, create_time, update_by, update_time, total, status, remark, sell_status, image, exchange, grounding, cochain, tether_id, #{tetherName}, #{showTime}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, #{total}, #{status}, #{remark}, #{sellStatus}, #{image}, #{exchange}, #{grounding}, #{cochain}, #{tetherId}, update po_tether tether_name = #{tetherName}, show_time = #{showTime}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, total = #{total}, status = #{status}, remark = #{remark}, sell_status = #{sellStatus}, image = #{image}, exchange = #{exchange}, grounding = #{grounding}, cochain = #{cochain}, tether_id #{tetherId}, where tether_id = #{tetherId} delete from po_tether where tether_id = #{tetherId} update po_tether set del_flag = '1' where tether_id in #{tetherId} update po_tether set cochain = #{cochain} where tether_id = #{tetherId} update po_tether set grounding = #{grounding} where tether_id = #{tetherId} UPDATE po_tether INNER JOIN ( SELECT po_tether.tether_id, ( SELECT COUNT( po_Tetherandcollection.tether_id ) FROM po_Tetherandcollection WHERE po_tether.tether_id = po_Tetherandcollection.tether_id ) AS total FROM po_tether ) a ON po_tether.tether_id = a.tether_id SET po_tether.total = a.total