浏览代码

city to id

胡轶钦 5 年前
父节点
当前提交
c3429c7ec9
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      src/main/resources/mapper/TaPersonMapper.xml

+ 2
- 2
src/main/resources/mapper/TaPersonMapper.xml 查看文件

536
            UPDATE ta_person a
536
            UPDATE ta_person a
537
         INNER JOIN (
537
         INNER JOIN (
538
             SELECT
538
             SELECT
539
-                t.*, s.pinyin AS province
539
+                t.*, s.name AS province
540
             FROM
540
             FROM
541
                 td_city t
541
                 td_city t
542
             INNER JOIN td_city s ON t.parentid = s.id
542
             INNER JOIN td_city s ON t.parentid = s.id
543
-        ) b ON a.city = b.pinyin
543
+        ) b ON a.city like CONCAT(b.shortname, '%')
544
         AND a.province = b.province
544
         AND a.province = b.province
545
         set a.city = b.id
545
         set a.city = b.id
546
         where a.city IS NOT NULL
546
         where a.city IS NOT NULL