<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mappernamespace="com.laowu.mapper.CityDictMapper"><!-- 通用查询映射结果 --><resultMapid="BaseResultMap"type="com.laowu.model.CityDictDO"><idcolumn="id"property="id"/><resultcolumn="create_date"property="createDate"/><resultcolumn="update_date"property="updateDate"/><resultcolumn="delete_date"property="deleteDate"/><resultcolumn="province_id"property="provinceId"/><resultcolumn="city"property="city"/></resultMap><!-- 通用查询结果列 --><sqlid="Base_Column_List"> create_date, update_date, delete_date, id, province_id, city</sql><selectid="getCityName"parameterType="long"resultType="string"> SELECT concat( t2.province, t.city ) AS cityName FROM city_dict t LEFT JOIN province_dict t2 ON t.province_id = t2.id WHERE t.delete_date IS NULL AND t2.delete_date IS NULL AND t.id = #{id}</select></mapper>