ApplyAreasMapper.xml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.zhongzheng.modules.base.mapper.ApplyAreasMapper">
  6. <resultMap type="com.zhongzheng.modules.base.domain.ApplyAreas" id="ApplyAreasResult">
  7. <result property="areaId" column="area_id"/>
  8. <result property="code" column="code"/>
  9. <result property="areaName" column="area_name"/>
  10. <result property="areaFullName" column="area_full_name"/>
  11. <result property="parentId" column="parent_id"/>
  12. <result property="areaType" column="area_type"/>
  13. <result property="status" column="status"/>
  14. <result property="createTime" column="create_time"/>
  15. <result property="updateTime" column="update_time"/>
  16. <result property="parentName" column="parent_name"/>
  17. </resultMap>
  18. <select id="selectCityList" parameterType="com.zhongzheng.modules.base.bo.ApplyAreasQueryBo" resultMap="ApplyAreasResult">
  19. SELECT
  20. a1.*,
  21. a2.area_name AS parent_name
  22. FROM
  23. apply_areas a1
  24. LEFT JOIN apply_areas a2 ON a1.parent_id = a2.area_id
  25. WHERE a1.area_type=2
  26. <if test="status != null and status.size()!=0 ">
  27. AND a1.status in
  28. <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
  29. #{item}
  30. </foreach>
  31. </if>
  32. <if test="areaName != null and areaName != ''">
  33. AND a1.area_name like concat('%', #{areaName}, '%')
  34. </if>
  35. </select>
  36. </mapper>