UPDATE ta_person SET ${field} = IFNULL(${field}, 0) + #{increment} WHERE person_id = #{personId} UPDATE ta_person a INNER JOIN ( SELECT t.*, s.pinyin AS province FROM td_city t INNER JOIN td_city s ON t.parentid = s.id ) b ON a.city = b.pinyin AND a.province = b.province set a.city = b.id where a.city IS NOT NULL and (a.city REGEXP '[^0-9.]')=1 and a.person_id = #{personId}