ZhuDongming
2019-11-20 f32e22e52376cabe49e8c7d1f52adb4b1aebffd3
src/main/resources/mapper/OrganizationMapper.xml
@@ -8,6 +8,8 @@
    <result column="province_code" jdbcType="INTEGER" property="provinceCode" />
    <result column="city_code" jdbcType="INTEGER" property="cityCode" />
    <result column="area_code" jdbcType="INTEGER" property="areaCode" />
    <result column="town_code" jdbcType="BIGINT" property="townCode" />
    <result column="village_code" jdbcType="BIGINT" property="villageCode" />
    <result column="address" jdbcType="VARCHAR" property="address" />
    <result column="telephone" jdbcType="VARCHAR" property="telephone" />
    <result column="email" jdbcType="VARCHAR" property="email" />
@@ -20,6 +22,8 @@
          <result column="province_name" property="provinceName" jdbcType="VARCHAR" />
          <result column="city_name" property="cityName" jdbcType="VARCHAR" />
          <result column="area_name" property="areaName" jdbcType="VARCHAR" />
          <result column="town_name" property="townName" jdbcType="VARCHAR" />
          <result column="village_name" property="villageName" jdbcType="VARCHAR" />
      </association>
  </resultMap>
  <sql id="Example_Where_Clause">
@@ -56,7 +60,7 @@
    create_time, expire_time, description
  </sql>
   <sql id="Relation_Province_City_Area_List">
       are.area_name, cti.city_name, pro.province_name
       are.area_name, cti.city_name, pro.province_name,tow.town_name,vil.village_name
  </sql>
  <select id="selectWithAreaNameByExample" parameterType="tk.mybatis.mapper.entity.Example" resultMap="BaseResultMap">
    select
@@ -67,6 +71,8 @@
      ,
      <include refid="Relation_Province_City_Area_List" />
      from organization
      left join village vil on organization.village_code = vil.village_code
      left join town tow on organization.town_code = tow.town_code
      left join area are on organization.area_code = are.area_code
      left join city cti on organization.city_code = cti.city_code
      left join province pro on organization.province_code = pro.province_code
@@ -94,4 +100,7 @@
         AND o.city_code = c.city_code
      </if>
   </select>
    <select id="selectLowerOrgIds" resultType="java.lang.Integer">
            call proc_lowerOrgIds_GetByOrgId(#{orgId,jdbcType=INTEGER});
    </select>
</mapper>