Blame view

parking-module-system/src/main/resources/mybatis/smapper/TbAreaMangeSMapper.xml 2.07 KB
55f68655   王彪总   新项目
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
  <?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">
  <mapper namespace="com.zteits.sys.mapper.smapper.TbAreaManageMapper">
      <resultMap id="BaseResultMap" type="com.zteits.clouds.api.dto.sys.param.AreaListTreeDTO">
          <id column="id" jdbcType="BIGINT" property="id" />
          <result column="area_code" jdbcType="BIGINT" property="value" />
          <result column="area_name" jdbcType="VARCHAR" property="label" />
          <result column="area_type" jdbcType="INTEGER" property="areaType" />
          <result column="parent_id" jdbcType="BIGINT" property="parentId" />
          <result column="data_state" jdbcType="INTEGER" property="dataState" />
          <result column="sort_num" jdbcType="INTEGER" property="sortNum" />
          <result column="car_number_head" jdbcType="VARCHAR" property="carNumberHead" />
      </resultMap>
    <sql id="Base_Column_List">
      id, area_code, area_name, area_type, parent_id, data_state, car_number_head,sort_num
    </sql>
  
      <!-- 根据地域类型查询所有地域-->
      <select id="InitAreaList" resultMap="BaseResultMap">
          SELECT  <include refid="Base_Column_List" />
          from tb_area
          WHERE  data_state = 1
  
      </select>
  
      <!-- 根据地域类型查询所有地域-->
      <select id="areaBlockByAreaId" parameterType="com.zteits.clouds.api.dto.park.param.closecarpark.QueryAreaBlockRequest"
              resultType="com.zteits.clouds.api.dto.park.dto.AreaBlockListDTO">
          SELECT
          c.id,
          c.area_code areaCode,
          c.area_name areaName,
          c.area_type areaType,
          c.parent_id parentId,
          c.org_id orgId,
          c.data_state dataState
          FROM
          tb_area_block c
          WHERE  c.data_state=1
          <if test="orgId != null and orgId !='' and orgId !='-1' ">
              and c.org_id=#{orgId}
          </if>
          <if test="parentId != null and parentId !=''">
              and c.parent_id=#{parentId}
          </if>
          and c.area_type=#{areaType}
          order by c.area_name
  
      </select>
    
  </mapper>